diff --git a/.gitignore b/.gitignore index 2e19823c3..d320582c5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,33 +12,34 @@ ebin test/ebin/*.beam .exrc plugins/*/ebin -log/ *.swp *.so .erlang.mk/ cover/ -emqx.d eunit.coverdata test/ct.cover.spec -logs ct.coverdata .idea/ -emqx.iml -_rel/ -data/ _build .rebar3 rebar3.crashdump .DS_Store -emqx.iml -bbmustache/ etc/gen.emqx.conf compile_commands.json cuttlefish -rebar.lock xrefr -erlang.mk *.coverdata etc/emqx.conf.rendered Mnesia.*/ +*.DS_Store +_checkouts +rebar.config.rendered +/rebar3 +rebar.lock .stamp +tmp/ +_packages +elvis +emqx_dialyzer_*_plt +apps/emqx_dashboard/priv/www +dist.zip diff --git a/apps/emqx_auth_http/.gitignore b/apps/emqx_auth_http/.gitignore new file mode 100644 index 000000000..557a3a337 --- /dev/null +++ b/apps/emqx_auth_http/.gitignore @@ -0,0 +1,25 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.erlang.mk/ +emqx_auth_http.d +data +ct.cover.spec +cover/ +ct.coverdata +eunit.coverdata +logs/ +erlang.mk +_build/ +rebar.lock +rebar3.crashdump +etc/emqx_auth_http.conf.rendered +.rebar3/ +*.swp diff --git a/apps/emqx_auth_http/README.md b/apps/emqx_auth_http/README.md new file mode 100644 index 000000000..ed743334a --- /dev/null +++ b/apps/emqx_auth_http/README.md @@ -0,0 +1,100 @@ +emqx_auth_http +============== + +EMQ X HTTP Auth/ACL Plugin + +Build +----- + +``` +make && make tests +``` + +Configure the Plugin +-------------------- + +File: etc/emqx_auth_http.conf + +``` +##-------------------------------------------------------------------- +## Authentication request. +## +## Variables: +## - %u: username +## - %c: clientid +## - %a: ipaddress +## - %r: protocol +## - %P: password +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## Value: URL +auth.http.auth_req = http://127.0.0.1:8080/mqtt/auth +## Value: post | get | put +auth.http.auth_req.method = post +## Value: Params +auth.http.auth_req.params = clientid=%c,username=%u,password=%P + +##-------------------------------------------------------------------- +## Superuser request. +## +## Variables: +## - %u: username +## - %c: clientid +## - %a: ipaddress +## - %r: protocol +## - %P: password +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## Value: URL +auth.http.super_req = http://127.0.0.1:8080/mqtt/superuser +## Value: post | get | put +auth.http.super_req.method = post +## Value: Params +auth.http.super_req.params = clientid=%c,username=%u + +##-------------------------------------------------------------------- +## ACL request. +## +## Variables: +## - %A: 1 | 2, 1 = sub, 2 = pub +## - %u: username +## - %c: clientid +## - %a: ipaddress +## - %r: protocol +## - %m: mountpoint +## - %t: topic +## +## Value: URL +auth.http.acl_req = http://127.0.0.1:8080/mqtt/acl +## Value: post | get | put +auth.http.acl_req.method = get +## Value: Params +auth.http.acl_req.params = access=%A,username=%u,clientid=%c,ipaddr=%a,topic=%t +``` + +Load the Plugin +--------------- + +``` +./bin/emqx_ctl plugins load emqx_auth_http +``` + +HTTP API +-------- + +200 if ok + +4xx if unauthorized + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. + diff --git a/apps/emqx_auth_http/etc/emqx_auth_http.conf b/apps/emqx_auth_http/etc/emqx_auth_http.conf new file mode 100644 index 000000000..e6763d4c6 --- /dev/null +++ b/apps/emqx_auth_http/etc/emqx_auth_http.conf @@ -0,0 +1,162 @@ +##-------------------------------------------------------------------- +## HTTP Auth/ACL Plugin +##-------------------------------------------------------------------- + +##-------------------------------------------------------------------- +## Authentication request. + +## HTTP URL API path for authentication request +## +## Value: URL +## +## Examples: http://127.0.0.1:8991/mqtt/auth, https://[::1]:8991/mqtt/auth +auth.http.auth_req = http://127.0.0.1:8991/mqtt/auth + +## Value: post | get | put +auth.http.auth_req.method = post + +## It only works when method=post +## Value: json | x-www-form-urlencoded +auth.http.auth_req.content_type = x-www-form-urlencoded + +## Variables: +## - %u: username +## - %c: clientid +## - %a: ipaddress +## - %r: protocol +## - %P: password +## - %p: sockport of server accepted +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## Value: Params +auth.http.auth_req.params = clientid=%c,username=%u,password=%P + +##-------------------------------------------------------------------- +## Superuser request. + +## HTTP URL API path for Superuser request +## +## Value: URL +## +## Examples: http://127.0.0.1:8991/mqtt/superuser, https://[::1]:8991/mqtt/superuser +#auth.http.super_req = http://127.0.0.1:8991/mqtt/superuser + +## Value: post | get | put +#auth.http.super_req.method = post + +## It only works when method=pos +## Value: json | x-www-form-urlencoded +#auth.http.super_req.content_type = x-www-form-urlencoded + +## Variables: +## - %u: username +## - %c: clientid +## - %a: ipaddress +## - %r: protocol +## - %P: password +## - %p: sockport of server accepted +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## Value: Params +#auth.http.super_req.params = clientid=%c,username=%u + +##-------------------------------------------------------------------- +## ACL request. + +## HTTP URL API path for ACL request +## +## Value: URL +## +## Examples: http://127.0.0.1:8991/mqtt/acl, https://[::1]:8991/mqtt/acl +auth.http.acl_req = http://127.0.0.1:8991/mqtt/acl + +## Value: post | get | put +auth.http.acl_req.method = get + +## It only works when method=post +## Value: json | x-www-form-urlencoded +auth.http.acl_req.content_type = x-www-form-urlencoded + +## Variables: +## - %A: 1 | 2, 1 = sub, 2 = pub +## - %u: username +## - %c: clientid +## - %a: ipaddress +## - %r: protocol +## - %m: mountpoint +## - %t: topic +## +## Value: Params +auth.http.acl_req.params = access=%A,username=%u,clientid=%c,ipaddr=%a,topic=%t,mountpoint=%m + +##------------------------------------------------------------------------------ +## Http Reqeust options + +## Time-out time for the http request, 0 is never timeout. +## +## Value: Duration +## -h: hour, e.g. '2h' for 2 hours +## -m: minute, e.g. '5m' for 5 minutes +## -s: second, e.g. '30s' for 30 seconds +## +## Default: 5s +## auth.http.request.timeout = 5s + +## Connection time-out time, used during the initial request +## when the client is connecting to the server +## +## Value: Duration +## +## Default is same with the timeout option +## auth.http.request.connect_timeout = 0 + +## Re-send http reuqest times +## +## Value: integer +## +## Default: 3 +auth.http.request.retry_times = 5 + +## The interval for re-sending the http request +## +## Value: Duration +## +## Default: 1s +auth.http.request.retry_interval = 1s + +## The 'Exponential Backoff' mechanism for re-sending request. The actually +## re-send time interval is `interval * backoff ^ times` +## +## Value: float +## +## Default: 2.0 +auth.http.request.retry_backoff = 2.0 + +##------------------------------------------------------------------------------ +## SSL options + +## Path to the file containing PEM-encoded CA certificates. The CA certificates +## are used during server authentication and when building the client certificate chain. +## +## Value: File +## auth.http.ssl.cacertfile = {{ platform_etc_dir }}/certs/ca.pem + +## The path to a file containing the client's certificate. +## +## Value: File +## auth.http.ssl.certfile = {{ platform_etc_dir }}/certs/client-cert.pem + +## Path to a file containing the client's private PEM-encoded key. +## +## Value: File +## auth.http.ssl.keyfile = {{ platform_etc_dir }}/certs/client-key.pem + +##-------------------------------------------------------------------- +## HTTP Request Headers +## +## Example: auth.http.header.Accept-Encoding = * +## +## Value: String +## auth.http.header.Accept = */* diff --git a/apps/emqx_auth_http/include/emqx_auth_http.hrl b/apps/emqx_auth_http/include/emqx_auth_http.hrl new file mode 100644 index 000000000..2bbe12827 --- /dev/null +++ b/apps/emqx_auth_http/include/emqx_auth_http.hrl @@ -0,0 +1,25 @@ + +-define(APP, emqx_auth_http). + +-record(http_request, {method = post, path, headers, params, request_timeout}). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). diff --git a/apps/emqx_auth_http/priv/emqx_auth_http.schema b/apps/emqx_auth_http/priv/emqx_auth_http.schema new file mode 100644 index 000000000..4f4289db0 --- /dev/null +++ b/apps/emqx_auth_http/priv/emqx_auth_http.schema @@ -0,0 +1,169 @@ +%%-*- mode: erlang -*- +%% emqx_auth_http config mapping +{mapping, "auth.http.auth_req", "emqx_auth_http.auth_req", [ + {datatype, string} +]}. + +{mapping, "auth.http.auth_req.method", "emqx_auth_http.auth_req", [ + {default, post}, + {datatype, {enum, [post, get]}} +]}. + +{mapping, "auth.http.auth_req.content_type", "emqx_auth_http.auth_req", [ + {default, 'x-www-form-urlencoded'}, + {datatype, {enum, ['json', 'x-www-form-urlencoded']}} +]}. + +{mapping, "auth.http.auth_req.params", "emqx_auth_http.auth_req", [ + {datatype, string} +]}. + +{translation, "emqx_auth_http.auth_req", fun(Conf) -> + case cuttlefish:conf_get("auth.http.auth_req", Conf) of + undefined -> cuttlefish:unset(); + Url -> + Params = cuttlefish:conf_get("auth.http.auth_req.params", Conf), + [{url, Url}, + {method, cuttlefish:conf_get("auth.http.auth_req.method", Conf)}, + {content_type, list_to_binary("application/" ++ atom_to_list(cuttlefish:conf_get("auth.http.auth_req.content_type", Conf)))}, + {params, [list_to_tuple(string:tokens(S, "=")) || S <- string:tokens(Params, ",")]}] + end +end}. + +{mapping, "auth.http.super_req", "emqx_auth_http.super_req", [ + {datatype, string} +]}. + +{mapping, "auth.http.super_req.method", "emqx_auth_http.super_req", [ + {default, post}, + {datatype, {enum, [post, get]}} +]}. + +{mapping, "auth.http.super_req.content_type", "emqx_auth_http.super_req", [ + {default, 'x-www-form-urlencoded'}, + {datatype, {enum, ['json', 'x-www-form-urlencoded']}} +]}. + +{mapping, "auth.http.super_req.params", "emqx_auth_http.super_req", [ + {datatype, string} +]}. + +{translation, "emqx_auth_http.super_req", fun(Conf) -> + case cuttlefish:conf_get("auth.http.super_req", Conf, undefined) of + undefined -> cuttlefish:unset(); + Url -> Params = cuttlefish:conf_get("auth.http.super_req.params", Conf), + [{url, Url}, {method, cuttlefish:conf_get("auth.http.super_req.method", Conf)}, + {content_type, list_to_binary("application/" ++ atom_to_list(cuttlefish:conf_get("auth.http.super_req.content_type", Conf)))}, + {params, [list_to_tuple(string:tokens(S, "=")) || S <- string:tokens(Params, ",")]}] + end +end}. + +{mapping, "auth.http.acl_req", "emqx_auth_http.acl_req", [ + {default, undefined}, + {datatype, string} +]}. + +{mapping, "auth.http.acl_req.method", "emqx_auth_http.acl_req", [ + {default, post}, + {datatype, {enum, [post, get]}} +]}. + +{mapping, "auth.http.acl_req.content_type", "emqx_auth_http.acl_req", [ + {default, 'x-www-form-urlencoded'}, + {datatype, {enum, ['json', 'x-www-form-urlencoded']}} +]}. + +{mapping, "auth.http.acl_req.params", "emqx_auth_http.acl_req", [ + {datatype, string} +]}. + +{translation, "emqx_auth_http.acl_req", fun(Conf) -> + case cuttlefish:conf_get("auth.http.acl_req", Conf, undefined) of + undefined -> cuttlefish:unset(); + Url -> Params = cuttlefish:conf_get("auth.http.acl_req.params", Conf), + [{url, Url}, + {method, cuttlefish:conf_get("auth.http.acl_req.method", Conf)}, + {content_type, list_to_binary("application/" ++ atom_to_list(cuttlefish:conf_get("auth.http.acl_req.content_type", Conf)))}, + {params, [list_to_tuple(string:tokens(S, "=")) || S <- string:tokens(Params, ",")]}] + end +end}. + +{mapping, "auth.http.request.timeout", "emqx_auth_http.request_timeout", [ + {default, "5s"}, + {datatype, [integer, {duration, ms}]} +]}. + +{mapping, "auth.http.pool_size", "emqx_auth_http.pool_opts", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "auth.http.request.connect_timeout", "emqx_auth_http.pool_opts", [ + {default, "5s"}, + {datatype, [integer, {duration, ms}]} +]}. + +{mapping, "auth.http.ssl.cacertfile", "emqx_auth_http.pool_opts", [ + {datatype, string} +]}. + +{mapping, "auth.http.ssl.certfile", "emqx_auth_http.pool_opts", [ + {datatype, string} +]}. + +{mapping, "auth.http.ssl.keyfile", "emqx_auth_http.pool_opts", [ + {datatype, string} +]}. + +{mapping, "auth.http.request.retry_times", "emqx_auth_http.pool_opts", [ + {default, 5}, + {datatype, integer} +]}. + +{mapping, "auth.http.request.retry_interval", "emqx_auth_http.pool_opts", [ + {default, "1s"}, + {datatype, {duration, ms}} +]}. + +{mapping, "auth.http.request.retry_backoff", "emqx_auth_http.pool_opts", [ + {default, 2.0}, + {datatype, float} +]}. + +{translation, "emqx_auth_http.pool_opts", fun(Conf) -> + Filter = fun(L) -> [{K, V} || {K, V} <- L, V =/= undefined] end, + InfinityFun = fun(0) -> infinity; + (Duration) -> Duration + end, + SslOpts = Filter([{cacertfile, cuttlefish:conf_get("auth.http.ssl.cacertfile", Conf, undefined)}, + {certfile, cuttlefish:conf_get("auth.http.ssl.certfile", Conf, undefined)}, + {keyfile, cuttlefish:conf_get("auth.http.ssl.keyfile", Conf, undefined)}]), + Opts = [{pool_size, cuttlefish:conf_get("auth.http.pool_size", Conf)}, + {connect_timeout, InfinityFun(cuttlefish:conf_get("auth.http.request.connect_timeout", Conf))}, + {retry, cuttlefish:conf_get("auth.http.request.retry_times", Conf)}, + {retry_timeout, cuttlefish:conf_get("auth.http.request.retry_interval", Conf)}], + case SslOpts of + [] -> Filter(Opts); + _ -> + TlsVers = ['tlsv1.2','tlsv1.1',tlsv1], + DefaultOpts = [{versions, TlsVers}, + {ciphers, lists:foldl( + fun(TlsVer, Ciphers) -> + Ciphers ++ ssl:cipher_suites(all, TlsVer) + end, [], TlsVers)}], + Filter([{ssl, DefaultOpts ++ SslOpts} | Opts]) + end +end}. + + +{mapping, "auth.http.header.$field", "emqx_auth_http.headers", [ + {datatype, string} +]}. + +{translation, "emqx_auth_http.headers", fun(Conf) -> + lists:map( + fun({["auth", "http", "header", Field], Value}) -> + {Field, Value} + end, + cuttlefish_variable:filter_by_prefix("auth.http.header", Conf)) +end}. \ No newline at end of file diff --git a/apps/emqx_auth_http/rebar.config b/apps/emqx_auth_http/rebar.config new file mode 100644 index 000000000..0f2e48298 --- /dev/null +++ b/apps/emqx_auth_http/rebar.config @@ -0,0 +1,29 @@ +{deps, + [{gun, {git, "https://github.com/emqx/gun", {tag, "1.3.4"}}}, + {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + {parse_transform}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions]}. + +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}, + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "v1.2.2"}}} + ]} + ]} + ]}. diff --git a/apps/emqx_auth_http/src/emqx_acl_http.erl b/apps/emqx_auth_http/src/emqx_acl_http.erl new file mode 100644 index 000000000..a6f60b465 --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_acl_http.erl @@ -0,0 +1,89 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_http). + +-include("emqx_auth_http.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[ACL http]"). + +-import(emqx_auth_http_cli, + [ request/6 + , feedvar/2 + ]). + +%% ACL callbacks +-export([ register_metrics/0 + , check_acl/5 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +%%-------------------------------------------------------------------- +%% ACL callbacks +%%-------------------------------------------------------------------- + +check_acl(ClientInfo, PubSub, Topic, AclResult, State) -> + return_with(fun inc_metrics/1, + do_check_acl(ClientInfo, PubSub, Topic, AclResult, State)). + +do_check_acl(#{username := <<$$, _/binary>>}, _PubSub, _Topic, _AclResult, _Config) -> + ok; +do_check_acl(ClientInfo, PubSub, Topic, _AclResult, #{acl_req := AclReq, + pool_name := PoolName}) -> + ClientInfo1 = ClientInfo#{access => access(PubSub), topic => Topic}, + case check_acl_request(PoolName, AclReq, ClientInfo1) of + {ok, 200, <<"ignore">>} -> ok; + {ok, 200, _Body} -> {stop, allow}; + {ok, _Code, _Body} -> {stop, deny}; + {error, Error} -> + ?LOG(error, "Request ACL path ~s, error: ~p", + [AclReq#http_request.path, Error]), + ok + end. + +description() -> "ACL with HTTP API". + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +inc_metrics(ok) -> + emqx_metrics:inc(?ACL_METRICS(ignore)); +inc_metrics({stop, allow}) -> + emqx_metrics:inc(?ACL_METRICS(allow)); +inc_metrics({stop, deny}) -> + emqx_metrics:inc(?ACL_METRICS(deny)). + +return_with(Fun, Result) -> + Fun(Result), Result. + +check_acl_request(PoolName, #http_request{path = Path, + method = Method, + headers = Headers, + params = Params, + request_timeout = RequestTimeout}, ClientInfo) -> + request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), RequestTimeout). + +access(subscribe) -> 1; +access(publish) -> 2. + diff --git a/apps/emqx_auth_http/src/emqx_auth_http.app.src b/apps/emqx_auth_http/src/emqx_auth_http.app.src new file mode 100644 index 000000000..ce73e10ea --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_auth_http.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_http, + [{description, "EMQ X Authentication/ACL with HTTP API"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_http_sup]}, + {applications, [kernel,stdlib,gproc,gun]}, + {mod, {emqx_auth_http_app, []}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-http"} + ]} + ]}. diff --git a/apps/emqx_auth_http/src/emqx_auth_http.erl b/apps/emqx_auth_http/src/emqx_auth_http.erl new file mode 100644 index 000000000..20026d6ee --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_auth_http.erl @@ -0,0 +1,112 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_http). + +-include("emqx_auth_http.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/types.hrl"). + +-logger_header("[Auth http]"). + +-import(emqx_auth_http_cli, + [ request/6 + , feedvar/2 + ]). + +%% Callbacks +-export([ register_metrics/0 + , check/3 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +check(ClientInfo, AuthResult, #{auth_req := AuthReq, + super_req := SuperReq, + pool_name := PoolName}) -> + case authenticate(PoolName, AuthReq, ClientInfo) of + {ok, 200, <<"ignore">>} -> + emqx_metrics:inc(?AUTH_METRICS(ignore)), ok; + {ok, 200, Body} -> + emqx_metrics:inc(?AUTH_METRICS(success)), + IsSuperuser = is_superuser(PoolName, SuperReq, ClientInfo), + {stop, AuthResult#{is_superuser => IsSuperuser, + auth_result => success, + anonymous => false, + mountpoint => mountpoint(Body, ClientInfo)}}; + {ok, Code, _Body} -> + ?LOG(error, "Deny connection from path: ~s, response http code: ~p", + [AuthReq#http_request.path, Code]), + emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{auth_result => http_to_connack_error(Code), + anonymous => false}}; + {error, Error} -> + ?LOG(error, "Request auth path: ~s, error: ~p", + [AuthReq#http_request.path, Error]), + emqx_metrics:inc(?AUTH_METRICS(failure)), + %%FIXME later: server_unavailable is not right. + {stop, AuthResult#{auth_result => server_unavailable, + anonymous => false}} + end. + +description() -> "Authentication by HTTP API". + +%%-------------------------------------------------------------------- +%% Requests +%%-------------------------------------------------------------------- + +authenticate(PoolName, #http_request{path = Path, + method = Method, + headers = Headers, + params = Params, + request_timeout = RequestTimeout}, ClientInfo) -> + request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), RequestTimeout). + +-spec(is_superuser(atom(), maybe(#http_request{}), emqx_types:client()) -> boolean()). +is_superuser(_PoolName, undefined, _ClientInfo) -> + false; +is_superuser(PoolName, #http_request{path = Path, + method = Method, + headers = Headers, + params = Params, + request_timeout = RequestTimeout}, ClientInfo) -> + case request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), RequestTimeout) of + {ok, 200, _Body} -> true; + {ok, _Code, _Body} -> false; + {error, Error} -> ?LOG(error, "Request superuser path ~s, error: ~p", [Path, Error]), + false + end. + +mountpoint(Body, #{mountpoint := Mountpoint}) -> + case emqx_json:safe_decode(Body, [return_maps]) of + {error, _} -> Mountpoint; + {ok, Json} when is_map(Json) -> + maps:get(<<"mountpoint">>, Json, Mountpoint); + {ok, _NotMap} -> Mountpoint + end. + +http_to_connack_error(400) -> bad_username_or_password; +http_to_connack_error(401) -> bad_username_or_password; +http_to_connack_error(403) -> not_authorized; +http_to_connack_error(429) -> banned; +http_to_connack_error(503) -> server_unavailable; +http_to_connack_error(504) -> server_busy; +http_to_connack_error(_) -> server_unavailable. diff --git a/apps/emqx_auth_http/src/emqx_auth_http_app.erl b/apps/emqx_auth_http/src/emqx_auth_http_app.erl new file mode 100644 index 000000000..30dfc5dc5 --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_auth_http_app.erl @@ -0,0 +1,176 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_http_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_http.hrl"). + +-export([ start/2 + , stop/1 + ]). +-export([init/1]). + +%%-------------------------------------------------------------------- +%% Application Callbacks +%%-------------------------------------------------------------------- + +start(_StartType, _StartArgs) -> + case translate_env() of + ok -> + {ok, PoolOpts} = application:get_env(?APP, pool_opts), + {ok, Sup} = emqx_http_client_sup:start_link(?APP, ssl(inet(PoolOpts))), + with_env(auth_req, fun load_auth_hook/1), + with_env(acl_req, fun load_acl_hook/1), + {ok, Sup}; + {error, Reason} -> + {error, Reason} + end. + +load_auth_hook(AuthReq) -> + ok = emqx_auth_http:register_metrics(), + SuperReq = r(application:get_env(?APP, super_req, undefined)), + Params = #{auth_req => AuthReq, + super_req => SuperReq, + pool_name => ?APP}, + emqx:hook('client.authenticate', {emqx_auth_http, check, [Params]}). + +load_acl_hook(AclReq) -> + ok = emqx_acl_http:register_metrics(), + Params = #{acl_req => AclReq, + pool_name => ?APP}, + emqx:hook('client.check_acl', {emqx_acl_http, check_acl, [Params]}). + +stop(_State) -> + emqx:unhook('client.authenticate', {emqx_auth_http, check}), + emqx:unhook('client.check_acl', {emqx_acl_http, check_acl}), + emqx_http_client_sup:stop_pool(?APP). + +%%-------------------------------------------------------------------- +%% Dummy supervisor +%%-------------------------------------------------------------------- + +init([]) -> + {ok, { {one_for_all, 10, 100}, []} }. + +%%-------------------------------------------------------------------- +%% Internel functions +%%-------------------------------------------------------------------- + +with_env(Par, Fun) -> + case application:get_env(?APP, Par) of + undefined -> ok; + {ok, Req} -> Fun(r(Req)) + end. + +r(undefined) -> + undefined; +r(Config) -> + Headers = application:get_env(?APP, headers, []), + Method = proplists:get_value(method, Config, post), + Path = proplists:get_value(path, Config), + NewHeaders = case Method =:= post orelse Method =:= put of + true -> + ContentType = proplists:get_value(content_type, Config, <<"application/x-www-form-urlencoded">>), + [{<<"content-type">>, ContentType} | Headers]; + _ -> + Headers + end, + Params = proplists:get_value(params, Config), + {ok, RequestTimeout} = application:get_env(?APP, request_timeout), + #http_request{method = Method, path = Path, headers = NewHeaders, params = Params, request_timeout = RequestTimeout}. + +inet(PoolOpts) -> + Host = proplists:get_value(host, PoolOpts), + TransOpts = proplists:get_value(transport_opts, PoolOpts, []), + NewPoolOpts = proplists:delete(transport_opts, PoolOpts), + Inet = case Host of + {_,_,_,_} -> inet; + {_,_,_,_,_,_,_,_} -> inet6; + _ -> + case inet:getaddr(Host, inet6) of + {error, _} -> inet; + {ok, _} -> inet6 + end + end, + [{transport_opts, [Inet | TransOpts]} | NewPoolOpts]. + +ssl(PoolOpts) -> + case proplists:get_value(ssl, PoolOpts, []) of + [] -> + PoolOpts; + SSLOpts -> + TransOpts = proplists:get_value(transport_opts, PoolOpts, []), + NewPoolOpts = proplists:delete(transport_opts, PoolOpts), + [{transport_opts, SSLOpts ++ TransOpts}, {transport, ssl} | NewPoolOpts] + end. + +translate_env() -> + URLs = lists:foldl(fun(Name, Acc) -> + case application:get_env(?APP, Name, []) of + [] -> Acc; + Env -> + URL = proplists:get_value(url, Env), + #{host := Host, + path := Path, + scheme := Scheme} = URIMap = uri_string:parse(add_default_scheme(URL)), + Port = maps:get(port, URIMap, case Scheme of + "https" -> 443; + _ -> 80 + end), + [{Name, {Host, Port, path(Path)}} | Acc] + end + end, [], [acl_req, auth_req, super_req]), + case same_host_and_port(URLs) of + true -> + [begin + {ok, Req} = application:get_env(?APP, Name), + application:set_env(?APP, Name, [{path, Path} | Req]) + end || {Name, {_, _, Path}} <- URLs], + {_, {Host, Port, _}} = lists:last(URLs), + PoolOpts = application:get_env(?APP, pool_opts, []), + NHost = case inet:parse_address(Host) of + {ok, {_,_,_,_} = Addr} -> Addr; + {ok, {_,_,_,_,_,_,_,_} = Addr} -> Addr; + {error, einval} -> Host + end, + application:set_env(?APP, pool_opts, [{host, NHost}, {port, Port} | PoolOpts]), + ok; + false -> + {error, different_server} + end. + +same_host_and_port([_]) -> + true; +same_host_and_port([{_, {Host, Port, _}}, {_, {Host, Port, _}}]) -> + true; +same_host_and_port([{_, {Host, Port, _}}, URL = {_, {Host, Port, _}} | Rest]) -> + same_host_and_port([URL | Rest]); +same_host_and_port(_) -> + false. + +path("") -> "/"; +path(Path) -> Path. + +add_default_scheme("http://" ++ _ = URL) -> + URL; +add_default_scheme("https://" ++ _ = URL) -> + URL; +add_default_scheme(URL) -> + "http://" ++ URL. \ No newline at end of file diff --git a/apps/emqx_auth_http/src/emqx_auth_http_cli.erl b/apps/emqx_auth_http/src/emqx_auth_http_cli.erl new file mode 100644 index 000000000..9a52d833a --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_auth_http_cli.erl @@ -0,0 +1,103 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_http_cli). + +-include("emqx_auth_http.hrl"). + +-export([ request/6 + , feedvar/2 + , feedvar/3 + ]). + +%%-------------------------------------------------------------------- +%% HTTP Request +%%-------------------------------------------------------------------- + +request(PoolName, get, Path, Headers, Params, Timeout) -> + NewPath = Path ++ "?" ++ binary_to_list(cow_qs:qs(bin_kw(Params))), + do_request(get, PoolName, {NewPath, Headers}, Timeout); + +request(PoolName, post, Path, Headers, Params, Timeout) -> + Body = case proplists:get_value(<<"content-type">>, Headers) of + <<"application/x-www-form-urlencoded">> -> + cow_qs:qs(bin_kw(Params)); + <<"application/json">> -> + emqx_json:encode(bin_kw(Params)) + end, + do_request(post, PoolName, {Path, Headers, Body}, Timeout). + +do_request(Method, PoolName, Req, Timeout) -> + do_request(Method, PoolName, Req, Timeout, 3). + +%% Only retry when connection closed by keepalive +do_request(_Method, _PoolName, _Req, _Timeout, 0) -> + {error, normal}; +do_request(Method, PoolName, Req, Timeout, Retry) -> + case emqx_http_client:request(Method, PoolName, Req, Timeout) of + {error, normal} -> + do_request(Method, PoolName, Req, Timeout, Retry - 1); + {error, Reason} -> + {error, Reason}; + {ok, StatusCode, _Headers} -> + {ok, StatusCode, <<>>}; + {ok, StatusCode, _Headers, Body} -> + {ok, StatusCode, Body} + end. + +%% TODO: move this conversion to cuttlefish config and schema +bin_kw(KeywordList) when is_list(KeywordList) -> + [{bin(K), bin(V)} || {K, V} <- KeywordList]. + +bin(Atom) when is_atom(Atom) -> + list_to_binary(atom_to_list(Atom)); +bin(Int) when is_integer(Int) -> + integer_to_binary(Int); +bin(Float) when is_float(Float) -> + float_to_binary(Float, [{decimals, 12}, compact]); +bin(List) when is_list(List)-> + list_to_binary(List); +bin(Binary) when is_binary(Binary) -> + Binary. + +%%-------------------------------------------------------------------- +%% Feed Variables +%%-------------------------------------------------------------------- + +feedvar(Params, ClientInfo = #{clientid := ClientId, + protocol := Protocol, + peerhost := Peerhost}) -> + lists:map(fun({Param, "%u"}) -> {Param, maps:get(username, ClientInfo, null)}; + ({Param, "%c"}) -> {Param, ClientId}; + ({Param, "%r"}) -> {Param, Protocol}; + ({Param, "%a"}) -> {Param, inet:ntoa(Peerhost)}; + ({Param, "%P"}) -> {Param, maps:get(password, ClientInfo, null)}; + ({Param, "%p"}) -> {Param, maps:get(sockport, ClientInfo, null)}; + ({Param, "%C"}) -> {Param, maps:get(cn, ClientInfo, null)}; + ({Param, "%d"}) -> {Param, maps:get(dn, ClientInfo, null)}; + ({Param, "%A"}) -> {Param, maps:get(access, ClientInfo, null)}; + ({Param, "%t"}) -> {Param, maps:get(topic, ClientInfo, null)}; + ({Param, "%m"}) -> {Param, maps:get(mountpoint, ClientInfo, null)}; + ({Param, Var}) -> {Param, Var} + end, Params). + +feedvar(Params, Var, Val) -> + lists:map(fun({Param, Var0}) when Var0 == Var -> + {Param, Val}; + ({Param, Var0}) -> + {Param, Var0} + end, Params). + diff --git a/apps/emqx_auth_http/src/emqx_http_client.erl b/apps/emqx_auth_http/src/emqx_http_client.erl new file mode 100644 index 000000000..4ed2c33e5 --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_http_client.erl @@ -0,0 +1,256 @@ +-module(emqx_http_client). + +-behaviour(gen_server). + +-include_lib("emqx/include/logger.hrl"). + +%% APIs +-export([ start_link/3 + , request/3 + , request/4 + ]). + +%% gen_server callbacks +-export([ init/1 + , handle_call/3 + , handle_cast/2 + , handle_info/2 + , terminate/2 + , code_change/3 + ]). + +-record(state, { + pool :: ecpool:poo_name(), + id :: pos_integer(), + client :: pid() | undefined, + mref :: reference() | undefined, + host :: inet:hostname() | inet:ip_address(), + port :: inet:port_number(), + gun_opts :: proplists:proplist(), + gun_state :: down | up, + requests :: map() + }). + +%%-------------------------------------------------------------------- +%% APIs +%%-------------------------------------------------------------------- + +start_link(Pool, Id, Opts) -> + gen_server:start_link(?MODULE, [Pool, Id, Opts], []). + +request(Method, Pool, Req) -> + request(Method, Pool, Req, 5000). + +request(get, Pool, {Path, Headers}, Timeout) -> + call(pick(Pool), {get, {Path, Headers}, Timeout}, Timeout + 1000); +request(Method, Pool, {Path, Headers, Body}, Timeout) -> + call(pick(Pool), {Method, {Path, Headers, Body}, Timeout}, Timeout + 1000). + +%%-------------------------------------------------------------------- +%% gen_server callbacks +%%-------------------------------------------------------------------- + +init([Pool, Id, Opts]) -> + State = #state{pool = Pool, + id = Id, + client = undefined, + mref = undefined, + host = proplists:get_value(host, Opts), + port = proplists:get_value(port, Opts), + gun_opts = gun_opts(Opts), + gun_state = down, + requests = #{}}, + true = gproc_pool:connect_worker(Pool, {Pool, Id}), + {ok, State}. + +handle_call(Req = {_, _, _}, From, State = #state{client = undefined, gun_state = down}) -> + case open(State) of + {ok, NewState} -> + handle_call(Req, From, NewState); + {error, Reason} -> + {reply, {error, Reason}, State} + end; + +handle_call(Req = {_, _, Timeout}, From, State = #state{client = Client, mref = MRef, gun_state = down}) when is_pid(Client) -> + case gun:await_up(Client, Timeout, MRef) of + {ok, _} -> + handle_call(Req, From, State#state{gun_state = up}); + {error, timeout} -> + {reply, {error, timeout}, State}; + {error, Reason} -> + true = erlang:demonitor(MRef, [flush]), + {reply, {error, Reason}, State#state{client = undefined, mref = undefined}} + end; + +handle_call({Method, Request, Timeout}, From, State = #state{client = Client, requests = Requests, gun_state = up}) when is_pid(Client) -> + StreamRef = do_request(Client, Method, Request), + ExpirationTime = erlang:system_time(millisecond) + Timeout, + {noreply, State#state{requests = maps:put(StreamRef, {From, ExpirationTime, undefined}, Requests)}}; + +handle_call(Req, _From, State) -> + ?LOG(error, "Unexpected call: ~p", [Req]), + {reply, ignored, State}. + +handle_cast(Msg, State) -> + ?LOG(error, "Unexpected cast: ~p", [Msg]), + {noreply, State}. + +handle_info({gun_response, Client, StreamRef, IsFin, StatusCode, Headers}, State = #state{client = Client, requests = Requests}) -> + Now = erlang:system_time(millisecond), + case maps:take(StreamRef, Requests) of + error -> + ?LOG(error, "Received 'gun_response' message from unknown stream ref: ~p", [StreamRef]), + {noreply, State}; + {{_, ExpirationTime, _}, NRequests} when Now > ExpirationTime -> + gun:cancel(Client, StreamRef), + flush_stream(Client, StreamRef), + {noreply, State#state{requests = NRequests}}; + {{From, ExpirationTime, undefined}, NRequests} -> + case IsFin of + fin -> + gen_server:reply(From, {ok, StatusCode, Headers}), + {noreply, State#state{requests = NRequests}}; + nofin -> + {noreply, State#state{requests = NRequests#{StreamRef => {From, ExpirationTime, {StatusCode, Headers, <<>>}}}}} + end; + _ -> + ?LOG(error, "Received 'gun_response' message does not match the state"), + {noreply, State} + end; + +handle_info({gun_data, Client, StreamRef, IsFin, Data}, State = #state{client = Client, requests = Requests}) -> + Now = erlang:system_time(millisecond), + case maps:take(StreamRef, Requests) of + error -> + ?LOG(error, "Received 'gun_data' message from unknown stream ref: ~p", [StreamRef]), + {noreply, State}; + {{_, ExpirationTime, _}, NRequests} when Now > ExpirationTime -> + gun:cancel(Client, StreamRef), + flush_stream(Client, StreamRef), + {noreply, State#state{requests = NRequests}}; + {{From, ExpirationTime, {StatusCode, Headers, Acc}}, NRequests} -> + case IsFin of + fin -> + gen_server:reply(From, {ok, StatusCode, Headers, <>}), + {noreply, State#state{requests = NRequests}}; + nofin -> + {noreply, State#state{requests = NRequests#{StreamRef => {From, ExpirationTime, {StatusCode, Headers, <>}}}}} + end; + _ -> + ?LOG(error, "Received 'gun_data' message does not match the state"), + {noreply, State} + end; + +handle_info({gun_error, Client, StreamRef, Reason}, State = #state{client = Client, requests = Requests}) -> + Now = erlang:system_time(millisecond), + case maps:take(StreamRef, Requests) of + error -> + ?LOG(error, "Received 'gun_error' message from unknown stream ref: ~p~n", [StreamRef]), + {noreply, State}; + {{_, ExpirationTime, _}, NRequests} when Now > ExpirationTime -> + {noreply, State#state{requests = NRequests}}; + {{From, _, _}, NRequests} -> + gen_server:reply(From, {error, Reason}), + {noreply, State#state{requests = NRequests}} + end; + +handle_info({gun_up, Client, _}, State = #state{client = Client}) -> + {noreply, State#state{gun_state = up}}; + +handle_info({gun_down, Client, _, Reason, KilledStreams, _}, State = #state{client = Client, requests = Requests}) -> + Now = erlang:system_time(millisecond), + NRequests = lists:foldl(fun(StreamRef, Acc) -> + case maps:take(StreamRef, Acc) of + error -> Acc; + {{_, ExpirationTime, _}, NAcc} when Now > ExpirationTime -> + NAcc; + {{From, _, _}, NAcc} -> + gen_server:reply(From, {error, Reason}), + NAcc + end + end, Requests, KilledStreams), + {noreply, State#state{gun_state = down, requests = NRequests}}; + +handle_info({'DOWN', MRef, process, Client, Reason}, State = #state{mref = MRef, client = Client, requests = Requests}) -> + true = erlang:demonitor(MRef, [flush]), + Now = erlang:system_time(millisecond), + lists:foreach(fun({_, {_, ExpirationTime, _}}) when Now > ExpirationTime -> + ok; + ({_, {From, _, _}}) -> + gen_server:reply(From, {error, Reason}) + end, maps:to_list(Requests)), + case open(State#state{requests = #{}}) of + {ok, NewState} -> + {noreply, NewState}; + {error, Reason} -> + {noreply, State#state{mref = undefined, client = undefined}} + end; + +handle_info(Info, State) -> + ?LOG(error, "Unexpected info: ~p", [Info]), + {noreply, State}. + +terminate(_Reason, #state{pool = Pool, id = Id}) -> + gproc_pool:disconnect_worker(Pool, {Pool, Id}), + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +open(State = #state{host = Host, port = Port, gun_opts = GunOpts}) -> + case gun:open(Host, Port, GunOpts) of + {ok, ConnPid} when is_pid(ConnPid) -> + MRef = monitor(process, ConnPid), + {ok, State#state{mref = MRef, client = ConnPid}}; + {error, Reason} -> + {error, Reason} + end. + +gun_opts(Opts) -> + gun_opts(Opts, #{retry => 5, + retry_timeout => 1000, + connect_timeout => 5000, + protocols => [http], + http_opts => #{keepalive => infinity}}). + +gun_opts([], Acc) -> + Acc; +gun_opts([{retry, Retry} | Opts], Acc) -> + gun_opts(Opts, Acc#{retry => Retry}); +gun_opts([{retry_timeout, RetryTimeout} | Opts], Acc) -> + gun_opts(Opts, Acc#{retry_timeout => RetryTimeout}); +gun_opts([{connect_timeout, ConnectTimeout} | Opts], Acc) -> + gun_opts(Opts, Acc#{connect_timeout => ConnectTimeout}); +gun_opts([{transport, Transport} | Opts], Acc) -> + gun_opts(Opts, Acc#{transport => Transport}); +gun_opts([{transport_opts, TransportOpts} | Opts], Acc) -> + gun_opts(Opts, Acc#{transport_opts => TransportOpts}); +gun_opts([_ | Opts], Acc) -> + gun_opts(Opts, Acc). + +call(ChannPid, Msg, Timeout) -> + gen_server:call(ChannPid, Msg, Timeout). + +pick(Pool) -> + gproc_pool:pick_worker(Pool). + +do_request(Client, get, {Path, Headers}) -> + gun:get(Client, Path, Headers); +do_request(Client, post, {Path, Headers, Body}) -> + gun:post(Client, Path, Headers, Body). + +flush_stream(Client, StreamRef) -> + receive + {gun_response, Client, StreamRef, _, _, _} -> + flush_stream(Client, StreamRef); + {gun_data, Client, StreamRef, _, _} -> + flush_stream(Client, StreamRef); + {gun_error, Client, StreamRef, _} -> + flush_stream(Client, StreamRef) + after 0 -> + ok + end. \ No newline at end of file diff --git a/apps/emqx_auth_http/src/emqx_http_client_sup.erl b/apps/emqx_auth_http/src/emqx_http_client_sup.erl new file mode 100644 index 000000000..dcdd2e4c4 --- /dev/null +++ b/apps/emqx_auth_http/src/emqx_http_client_sup.erl @@ -0,0 +1,48 @@ +-module(emqx_http_client_sup). + +-behaviour(supervisor). + +-export([ start_link/2 + , init/1 + , stop_pool/1 + ]). + +start_link(Pool, Opts) -> + supervisor:start_link(?MODULE, [Pool, Opts]). + +init([Pool, Opts]) -> + PoolSize = pool_size(Opts), + ok = ensure_pool(Pool, random, [{size, PoolSize}]), + {ok, {{one_for_one, 10, 100}, [ + begin + ensure_pool_worker(Pool, {Pool, I}, I), + #{id => {Pool, I}, + start => {emqx_http_client, start_link, [Pool, I, Opts]}, + restart => transient, + shutdown => 5000, + type => worker, + modules => [emqx_http_client]} + end || I <- lists:seq(1, PoolSize)]}}. + + +ensure_pool(Pool, Type, Opts) -> + try gproc_pool:new(Pool, Type, Opts) + catch + error:exists -> ok + end. + +ensure_pool_worker(Pool, Name, Slot) -> + try gproc_pool:add_worker(Pool, Name, Slot) + catch + error:exists -> ok + end. + +pool_size(Opts) -> + Schedulers = erlang:system_info(schedulers), + proplists:get_value(pool_size, Opts, Schedulers). + +stop_pool(Name) -> + Workers = gproc_pool:defined_workers(Name), + [gproc_pool:remove_worker(Name, WokerName) || {WokerName, _, _} <- Workers], + gproc_pool:delete(Name), + ok. \ No newline at end of file diff --git a/apps/emqx_auth_http/test/emqx_auth_http_SUITE.erl b/apps/emqx_auth_http/test/emqx_auth_http_SUITE.erl new file mode 100644 index 000000000..ae6cab4c3 --- /dev/null +++ b/apps/emqx_auth_http/test/emqx_auth_http_SUITE.erl @@ -0,0 +1,168 @@ +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. + +-module(emqx_auth_http_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("common_test/include/ct.hrl"). +-include_lib("eunit/include/eunit.hrl"). + +-define(APP, emqx_auth_http). + +-define(USER(ClientId, Username, Protocol, Peerhost, Zone), + #{clientid => ClientId, username => Username, protocol => Protocol, + peerhost => Peerhost, zone => Zone}). + +-define(USER(ClientId, Username, Protocol, Peerhost, Zone, Mountpoint), + #{clientid => ClientId, username => Username, protocol => Protocol, + peerhost => Peerhost, zone => Zone, mountpoint => Mountpoint}). + +%%-------------------------------------------------------------------- +%% Setups +%%-------------------------------------------------------------------- + +all() -> + [{group, http_inet}, + {group, http_inet6}, + {group, https_inet}, + {group, https_inet6}]. + +groups() -> + Cases = emqx_ct:all(?MODULE), + [{Name, Cases} || Name <- [http_inet, http_inet6, https_inet, https_inet6]]. + +init_per_group(GrpName, Cfg) -> + [Schema, Inet] = [list_to_atom(X) || X <- string:tokens(atom_to_list(GrpName), "_")], + http_auth_server:start(Schema, Inet), + Fun = fun(App) -> set_special_configs(App, Schema, Inet) end, + emqx_ct_helpers:start_apps([emqx_auth_http], Fun), + Cfg. + +end_per_group(_GrpName, _Cfg) -> + http_auth_server:stop(), + emqx_ct_helpers:stop_apps([emqx_auth_http, emqx]). + +set_special_configs(emqx, _Schmea, _Inet) -> + application:set_env(emqx, allow_anonymous, true), + application:set_env(emqx, enable_acl_cache, false), + LoadedPluginPath = filename:join(["test", "emqx_SUITE_data", "loaded_plugins"]), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, LoadedPluginPath)); + +set_special_configs(emqx_auth_http, Schema, Inet) -> + ServerAddr = http_server(Schema, Inet), + + AuthReq = #{method => get, + url => ServerAddr ++ "/mqtt/auth", + content_type => <<"application/x-www-form-urlencoded">>, + params => [{"clientid", "%c"}, {"username", "%u"}, {"password", "%P"}]}, + AclReq = #{method => post, + url => ServerAddr ++ "/mqtt/acl", + content_type => <<"application/json">>, + params => [{"access", "%A"}, {"username", "%u"}, {"clientid", "%c"}, {"ipaddr", "%a"}, {"topic", "%t"}, {"mountpoint", "%m"}]}, + + Schema =:= https andalso set_https_client_opts(), + + application:set_env(emqx_auth_http, auth_req, maps:to_list(AuthReq)), + application:set_env(emqx_auth_http, acl_req, maps:to_list(AclReq)). + +%% @private +set_https_client_opts() -> + TransportOpts = emqx_ct_helpers:client_ssl_twoway(), + {ok, PoolOpts} = application:get_env(emqx_auth_http, pool_opts), + application:set_env(emqx_auth_http, pool_opts, [{transport_opts, TransportOpts}, {transport, ssl} | PoolOpts]). + +%% @private +http_server(http, inet) -> "http://127.0.0.1:8991"; +http_server(http, inet6) -> "http://[::1]:8991"; +http_server(https, inet) -> "https://127.0.0.1:8991"; +http_server(https, inet6) -> "https://[::1]:8991". + +%%------------------------------------------------------------------------------ +%% Testcases +%%------------------------------------------------------------------------------ + +t_check_acl(_) -> + SuperUser = ?USER(<<"superclient">>, <<"superuser">>, mqtt, {127,0,0,1}, external), + deny = emqx_access_control:check_acl(SuperUser, subscribe, <<"users/testuser/1">>), + deny = emqx_access_control:check_acl(SuperUser, publish, <<"anytopic">>), + + User1 = ?USER(<<"client1">>, <<"testuser">>, mqtt, {127,0,0,1}, external), + UnIpUser1 = ?USER(<<"client1">>, <<"testuser">>, mqtt, {192,168,0,4}, external), + UnClientIdUser1 = ?USER(<<"unkonwc">>, <<"testuser">>, mqtt, {127,0,0,1}, external), + UnnameUser1= ?USER(<<"client1">>, <<"unuser">>, mqtt, {127,0,0,1}, external), + allow = emqx_access_control:check_acl(User1, subscribe, <<"users/testuser/1">>), + deny = emqx_access_control:check_acl(User1, publish, <<"users/testuser/1">>), + deny = emqx_access_control:check_acl(UnIpUser1, subscribe, <<"users/testuser/1">>), + deny = emqx_access_control:check_acl(UnClientIdUser1, subscribe, <<"users/testuser/1">>), + deny = emqx_access_control:check_acl(UnnameUser1, subscribe, <<"$SYS/testuser/1">>), + + User2 = ?USER(<<"client2">>, <<"xyz">>, mqtt, {127,0,0,1}, external), + UserC = ?USER(<<"client2">>, <<"xyz">>, mqtt, {192,168,1,3}, external), + allow = emqx_access_control:check_acl(UserC, publish, <<"a/b/c">>), + deny = emqx_access_control:check_acl(User2, publish, <<"a/b/c">>), + deny = emqx_access_control:check_acl(User2, subscribe, <<"$SYS/testuser/1">>). + +t_check_auth(_) -> + User1 = ?USER(<<"client1">>, <<"testuser1">>, mqtt, {127,0,0,1}, external, undefined), + User2 = ?USER(<<"client2">>, <<"testuser2">>, mqtt, {127,0,0,1}, exteneral, undefined), + User3 = ?USER(<<"client3">>, undefined, mqtt, {127,0,0,1}, exteneral, undefined), + + {ok, #{auth_result := success, + anonymous := false, + is_superuser := false}} = emqx_access_control:authenticate(User1#{password => <<"pass1">>}), + {error, bad_username_or_password} = emqx_access_control:authenticate(User1#{password => <<"pass">>}), + {error, bad_username_or_password} = emqx_access_control:authenticate(User1#{password => <<>>}), + + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(User2#{password => <<"pass2">>}), + {error, bad_username_or_password} = emqx_access_control:authenticate(User2#{password => <<>>}), + {error, bad_username_or_password} = emqx_access_control:authenticate(User2#{password => <<"errorpwd">>}), + + {error, bad_username_or_password} = emqx_access_control:authenticate(User3#{password => <<"pwd">>}). + +t_sub_pub(_) -> + ct:pal("start client"), + {ok, T1} = emqtt:start_link([{host, "localhost"}, + {clientid, <<"client1">>}, + {username, <<"testuser1">>}, + {password, <<"pass1">>}]), + {ok, _} = emqtt:connect(T1), + emqtt:publish(T1, <<"topic">>, <<"body">>, [{qos, 0}, {retain, true}]), + timer:sleep(1000), + {ok, T2} = emqtt:start_link([{host, "localhost"}, + {clientid, <<"client2">>}, + {username, <<"testuser2">>}, + {password, <<"pass2">>}]), + {ok, _} = emqtt:connect(T2), + emqtt:subscribe(T2, <<"topic">>), + receive + {publish, _Topic, Payload} -> + ?assertEqual(<<"body">>, Payload) + after 1000 -> false end, + emqtt:disconnect(T1), + emqtt:disconnect(T2). + +t_comment_config(_) -> + AuthCount = length(emqx_hooks:lookup('client.authenticate')), + AclCount = length(emqx_hooks:lookup('client.check_acl')), + application:stop(?APP), + [application:unset_env(?APP, Par) || Par <- [acl_req, auth_req]], + application:start(?APP), + ?assertEqual([], emqx_hooks:lookup('client.authenticate')), + ?assertEqual(AuthCount - 1, length(emqx_hooks:lookup('client.authenticate'))), + ?assertEqual(AclCount - 1, length(emqx_hooks:lookup('client.check_acl'))). + diff --git a/apps/emqx_auth_http/test/http_auth_server.erl b/apps/emqx_auth_http/test/http_auth_server.erl new file mode 100644 index 000000000..54c4d38b3 --- /dev/null +++ b/apps/emqx_auth_http/test/http_auth_server.erl @@ -0,0 +1,152 @@ +-module(http_auth_server). + +-export([ start/2 + , stop/0 + ]). + +-define(SUPERUSER, [[{"username", "superuser"}, {"clientid", "superclient"}]]). + +-define(ACL, [[{<<"username">>, <<"testuser">>}, + {<<"clientid">>, <<"client1">>}, + {<<"access">>, <<"1">>}, + {<<"topic">>, <<"users/testuser/1">>}, + {<<"ipaddr">>, <<"127.0.0.1">>}, + {<<"mountpoint">>, <<"null">>}], + [{<<"username">>, <<"xyz">>}, + {<<"clientid">>, <<"client2">>}, + {<<"access">>, <<"2">>}, + {<<"topic">>, <<"a/b/c">>}, + {<<"ipaddr">>, <<"192.168.1.3">>}, + {<<"mountpoint">>, <<"null">>}], + [{<<"username">>, <<"testuser1">>}, + {<<"clientid">>, <<"client1">>}, + {<<"access">>, <<"2">>}, + {<<"topic">>, <<"topic">>}, + {<<"ipaddr">>, <<"127.0.0.1">>}, + {<<"mountpoint">>, <<"null">>}], + [{<<"username">>, <<"testuser2">>}, + {<<"clientid">>, <<"client2">>}, + {<<"access">>, <<"1">>}, + {<<"topic">>, <<"topic">>}, + {<<"ipaddr">>, <<"127.0.0.1">>}, + {<<"mountpoint">>, <<"null">>}]]). + +-define(AUTH, [[{<<"clientid">>, <<"client1">>}, + {<<"username">>, <<"testuser1">>}, + {<<"password">>, <<"pass1">>}], + [{<<"clientid">>, <<"client2">>}, + {<<"username">>, <<"testuser2">>}, + {<<"password">>, <<"pass2">>}]]). + +%%------------------------------------------------------------------------------ +%% REST Interface +%%------------------------------------------------------------------------------ + +-rest_api(#{ name => auth + , method => 'GET' + , path => "/mqtt/auth" + , func => authenticate + , descr => "Authenticate user access permission" + }). + +-rest_api(#{ name => is_superuser + , method => 'GET' + , path => "/mqtt/superuser" + , func => is_superuser + , descr => "Is super user" + }). + +-rest_api(#{ name => acl + , method => 'GET' + , path => "/mqtt/acl" + , func => check_acl + , descr => "Check acl" + }). + +-rest_api(#{ name => auth + , method => 'POST' + , path => "/mqtt/auth" + , func => authenticate + , descr => "Authenticate user access permission" + }). + +-rest_api(#{ name => is_superuser + , method => 'POST' + , path => "/mqtt/superuser" + , func => is_superuser + , descr => "Is super user" + }). + +-rest_api(#{ name => acl + , method => 'POST' + , path => "/mqtt/acl" + , func => check_acl + , descr => "Check acl" + }). + +-export([ authenticate/2 + , is_superuser/2 + , check_acl/2 + ]). + +authenticate(_Binding, Params) -> + return(check(Params, ?AUTH)). + +is_superuser(_Binding, Params) -> + return(check(Params, ?SUPERUSER)). + +check_acl(_Binding, Params) -> + return(check(Params, ?ACL)). + +return(allow) -> {200, <<"allow">>}; +return(deny) -> {400, <<"deny">>}. + +start(http, Inet) -> + application:ensure_all_started(minirest), + Handlers = [{"/", minirest:handler(#{modules => [?MODULE]})}], + Dispatch = [{"/[...]", minirest, Handlers}], + minirest:start_http(http_auth_server, #{socket_opts => [Inet, {port, 8991}]}, Dispatch); + +start(https, Inet) -> + application:ensure_all_started(minirest), + Handlers = [{"/", minirest:handler(#{modules => [?MODULE]})}], + Dispatch = [{"/[...]", minirest, Handlers}], + minirest:start_https(http_auth_server, #{socket_opts => [Inet, {port, 8991} | certopts()]}, Dispatch). + +%% @private +certopts() -> + Certfile = filename:join(["etc", "certs", "cert.pem"]), + Keyfile = filename:join(["etc", "certs", "key.pem"]), + CaCert = filename:join(["etc", "certs", "cacert.pem"]), + [{verify, verify_peer}, + {certfile, emqx_ct_helpers:deps_path(emqx, Certfile)}, + {keyfile, emqx_ct_helpers:deps_path(emqx, Keyfile)}, + {cacertfile, emqx_ct_helpers:deps_path(emqx, CaCert)}] ++ emqx_ct_helpers:client_ssl(). + +stop() -> + minirest:stop_http(http_auth_server). + +-spec check(HttpReqParams :: list(), DefinedConf :: list()) -> allow | deny. +check(_Params, []) -> + %ct:pal("check auth_result: deny~n"), + deny; +check(Params, [ConfRecord|T]) -> + % ct:pal("Params: ~p, ConfRecord:~p ~n", [Params, ConfRecord]), + case match_config(Params, ConfRecord) of + not_match -> + check(Params, T); + matched -> allow + end. + +match_config([], _ConfigColumn) -> + %ct:pal("match_config auth_result: matched~n"), + matched; + +match_config([Param|T], ConfigColumn) -> + %ct:pal("Param: ~p, ConfigColumn:~p ~n", [Param, ConfigColumn]), + case lists:member(Param, ConfigColumn) of + true -> + match_config(T, ConfigColumn); + false -> + not_match + end. diff --git a/apps/emqx_auth_jwt/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_jwt/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..b8e722570 --- /dev/null +++ b/apps/emqx_auth_jwt/.github/workflows/run_test_cases.yaml @@ -0,0 +1,29 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + container: + image: erlang:22.1 + + steps: + - uses: actions/checkout@v1 + - name: run test cases + run: | + make xref + make eunit + make ct + make cover + - uses: actions/upload-artifact@v1 + if: always() + with: + name: logs + path: _build/test/logs + - uses: actions/upload-artifact@v1 + with: + name: cover + path: _build/test/cover + diff --git a/apps/emqx_auth_jwt/.gitignore b/apps/emqx_auth_jwt/.gitignore new file mode 100644 index 000000000..62e4fbb25 --- /dev/null +++ b/apps/emqx_auth_jwt/.gitignore @@ -0,0 +1,28 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.erlang.mk/ +emqx_auth_jwt.d +data/ +.DS_Store +cover/ +ct.coverdata +eunit.coverdata +logs/ +test/ct.cover.spec +emq_auth_jwt.d +erlang.mk +_build/ +rebar.lock +rebar3.crashdump +etc/emqx_auth_jwt.conf.rendered +.rebar3/ +*.swp +Mnesia.nonode@nohost/ diff --git a/apps/emqx_auth_jwt/LICENSE b/apps/emqx_auth_jwt/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_auth_jwt/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_jwt/Makefile b/apps/emqx_auth_jwt/Makefile new file mode 100644 index 000000000..b8d85351d --- /dev/null +++ b/apps/emqx_auth_jwt/Makefile @@ -0,0 +1,37 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: + $(REBAR) as test ct -v + +eunit: + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_auth_jwt.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_auth_jwt.conf -i priv/emqx_auth_jwt.schema -d data diff --git a/apps/emqx_auth_jwt/README.md b/apps/emqx_auth_jwt/README.md new file mode 100644 index 000000000..9675ae87c --- /dev/null +++ b/apps/emqx_auth_jwt/README.md @@ -0,0 +1,90 @@ + +# emqx-auth-jwt + +EMQ X JWT Authentication Plugin + +Build +----- + +``` +make && make tests +``` + +Configure the Plugin +-------------------- + +File: etc/plugins/emqx_auth_jwt.conf + +``` +## HMAC Hash Secret. +## +## Value: String +auth.jwt.secret = emqxsecret + +## From where the JWT string can be got +## +## Value: username | password +## Default: password +auth.jwt.from = password + +## RSA or ECDSA public key file. +## +## Value: File +## auth.jwt.pubkey = etc/certs/jwt_public_key.pem + +## Enable to verify claims fields +## +## Value: on | off +auth.jwt.verify_claims = off + +## The checklist of claims to validate +## +## Value: String +## auth.jwt.verify_claims.$name = expected +## +## Variables: +## - %u: username +## - %c: clientid +# auth.jwt.verify_claims.username = %u +``` + +Load the Plugin +--------------- + +``` +./bin/emqx_ctl plugins load emqx_auth_jwt +``` + +Example +------- + +``` +mosquitto_pub -t 'pub' -m 'hello' -i test -u test -P eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYm9iIiwiYWdlIjoyOX0.bIV_ZQ8D5nQi0LT8AVkpM4Pd6wmlbpR9S8nOLJAsA8o +``` + +Algorithms +---------- + +The JWT spec supports several algorithms for cryptographic signing. This plugin currently supports: + +* HS256 - HMAC using SHA-256 hash algorithm +* HS384 - HMAC using SHA-384 hash algorithm +* HS512 - HMAC using SHA-512 hash algorithm + +* RS256 - RSA with the SHA-256 hash algorithm +* RS384 - RSA with the SHA-384 hash algorithm +* RS512 - RSA with the SHA-512 hash algorithm + +* ES256 - ECDSA using the P-256 curve +* ES384 - ECDSA using the P-384 curve +* ES512 - ECDSA using the P-512 curve + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. diff --git a/apps/emqx_auth_jwt/TODO.md b/apps/emqx_auth_jwt/TODO.md new file mode 100644 index 000000000..dfd730e0a --- /dev/null +++ b/apps/emqx_auth_jwt/TODO.md @@ -0,0 +1,2 @@ +1. Notice for the [Critical vulnerabilities in JSON Web Token](https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/) + diff --git a/apps/emqx_auth_jwt/doc/hmac-vs-ecdsa-for-jwt.txt b/apps/emqx_auth_jwt/doc/hmac-vs-ecdsa-for-jwt.txt new file mode 100644 index 000000000..88fa5ebde --- /dev/null +++ b/apps/emqx_auth_jwt/doc/hmac-vs-ecdsa-for-jwt.txt @@ -0,0 +1,3 @@ + +https://crypto.stackexchange.com/questions/30657/hmac-vs-ecdsa-for-jwt + diff --git a/apps/emqx_auth_jwt/etc/emqx_auth_jwt.conf b/apps/emqx_auth_jwt/etc/emqx_auth_jwt.conf new file mode 100644 index 000000000..5a599ca23 --- /dev/null +++ b/apps/emqx_auth_jwt/etc/emqx_auth_jwt.conf @@ -0,0 +1,45 @@ +##-------------------------------------------------------------------- +## JWT Auth Plugin +##-------------------------------------------------------------------- + +## HMAC Hash Secret. +## +## Value: String +auth.jwt.secret = emqxsecret + +## RSA or ECDSA public key file. +## +## Value: File +#auth.jwt.pubkey = etc/certs/jwt_public_key.pem + +## The JWKs server address +## +## see: http://self-issued.info/docs/draft-ietf-jose-json-web-key.html +## +#auth.jwt.jwks = https://127.0.0.1:8080/jwks + +## The JWKs refresh interval +## +## Value: Duration +#auth.jwt.jwks.refresh_interval = 5m + +## From where the JWT string can be got +## +## Value: username | password +## Default: password +auth.jwt.from = password + +## Enable to verify claims fields +## +## Value: on | off +auth.jwt.verify_claims = off + +## The checklist of claims to validate +## +## Value: String +## auth.jwt.verify_claims.$name = expected +## +## Variables: +## - %u: username +## - %c: clientid +#auth.jwt.verify_claims.username = %u diff --git a/apps/emqx_auth_jwt/priv/emqx_auth_jwt.schema b/apps/emqx_auth_jwt/priv/emqx_auth_jwt.schema new file mode 100644 index 000000000..3d8de3678 --- /dev/null +++ b/apps/emqx_auth_jwt/priv/emqx_auth_jwt.schema @@ -0,0 +1,49 @@ +%%-*- mode: erlang -*- + +{mapping, "auth.jwt.secret", "emqx_auth_jwt.secret", [ + {datatype, string} +]}. + +{mapping, "auth.jwt.jwks", "emqx_auth_jwt.jwks", [ + {datatype, string} +]}. + +{mapping, "auth.jwt.jwks.refresh_interval", "emqx_auth_jwt.refresh_interval", [ + {datatype, {duration, ms}} +]}. + +{mapping, "auth.jwt.from", "emqx_auth_jwt.from", [ + {default, password}, + {datatype, atom} +]}. + +{mapping, "auth.jwt.pubkey", "emqx_auth_jwt.pubkey", [ + {datatype, string} +]}. + +{mapping, "auth.jwt.signature_format", "emqx_auth_jwt.jwerl_opts", [ + {default, "der"}, + {datatype, {enum, [raw, der]}} +]}. + +{mapping, "auth.jwt.verify_claims", "emqx_auth_jwt.verify_claims", [ + {default, off}, + {datatype, flag} +]}. + +{mapping, "auth.jwt.verify_claims.$name", "emqx_auth_jwt.verify_claims", [ + {datatype, string} +]}. + +{translation, "emqx_auth_jwt.verify_claims", fun(Conf) -> + case cuttlefish:conf_get("auth.jwt.verify_claims", Conf) of + false -> cuttlefish:unset(); + true -> + lists:foldr( + fun({["auth","jwt","verify_claims", Name], Value}, Acc) -> + [{list_to_atom(Name), list_to_binary(Value)} | Acc]; + ({["auth","jwt","verify_claims"], _Value}, Acc) -> + Acc + end, [], cuttlefish_variable:filter_by_prefix("auth.jwt.verify_claims", Conf)) + end +end}. diff --git a/apps/emqx_auth_jwt/rebar.config b/apps/emqx_auth_jwt/rebar.config new file mode 100644 index 000000000..4164d1fed --- /dev/null +++ b/apps/emqx_auth_jwt/rebar.config @@ -0,0 +1,25 @@ +{deps, + [ + {jose, {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.10.1"}}} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + {parse_transform}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions]}. +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, [{emqx_ct_helpers, {git, "http://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}]} + ]} + ]}. diff --git a/apps/emqx_auth_jwt/rebar.config.script b/apps/emqx_auth_jwt/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_jwt/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src b/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src new file mode 100644 index 000000000..e5d25e11b --- /dev/null +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_jwt, + [{description, "EMQ X Authentication with JWT"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_jwt_sup]}, + {applications, [kernel,stdlib,jose]}, + {mod, {emqx_auth_jwt_app, []}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-jwt"} + ]} + ]}. diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src.script b/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt.appup.src b/apps/emqx_auth_jwt/src/emqx_auth_jwt.appup.src new file mode 100644 index 000000000..50f8376ba --- /dev/null +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt.appup.src @@ -0,0 +1,16 @@ +%% -*-: erlang -*- + +{VSN, + [ + {"4.2.0", [ + {restart_application, emqx_auth_jwt} + ]}, + {<<".*">>, []} + ], + [ + {"4.2.0", [ + {restart_application, emqx_auth_jwt} + ]}, + {<<".*">>, []} + ] +}. diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl b/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl new file mode 100644 index 000000000..6be726dc9 --- /dev/null +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl @@ -0,0 +1,99 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_jwt). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[JWT]"). + +-export([ register_metrics/0 + , check/3 + , description/0 + ]). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +%%-------------------------------------------------------------------- +%% Authentication callbacks +%%-------------------------------------------------------------------- + +check(ClientInfo, AuthResult, #{pid := Pid, + from := From, + checklists := Checklists}) -> + case maps:find(From, ClientInfo) of + error -> + ok = emqx_metrics:inc(?AUTH_METRICS(ignore)); + {ok, undefined} -> + ok = emqx_metrics:inc(?AUTH_METRICS(ignore)); + {ok, Token} -> + case emqx_auth_jwt_svr:verify(Pid, Token) of + {error, not_found} -> + ok = emqx_metrics:inc(?AUTH_METRICS(ignore)); + {error, not_token} -> + ok = emqx_metrics:inc(?AUTH_METRICS(ignore)); + {error, Reason} -> + ok = emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{auth_result => Reason, anonymous => false}}; + {ok, Claims} -> + {stop, maps:merge(AuthResult, verify_claims(Checklists, Claims, ClientInfo))} + end + end. + +description() -> "Authentication with JWT". + +%%------------------------------------------------------------------------------ +%% Verify Claims +%%-------------------------------------------------------------------- + +verify_claims(Checklists, Claims, ClientInfo) -> + case do_verify_claims(feedvar(Checklists, ClientInfo), Claims) of + {error, Reason} -> + ok = emqx_metrics:inc(?AUTH_METRICS(failure)), + #{auth_result => Reason, anonymous => false}; + ok -> + ok = emqx_metrics:inc(?AUTH_METRICS(success)), + #{auth_result => success, anonymous => false, jwt_claims => Claims} + end. + +do_verify_claims([], _Claims) -> + ok; +do_verify_claims([{Key, Expected} | L], Claims) -> + case maps:get(Key, Claims, undefined) =:= Expected of + true -> do_verify_claims(L, Claims); + false -> {error, {verify_claim_failed, Key}} + end. + +feedvar(Checklists, #{username := Username, clientid := ClientId}) -> + lists:map(fun({K, <<"%u">>}) -> {K, Username}; + ({K, <<"%c">>}) -> {K, ClientId}; + ({K, Expected}) -> {K, Expected} + end, Checklists). diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt_app.erl b/apps/emqx_auth_jwt/src/emqx_auth_jwt_app.erl new file mode 100644 index 000000000..736fb28b9 --- /dev/null +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt_app.erl @@ -0,0 +1,82 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_jwt_app). + +-behaviour(application). + +-behaviour(supervisor). + +-emqx_plugin(auth). + +-export([start/2, stop/1]). + +-export([init/1]). + +-define(APP, emqx_auth_jwt). + +start(_Type, _Args) -> + {ok, Sup} = supervisor:start_link({local, ?MODULE}, ?MODULE, []), + + {ok, Pid} = start_auth_server(jwks_svr_options()), + ok = emqx_auth_jwt:register_metrics(), + + AuthEnv0 = auth_env(), + AuthEnv1 = AuthEnv0#{pid => Pid}, + + emqx:hook('client.authenticate', {emqx_auth_jwt, check, [AuthEnv1]}), + {ok, Sup, AuthEnv1}. + +stop(AuthEnv) -> + emqx:unhook('client.authenticate', {emqx_auth_jwt, check, [AuthEnv]}). + +%%-------------------------------------------------------------------- +%% Dummy supervisor +%%-------------------------------------------------------------------- + +init([]) -> + {ok, {{one_for_all, 1, 10}, []}}. + +start_auth_server(Options) -> + Spec = #{id => jwt_svr, + start => {emqx_auth_jwt_svr, start_link, [Options]}, + restart => permanent, + shutdown => brutal_kill, + type => worker, + modules => [emqx_auth_jwt_svr]}, + supervisor:start_child(?MODULE, Spec). + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +auth_env() -> + Checklists = [{atom_to_binary(K, utf8), V} + || {K, V} <- env(verify_claims, [])], + #{ from => env(from, password) + , checklists => Checklists + }. + +jwks_svr_options() -> + [{K, V} || {K, V} + <- [{secret, env(secret, undefined)}, + {pubkey, env(pubkey, undefined)}, + {jwks_addr, env(jwks, undefined)}, + {interval, env(refresh_interval, undefined)}], + V /= undefined]. + +env(Key, Default) -> + application:get_env(?APP, Key, Default). diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl b/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl new file mode 100644 index 000000000..b347d0e0b --- /dev/null +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl @@ -0,0 +1,222 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_jwt_svr). + +-behaviour(gen_server). + +-include_lib("emqx/include/logger.hrl"). +-include_lib("jose/include/jose_jwk.hrl"). + +-logger_header("[JWT-SVR]"). + +%% APIs +-export([start_link/1]). + +-export([verify/2]). + +%% gen_server callbacks +-export([ init/1 + , handle_call/3 + , handle_cast/2 + , handle_info/2 + , terminate/2 + , code_change/3 + ]). + +-type options() :: [option()]. +-type option() :: {secret, list()} + | {pubkey, list()} + | {jwks_addr, list()} + | {interval, pos_integer()}. + +-define(INTERVAL, 300000). + +-record(state, {static, remote, addr, tref, intv}). + +%%-------------------------------------------------------------------- +%% APIs +%%-------------------------------------------------------------------- + +-spec start_link(options()) -> gen_server:start_ret(). +start_link(Options) -> + gen_server:start_link(?MODULE, [Options], []). + +-spec verify(pid(), binary()) + -> {error, term()} + | {ok, Payload :: map()}. +verify(S, JwsCompacted) when is_binary(JwsCompacted) -> + case catch jose_jws:peek(JwsCompacted) of + {'EXIT', _} -> {error, not_token}; + _ -> gen_server:call(S, {verify, JwsCompacted}) + end. + +%%-------------------------------------------------------------------- +%% gen_server callbacks +%%-------------------------------------------------------------------- + +init([Options]) -> + ok = jose:json_module(jiffy), + {Static, Remote} = do_init_jwks(Options), + Intv = proplists:get_value(interval, Options, ?INTERVAL), + {ok, reset_timer( + #state{ + static = Static, + remote = Remote, + addr = proplists:get_value(jwks_addr, Options), + intv = Intv})}. + +%% @private +do_init_jwks(Options) -> + K2J = fun(K, F) -> + case proplists:get_value(K, Options) of + undefined -> undefined; + V -> + try F(V) of + {error, Reason} -> + ?LOG(warning, "Build ~p JWK ~p failed: {error, ~p}~n", + [K, V, Reason]), + undefined; + J -> J + catch T:R:_ -> + ?LOG(warning, "Build ~p JWK ~p failed: {~p, ~p}~n", + [K, V, T, R]), + undefined + end + end + end, + OctJwk = K2J(secret, fun(V) -> + jose_jwk:from_oct(list_to_binary(V)) + end), + PemJwk = K2J(pubkey, fun jose_jwk:from_pem_file/1), + Remote = K2J(jwks_addr, fun request_jwks/1), + {[J ||J <- [OctJwk, PemJwk], J /= undefined], Remote}. + +handle_call({verify, JwsCompacted}, _From, State) -> + handle_verify(JwsCompacted, State); + +handle_call(_Req, _From, State) -> + {reply, ok, State}. + +handle_cast(_Msg, State) -> + {noreply, State}. + +handle_info({timeout, _TRef, refresh}, State = #state{addr = Addr}) -> + NState = try + State#state{remote = request_jwks(Addr)} + catch _:_ -> + State + end, + {noreply, reset_timer(NState)}; + +handle_info(_Info, State) -> + {noreply, State}. + +terminate(_Reason, State) -> + _ = cancel_timer(State), + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%%-------------------------------------------------------------------- +%% Internal funcs +%%-------------------------------------------------------------------- + +handle_verify(JwsCompacted, + State = #state{static = Static, remote = Remote}) -> + try + Jwks = case emqx_json:decode(jose_jws:peek_protected(JwsCompacted), [return_maps]) of + #{<<"kid">> := Kid} -> + [J || J <- Remote, maps:get(<<"kid">>, J#jose_jwk.fields, undefined) =:= Kid]; + _ -> Static + end, + case Jwks of + [] -> {reply, {error, not_found}, State}; + _ -> + {reply, do_verify(JwsCompacted, Jwks), State} + end + catch + _:_ -> + {reply, {error, invalid_signature}, State} + end. + +request_jwks(Addr) -> + case httpc:request(get, {Addr, []}, [], [{body_format, binary}]) of + {error, Reason} -> + error(Reason); + {ok, {_Code, _Headers, Body}} -> + try + JwkSet = jose_jwk:from(emqx_json:decode(Body, [return_maps])), + {_, Jwks} = JwkSet#jose_jwk.keys, Jwks + catch _:_ -> + ?LOG(error, "Invalid jwks server response: ~p~n", [Body]), + error(badarg) + end + end. + +reset_timer(State = #state{addr = undefined}) -> + State; +reset_timer(State = #state{intv = Intv}) -> + State#state{tref = erlang:start_timer(Intv, self(), refresh)}. + +cancel_timer(State = #state{tref = undefined}) -> + State; +cancel_timer(State = #state{tref = TRef}) -> + erlang:cancel_timer(TRef), + State#state{tref = undefined}. + +do_verify(_JwsCompated, []) -> + {error, invalid_signature}; +do_verify(JwsCompacted, [Jwk|More]) -> + case jose_jws:verify(Jwk, JwsCompacted) of + {true, Payload, _Jws} -> + Claims = emqx_json:decode(Payload, [return_maps]), + case check_claims(Claims) of + false -> + {error, invalid_signature}; + NClaims -> + {ok, NClaims} + end; + {false, _, _} -> + do_verify(JwsCompacted, More) + end. + +check_claims(Claims) -> + Now = os:system_time(seconds), + Checker = [{<<"exp">>, fun(ExpireTime) -> + Now < ExpireTime + end}, + {<<"iat">>, fun(IssueAt) -> + IssueAt =< Now + end}, + {<<"nbf">>, fun(NotBefore) -> + NotBefore =< Now + end} + ], + do_check_claim(Checker, Claims). + +do_check_claim([], Claims) -> + Claims; +do_check_claim([{K, F}|More], Claims) -> + case maps:take(K, Claims) of + error -> do_check_claim(More, Claims); + {V, NClaims} -> + case F(V) of + true -> do_check_claim(More, NClaims); + _ -> false + end + end. diff --git a/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl b/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl new file mode 100644 index 000000000..12f307b2a --- /dev/null +++ b/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl @@ -0,0 +1,142 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_jwt_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). + +-define(APP, emqx_auth_jwt). + +all() -> + [{group, emqx_auth_jwt}]. + +groups() -> + [{emqx_auth_jwt, [sequence], [ t_check_auth + , t_check_claims + , t_check_claims_clientid + , t_check_claims_username + ]} + ]. + +init_per_suite(Config) -> + emqx_ct_helpers:start_apps([emqx, emqx_auth_jwt], fun set_special_configs/1), + Config. + +end_per_suite(_Config) -> + emqx_ct_helpers:stop_apps([emqx_auth_jwt, emqx]). + +set_special_configs(emqx) -> + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, acl_nomatch, deny), + application:set_env(emqx, enable_acl_cache, false), + LoadedPluginPath = filename:join(["test", "emqx_SUITE_data", "loaded_plugins"]), + AclFilePath = filename:join(["test", "emqx_SUITE_data", "acl.conf"]), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, LoadedPluginPath)), + application:set_env(emqx, acl_file, + emqx_ct_helpers:deps_path(emqx, AclFilePath)); + +set_special_configs(emqx_auth_jwt) -> + application:set_env(emqx_auth_jwt, secret, "emqxsecret"), + application:set_env(emqx_auth_jwt, from, password); + +set_special_configs(_) -> + ok. + +sign(Payload, Alg, Key) -> + Jwk = jose_jwk:from_oct(Key), + Jwt = emqx_json:encode(Payload), + {_, Token} = jose_jws:compact(jose_jwt:sign(Jwk, #{<<"alg">> => Alg}, Jwt)), + Token. + +%%------------------------------------------------------------------------------ +%% Testcases +%%------------------------------------------------------------------------------ + +t_check_auth(_) -> + Plain = #{clientid => <<"client1">>, username => <<"plain">>, zone => external}, + Jwt = sign([{clientid, <<"client1">>}, + {username, <<"plain">>}, + {exp, os:system_time(seconds) + 3}], <<"HS256">>, <<"emqxsecret">>), + ct:pal("Jwt: ~p~n", [Jwt]), + + Result0 = emqx_access_control:authenticate(Plain#{password => Jwt}), + ct:pal("Auth result: ~p~n", [Result0]), + ?assertMatch({ok, #{auth_result := success, jwt_claims := #{<<"clientid">> := <<"client1">>}}}, Result0), + + ct:sleep(3100), + Result1 = emqx_access_control:authenticate(Plain#{password => Jwt}), + ct:pal("Auth result after 1000ms: ~p~n", [Result1]), + ?assertMatch({error, _}, Result1), + + Jwt_Error = sign([{client_id, <<"client1">>}, + {username, <<"plain">>}], <<"HS256">>, <<"secret">>), + ct:pal("invalid jwt: ~p~n", [Jwt_Error]), + Result2 = emqx_access_control:authenticate(Plain#{password => Jwt_Error}), + ct:pal("Auth result for the invalid jwt: ~p~n", [Result2]), + ?assertEqual({error, invalid_signature}, Result2), + ?assertMatch({error, _}, emqx_access_control:authenticate(Plain#{password => <<"asd">>})). + +t_check_claims(_) -> + application:set_env(emqx_auth_jwt, verify_claims, [{sub, <<"value">>}]), + Plain = #{clientid => <<"client1">>, username => <<"plain">>, zone => external}, + Jwt = sign([{client_id, <<"client1">>}, + {username, <<"plain">>}, + {sub, value}, + {exp, os:system_time(seconds) + 3}], <<"HS256">>, <<"emqxsecret">>), + Result0 = emqx_access_control:authenticate(Plain#{password => Jwt}), + ct:pal("Auth result: ~p~n", [Result0]), + ?assertMatch({ok, #{auth_result := success, jwt_claims := _}}, Result0), + Jwt_Error = sign([{clientid, <<"client1">>}, + {username, <<"plain">>}], <<"HS256">>, <<"secret">>), + Result2 = emqx_access_control:authenticate(Plain#{password => Jwt_Error}), + ct:pal("Auth result for the invalid jwt: ~p~n", [Result2]), + ?assertEqual({error, invalid_signature}, Result2). + +t_check_claims_clientid(_) -> + application:set_env(emqx_auth_jwt, verify_claims, [{clientid, <<"%c">>}]), + Plain = #{clientid => <<"client23">>, username => <<"plain">>, zone => external}, + Jwt = sign([{client_id, <<"client23">>}, + {username, <<"plain">>}, + {exp, os:system_time(seconds) + 3}], <<"HS256">>, <<"emqxsecret">>), + Result0 = emqx_access_control:authenticate(Plain#{password => Jwt}), + ct:pal("Auth result: ~p~n", [Result0]), + ?assertMatch({ok, #{auth_result := success, jwt_claims := _}}, Result0), + Jwt_Error = sign([{clientid, <<"client1">>}, + {username, <<"plain">>}], <<"HS256">>, <<"secret">>), + Result2 = emqx_access_control:authenticate(Plain#{password => Jwt_Error}), + ct:pal("Auth result for the invalid jwt: ~p~n", [Result2]), + ?assertEqual({error, invalid_signature}, Result2). + +t_check_claims_username(_) -> + application:set_env(emqx_auth_jwt, verify_claims, [{username, <<"%u">>}]), + Plain = #{clientid => <<"client23">>, username => <<"plain">>, zone => external}, + Jwt = sign([{client_id, <<"client23">>}, + {username, <<"plain">>}, + {exp, os:system_time(seconds) + 3}], <<"HS256">>, <<"emqxsecret">>), + Result0 = emqx_access_control:authenticate(Plain#{password => Jwt}), + ct:pal("Auth result: ~p~n", [Result0]), + ?assertMatch({ok, #{auth_result := success, jwt_claims := _}}, Result0), + Jwt_Error = sign([{clientid, <<"client1">>}, + {username, <<"plain">>}], <<"HS256">>, <<"secret">>), + Result3 = emqx_access_control:authenticate(Plain#{password => Jwt_Error}), + ct:pal("Auth result for the invalid jwt: ~p~n", [Result3]), + ?assertEqual({error, invalid_signature}, Result3). diff --git a/apps/emqx_auth_ldap/.ci/docker-compose.yml b/apps/emqx_auth_ldap/.ci/docker-compose.yml new file mode 100644 index 000000000..bba9b711f --- /dev/null +++ b/apps/emqx_auth_ldap/.ci/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3' + +services: + erlang: + image: erlang:22.1 + volumes: + - ../:/emqx_auth_ldap + networks: + - emqx_bridge + depends_on: + - ldap_server + tty: true + + ldap_server: + build: ./emqx-ldap + image: emqx-ldap:1.0 + restart: always + ports: + - 389:389 + - 636:636 + networks: + - emqx_bridge + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_ldap/.ci/emqx-ldap/Dockerfile b/apps/emqx_auth_ldap/.ci/emqx-ldap/Dockerfile new file mode 100644 index 000000000..0a01572c4 --- /dev/null +++ b/apps/emqx_auth_ldap/.ci/emqx-ldap/Dockerfile @@ -0,0 +1,26 @@ +FROM buildpack-deps:stretch + +ENV VERSION=2.4.50 + +RUN apt-get update && apt-get install -y groff groff-base +RUN wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-${VERSION}.tgz \ + && gunzip -c openldap-${VERSION}.tgz | tar xvfB - \ + && cd openldap-${VERSION} \ + && ./configure && make depend && make && make install \ + && cd .. && rm -rf openldap-${VERSION} + +COPY ./slapd.conf /usr/local/etc/openldap/slapd.conf +COPY ./emqx.io.ldif /usr/local/etc/openldap/schema/emqx.io.ldif +COPY ./emqx.schema /usr/local/etc/openldap/schema/emqx.schema +COPY ./*.pem /usr/local/etc/openldap/ + +RUN mkdir -p /usr/local/etc/openldap/data \ + && slapadd -l /usr/local/etc/openldap/schema/emqx.io.ldif -f /usr/local/etc/openldap/slapd.conf + +WORKDIR /usr/local/etc/openldap + +EXPOSE 389 636 + +ENTRYPOINT ["/usr/local/libexec/slapd", "-h", "ldap:/// ldaps:///", "-d", "3", "-f", "/usr/local/etc/openldap/slapd.conf"] + +CMD [] diff --git a/apps/emqx_auth_ldap/.ci/emqx-ldap/slapd.conf b/apps/emqx_auth_ldap/.ci/emqx-ldap/slapd.conf new file mode 100644 index 000000000..d6ba20caa --- /dev/null +++ b/apps/emqx_auth_ldap/.ci/emqx-ldap/slapd.conf @@ -0,0 +1,16 @@ +include /usr/local/etc/openldap/schema/core.schema +include /usr/local/etc/openldap/schema/cosine.schema +include /usr/local/etc/openldap/schema/inetorgperson.schema +include /usr/local/etc/openldap/schema/ppolicy.schema +include /usr/local/etc/openldap/schema/emqx.schema + +TLSCACertificateFile /usr/local/etc/openldap/cacert.pem +TLSCertificateFile /usr/local/etc/openldap/cert.pem +TLSCertificateKeyFile /usr/local/etc/openldap/key.pem + +database bdb +suffix "dc=emqx,dc=io" +rootdn "cn=root,dc=emqx,dc=io" +rootpw {SSHA}eoF7NhNrejVYYyGHqnt+MdKNBh4r1w3W + +directory /usr/local/etc/openldap/data diff --git a/apps/emqx_auth_ldap/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_ldap/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..dd6978406 --- /dev/null +++ b/apps/emqx_auth_ldap/.github/workflows/run_test_cases.yaml @@ -0,0 +1,49 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + strategy: + matrix: + network_type: + - ipv4 + - ipv6 + + steps: + - name: install docker-compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - uses: actions/checkout@v1 + - name: prepare + env: + NETWORK_TYPE: ${{ matrix.network_type }} + run: | + set -e -x -u + cp ./emqx.io.ldif ./emqx.schema ./.ci/emqx-ldap + cp ./test/certs/* ./.ci/emqx-ldap + docker-compose -f ./.ci/docker-compose.yml -p tests build + if [ "$NETWORK_TYPE" = "ipv6" ];then docker network create --driver bridge --ipv6 --subnet fd15:555::/64 tests_emqx_bridge --attachable; fi + docker-compose -f ./.ci/docker-compose.yml -p tests up -d + if [ "$NETWORK_TYPE" != "ipv6" ];then + docker exec -i tests_erlang_1 sh -c "sed -i '/auth.ldap.servers/c auth.ldap.servers = ldap_server' ./emqx_auth_ldap/etc/emqx_auth_ldap.conf" + else + ipv6_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' $(docker ps -a -f name=tests_ldap_server_1 -q)) + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "sed -i '/auth.ldap.servers/c auth.ldap.servers = $ipv6_address' /emqx_auth_ldap/etc/emqx_auth_ldap.conf" + fi + - name: run test cases + run: | + set -e -x -u + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_ldap xref" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_ldap eunit" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_ldap ct" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_ldap cover" + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: logs_${{ matrix.network_type }} + path: _build/test/logs + diff --git a/apps/emqx_auth_ldap/.gitignore b/apps/emqx_auth_ldap/.gitignore new file mode 100644 index 000000000..eb8f0639f --- /dev/null +++ b/apps/emqx_auth_ldap/.gitignore @@ -0,0 +1,25 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.erlang.mk/ +emqx_auth_ldap.d +data/ +cover/ +ct.coverdata +eunit.coverdata +logs/ +test/ct.cover.spec +.DS_Store +_build/ +rebar.lock +erlang.mk +rebar3.crashdump +.rebar3/ +etc/emqx_auth_ldap.conf.rendered diff --git a/apps/emqx_auth_ldap/LICENSE b/apps/emqx_auth_ldap/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_auth_ldap/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_ldap/Makefile b/apps/emqx_auth_ldap/Makefile new file mode 100644 index 000000000..759c123fa --- /dev/null +++ b/apps/emqx_auth_ldap/Makefile @@ -0,0 +1,35 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + + +compile: + $(REBAR) compile + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +clean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_auth_ldap.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_auth_ldap.conf -i priv/emqx_auth_ldap.schema -d data diff --git a/apps/emqx_auth_ldap/README.md b/apps/emqx_auth_ldap/README.md new file mode 100644 index 000000000..c4d56c839 --- /dev/null +++ b/apps/emqx_auth_ldap/README.md @@ -0,0 +1,96 @@ +emqx_auth_ldap +============== + +EMQ X LDAP Authentication Plugin + +Build +----- + +``` +make +``` + +Load the Plugin +--------------- + +``` +# ./bin/emqx_ctl plugins load emqx_auth_ldap +``` + +Generate Password +--------------- + +``` +slappasswd -h '{ssha}' -s public +``` + +Configuration Open LDAP +----------------------- + +vim /etc/openldap/slapd.conf + +``` +include /etc/openldap/schema/core.schema +include /etc/openldap/schema/cosine.schema +include /etc/openldap/schema/inetorgperson.schema +include /etc/openldap/schema/ppolicy.schema +include /etc/openldap/schema/emqx.schema + +database bdb +suffix "dc=emqx,dc=io" +rootdn "cn=root,dc=emqx,dc=io" +rootpw {SSHA}eoF7NhNrejVYYyGHqnt+MdKNBh4r1w3W + +directory /etc/openldap/data +``` + +If the ldap launched with error below: +``` +Unrecognized database type (bdb) +5c4a72b9 slapd.conf: line 7: failed init (bdb) +slapadd: bad configuration file! +``` + +Insert lines to the slapd.conf +``` +modulepath /usr/lib/ldap +moduleload back_bdb.la +``` + +Import EMQX User Data +---------------------- + +Use ldapadd +``` +# ldapadd -x -D "cn=root,dc=emqx,dc=io" -w public -f emqx.com.ldif +``` + +Use slapadd +``` +# sudo slapadd -l schema/emqx.io.ldif -f slapd.conf +``` + +Launch slapd +``` +# sudo slapd -d 3 +``` + +Test +----- +After configure slapd correctly and launch slapd successfully. +You could execute + +``` bash +# make tests +``` + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. + diff --git a/apps/emqx_auth_ldap/emqx.io.ldif b/apps/emqx_auth_ldap/emqx.io.ldif new file mode 100644 index 000000000..f9833cd88 --- /dev/null +++ b/apps/emqx_auth_ldap/emqx.io.ldif @@ -0,0 +1,135 @@ +## create emqx.io + +dn:dc=emqx,dc=io +objectclass: top +objectclass: dcobject +objectclass: organization +dc:emqx +o:emqx,Inc. + +# create testdevice.emqx.io +dn:ou=testdevice,dc=emqx,dc=io +objectClass: top +objectclass:organizationalUnit +ou:testdevice + +# create user admin +dn:uid=admin,ou=testdevice,dc=emqx,dc=io +objectClass: top +objectClass: simpleSecurityObject +objectClass: account +userPassword:: e1NIQX1XNnBoNU1tNVB6OEdnaVVMYlBnekczN21qOWc9 +uid: admin + +## create user=mqttuser0001, +# password=mqttuser0001, +# passhash={SHA}mlb3fat40MKBTXUVZwCKmL73R/0= +# base64passhash=e1NIQX1tbGIzZmF0NDBNS0JUWFVWWndDS21MNzNSLzA9 +dn:uid=mqttuser0001,ou=testdevice,dc=emqx,dc=io +objectClass: top +objectClass: mqttUser +objectClass: mqttDevice +objectClass: mqttSecurity +uid: mqttuser0001 +isEnabled: TRUE +mqttAccountName: user1 +mqttPublishTopic: mqttuser0001/pub/1 +mqttPublishTopic: mqttuser0001/pub/+ +mqttPublishTopic: mqttuser0001/pub/# +mqttSubscriptionTopic: mqttuser0001/sub/1 +mqttSubscriptionTopic: mqttuser0001/sub/+ +mqttSubscriptionTopic: mqttuser0001/sub/# +mqttPubSubTopic: mqttuser0001/pubsub/1 +mqttPubSubTopic: mqttuser0001/pubsub/+ +mqttPubSubTopic: mqttuser0001/pubsub/# +userPassword:: e1NIQX1tbGIzZmF0NDBNS0JUWFVWWndDS21MNzNSLzA9 + +## create user=mqttuser0002 +# password=mqttuser0002, +# passhash={SSHA}n9XdtoG4Q/TQ3TQF4Y+khJbMBH4qXj4M +# base64passhash=e1NTSEF9bjlYZHRvRzRRL1RRM1RRRjRZK2toSmJNQkg0cVhqNE0= +dn:uid=mqttuser0002,ou=testdevice,dc=emqx,dc=io +objectClass: top +objectClass: mqttUser +objectClass: mqttDevice +objectClass: mqttSecurity +uid: mqttuser0002 +isEnabled: TRUE +mqttAccountName: user2 +mqttPublishTopic: mqttuser0002/pub/1 +mqttPublishTopic: mqttuser0002/pub/+ +mqttPublishTopic: mqttuser0002/pub/# +mqttSubscriptionTopic: mqttuser0002/sub/1 +mqttSubscriptionTopic: mqttuser0002/sub/+ +mqttSubscriptionTopic: mqttuser0002/sub/# +mqttPubSubTopic: mqttuser0002/pubsub/1 +mqttPubSubTopic: mqttuser0002/pubsub/+ +mqttPubSubTopic: mqttuser0002/pubsub/# +userPassword:: e1NTSEF9bjlYZHRvRzRRL1RRM1RRRjRZK2toSmJNQkg0cVhqNE0= + +## create user mqttuser0003 +# password=mqttuser0003, +# passhash={MD5}ybsPGoaK3nDyiQvveiCOIw== +# base64passhash=e01ENX15YnNQR29hSzNuRHlpUXZ2ZWlDT0l3PT0= +dn:uid=mqttuser0003,ou=testdevice,dc=emqx,dc=io +objectClass: top +objectClass: mqttUser +objectClass: mqttDevice +objectClass: mqttSecurity +uid: mqttuser0003 +isEnabled: TRUE +mqttPublishTopic: mqttuser0003/pub/1 +mqttPublishTopic: mqttuser0003/pub/+ +mqttPublishTopic: mqttuser0003/pub/# +mqttSubscriptionTopic: mqttuser0003/sub/1 +mqttSubscriptionTopic: mqttuser0003/sub/+ +mqttSubscriptionTopic: mqttuser0003/sub/# +mqttPubSubTopic: mqttuser0003/pubsub/1 +mqttPubSubTopic: mqttuser0003/pubsub/+ +mqttPubSubTopic: mqttuser0003/pubsub/# +userPassword:: e01ENX15YnNQR29hSzNuRHlpUXZ2ZWlDT0l3PT0= + +## create user mqttuser0004 +# password=mqttuser0004, +# passhash={MD5}2Br6pPDSEDIEvUlu9+s+MA== +# base64passhash=e01ENX0yQnI2cFBEU0VESUV2VWx1OStzK01BPT0= +dn:uid=mqttuser0004,ou=testdevice,dc=emqx,dc=io +objectClass: top +objectClass: mqttUser +objectClass: mqttDevice +objectClass: mqttSecurity +uid: mqttuser0004 +isEnabled: TRUE +mqttPublishTopic: mqttuser0004/pub/1 +mqttPublishTopic: mqttuser0004/pub/+ +mqttPublishTopic: mqttuser0004/pub/# +mqttSubscriptionTopic: mqttuser0004/sub/1 +mqttSubscriptionTopic: mqttuser0004/sub/+ +mqttSubscriptionTopic: mqttuser0004/sub/# +mqttPubSubTopic: mqttuser0004/pubsub/1 +mqttPubSubTopic: mqttuser0004/pubsub/+ +mqttPubSubTopic: mqttuser0004/pubsub/# +userPassword: {MD5}2Br6pPDSEDIEvUlu9+s+MA== + +## create user mqttuser0005 +# password=mqttuser0005, +# passhash={SHA}jKnxeEDGR14kE8AR7yuVFOelhz4= +# base64passhash=e1NIQX1qS254ZUVER1IxNGtFOEFSN3l1VkZPZWxoejQ9 +objectClass: top +dn:uid=mqttuser0005,ou=testdevice,dc=emqx,dc=io +objectClass: mqttUser +objectClass: mqttDevice +objectClass: mqttSecurity +uid: mqttuser0005 +isEnabled: TRUE +mqttPublishTopic: mqttuser0005/pub/1 +mqttPublishTopic: mqttuser0005/pub/+ +mqttPublishTopic: mqttuser0005/pub/# +mqttSubscriptionTopic: mqttuser0005/sub/1 +mqttSubscriptionTopic: mqttuser0005/sub/+ +mqttSubscriptionTopic: mqttuser0005/sub/# +mqttPubSubTopic: mqttuser0005/pubsub/1 +mqttPubSubTopic: mqttuser0005/pubsub/+ +mqttPubSubTopic: mqttuser0005/pubsub/# +userPassword: {SHA}jKnxeEDGR14kE8AR7yuVFOelhz4= + diff --git a/apps/emqx_auth_ldap/emqx.schema b/apps/emqx_auth_ldap/emqx.schema new file mode 100644 index 000000000..55f92269b --- /dev/null +++ b/apps/emqx_auth_ldap/emqx.schema @@ -0,0 +1,46 @@ +# +# Preliminary Apple OS X Native LDAP Schema +# This file is subject to change. +# +attributetype ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.1.3 NAME 'isEnabled' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 + SINGLE-VALUE + USAGE userApplications ) + +attributetype ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.4.1 NAME ( 'mqttPublishTopic' 'mpt' ) + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + USAGE userApplications ) +attributetype ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.4.2 NAME ( 'mqttSubscriptionTopic' 'mst' ) + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + USAGE userApplications ) +attributetype ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.4.3 NAME ( 'mqttPubSubTopic' 'mpst' ) + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + USAGE userApplications ) +attributetype ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.4.4 NAME ( 'mqttAccountName' 'man' ) + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + USAGE userApplications ) + + +objectclass ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.4 NAME 'mqttUser' + AUXILIARY + MAY ( mqttPublishTopic $ mqttSubscriptionTopic $ mqttPubSubTopic $ mqttAccountName) ) + +objectclass ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.2 NAME 'mqttDevice' + SUP top + STRUCTURAL + MUST ( uid ) + MAY ( isEnabled ) ) + +objectclass ( 1.3.6.1.4.1.11.2.53.2.2.3.1.2.3.3 NAME 'mqttSecurity' + SUP top + AUXILIARY + MAY ( userPassword $ userPKCS12 $ pwdAttribute $ pwdLockout ) ) diff --git a/apps/emqx_auth_ldap/etc/emqx_auth_ldap.conf b/apps/emqx_auth_ldap/etc/emqx_auth_ldap.conf new file mode 100644 index 000000000..746510fb3 --- /dev/null +++ b/apps/emqx_auth_ldap/etc/emqx_auth_ldap.conf @@ -0,0 +1,78 @@ +##-------------------------------------------------------------------- +## LDAP Auth Plugin +##-------------------------------------------------------------------- + +## LDAP server list, seperated by ','. +## +## Value: String +auth.ldap.servers = 127.0.0.1 + +## LDAP server port. +## +## Value: Port +auth.ldap.port = 389 + +## LDAP pool size +## +## Value: String +auth.ldap.pool = 8 + +## LDAP Bind DN. +## +## Value: DN +auth.ldap.bind_dn = cn=root,dc=emqx,dc=io + +## LDAP Bind Password. +## +## Value: String +auth.ldap.bind_password = public + +## LDAP query timeout. +## +## Value: Number +auth.ldap.timeout = 30s + +## Device DN. +## +## Variables: +## +## Value: DN +auth.ldap.device_dn = ou=device,dc=emqx,dc=io + +## Specified ObjectClass +## +## Variables: +## +## Value: string +auth.ldap.match_objectclass = mqttUser + +## attributetype for username +## +## Variables: +## +## Value: string +auth.ldap.username.attributetype = uid + +## attributetype for password +## +## Variables: +## +## Value: string +auth.ldap.password.attributetype = userPassword + +## Whether to enable SSL. +## +## Value: true | false +auth.ldap.ssl = false + +#auth.ldap.ssl.certfile = etc/certs/cert.pem + +#auth.ldap.ssl.keyfile = etc/certs/key.pem + +#auth.ldap.ssl.cacertfile = etc/certs/cacert.pem + +#auth.ldap.ssl.verify = verify_peer + +#auth.ldap.ssl.fail_if_no_peer_cert = true + +#auth.ldap.ssl.server_name_indication = your_server_name diff --git a/apps/emqx_auth_ldap/include/emqx_auth_ldap.hrl b/apps/emqx_auth_ldap/include/emqx_auth_ldap.hrl new file mode 100644 index 000000000..8950c0ec8 --- /dev/null +++ b/apps/emqx_auth_ldap/include/emqx_auth_ldap.hrl @@ -0,0 +1,23 @@ + +-define(APP, emqx_auth_ldap). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). diff --git a/apps/emqx_auth_ldap/priv/emqx_auth_ldap.schema b/apps/emqx_auth_ldap/priv/emqx_auth_ldap.schema new file mode 100644 index 000000000..554752a0b --- /dev/null +++ b/apps/emqx_auth_ldap/priv/emqx_auth_ldap.schema @@ -0,0 +1,176 @@ +%%-*- mode: erlang -*- +%% emqx_auth_ldap config mapping + +{mapping, "auth.ldap.servers", "emqx_auth_ldap.ldap", [ + {default, "127.0.0.1"}, + {datatype, string} +]}. + +{mapping, "auth.ldap.port", "emqx_auth_ldap.ldap", [ + {default, 389}, + {datatype, integer} +]}. + +{mapping, "auth.ldap.pool", "emqx_auth_ldap.ldap", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "auth.ldap.bind_dn", "emqx_auth_ldap.ldap", [ + {datatype, string}, + {default, "cn=root,dc=emqx,dc=io"} +]}. + +{mapping, "auth.ldap.bind_password", "emqx_auth_ldap.ldap", [ + {datatype, string}, + {default, "public"} +]}. + +{mapping, "auth.ldap.timeout", "emqx_auth_ldap.ldap", [ + {default, "30s"}, + {datatype, {duration, ms}} +]}. + +{mapping, "auth.ldap.ssl", "emqx_auth_ldap.ldap", [ + {default, false}, + {datatype, {enum, [true, false]}} +]}. + +{mapping, "auth.ldap.ssl.certfile", "emqx_auth_ldap.ldap", [ + {datatype, string} +]}. + +{mapping, "auth.ldap.ssl.keyfile", "emqx_auth_ldap.ldap", [ + {datatype, string} +]}. + +{mapping, "auth.ldap.ssl.cacertfile", "emqx_auth_ldap.ldap", [ + {datatype, string} +]}. + +{mapping, "auth.ldap.ssl.verify", "emqx_auth_ldap.ldap", [ + {default, verify_none}, + {datatype, {enum, [verify_none, verify_peer]}} +]}. + +{mapping, "auth.ldap.ssl.fail_if_no_peer_cert", "emqx_auth_ldap.ldap", [ + {datatype, {enum, [true, false]}} +]}. + +{mapping, "auth.ldap.ssl.server_name_indication", "emqx_auth_ldap.ldap", [ + {datatype, string} +]}. + +{translation, "emqx_auth_ldap.ldap", fun(Conf) -> + A2N = fun(A) -> case inet:parse_address(A) of {ok, N} -> N; _ -> A end end, + Servers = [A2N(A) || A <- string:tokens(cuttlefish:conf_get("auth.ldap.servers", Conf), ",")], + Port = cuttlefish:conf_get("auth.ldap.port", Conf), + Pool = cuttlefish:conf_get("auth.ldap.pool", Conf), + BindDN = cuttlefish:conf_get("auth.ldap.bind_dn", Conf), + BindPassword = cuttlefish:conf_get("auth.ldap.bind_password", Conf), + Timeout = cuttlefish:conf_get("auth.ldap.timeout", Conf), + Filter = fun(Ls) -> [E || E = {_, V} <- Ls, V /= undefined]end, + SslOpts = fun() -> + [{certfile, cuttlefish:conf_get("auth.ldap.ssl.certfile", Conf)}, + {keyfile, cuttlefish:conf_get("auth.ldap.ssl.keyfile", Conf)}, + {cacertfile, cuttlefish:conf_get("auth.ldap.ssl.cacertfile", Conf, undefined)}, + {verify, cuttlefish:conf_get("auth.ldap.ssl.verify", Conf, undefined)}, + {server_name_indication, cuttlefish:conf_get("auth.ldap.ssl.server_name_indication", Conf, disable)}, + {fail_if_no_peer_cert, cuttlefish:conf_get("auth.ldap.ssl.fail_if_no_peer_cert", Conf, undefined)}] + end, + Opts = [{servers, Servers}, + {port, Port}, + {timeout, Timeout}, + {bind_dn, BindDN}, + {bind_password, BindPassword}, + {pool, Pool}, + {auto_reconnect, 2}], + case cuttlefish:conf_get("auth.ldap.ssl", Conf) of + true -> [{ssl, true}, {sslopts, Filter(SslOpts())}|Opts]; + false -> [{ssl, false}|Opts] + end +end}. + +{mapping, "auth.ldap.device_dn", "emqx_auth_ldap.device_dn", [ + {default, "ou=device,dc=emqx,dc=io"}, + {datatype, string} +]}. + +{mapping, "auth.ldap.match_objectclass", "emqx_auth_ldap.match_objectclass", [ + {default, "mqttUser"}, + {datatype, string} +]}. + +{mapping, "auth.ldap.custom_base_dn", "emqx_auth_ldap.custom_base_dn", [ + {default, "${username_attr}=${user},${device_dn}"}, + {datatype, string} +]}. + +%% auth.ldap.filters.1.key = "objectClass" +%% auth.ldap.filters.1.value = "mqttUser" +%% auth.ldap.filters.1.op = "and" +%% auth.ldap.filters.2.key = "uiAttr" +%% auth.ldap.filters.2.value "someAttr" +%% auth.ldap.filters.2.op = "or" +%% auth.ldap.filters.3.key = "someKey" +%% auth.ldap.filters.3.value = "someValue" +%% The configuratation structure sent to the application: +%% [{"objectClass","mqttUser"},"and",{"uiAttr","someAttr"},"or",{"someKey","someAttr"}] +%% The resulting LDAP filter would look like this: +%% ==> "|(&(objectClass=Class)(uiAttr=someAttr)(someKey=someValue))" +{translation, "emqx_auth_ldap.filters", +fun(Conf) -> + Settings = cuttlefish_variable:filter_by_prefix("auth.ldap.filters", Conf), + Keys = [{Num, {key, V}} || {["auth","ldap","filters", Num, "key"], V} <- Settings], + Values = [{Num, {value, V}} || {["auth","ldap","filters", Num, "value"], V} <- Settings], + Ops = [{Num, {op, V}} || {["auth","ldap","filters", Num, "op"], V} <- Settings], + RawFilters = Keys ++ Values ++ Ops, + Filters = + lists:foldl( + fun({Num,{T,V}}, Acc)-> + maps:update_with(Num, + fun(F)-> + maps:put(T,V,F) + end, + #{T=>V}, Acc) + end, #{}, RawFilters), + Order=lists:usort(maps:keys(Filters)), + lists:reverse( + lists:foldl( + fun(F,Acc)-> + case F of + #{key:=K, op:=Op, value:=V} -> [Op,{K,V}|Acc]; + #{key:=K, value:=V} -> [{K,V}|Acc] + end + end, + [], + lists:map(fun(K) -> maps:get(K, Filters) end, Order))) +end}. + +{mapping, "auth.ldap.filters.$num.key", "emqx_auth_ldap.filters", [ + {datatype, string} +]}. + +{mapping, "auth.ldap.filters.$num.value", "emqx_auth_ldap.filters", [ + {datatype, string} +]}. + +{mapping, "auth.ldap.filters.$num.op", "emqx_auth_ldap.filters", [ + {datatype, {enum, [ "or", "and" ] } } +]}. + + +{mapping, "auth.ldap.bind_as_user", "emqx_auth_ldap.bind_as_user", [ + {default, false}, + {datatype, {enum, [true, false]}} +]}. + +{mapping, "auth.ldap.username.attributetype", "emqx_auth_ldap.username_attr", [ + {default, "uid"}, + {datatype, string} +]}. + +{mapping, "auth.ldap.password.attributetype", "emqx_auth_ldap.password_attr", [ + {default, "userPassword"}, + {datatype, string} +]}. diff --git a/apps/emqx_auth_ldap/rebar.config b/apps/emqx_auth_ldap/rebar.config new file mode 100644 index 000000000..c155efaed --- /dev/null +++ b/apps/emqx_auth_ldap/rebar.config @@ -0,0 +1,27 @@ +{deps, + [{eldap2, {git, "https://github.com/emqx/eldap2", {tag, "v0.2.2"}}}, + {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.0"}}}, + {emqx_passwd, {git, "https://github.com/emqx/emqx-passwd", {tag, "v1.1.1"}}} + ]}. + +{profiles, + [{test, + [{deps, [{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}]} + ]} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + {parse_transform}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions]}. +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + diff --git a/apps/emqx_auth_ldap/rebar.config.script b/apps/emqx_auth_ldap/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_ldap/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_ldap/src/emqx_acl_ldap.erl b/apps/emqx_auth_ldap/src/emqx_acl_ldap.erl new file mode 100644 index 000000000..cfd51164a --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_acl_ldap.erl @@ -0,0 +1,98 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_ldap). + +-include("emqx_auth_ldap.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("eldap/include/eldap.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-export([ register_metrics/0 + , check_acl/5 + , description/0 + ]). + +-import(proplists, [get_value/2]). + +-import(emqx_auth_ldap_cli, [search/4]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +check_acl(ClientInfo, PubSub, Topic, NoMatchAction, State) -> + case do_check_acl(ClientInfo, PubSub, Topic, NoMatchAction, State) of + ok -> emqx_metrics:inc(?ACL_METRICS(ignore)), ok; + {stop, allow} -> emqx_metrics:inc(?ACL_METRICS(allow)), {stop, allow}; + {stop, deny} -> emqx_metrics:inc(?ACL_METRICS(deny)), {stop, deny} + end. + +do_check_acl(#{username := <<$$, _/binary>>}, _PubSub, _Topic, _NoMatchAction, _State) -> + ok; + +do_check_acl(#{username := Username}, PubSub, Topic, _NoMatchAction, + #{device_dn := DeviceDn, + match_objectclass := ObjectClass, + username_attr := UidAttr, + custom_base_dn := CustomBaseDN, + pool := Pool} = Config) -> + + Filters = maps:get(filters, Config, []), + + ReplaceRules = [{"${username_attr}", UidAttr}, + {"${user}", binary_to_list(Username)}, + {"${device_dn}", DeviceDn}], + + Filter = emqx_auth_ldap:prepare_filter(Filters, UidAttr, ObjectClass, ReplaceRules), + + Attribute = case PubSub of + publish -> "mqttPublishTopic"; + subscribe -> "mqttSubscriptionTopic" + end, + Attribute1 = "mqttPubSubTopic", + ?LOG(debug, "[LDAP] search dn:~p filter:~p, attribute:~p", + [DeviceDn, Filter, Attribute]), + + BaseDN = emqx_auth_ldap:replace_vars(CustomBaseDN, ReplaceRules), + + case search(Pool, BaseDN, Filter, [Attribute, Attribute1]) of + {error, noSuchObject} -> + ok; + {ok, #eldap_search_result{entries = []}} -> + ok; + {ok, #eldap_search_result{entries = [Entry]}} -> + Topics = get_value(Attribute, Entry#eldap_entry.attributes) + ++ get_value(Attribute1, Entry#eldap_entry.attributes), + match(Topic, Topics); + Error -> + ?LOG(error, "[LDAP] search error:~p", [Error]), + {stop, deny} + end. + +match(_Topic, []) -> + ok; + +match(Topic, [Filter | Topics]) -> + case emqx_topic:match(Topic, list_to_binary(Filter)) of + true -> {stop, allow}; + false -> match(Topic, Topics) + end. + +description() -> + "ACL with LDAP". + diff --git a/apps/emqx_auth_ldap/src/emqx_auth_ldap.app.src b/apps/emqx_auth_ldap/src/emqx_auth_ldap.app.src new file mode 100644 index 000000000..51286dd9d --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_auth_ldap.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_ldap, + [{description, "EMQ X Authentication/ACL with LDAP"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_ldap_sup]}, + {applications, [kernel,stdlib,eldap2,ecpool,emqx_passwd]}, + {mod, {emqx_auth_ldap_app,[]}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-ldap"} + ]} + ]}. diff --git a/apps/emqx_auth_ldap/src/emqx_auth_ldap.app.src.script b/apps/emqx_auth_ldap/src/emqx_auth_ldap.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_auth_ldap.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_ldap/src/emqx_auth_ldap.erl b/apps/emqx_auth_ldap/src/emqx_auth_ldap.erl new file mode 100644 index 000000000..01cbb0ecb --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_auth_ldap.erl @@ -0,0 +1,210 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_ldap). + +-include("emqx_auth_ldap.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("eldap/include/eldap.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-import(proplists, [get_value/2]). + +-import(emqx_auth_ldap_cli, [search/3]). + +-export([ register_metrics/0 + , check/3 + , description/0 + , prepare_filter/4 + , replace_vars/2 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +check(ClientInfo = #{username := Username, password := Password}, AuthResult, + State = #{password_attr := PasswdAttr, bind_as_user := BindAsUserRequired, pool := Pool}) -> + CheckResult = + case lookup_user(Username, State) of + undefined -> {error, not_found}; + {error, Error} -> {error, Error}; + Entry -> + PasswordString = binary_to_list(Password), + ObjectName = Entry#eldap_entry.object_name, + Attributes = Entry#eldap_entry.attributes, + case BindAsUserRequired of + true -> + emqx_auth_ldap_cli:post_bind(Pool, ObjectName, PasswordString); + false -> + case get_value(PasswdAttr, Attributes) of + undefined -> + logger:error("LDAP Search State: ~p, uid: ~p, result:~p", + [State, Username, Attributes]), + {error, not_found}; + [Passhash1] -> + format_password(Passhash1, Password, ClientInfo) + end + end + end, + case CheckResult of + ok -> + ok = emqx_metrics:inc(?AUTH_METRICS(success)), + {stop, AuthResult#{auth_result => success, anonymous => false}}; + {error, not_found} -> + emqx_metrics:inc(?AUTH_METRICS(ignore)); + {error, ResultCode} -> + ok = emqx_metrics:inc(?AUTH_METRICS(failure)), + ?LOG(error, "[LDAP] Auth from ldap failed: ~p", [ResultCode]), + {stop, AuthResult#{auth_result => ResultCode, anonymous => false}} + end. + +lookup_user(Username, #{username_attr := UidAttr, + match_objectclass := ObjectClass, + device_dn := DeviceDn, + custom_base_dn := CustomBaseDN, pool := Pool} = Config) -> + + Filters = maps:get(filters, Config, []), + + ReplaceRules = [{"${username_attr}", UidAttr}, + {"${user}", binary_to_list(Username)}, + {"${device_dn}", DeviceDn}], + + Filter = prepare_filter(Filters, UidAttr, ObjectClass, ReplaceRules), + + %% auth.ldap.custom_base_dn = "${username_attr}=${user},${device_dn}" + BaseDN = replace_vars(CustomBaseDN, ReplaceRules), + + case search(Pool, BaseDN, Filter) of + %% This clause seems to be impossible to match. `eldap2:search/2` does + %% not validates the result, so if it returns "successfully" from the + %% LDAP server, it always returns `{ok, #eldap_search_result{}}`. + {error, noSuchObject} -> + undefined; + %% In case no user was found by the search, but the search was completed + %% without error we get an empty `entries` list. + {ok, #eldap_search_result{entries = []}} -> + undefined; + {ok, #eldap_search_result{entries = [Entry]}} -> + Attributes = Entry#eldap_entry.attributes, + case get_value("isEnabled", Attributes) of + undefined -> + Entry; + [Val] -> + case list_to_atom(string:to_lower(Val)) of + true -> Entry; + false -> {error, username_disabled} + end + end; + {error, Error} -> + ?LOG(error, "[LDAP] Search dn: ~p, filter: ~p, fail:~p", [DeviceDn, Filter, Error]), + {error, username_or_password_error} + end. + +check_pass(Password, Password, _ClientInfo) -> ok; +check_pass(_, _, _) -> {error, bad_username_or_password}. + +format_password(Passhash, Password, ClientInfo) -> + case do_format_password(Passhash, Password) of + {error, Error2} -> + {error, Error2}; + {Passhash1, Password1} -> + check_pass(Passhash1, Password1, ClientInfo) + end. + +do_format_password(Passhash, Password) -> + Base64PasshashHandler = + handle_passhash(fun(HashType, Passhash1, Password1) -> + Passhash2 = binary_to_list(base64:decode(Passhash1)), + resolve_passhash(HashType, Passhash2, Password1) + end, + fun(_Passhash, _Password) -> + {error, password_error} + end), + PasshashHandler = handle_passhash(fun resolve_passhash/3, Base64PasshashHandler), + PasshashHandler(Passhash, Password). + +resolve_passhash(HashType, Passhash, Password) -> + [_, Passhash1] = string:tokens(Passhash, "}"), + do_resolve(HashType, Passhash1, Password). + +handle_passhash(HandleMatch, HandleNoMatch) -> + fun(Passhash, Password) -> + case re:run(Passhash, "(?<={)[^{}]+(?=})", [{capture, all, list}, global]) of + {match, [[HashType]]} -> + HandleMatch(list_to_atom(string:to_lower(HashType)), Passhash, Password); + _ -> + HandleNoMatch(Passhash, Password) + end + end. + +do_resolve(ssha, Passhash, Password) -> + D64 = base64:decode(Passhash), + {HashedData, Salt} = lists:split(20, binary_to_list(D64)), + NewHash = crypto:hash(sha, <>), + {list_to_binary(HashedData), NewHash}; +do_resolve(HashType, Passhash, Password) -> + Password1 = base64:encode(crypto:hash(HashType, Password)), + {list_to_binary(Passhash), Password1}. + +description() -> "LDAP Authentication Plugin". + +prepare_filter(Filters, _UidAttr, ObjectClass, ReplaceRules) -> + SubFilters = + lists:map(fun({K, V}) -> + {replace_vars(K, ReplaceRules), replace_vars(V, ReplaceRules)}; + (Op) -> + Op + end, Filters), + case SubFilters of + [] -> eldap2:equalityMatch("objectClass", ObjectClass); + _List -> compile_filters(SubFilters, []) + end. + + +compile_filters([{Key, Value}], []) -> + compile_equal(Key, Value); +compile_filters([{K1, V1}, "and", {K2, V2} | Rest], []) -> + compile_filters( + Rest, + eldap2:'and'([compile_equal(K1, V1), + compile_equal(K2, V2)])); +compile_filters([{K1, V1}, "or", {K2, V2} | Rest], []) -> + compile_filters( + Rest, + eldap2:'or'([compile_equal(K1, V1), + compile_equal(K2, V2)])); +compile_filters(["and", {K, V} | Rest], PartialFilter) -> + compile_filters( + Rest, + eldap2:'and'([PartialFilter, + compile_equal(K, V)])); +compile_filters(["or", {K, V} | Rest], PartialFilter) -> + compile_filters( + Rest, + eldap2:'or'([PartialFilter, + compile_equal(K, V)])); +compile_filters([], Filter) -> + Filter. + +compile_equal(Key, Value) -> + eldap2:equalityMatch(Key, Value). + +replace_vars(CustomBaseDN, ReplaceRules) -> + lists:foldl(fun({Pattern, Substitute}, DN) -> + lists:flatten(string:replace(DN, Pattern, Substitute)) + end, CustomBaseDN, ReplaceRules). diff --git a/apps/emqx_auth_ldap/src/emqx_auth_ldap_app.erl b/apps/emqx_auth_ldap/src/emqx_auth_ldap_app.erl new file mode 100644 index 000000000..5922950f0 --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_auth_ldap_app.erl @@ -0,0 +1,78 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_ldap_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_ldap.hrl"). + +%% Application callbacks +-export([ start/2 + , prep_stop/1 + , stop/1 + ]). + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqx_auth_ldap_sup:start_link(), + if_enabled([device_dn, match_objectclass, + username_attr, password_attr, + filters, custom_base_dn, bind_as_user], + fun load_auth_hook/1), + if_enabled([device_dn, match_objectclass, + username_attr, password_attr, + filters, custom_base_dn, bind_as_user], + fun load_acl_hook/1), + {ok, Sup}. + +prep_stop(State) -> + emqx:unhook('client.authenticate', fun emqx_auth_ldap:check/3), + emqx:unhook('client.check_acl', fun emqx_acl_ldap:check_acl/5), + State. + +stop(_State) -> + ok. + +load_auth_hook(DeviceDn) -> + ok = emqx_auth_ldap:register_metrics(), + Params = maps:from_list(DeviceDn), + emqx:hook('client.authenticate', fun emqx_auth_ldap:check/3, [Params#{pool => ?APP}]). + +load_acl_hook(DeviceDn) -> + ok = emqx_acl_ldap:register_metrics(), + Params = maps:from_list(DeviceDn), + emqx:hook('client.check_acl', fun emqx_acl_ldap:check_acl/5 , [Params#{pool => ?APP}]). + +if_enabled(Cfgs, Fun) -> + case get_env(Cfgs) of + {ok, InitArgs} -> Fun(InitArgs); + [] -> ok + end. + +get_env(Cfgs) -> + get_env(Cfgs, []). + +get_env([Cfg | LeftCfgs], ENVS) -> + case application:get_env(?APP, Cfg) of + {ok, ENV} -> + get_env(LeftCfgs, [{Cfg, ENV} | ENVS]); + undefined -> + get_env(LeftCfgs, ENVS) + end; +get_env([], ENVS) -> + {ok, ENVS}. diff --git a/apps/emqx_auth_ldap/src/emqx_auth_ldap_cli.erl b/apps/emqx_auth_ldap/src/emqx_auth_ldap_cli.erl new file mode 100644 index 000000000..2f6e8099c --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_auth_ldap_cli.erl @@ -0,0 +1,150 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_ldap_cli). + +-behaviour(ecpool_worker). + +-include("emqx_auth_ldap.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +%% ecpool callback +-export([connect/1]). + +-export([ search/3 + , search/4 + , post_bind/3 + , init_args/1 + ]). + +-import(proplists, + [ get_value/2 + , get_value/3 + ]). + +%%-------------------------------------------------------------------- +%% LDAP Connect/Search +%%-------------------------------------------------------------------- + +connect(Opts) -> + Servers = get_value(servers, Opts, ["localhost"]), + Port = get_value(port, Opts, 389), + Timeout = get_value(timeout, Opts, 30), + BindDn = get_value(bind_dn, Opts), + BindPassword = get_value(bind_password, Opts), + LdapOpts = case get_value(ssl, Opts, false)of + true -> + SslOpts = get_value(sslopts, Opts), + [{port, Port}, {timeout, Timeout}, {sslopts, SslOpts}]; + false -> + [{port, Port}, {timeout, Timeout}] + end, + ?LOG(debug, "[LDAP] Connecting to OpenLDAP server: ~p, Opts:~p ...", [Servers, LdapOpts]), + + case eldap2:open(Servers, LdapOpts) of + {ok, LDAP} -> + try eldap2:simple_bind(LDAP, BindDn, BindPassword) of + ok -> {ok, LDAP}; + {error, Error} -> + ?LOG(error, "[LDAP] Can't authenticated to OpenLDAP server: ~p", [Error]), + {error, Error} + catch + error:Reason -> + ?LOG(error, "[LDAP] Can't authenticated to OpenLDAP server: ~p", [Reason]), + {error, Reason} + end; + {error, Reason} -> + ?LOG(error, "[LDAP] Can't connect to OpenLDAP server: ~p", [Reason]), + {error, Reason} + end. + +search(Pool, Base, Filter) -> + ecpool:with_client(Pool, + fun(C) -> + case application:get_env(?APP, bind_as_user) of + {ok, true} -> + {ok, Opts} = application:get_env(?APP, ldap), + BindDn = get_value(bind_dn, Opts), + BindPassword = get_value(bind_password, Opts), + try eldap2:simple_bind(C, BindDn, BindPassword) of + ok -> + eldap2:search(C, [{base, Base}, + {filter, Filter}, + {deref, eldap2:derefFindingBaseObj()}]); + {error, Error} -> + {error, Error} + catch + error:Reason -> {error, Reason} + end; + {ok, false} -> + eldap2:search(C, [{base, Base}, + {filter, Filter}, + {deref, eldap2:derefFindingBaseObj()}]) + end + end). + +search(Pool, Base, Filter, Attributes) -> + ecpool:with_client(Pool, + fun(C) -> + case application:get_env(?APP, bind_as_user) of + {ok, true} -> + {ok, Opts} = application:get_env(?APP, ldap), + BindDn = get_value(bind_dn, Opts), + BindPassword = get_value(bind_password, Opts), + try eldap2:simple_bind(C, BindDn, BindPassword) of + ok -> + eldap2:search(C, [{base, Base}, + {filter, Filter}, + {attributes, Attributes}, + {deref, eldap2:derefFindingBaseObj()}]); + {error, Error} -> + {error, Error} + catch + error:Reason -> {error, Reason} + end; + {ok, false} -> + eldap2:search(C, [{base, Base}, + {filter, Filter}, + {attributes, Attributes}, + {deref, eldap2:derefFindingBaseObj()}]) + end + end). + +post_bind(Pool, BindDn, BindPassword) -> + ecpool:with_client(Pool, + fun(C) -> + try eldap2:simple_bind(C, BindDn, BindPassword) of + ok -> ok; + {error, Error} -> + {error, Error} + catch + error:Reason -> {error, Reason} + end + end). + + +init_args(ENVS) -> + DeviceDn = get_value(device_dn, ENVS), + ObjectClass = get_value(match_objectclass, ENVS), + UidAttr = get_value(username_attr, ENVS), + PasswdAttr = get_value(password_attr, ENVS), + {ok, #{device_dn => DeviceDn, + match_objectclass => ObjectClass, + username_attr => UidAttr, + password_attr => PasswdAttr}}. + diff --git a/apps/emqx_auth_ldap/src/emqx_auth_ldap_sup.erl b/apps/emqx_auth_ldap/src/emqx_auth_ldap_sup.erl new file mode 100644 index 000000000..ca4440f1a --- /dev/null +++ b/apps/emqx_auth_ldap/src/emqx_auth_ldap_sup.erl @@ -0,0 +1,35 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_ldap_sup). + +-behaviour(supervisor). + +-include("emqx_auth_ldap.hrl"). + +-export([start_link/0]). + +-export([init/1]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +init([]) -> + %% LDAP Connection Pool. + {ok, Server} = application:get_env(?APP, ldap), + PoolSpec = ecpool:pool_spec(?APP, ?APP, emqx_auth_ldap_cli, Server), + {ok, {{one_for_one, 10, 100}, [PoolSpec]}}. + diff --git a/apps/emqx_auth_ldap/test/certs/cacert.pem b/apps/emqx_auth_ldap/test/certs/cacert.pem new file mode 100644 index 000000000..604fd2362 --- /dev/null +++ b/apps/emqx_auth_ldap/test/certs/cacert.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDUTCCAjmgAwIBAgIJAPPYCjTmxdt/MA0GCSqGSIb3DQEBCwUAMD8xCzAJBgNV +BAYTAkNOMREwDwYDVQQIDAhoYW5nemhvdTEMMAoGA1UECgwDRU1RMQ8wDQYDVQQD +DAZSb290Q0EwHhcNMjAwNTA4MDgwNjUyWhcNMzAwNTA2MDgwNjUyWjA/MQswCQYD +VQQGEwJDTjERMA8GA1UECAwIaGFuZ3pob3UxDDAKBgNVBAoMA0VNUTEPMA0GA1UE +AwwGUm9vdENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzcgVLex1 +EZ9ON64EX8v+wcSjzOZpiEOsAOuSXOEN3wb8FKUxCdsGrsJYB7a5VM/Jot25Mod2 +juS3OBMg6r85k2TWjdxUoUs+HiUB/pP/ARaaW6VntpAEokpij/przWMPgJnBF3Ur +MjtbLayH9hGmpQrI5c2vmHQ2reRZnSFbY+2b8SXZ+3lZZgz9+BaQYWdQWfaUWEHZ +uDaNiViVO0OT8DRjCuiDp3yYDj3iLWbTA/gDL6Tf5XuHuEwcOQUrd+h0hyIphO8D +tsrsHZ14j4AWYLk1CPA6pq1HIUvEl2rANx2lVUNv+nt64K/Mr3RnVQd9s8bK+TXQ +KGHd2Lv/PALYuwIDAQABo1AwTjAdBgNVHQ4EFgQUGBmW+iDzxctWAWxmhgdlE8Pj +EbQwHwYDVR0jBBgwFoAUGBmW+iDzxctWAWxmhgdlE8PjEbQwDAYDVR0TBAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAQEAGbhRUjpIred4cFAFJ7bbYD9hKu/yzWPWkMRa +ErlCKHmuYsYk+5d16JQhJaFy6MGXfLgo3KV2itl0d+OWNH0U9ULXcglTxy6+njo5 +CFqdUBPwN1jxhzo9yteDMKF4+AHIxbvCAJa17qcwUKR5MKNvv09C6pvQDJLzid7y +E2dkgSuggik3oa0427KvctFf8uhOV94RvEDyqvT5+pgNYZ2Yfga9pD/jjpoHEUlo +88IGU8/wJCx3Ds2yc8+oBg/ynxG8f/HmCC1ET6EHHoe2jlo8FpU/SgGtghS1YL30 +IWxNsPrUP+XsZpBJy/mvOhE5QXo6Y35zDqqj8tI7AGmAWu22jg== +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_ldap/test/certs/cert.pem b/apps/emqx_auth_ldap/test/certs/cert.pem new file mode 100644 index 000000000..092390b1d --- /dev/null +++ b/apps/emqx_auth_ldap/test/certs/cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDEzCCAfugAwIBAgIBAjANBgkqhkiG9w0BAQsFADA/MQswCQYDVQQGEwJDTjER +MA8GA1UECAwIaGFuZ3pob3UxDDAKBgNVBAoMA0VNUTEPMA0GA1UEAwwGUm9vdENB +MB4XDTIwMDUwODA4MDcwNVoXDTMwMDUwNjA4MDcwNVowPzELMAkGA1UEBhMCQ04x +ETAPBgNVBAgMCGhhbmd6aG91MQwwCgYDVQQKDANFTVExDzANBgNVBAMMBlNlcnZl +cjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALNeWT3pE+QFfiRJzKmn +AMUrWo3K2j/Tm3+Xnl6WLz67/0rcYrJbbKvS3uyRP/stXyXEKw9CepyQ1ViBVFkW +Aoy8qQEOWFDsZc/5UzhXUnb6LXr3qTkFEjNmhj+7uzv/lbBxlUG1NlYzSeOB6/RT +8zH/lhOeKhLnWYPXdXKsa1FL6ij4X8DeDO1kY7fvAGmBn/THh1uTpDizM4YmeI+7 +4dmayA5xXvARte5h4Vu5SIze7iC057N+vymToMk2Jgk+ZZFpyXrnq+yo6RaD3ANc +lrc4FbeUQZ5a5s5Sxgs9a0Y3WMG+7c5VnVXcbjBRz/aq2NtOnQQjikKKQA8GF080 +BQkCAwEAAaMaMBgwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJKoZIhvcNAQEL +BQADggEBAJefnMZpaRDHQSNUIEL3iwGXE9c6PmIsQVE2ustr+CakBp3TZ4l0enLt +iGMfEVFju69cO4oyokWv+hl5eCMkHBf14Kv51vj448jowYnF1zmzn7SEzm5Uzlsa +sqjtAprnLyof69WtLU1j5rYWBuFX86yOTwRAFNjm9fvhAcrEONBsQtqipBWkMROp +iUYMkRqbKcQMdwxov+lHBYKq9zbWRoqLROAn54SRqgQk6c15JdEfgOOjShbsOkIH +UhqcwRkQic7n1zwHVGVDgNIZVgmJ2IdIWBlPEC7oLrRrBD/X1iEEXtKab6p5o22n +KB5mN+iQaE+Oe2cpGKZJiJRdM+IqDDQ= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_ldap/test/certs/client-cert.pem b/apps/emqx_auth_ldap/test/certs/client-cert.pem new file mode 100644 index 000000000..09d855221 --- /dev/null +++ b/apps/emqx_auth_ldap/test/certs/client-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDEzCCAfugAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MQswCQYDVQQGEwJDTjER +MA8GA1UECAwIaGFuZ3pob3UxDDAKBgNVBAoMA0VNUTEPMA0GA1UEAwwGUm9vdENB +MB4XDTIwMDUwODA4MDY1N1oXDTMwMDUwNjA4MDY1N1owPzELMAkGA1UEBhMCQ04x +ETAPBgNVBAgMCGhhbmd6aG91MQwwCgYDVQQKDANFTVExDzANBgNVBAMMBkNsaWVu +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMy4hoksKcZBDbY680u6 +TS25U51nuB1FBcGMlF9B/t057wPOlxF/OcmbxY5MwepS41JDGPgulE1V7fpsXkiW +1LUimYV/tsqBfymIe0mlY7oORahKji7zKQ2UBIVFhdlvQxunlIDnw6F9popUgyHt +dMhtlgZK8oqRwHxO5dbfoukYd6J/r+etS5q26sgVkf3C6dt0Td7B25H9qW+f7oLV +PbcHYCa+i73u9670nrpXsC+Qc7Mygwa2Kq/jwU+ftyLQnOeW07DuzOwsziC/fQZa +nbxR+8U9FNftgRcC3uP/JMKYUqsiRAuaDokARZxVTV5hUElfpO6z6/NItSDvvh3i +eikCAwEAAaMaMBgwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJKoZIhvcNAQEL +BQADggEBABchYxKo0YMma7g1qDswJXsR5s56Czx/I+B41YcpMBMTrRqpUC0nHtLk +M7/tZp592u/tT8gzEnQjZLKBAhFeZaR3aaKyknLqwiPqJIgg0pgsBGITrAK3Pv4z +5/YvAJJKgTe5UdeTz6U4lvNEux/4juZ4pmqH4qSFJTOzQS7LmgSmNIdd072rwXBd +UzcSHzsJgEMb88u/LDLjj1pQ7AtZ4Tta8JZTvcgBFmjB0QUi6fgkHY6oGat/W4kR +jSRUBlMUbM/drr2PVzRc2dwbFIl3X+ZE6n5Sl3ZwRAC/s92JU6CPMRW02muVu6xl +goraNgPISnrbpR6KjxLZkVembXzjNNc= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_ldap/test/certs/client-key.pem b/apps/emqx_auth_ldap/test/certs/client-key.pem new file mode 100644 index 000000000..2b3f30cf6 --- /dev/null +++ b/apps/emqx_auth_ldap/test/certs/client-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAzLiGiSwpxkENtjrzS7pNLblTnWe4HUUFwYyUX0H+3TnvA86X +EX85yZvFjkzB6lLjUkMY+C6UTVXt+mxeSJbUtSKZhX+2yoF/KYh7SaVjug5FqEqO +LvMpDZQEhUWF2W9DG6eUgOfDoX2milSDIe10yG2WBkryipHAfE7l1t+i6Rh3on+v +561LmrbqyBWR/cLp23RN3sHbkf2pb5/ugtU9twdgJr6Lve73rvSeulewL5BzszKD +BrYqr+PBT5+3ItCc55bTsO7M7CzOIL99BlqdvFH7xT0U1+2BFwLe4/8kwphSqyJE +C5oOiQBFnFVNXmFQSV+k7rPr80i1IO++HeJ6KQIDAQABAoIBAGWgvPjfuaU3qizq +uti/FY07USz0zkuJdkANH6LiSjlchzDmn8wJ0pApCjuIE0PV/g9aS8z4opp5q/gD +UBLM/a8mC/xf2EhTXOMrY7i9p/I3H5FZ4ZehEqIw9sWKK9YzC6dw26HabB2BGOnW +5nozPSQ6cp2RGzJ7BIkxSZwPzPnVTgy3OAuPOiJytvK+hGLhsNaT+Y9bNDvplVT2 +ZwYTV8GlHZC+4b2wNROILm0O86v96O+Qd8nn3fXjGHbMsAnONBq10bZS16L4fvkH +5G+W/1PeSXmtZFppdRRDxIW+DWcXK0D48WRliuxcV4eOOxI+a9N2ZJZZiNLQZGwg +w3A8+mECgYEA8HuJFrlRvdoBe2U/EwUtG74dcyy30L4yEBnN5QscXmEEikhaQCfX +Wm6EieMcIB/5I5TQmSw0cmBMeZjSXYoFdoI16/X6yMMuATdxpvhOZGdUGXxhAH+x +xoTUavWZnEqW3fkUU71kT5E2f2i+0zoatFESXHeslJyz85aAYpP92H0CgYEA2e5A +Yozt5eaA1Gyhd8SeptkEU4xPirNUnVQHStpMWUb1kzTNXrPmNWccQ7JpfpG6DcYl +zUF6p6mlzY+zkMiyPQjwEJlhiHM2NlL1QS7td0R8ewgsFoyn8WsBI4RejWrEG9td +EDniuIw+pBFkcWthnTLHwECHdzgquToyTMjrBB0CgYEA28tdGbrZXhcyAZEhHAZA +Gzog+pKlkpEzeonLKIuGKzCrEKRecIK5jrqyQsCjhS0T7ZRnL4g6i0s+umiV5M5w +fcc292pEA1h45L3DD6OlKplSQVTv55/OYS4oY3YEJtf5mfm8vWi9lQeY8sxOlQpn +O+VZTdBHmTC8PGeTAgZXHZUCgYA6Tyv88lYowB7SN2qQgBQu8jvdGtqhcs/99GCr +H3N0I69LPsKAR0QeH8OJPXBKhDUywESXAaEOwS5yrLNP1tMRz5Vj65YUCzeDG3kx +gpvY4IMp7ArX0bSRvJ6mYSFnVxy3k174G3TVCfksrtagHioVBGQ7xUg5ltafjrms +n8l55QKBgQDVzU8tQvBVqY8/1lnw11Vj4fkE/drZHJ5UkdC1eenOfSWhlSLfUJ8j +ds7vEWpRPPoVuPZYeR1y78cyxKe1GBx6Wa2lF5c7xjmiu0xbRnrxYeLolce9/ntp +asClqpnHT8/VJYTD7Kqj0fouTTZf0zkig/y+2XERppd8k+pSKjUCPQ== +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_ldap/test/certs/key.pem b/apps/emqx_auth_ldap/test/certs/key.pem new file mode 100644 index 000000000..6c338216e --- /dev/null +++ b/apps/emqx_auth_ldap/test/certs/key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAs15ZPekT5AV+JEnMqacAxStajcraP9Obf5eeXpYvPrv/Stxi +sltsq9Le7JE/+y1fJcQrD0J6nJDVWIFUWRYCjLypAQ5YUOxlz/lTOFdSdvotevep +OQUSM2aGP7u7O/+VsHGVQbU2VjNJ44Hr9FPzMf+WE54qEudZg9d1cqxrUUvqKPhf +wN4M7WRjt+8AaYGf9MeHW5OkOLMzhiZ4j7vh2ZrIDnFe8BG17mHhW7lIjN7uILTn +s36/KZOgyTYmCT5lkWnJeuer7KjpFoPcA1yWtzgVt5RBnlrmzlLGCz1rRjdYwb7t +zlWdVdxuMFHP9qrY206dBCOKQopADwYXTzQFCQIDAQABAoIBAQCuvCbr7Pd3lvI/ +n7VFQG+7pHRe1VKwAxDkx2t8cYos7y/QWcm8Ptwqtw58HzPZGWYrgGMCRpzzkRSF +V9g3wP1S5Scu5C6dBu5YIGc157tqNGXB+SpdZddJQ4Nc6yGHXYERllT04ffBGc3N +WG/oYS/1cSteiSIrsDy/91FvGRCi7FPxH3wIgHssY/tw69s1Cfvaq5lr2NTFzxIG +xCvpJKEdSfVfS9I7LYiymVjst3IOR/w76/ZFY9cRa8ZtmQSWWsm0TUpRC1jdcbkm +ZoJptYWlP+gSwx/fpMYftrkJFGOJhHJHQhwxT5X/ajAISeqjjwkWSEJLwnHQd11C +Zy2+29lBAoGBANlEAIK4VxCqyPXNKfoOOi5dS64NfvyH4A1v2+KaHWc7lqaqPN49 +ezfN2n3X+KWx4cviDD914Yc2JQ1vVJjSaHci7yivocDo2OfZDmjBqzaMp/y+rX1R +/f3MmiTqMa468rjaxI9RRZu7vDgpTR+za1+OBCgMzjvAng8dJuN/5gjlAoGBANNY +uYPKtearBmkqdrSV7eTUe49Nhr0XotLaVBH37TCW0Xv9wjO2xmbm5Ga/DCtPIsBb +yPeYwX9FjoasuadUD7hRvbFu6dBa0HGLmkXRJZTcD7MEX2Lhu4BuC72yDLLFd0r+ +Ep9WP7F5iJyagYqIZtz+4uf7gBvUDdmvXz3sGr1VAoGAdXTD6eeKeiI6PlhKBztF +zOb3EQOO0SsLv3fnodu7ZaHbUgLaoTMPuB17r2jgrYM7FKQCBxTNdfGZmmfDjlLB +0xZ5wL8ibU30ZXL8zTlWPElST9sto4B+FYVVF/vcG9sWeUUb2ncPcJ/Po3UAktDG +jYQTTyuNGtSJHpad/YOZctkCgYBtWRaC7bq3of0rJGFOhdQT9SwItN/lrfj8hyHA +OjpqTV4NfPmhsAtu6j96OZaeQc+FHvgXwt06cE6Rt4RG4uNPRluTFgO7XYFDfitP +vCppnoIw6S5BBvHwPP+uIhUX2bsi/dm8vu8tb+gSvo4PkwtFhEr6I9HglBKmcmog +q6waEQKBgHyecFBeM6Ls11Cd64vborwJPAuxIW7HBAFj/BS99oeG4TjBx4Sz2dFd +rzUibJt4ndnHIvCN8JQkjNG14i9hJln+H3mRss8fbZ9vQdqG+2vOWADYSzzsNI55 +RFY7JjluKcVkp/zCDeUxTU3O6sS+v6/3VE11Cob6OYQx3lN5wrZ3 +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_ldap/test/emqx_auth_ldap_SUITE.erl b/apps/emqx_auth_ldap/test/emqx_auth_ldap_SUITE.erl new file mode 100644 index 000000000..c9c38f610 --- /dev/null +++ b/apps/emqx_auth_ldap/test/emqx_auth_ldap_SUITE.erl @@ -0,0 +1,152 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_ldap_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). + +-define(PID, emqx_auth_ldap). + +-define(APP, emqx_auth_ldap). + +-define(DeviceDN, "ou=test_device,dc=emqx,dc=io"). + +-define(AuthDN, "ou=test_auth,dc=emqx,dc=io"). + +%%-------------------------------------------------------------------- +%% Setups +%%-------------------------------------------------------------------- + +all() -> + [{group, nossl}, {group, ssl}]. + +groups() -> + Cases = emqx_ct:all(?MODULE), + [{nossl, Cases}, {ssl, Cases}]. + +init_per_group(GrpName, Cfg) -> + Fun = fun(App) -> set_special_configs(GrpName, App) end, + emqx_ct_helpers:start_apps([emqx_auth_ldap], Fun), + Cfg. + +end_per_group(_GrpName, _Cfg) -> + emqx_ct_helpers:stop_apps([emqx_auth_ldap]). + +%%-------------------------------------------------------------------- +%% Cases +%%-------------------------------------------------------------------- + +t_check_auth(_) -> + MqttUser1 = #{clientid => <<"mqttuser1">>, + username => <<"mqttuser0001">>, + password => <<"mqttuser0001">>, + zone => external}, + MqttUser2 = #{clientid => <<"mqttuser2">>, + username => <<"mqttuser0002">>, + password => <<"mqttuser0002">>, + zone => external}, + MqttUser3 = #{clientid => <<"mqttuser3">>, + username => <<"mqttuser0003">>, + password => <<"mqttuser0003">>, + zone => external}, + MqttUser4 = #{clientid => <<"mqttuser4">>, + username => <<"mqttuser0004">>, + password => <<"mqttuser0004">>, + zone => external}, + MqttUser5 = #{clientid => <<"mqttuser5">>, + username => <<"mqttuser0005">>, + password => <<"mqttuser0005">>, + zone => external}, + NonExistUser1 = #{clientid => <<"mqttuser6">>, + username => <<"mqttuser0006">>, + password => <<"mqttuser0006">>, + zone => external}, + NonExistUser2 = #{clientid => <<"mqttuser7">>, + username => <<"mqttuser0005">>, + password => <<"mqttuser0006">>, + zone => external}, + ct:log("MqttUser: ~p", [emqx_access_control:authenticate(MqttUser1)]), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser1)), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser2)), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser3)), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser4)), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser5)), + ?assertEqual({error, not_authorized}, emqx_access_control:authenticate(NonExistUser1)), + ?assertEqual({error, bad_username_or_password}, emqx_access_control:authenticate(NonExistUser2)). + +t_check_acl(_) -> + MqttUser = #{clientid => <<"mqttuser1">>, username => <<"mqttuser0001">>, zone => external}, + NoMqttUser = #{clientid => <<"mqttuser2">>, username => <<"mqttuser0007">>, zone => external}, + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pub/1">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pub/+">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pub/#">>), + + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/sub/1">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/sub/+">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/sub/#">>), + + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pubsub/1">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pubsub/+">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pubsub/#">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/pubsub/1">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/pubsub/+">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/pubsub/#">>), + + deny = emqx_access_control:check_acl(NoMqttUser, publish, <<"mqttuser0001/req/mqttuser0001/+">>), + deny = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/req/mqttuser0002/+">>), + deny = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/req/+/mqttuser0002">>), + ok. + +%%-------------------------------------------------------------------- +%% Helpers +%%-------------------------------------------------------------------- + +set_special_configs(_, emqx) -> + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, enable_acl_cache, false), + application:set_env(emqx, acl_nomatch, deny), + AclFilePath = filename:join(["test", "emqx_SUITE_data", "acl.conf"]), + application:set_env(emqx, acl_file, + emqx_ct_helpers:deps_path(emqx, AclFilePath)), + LoadedPluginPath = filename:join(["test", "emqx_SUITE_data", "loaded_plugins"]), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, LoadedPluginPath)); + +set_special_configs(Ssl, emqx_auth_ldap) -> + case Ssl == ssl of + true -> + LdapOpts = application:get_env(emqx_auth_ldap, ldap, []), + Path = emqx_ct_helpers:deps_path(emqx_auth_ldap, "test/certs/"), + SslOpts = [{verify, verify_peer}, + {fail_if_no_peer_cert, true}, + {server_name_indication, disable}, + {keyfile, Path ++ "/client-key.pem"}, + {certfile, Path ++ "/client-cert.pem"}, + {cacertfile, Path ++ "/cacert.pem"}], + LdapOpts1 = lists:keystore(ssl, 1, LdapOpts, {ssl, true}), + LdapOpts2 = lists:keystore(sslopts, 1, LdapOpts1, {sslopts, SslOpts}), + LdapOpts3 = lists:keystore(port, 1, LdapOpts2, {port, 636}), + application:set_env(emqx_auth_ldap, ldap, LdapOpts3); + _ -> + ok + end, + application:set_env(emqx_auth_ldap, device_dn, "ou=testdevice, dc=emqx, dc=io"). + diff --git a/apps/emqx_auth_ldap/test/emqx_auth_ldap_bind_as_user_SUITE.erl b/apps/emqx_auth_ldap/test/emqx_auth_ldap_bind_as_user_SUITE.erl new file mode 100644 index 000000000..15875c6e3 --- /dev/null +++ b/apps/emqx_auth_ldap/test/emqx_auth_ldap_bind_as_user_SUITE.erl @@ -0,0 +1,114 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_ldap_bind_as_user_SUITE). + +-compile(export_all). +-compile(no_warning_export). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). + +-define(PID, emqx_auth_ldap). + +-define(APP, emqx_auth_ldap). + +-define(DeviceDN, "ou=test_device,dc=emqx,dc=io"). + +-define(AuthDN, "ou=test_auth,dc=emqx,dc=io"). + +all() -> + [check_auth, + check_acl]. + +init_per_suite(Config) -> + emqx_ct_helpers:start_apps([emqx, emqx_auth_ldap], fun set_special_configs/1), + % emqx_mod_acl_internal:unload([]), + Config. + +end_per_suite(_Config) -> + emqx_ct_helpers:stop_apps([emqx_auth_ldap, emqx]). + +check_auth(_) -> + MqttUser1 = #{clientid => <<"mqttuser1">>, + username => <<"user1">>, + password => <<"mqttuser0001">>, + zone => external}, + MqttUser2 = #{clientid => <<"mqttuser2">>, + username => <<"user2">>, + password => <<"mqttuser0002">>, + zone => external}, + NonExistUser1 = #{clientid => <<"mqttuser3">>, + username => <<"user3">>, + password => <<"mqttuser0003">>, + zone => external}, + ct:log("MqttUser: ~p", [emqx_access_control:authenticate(MqttUser1)]), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser1)), + ?assertMatch({ok, #{auth_result := success}}, emqx_access_control:authenticate(MqttUser2)), + ?assertEqual({error, not_authorized}, emqx_access_control:authenticate(NonExistUser1)). + +check_acl(_) -> + % emqx_modules:load_module(emqx_mod_acl_internal, false), + MqttUser = #{clientid => <<"mqttuser1">>, username => <<"user1">>, zone => external}, + NoMqttUser = #{clientid => <<"mqttuser2">>, username => <<"user7">>, zone => external}, + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pub/1">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pub/+">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pub/#">>), + + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/sub/1">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/sub/+">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/sub/#">>), + + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pubsub/1">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pubsub/+">>), + allow = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/pubsub/#">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/pubsub/1">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/pubsub/+">>), + allow = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/pubsub/#">>), + + deny = emqx_access_control:check_acl(NoMqttUser, publish, <<"mqttuser0001/req/mqttuser0001/+">>), + deny = emqx_access_control:check_acl(MqttUser, publish, <<"mqttuser0001/req/mqttuser0002/+">>), + deny = emqx_access_control:check_acl(MqttUser, subscribe, <<"mqttuser0001/req/+/mqttuser0002">>), + ok. + +set_special_configs(emqx) -> + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, enable_acl_cache, false), + application:set_env(emqx, acl_nomatch, deny), + AclFilePath = filename:join(["test", "emqx_SUITE_data", "acl.conf"]), + application:set_env(emqx, acl_file, + emqx_ct_helpers:deps_path(emqx, AclFilePath)), + LoadedPluginPath = filename:join(["test", "emqx_SUITE_data", "loaded_plugins"]), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, LoadedPluginPath)); + +set_special_configs(emqx_auth_ldap) -> + application:set_env(emqx_auth_ldap, bind_as_user, true), + application:set_env(emqx_auth_ldap, device_dn, "ou=testdevice, dc=emqx, dc=io"), + application:set_env(emqx_auth_ldap, custom_base_dn, "${device_dn}"), + %% auth.ldap.filters.1.key = mqttAccountName + %% auth.ldap.filters.1.value = ${user} + %% auth.ldap.filters.1.op = and + %% auth.ldap.filters.2.key = objectClass + %% auth.ldap.filters.1.value = mqttUser + application:set_env(emqx_auth_ldap, filters, [{"mqttAccountName", "${user}"}, + "and", + {"objectClass", "mqttUser"}]); + +set_special_configs(_App) -> + ok. + diff --git a/apps/emqx_auth_mnesia/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_mnesia/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..31efc5f92 --- /dev/null +++ b/apps/emqx_auth_mnesia/.github/workflows/run_test_cases.yaml @@ -0,0 +1,29 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + container: + image: erlang:22.1 + + steps: + - uses: actions/checkout@v1 + - name: run test cases + run: | + make xref + make eunit + make ct + make cover + - uses: actions/upload-artifact@v1 + if: always() + with: + name: logs + path: _build/test/logs + - uses: actions/upload-artifact@v1 + with: + name: cover + path: _build/test/cover + diff --git a/apps/emqx_auth_mnesia/.gitignore b/apps/emqx_auth_mnesia/.gitignore new file mode 100644 index 000000000..a4d9fea0a --- /dev/null +++ b/apps/emqx_auth_mnesia/.gitignore @@ -0,0 +1,26 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.erlang.mk/ +emqx_auth_mnesia.d +data/ +_build/ +.DS_Store +cover/ +ct.coverdata +eunit.coverdata +logs/ +test/ct.cover.spec +rebar.lock +rebar3.crashdump +erlang.mk +.*.swp +.rebar3/ +etc/emqx_auth_mnesia.conf.rendered diff --git a/apps/emqx_auth_mnesia/LICENSE b/apps/emqx_auth_mnesia/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/apps/emqx_auth_mnesia/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_mnesia/Makefile b/apps/emqx_auth_mnesia/Makefile new file mode 100644 index 000000000..aadf317d3 --- /dev/null +++ b/apps/emqx_auth_mnesia/Makefile @@ -0,0 +1,28 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +clean: distclean + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock diff --git a/apps/emqx_auth_mnesia/README.md b/apps/emqx_auth_mnesia/README.md new file mode 100644 index 000000000..8b4c145a8 --- /dev/null +++ b/apps/emqx_auth_mnesia/README.md @@ -0,0 +1,2 @@ +emqx_auth_mnesia +=============== diff --git a/apps/emqx_auth_mnesia/etc/emqx_auth_mnesia.conf b/apps/emqx_auth_mnesia/etc/emqx_auth_mnesia.conf new file mode 100644 index 000000000..ff74656cb --- /dev/null +++ b/apps/emqx_auth_mnesia/etc/emqx_auth_mnesia.conf @@ -0,0 +1,30 @@ +## Password hash. +## +## Value: plain | md5 | sha | sha256 | sha512 +auth.mnesia.password_hash = sha256 + +##-------------------------------------------------------------------- +## ClientId Authentication +##-------------------------------------------------------------------- + +## Examples +##auth.client.1.clientid = id +##auth.client.1.password = passwd +##auth.client.2.clientid = dev:devid +##auth.client.2.password = passwd2 +##auth.client.3.clientid = app:appid +##auth.client.3.password = passwd3 +##auth.client.4.clientid = client~!@#$%^&*()_+ +##auth.client.4.password = passwd~!@#$%^&*()_+ + +##-------------------------------------------------------------------- +## Username Authentication +##-------------------------------------------------------------------- + +## Examples: +##auth.user.1.username = admin +##auth.user.1.password = public +##auth.user.2.username = feng@emqtt.io +##auth.user.2.password = public +##auth.user.3.username = name~!@#$%^&*()_+ +##auth.user.3.password = pwsswd~!@#$%^&*()_+ diff --git a/apps/emqx_auth_mnesia/include/emqx_auth_mnesia.hrl b/apps/emqx_auth_mnesia/include/emqx_auth_mnesia.hrl new file mode 100644 index 000000000..034bd4f30 --- /dev/null +++ b/apps/emqx_auth_mnesia/include/emqx_auth_mnesia.hrl @@ -0,0 +1,38 @@ +-define(APP, emqx_auth_mnesia). + +-type(login():: {clientid, binary()} + | {username, binary()}). + +-record(emqx_user, { + login :: login(), + password :: binary(), + created_at :: integer() + }). + +-record(emqx_acl, { + filter:: {login() | all, emqx_topic:topic()}, + action :: pub | sub | pubsub, + access :: allow | deny, + created_at :: integer() + }). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). diff --git a/apps/emqx_auth_mnesia/priv/emqx_auth_mnesia.schema b/apps/emqx_auth_mnesia/priv/emqx_auth_mnesia.schema new file mode 100644 index 000000000..87d6bf47f --- /dev/null +++ b/apps/emqx_auth_mnesia/priv/emqx_auth_mnesia.schema @@ -0,0 +1,43 @@ +%%-*- mode: erlang -*- +%% emqx_auth_mnesia config mapping + +{mapping, "auth.mnesia.password_hash", "emqx_auth_mnesia.password_hash", [ + {default, sha256}, + {datatype, {enum, [plain, md5, sha, sha256, sha512]}} +]}. + +{mapping, "auth.client.$id.clientid", "emqx_auth_mnesia.clientid_list", [ + {datatype, string} +]}. + +{mapping, "auth.client.$id.password", "emqx_auth_mnesia.clientid_list", [ + {datatype, string} +]}. + +{translation, "emqx_auth_mnesia.clientid_list", fun(Conf) -> + ClientList = cuttlefish_variable:filter_by_prefix("auth.client", Conf), + lists:foldl( + fun({["auth", "client", Id, "clientid"], ClientId}, AccIn) -> + [{ClientId, cuttlefish:conf_get("auth.client." ++ Id ++ ".password", Conf)} | AccIn]; + (_, AccIn) -> + AccIn + end, [], ClientList) +end}. + +{mapping, "auth.user.$id.username", "emqx_auth_mnesia.username_list", [ + {datatype, string} +]}. + +{mapping, "auth.user.$id.password", "emqx_auth_mnesia.username_list", [ + {datatype, string} +]}. + +{translation, "emqx_auth_mnesia.username_list", fun(Conf) -> + Userlist = cuttlefish_variable:filter_by_prefix("auth.user", Conf), + lists:foldl( + fun({["auth", "user", Id, "username"], Username}, AccIn) -> + [{Username, cuttlefish:conf_get("auth.user." ++ Id ++ ".password", Conf)} | AccIn]; + (_, AccIn) -> + AccIn + end, [], Userlist) +end}. diff --git a/apps/emqx_auth_mnesia/rebar.config b/apps/emqx_auth_mnesia/rebar.config new file mode 100644 index 000000000..8ad5b9c60 --- /dev/null +++ b/apps/emqx_auth_mnesia/rebar.config @@ -0,0 +1,29 @@ +{minimum_otp_vsn, "21"}. + +{deps, + [{emqx_passwd, {git, "https://github.com/emqx/emqx-passwd.git", {tag, "v1.1.1"}}}, + {minirest, {git, "https://github.com/emqx/minirest.git", {tag, "0.3.2"}}} + ]}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "v1.2.2"}}} + ]} + ]} + ]}. + +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + {parse_transform}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions]}. +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + diff --git a/apps/emqx_auth_mnesia/rebar.config.script b/apps/emqx_auth_mnesia/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_mnesia/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_mnesia/src/emqx_acl_mnesia.erl b/apps/emqx_auth_mnesia/src/emqx_acl_mnesia.erl new file mode 100644 index 000000000..c657e54a0 --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_acl_mnesia.erl @@ -0,0 +1,103 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_mnesia). + +-include("emqx_auth_mnesia.hrl"). + +-include_lib("stdlib/include/ms_transform.hrl"). + +-define(TABLE, emqx_acl). + +%% ACL Callbacks +-export([ init/0 + , register_metrics/0 + , check_acl/5 + , description/0 + ]). + +init() -> + ok = ekka_mnesia:create_table(emqx_acl, [ + {disc_copies, [node()]}, + {attributes, record_info(fields, emqx_acl)}, + {storage_properties, [{ets, [{read_concurrency, true}]}]}]), + ok = ekka_mnesia:copy_table(emqx_acl, disc_copies). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +check_acl(ClientInfo = #{ clientid := Clientid }, PubSub, Topic, _NoMatchAction, _Params) -> + Username = maps:get(username, ClientInfo, undefined), + + Acls = case Username of + undefined -> + emqx_acl_mnesia_cli:lookup_acl({clientid, Clientid}) ++ + emqx_acl_mnesia_cli:lookup_acl(all); + _ -> + emqx_acl_mnesia_cli:lookup_acl({clientid, Clientid}) ++ + emqx_acl_mnesia_cli:lookup_acl({username, Username}) ++ + emqx_acl_mnesia_cli:lookup_acl(all) + end, + + case match(ClientInfo, PubSub, Topic, Acls) of + allow -> + emqx_metrics:inc(?ACL_METRICS(allow)), + {stop, allow}; + deny -> + emqx_metrics:inc(?ACL_METRICS(deny)), + {stop, deny}; + _ -> + emqx_metrics:inc(?ACL_METRICS(ignore)), + ok + end. + +description() -> "Acl with Mnesia". + +%%-------------------------------------------------------------------- +%% Internal functions +%%------------------------------------------------------------------- + +match(_ClientInfo, _PubSub, _Topic, []) -> + nomatch; +match(ClientInfo, PubSub, Topic, [ {_, ACLTopic, Action, Access, _} | Acls]) -> + case match_actions(PubSub, Action) andalso match_topic(ClientInfo, Topic, ACLTopic) of + true -> Access; + false -> match(ClientInfo, PubSub, Topic, Acls) + end. + +match_topic(ClientInfo, Topic, ACLTopic) when is_binary(Topic) -> + emqx_topic:match(Topic, feed_var(ClientInfo, ACLTopic)). + +match_actions(_, pubsub) -> true; +match_actions(subscribe, sub) -> true; +match_actions(publish, pub) -> true; +match_actions(_, _) -> false. + +feed_var(ClientInfo, Pattern) -> + feed_var(ClientInfo, emqx_topic:words(Pattern), []). +feed_var(_ClientInfo, [], Acc) -> + emqx_topic:join(lists:reverse(Acc)); +feed_var(ClientInfo = #{clientid := undefined}, [<<"%c">>|Words], Acc) -> + feed_var(ClientInfo, Words, [<<"%c">>|Acc]); +feed_var(ClientInfo = #{clientid := ClientId}, [<<"%c">>|Words], Acc) -> + feed_var(ClientInfo, Words, [ClientId |Acc]); +feed_var(ClientInfo = #{username := undefined}, [<<"%u">>|Words], Acc) -> + feed_var(ClientInfo, Words, [<<"%u">>|Acc]); +feed_var(ClientInfo = #{username := Username}, [<<"%u">>|Words], Acc) -> + feed_var(ClientInfo, Words, [Username|Acc]); +feed_var(ClientInfo, [W|Words], Acc) -> + feed_var(ClientInfo, Words, [W|Acc]). diff --git a/apps/emqx_auth_mnesia/src/emqx_acl_mnesia_api.erl b/apps/emqx_auth_mnesia/src/emqx_acl_mnesia_api.erl new file mode 100644 index 000000000..8f858dfa6 --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_acl_mnesia_api.erl @@ -0,0 +1,237 @@ +%c%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_mnesia_api). + +-include("emqx_auth_mnesia.hrl"). + +-include_lib("stdlib/include/ms_transform.hrl"). + +-import(proplists, [ get_value/2 + , get_value/3 + ]). + +-import(minirest, [return/1]). + +-rest_api(#{name => list_clientid, + method => 'GET', + path => "/acl/clientid", + func => list_clientid, + descr => "List available mnesia in the cluster" + }). + +-rest_api(#{name => list_username, + method => 'GET', + path => "/acl/username", + func => list_username, + descr => "List available mnesia in the cluster" + }). + +-rest_api(#{name => list_all, + method => 'GET', + path => "/acl/$all", + func => list_all, + descr => "List available mnesia in the cluster" + }). + +-rest_api(#{name => lookup_clientid, + method => 'GET', + path => "/acl/clientid/:bin:clientid", + func => lookup, + descr => "Lookup mnesia in the cluster" + }). + +-rest_api(#{name => lookup_username, + method => 'GET', + path => "/acl/username/:bin:username", + func => lookup, + descr => "Lookup mnesia in the cluster" + }). + +-rest_api(#{name => add, + method => 'POST', + path => "/acl", + func => add, + descr => "Add mnesia in the cluster" + }). + +-rest_api(#{name => delete_clientid, + method => 'DELETE', + path => "/acl/clientid/:bin:clientid/topic/:bin:topic", + func => delete, + descr => "Delete mnesia in the cluster" + }). + +-rest_api(#{name => delete_username, + method => 'DELETE', + path => "/acl/username/:bin:username/topic/:bin:topic", + func => delete, + descr => "Delete mnesia in the cluster" + }). + +-rest_api(#{name => delete_all, + method => 'DELETE', + path => "/acl/$all/topic/:bin:topic", + func => delete, + descr => "Delete mnesia in the cluster" + }). + + +-export([ list_clientid/2 + , list_username/2 + , list_all/2 + , lookup/2 + , add/2 + , delete/2 + ]). + +list_clientid(_Bindings, Params) -> + MatchSpec = ets:fun2ms( + fun({emqx_acl, {{clientid, Clientid}, Topic}, Action, Access, CreatedAt}) -> {{clientid,Clientid}, Topic, Action,Access, CreatedAt} end), + return({ok, emqx_auth_mnesia_api:paginate(emqx_acl, MatchSpec, Params, fun emqx_acl_mnesia_cli:comparing/2, fun format/1)}). + +list_username(_Bindings, Params) -> + MatchSpec = ets:fun2ms( + fun({emqx_acl, {{username, Username}, Topic}, Action, Access, CreatedAt}) -> {{username, Username}, Topic, Action,Access, CreatedAt} end), + return({ok, emqx_auth_mnesia_api:paginate(emqx_acl, MatchSpec, Params, fun emqx_acl_mnesia_cli:comparing/2, fun format/1)}). + +list_all(_Bindings, Params) -> + MatchSpec = ets:fun2ms( + fun({emqx_acl, {all, Topic}, Action, Access, CreatedAt}) -> {all, Topic, Action,Access, CreatedAt}end + ), + return({ok, emqx_auth_mnesia_api:paginate(emqx_acl, MatchSpec, Params, fun emqx_acl_mnesia_cli:comparing/2, fun format/1)}). + + +lookup(#{clientid := Clientid}, _Params) -> + return({ok, format(emqx_acl_mnesia_cli:lookup_acl({clientid, urldecode(Clientid)}))}); +lookup(#{username := Username}, _Params) -> + return({ok, format(emqx_acl_mnesia_cli:lookup_acl({username, urldecode(Username)}))}). + +add(_Bindings, Params) -> + [ P | _] = Params, + case is_list(P) of + true -> return(do_add(Params, [])); + false -> + Re = do_add(Params), + case Re of + #{result := ok} -> return({ok, Re}); + #{result := <<"ok">>} -> return({ok, Re}); + _ -> return({error, Re}) + end + end. + +do_add([ Params | ParamsN ], ReList) -> + do_add(ParamsN, [do_add(Params) | ReList]); + +do_add([], ReList) -> + {ok, ReList}. + +do_add(Params) -> + Clientid = get_value(<<"clientid">>, Params, undefined), + Username = get_value(<<"username">>, Params, undefined), + Login = case {Clientid, Username} of + {undefined, undefined} -> all; + {_, undefined} -> {clientid, urldecode(Clientid)}; + {undefined, _} -> {username, urldecode(Username)} + end, + Topic = urldecode(get_value(<<"topic">>, Params)), + Action = urldecode(get_value(<<"action">>, Params)), + Access = urldecode(get_value(<<"access">>, Params)), + Re = case validate([login, topic, action, access], [Login, Topic, Action, Access]) of + ok -> + emqx_acl_mnesia_cli:add_acl(Login, Topic, erlang:binary_to_atom(Action, utf8), erlang:binary_to_atom(Access, utf8)); + Err -> Err + end, + maps:merge(#{topic => Topic, + action => Action, + access => Access, + result => format_msg(Re) + }, case Login of + all -> #{all => '$all'}; + _ -> maps:from_list([Login]) + end). + +delete(#{clientid := Clientid, topic := Topic}, _) -> + return(emqx_acl_mnesia_cli:remove_acl({clientid, urldecode(Clientid)}, urldecode(Topic))); +delete(#{username := Username, topic := Topic}, _) -> + return(emqx_acl_mnesia_cli:remove_acl({username, urldecode(Username)}, urldecode(Topic))); +delete(#{topic := Topic}, _) -> + return(emqx_acl_mnesia_cli:remove_acl(all, urldecode(Topic))). + +%%------------------------------------------------------------------------------ +%% Interval Funcs +%%------------------------------------------------------------------------------ +format({{clientid, Clientid}, Topic, Action, Access, _CreatedAt}) -> + #{clientid => Clientid, topic => Topic, action => Action, access => Access}; +format({{username, Username}, Topic, Action, Access, _CreatedAt}) -> + #{username => Username, topic => Topic, action => Action, access => Access}; +format({all, Topic, Action, Access, _CreatedAt}) -> + #{all => '$all', topic => Topic, action => Action, access => Access}; +format(List) when is_list(List) -> + format(List, []). + +format([L | List], Relist) -> + format(List, [format(L) | Relist]); +format([], ReList) -> lists:reverse(ReList). + +validate([], []) -> + ok; +validate([K|Keys], [V|Values]) -> + case do_validation(K, V) of + false -> {error, K}; + true -> validate(Keys, Values) + end. +do_validation(login, all) -> + true; +do_validation(login, {clientid, V}) when is_binary(V) + andalso byte_size(V) > 0-> + true; +do_validation(login, {username, V}) when is_binary(V) + andalso byte_size(V) > 0-> + true; +do_validation(clientid, V) when is_binary(V) + andalso byte_size(V) > 0 -> + true; +do_validation(username, V) when is_binary(V) + andalso byte_size(V) > 0 -> + true; +do_validation(topic, V) when is_binary(V) + andalso byte_size(V) > 0 -> + true; +do_validation(action, V) when is_binary(V) -> + case V =:= <<"pub">> orelse V =:= <<"sub">> orelse V =:= <<"pubsub">> of + true -> true; + false -> false + end; +do_validation(access, V) when V =:= <<"allow">> orelse V =:= <<"deny">> -> + true; +do_validation(_, _) -> + false. + +format_msg(Message) + when is_atom(Message); + is_binary(Message) -> Message; + +format_msg(Message) when is_tuple(Message) -> + iolist_to_binary(io_lib:format("~p", [Message])). + +-if(?OTP_RELEASE >= 23). +urldecode(S) -> + [{R, _}] = uri_string:dissect_query(S), R. +-else. +urldecode(S) -> + http_uri:decode(S). +-endif. diff --git a/apps/emqx_auth_mnesia/src/emqx_acl_mnesia_cli.erl b/apps/emqx_auth_mnesia/src/emqx_acl_mnesia_cli.erl new file mode 100644 index 000000000..10fb4e87b --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_acl_mnesia_cli.erl @@ -0,0 +1,198 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_mnesia_cli). + +-include("emqx_auth_mnesia.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("stdlib/include/ms_transform.hrl"). +-define(TABLE, emqx_acl). + +%% Acl APIs +-export([ add_acl/4 + , lookup_acl/1 + , all_acls/0 + , all_acls/1 + , remove_acl/2 + ]). + +-export([cli/1]). +-export([comparing/2]). +%%-------------------------------------------------------------------- +%% Acl API +%%-------------------------------------------------------------------- + +%% @doc Add Acls +-spec(add_acl(login() |all, emqx_topic:topic(), pub | sub| pubsub, allow | deny) -> ok | {error, any()}). +add_acl(Login, Topic, Action, Access) -> + Acls = #?TABLE{ + filter = {Login, Topic}, + action = Action, + access = Access, + created_at = erlang:system_time(millisecond) + }, + ret(mnesia:transaction(fun mnesia:write/1, [Acls])). + +%% @doc Lookup acl by login +-spec(lookup_acl(login() | all) -> list()). +lookup_acl(undefined) -> []; +lookup_acl(Login) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {Filter, ACLTopic}, Action, Access, CreatedAt}) + when Filter =:= Login -> {Filter, ACLTopic, Action, Access, CreatedAt} end), + lists:sort(fun comparing/2, ets:select(?TABLE, MatchSpec)). + +%% @doc Remove acl +-spec(remove_acl(login() | all, emqx_topic:topic()) -> ok | {error, any()}). +remove_acl(Login, Topic) -> + ret(mnesia:transaction(fun mnesia:delete/1, [{?TABLE, {Login, Topic}}])). + +%% @doc All logins +-spec(all_acls() -> list()). +all_acls() -> + all_acls(clientid) ++ + all_acls(username) ++ + all_acls(all). + +all_acls(clientid) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {{clientid, Clientid}, Topic}, Action, Access, CreatedAt}) -> {{clientid, Clientid}, Topic, Action, Access, CreatedAt} end), + lists:sort(fun comparing/2, ets:select(?TABLE, MatchSpec)); +all_acls(username) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {{username, Username}, Topic}, Action, Access, CreatedAt}) -> {{username, Username}, Topic, Action, Access, CreatedAt} end), + lists:sort(fun comparing/2, ets:select(?TABLE, MatchSpec)); +all_acls(all) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {all, Topic}, Action, Access, CreatedAt}) -> {all, Topic, Action, Access, CreatedAt} end), + lists:sort(fun comparing/2, ets:select(?TABLE, MatchSpec)). + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +comparing({_, _, _, _, CreatedAt1}, + {_, _, _, _, CreatedAt2}) -> + CreatedAt1 >= CreatedAt2. + +ret({atomic, ok}) -> ok; +ret({aborted, Error}) -> {error, Error}. + +validate(action, "pub") -> true; +validate(action, "sub") -> true; +validate(action, "pubsub") -> true; +validate(access, "allow") -> true; +validate(access, "deny") -> true; +validate(_, _) -> false. + +%%-------------------------------------------------------------------- +%% ACL Cli +%%-------------------------------------------------------------------- + +cli(["list"]) -> + [ begin + case Filter of + {clientid, Clientid} -> + emqx_ctl:print("Acl(clientid = ~p topic = ~p action = ~p access = ~p)~n",[Clientid, Topic, Action, Access]); + {username, Username} -> + emqx_ctl:print("Acl(username = ~p topic = ~p action = ~p access = ~p)~n",[Username, Topic, Action, Access]); + all -> + emqx_ctl:print("Acl($all topic = ~p action = ~p access = ~p)~n",[Topic, Action, Access]) + end + end || {Filter, Topic, Action, Access, _} <- all_acls()]; + +cli(["list", "clientid"]) -> + [emqx_ctl:print("Acl(clientid = ~p topic = ~p action = ~p access = ~p)~n",[Clientid, Topic, Action, Access]) + || {{clientid, Clientid}, Topic, Action, Access, _} <- all_acls(clientid) ]; + +cli(["list", "username"]) -> + [emqx_ctl:print("Acl(username = ~p topic = ~p action = ~p access = ~p)~n",[Username, Topic, Action, Access]) + || {{username, Username}, Topic, Action, Access, _} <- all_acls(username) ]; + +cli(["list", "_all"]) -> + [emqx_ctl:print("Acl($all topic = ~p action = ~p access = ~p)~n",[Topic, Action, Access]) + || {all, Topic, Action, Access, _} <- all_acls(all) ]; + +cli(["add", "clientid", Clientid, Topic, Action, Access]) -> + case validate(action, Action) andalso validate(access, Access) of + true -> + case add_acl({clientid, iolist_to_binary(Clientid)}, iolist_to_binary(Topic), list_to_existing_atom(Action), list_to_existing_atom(Access)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + _ -> + emqx_ctl:print("Error: Input is illegal~n") + end; + +cli(["add", "username", Username, Topic, Action, Access]) -> + case validate(action, Action) andalso validate(access, Access) of + true -> + case add_acl({username, iolist_to_binary(Username)}, iolist_to_binary(Topic), list_to_existing_atom(Action), list_to_existing_atom(Access)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + _ -> + emqx_ctl:print("Error: Input is illegal~n") + end; + +cli(["add", "_all", Topic, Action, Access]) -> + case validate(action, Action) andalso validate(access, Access) of + true -> + case add_acl(all, iolist_to_binary(Topic), list_to_existing_atom(Action), list_to_existing_atom(Access)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + _ -> + emqx_ctl:print("Error: Input is illegal~n") + end; + +cli(["show", "clientid", Clientid]) -> + [emqx_ctl:print("Acl(clientid = ~p topic = ~p action = ~p access = ~p)~n",[NClientid, Topic, Action, Access]) + || {{clientid, NClientid}, Topic, Action, Access, _} <- lookup_acl({clientid, iolist_to_binary(Clientid)}) ]; + +cli(["show", "username", Username]) -> + [emqx_ctl:print("Acl(username = ~p topic = ~p action = ~p access = ~p)~n",[NUsername, Topic, Action, Access]) + || {{username, NUsername}, Topic, Action, Access, _} <- lookup_acl({username, iolist_to_binary(Username)}) ]; + +cli(["del", "clientid", Clientid, Topic])-> + case remove_acl({clientid, iolist_to_binary(Clientid)}, iolist_to_binary(Topic)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +cli(["del", "username", Username, Topic])-> + case remove_acl({username, iolist_to_binary(Username)}, iolist_to_binary(Topic)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +cli(["del", "_all", Topic])-> + case remove_acl(all, iolist_to_binary(Topic)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +cli(_) -> + emqx_ctl:usage([ {"acl list clientid","List clientid acls"} + , {"acl list username","List username acls"} + , {"acl list _all","List $all acls"} + , {"acl show clientid ", "Lookup clientid acl detail"} + , {"acl show username ", "Lookup username acl detail"} + , {"acl aad clientid ", "Add clientid acl"} + , {"acl add Username ", "Add username acl"} + , {"acl add _all ", "Add $all acl"} + , {"acl del clientid ", "Delete clientid acl"} + , {"acl del username ", "Delete username acl"} + , {"acl del _all ", "Delete $all acl"} + ]). + + diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.app.src b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.app.src new file mode 100644 index 000000000..debd8259b --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_mnesia, + [{description, "EMQ X Authentication with Mnesia"}, + {vsn, "git"}, + {modules, []}, + {registered, []}, + {applications, [kernel,stdlib,mnesia]}, + {mod, {emqx_auth_mnesia_app,[]}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-mnesia"} + ]} + ]}. diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.app.src.script b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src new file mode 100644 index 000000000..34d68b11f --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src @@ -0,0 +1,39 @@ +%% -*-: erlang -*- +{VSN, + [ + {"4.2.2", [ + {load_module, emqx_auth_mnesia_app}, + {load_module, emqx_auth_mnesia_cli}, + {load_module, emqx_acl_mnesia_cli}, + {apply, {emqx_ctl, unregister_command, [username]}} + ]}, + {"4.2.1", [ + {load_module, emqx_auth_mnesia_app}, + {load_module, emqx_auth_mnesia_cli}, + {load_module, emqx_acl_mnesia_cli}, + {apply, {emqx_ctl, unregister_command, [username]}} + ]}, + {"4.2.0", [ + {restart_application, emqx_auth_mnesia} + ]}, + {<<".*">>, []} + ], + [ + {"4.2.2", [ + {load_module, emqx_auth_mnesia_app}, + {load_module, emqx_auth_mnesia_cli}, + {load_module, emqx_acl_mnesia_cli}, + {apply, {emqx_ctl, register_command, [username, {emqx_auth_mnesia_cli, auth_username_cli}, []]}} + ]}, + {"4.2.1", [ + {load_module, emqx_auth_mnesia_app}, + {load_module, emqx_auth_mnesia_cli}, + {load_module, emqx_acl_mnesia_cli}, + {apply, {emqx_ctl, register_command, [username, {emqx_auth_mnesia_cli, auth_username_cli}, []]}} + ]}, + {"4.2.0", [ + {restart_application, emqx_auth_mnesia} + ]}, + {<<".*">>, []} + ] +}. diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.erl b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.erl new file mode 100644 index 000000000..9cb468a8f --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.erl @@ -0,0 +1,109 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mnesia). + +-include("emqx_auth_mnesia.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/types.hrl"). + +-include_lib("stdlib/include/ms_transform.hrl"). + +-define(TABLE, emqx_user). +%% Auth callbacks +-export([ init/1 + , register_metrics/0 + , check/3 + , description/0 + ]). + +init(#{clientid_list := ClientidList, username_list := UsernameList}) -> + ok = ekka_mnesia:create_table(emqx_user, [ + {disc_copies, [node()]}, + {attributes, record_info(fields, emqx_user)}, + {storage_properties, [{ets, [{read_concurrency, true}]}]}]), + [ add_default_user({{clientid, iolist_to_binary(Clientid)}, iolist_to_binary(Password)}) + || {Clientid, Password} <- ClientidList], + [ add_default_user({{username, iolist_to_binary(Username)}, iolist_to_binary(Password)}) + || {Username, Password} <- UsernameList], + ok = ekka_mnesia:copy_table(emqx_user, disc_copies). + +%% @private +add_default_user({Login, Password}) when is_tuple(Login) -> + emqx_auth_mnesia_cli:add_user(Login, Password). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +check(ClientInfo = #{ clientid := Clientid + , password := NPassword + }, AuthResult, #{hash_type := HashType}) -> + Username = maps:get(username, ClientInfo, undefined), + MatchSpec = ets:fun2ms(fun({?TABLE, {clientid, X }, Password, InterTime}) when X =:= Clientid-> Password; + ({?TABLE, {username, X }, Password, InterTime}) when X =:= Username andalso X =/= undefined -> Password + end), + case ets:select(?TABLE, MatchSpec) of + [] -> + emqx_metrics:inc(?AUTH_METRICS(ignore)), + ok; + List -> + case match_password(NPassword, HashType, List) of + false -> + ?LOG(error, "[Mnesia] Auth from mnesia failed: ~p", [ClientInfo]), + emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{anonymous => false, auth_result => password_error}}; + _ -> + emqx_metrics:inc(?AUTH_METRICS(success)), + {stop, AuthResult#{anonymous => false, auth_result => success}} + end + end. + +description() -> "Authentication with Mnesia". + +match_password(Password, HashType, HashList) -> + lists:any( + fun(Secret) -> + case is_salt_hash(Secret, HashType) of + true -> + <> = Secret, + Hash =:= hash(Password, Salt, HashType); + _ -> + Secret =:= hash(Password, HashType) + end + end, HashList). + +hash(undefined, HashType) -> + hash(<<>>, HashType); +hash(Password, HashType) -> + emqx_passwd:hash(HashType, Password). + +hash(undefined, SaltBin, HashType) -> + hash(<<>>, SaltBin, HashType); +hash(Password, SaltBin, HashType) -> + emqx_passwd:hash(HashType, <>). + +is_salt_hash(_, plain) -> + true; +is_salt_hash(Secret, HashType) -> + not (byte_size(Secret) == len(HashType)). + +len(md5) -> 32; +len(sha) -> 40; +len(sha256) -> 64; +len(sha512) -> 128. diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl new file mode 100644 index 000000000..ee52fcf36 --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl @@ -0,0 +1,319 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mnesia_api). + +-include_lib("stdlib/include/qlc.hrl"). +-include_lib("stdlib/include/ms_transform.hrl"). + +-define(TABLE, emqx_user). + +-import(proplists, [get_value/2]). +-import(minirest, [return/1]). +-export([paginate/5]). + +-export([ list_clientid/2 + , lookup_clientid/2 + , add_clientid/2 + , update_clientid/2 + , delete_clientid/2 + ]). + +-rest_api(#{name => list_clientid, + method => 'GET', + path => "/auth_clientid", + func => list_clientid, + descr => "List available clientid in the cluster" + }). + +-rest_api(#{name => lookup_clientid, + method => 'GET', + path => "/auth_clientid/:bin:clientid", + func => lookup_clientid, + descr => "Lookup clientid in the cluster" + }). + +-rest_api(#{name => add_clientid, + method => 'POST', + path => "/auth_clientid", + func => add_clientid, + descr => "Add clientid in the cluster" + }). + +-rest_api(#{name => update_clientid, + method => 'PUT', + path => "/auth_clientid/:bin:clientid", + func => update_clientid, + descr => "Update clientid in the cluster" + }). + +-rest_api(#{name => delete_clientid, + method => 'DELETE', + path => "/auth_clientid/:bin:clientid", + func => delete_clientid, + descr => "Delete clientid in the cluster" + }). + +-export([ list_username/2 + , lookup_username/2 + , add_username/2 + , update_username/2 + , delete_username/2 + ]). + +-rest_api(#{name => list_username, + method => 'GET', + path => "/auth_username", + func => list_username, + descr => "List available username in the cluster" + }). + +-rest_api(#{name => lookup_username, + method => 'GET', + path => "/auth_username/:bin:username", + func => lookup_username, + descr => "Lookup username in the cluster" + }). + +-rest_api(#{name => add_username, + method => 'POST', + path => "/auth_username", + func => add_username, + descr => "Add username in the cluster" + }). + +-rest_api(#{name => update_username, + method => 'PUT', + path => "/auth_username/:bin:username", + func => update_username, + descr => "Update username in the cluster" + }). + +-rest_api(#{name => delete_username, + method => 'DELETE', + path => "/auth_username/:bin:username", + func => delete_username, + descr => "Delete username in the cluster" + }). + +%%------------------------------------------------------------------------------ +%% Auth Clientid Api +%%------------------------------------------------------------------------------ + +list_clientid(_Bindings, Params) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {clientid, Clientid}, Password, CreatedAt}) -> {?TABLE, {clientid, Clientid}, Password, CreatedAt} end), + return({ok, paginate(?TABLE, MatchSpec, Params, fun emqx_auth_mnesia_cli:comparing/2, fun({?TABLE, {clientid, X}, _, _}) -> #{clientid => X} end)}). + +lookup_clientid(#{clientid := Clientid}, _Params) -> + return({ok, format(emqx_auth_mnesia_cli:lookup_user({clientid, urldecode(Clientid)}))}). + +add_clientid(_Bindings, Params) -> + [ P | _] = Params, + case is_list(P) of + true -> return(do_add_clientid(Params, [])); + false -> + Re = do_add_clientid(Params), + case Re of + ok -> return(ok); + <<"ok">> -> return(ok); + _ -> return({error, format_msg(Re)}) + end + end. + +do_add_clientid([ Params | ParamsN ], ReList ) -> + Clientid = urldecode(get_value(<<"clientid">>, Params)), + do_add_clientid(ParamsN, [{Clientid, format_msg(do_add_clientid(Params))} | ReList]); + +do_add_clientid([], ReList) -> + {ok, ReList}. + +do_add_clientid(Params) -> + Clientid = urldecode(get_value(<<"clientid">>, Params)), + Password = urldecode(get_value(<<"password">>, Params)), + Login = {clientid, Clientid}, + case validate([login, password], [Login, Password]) of + ok -> + emqx_auth_mnesia_cli:add_user(Login, Password); + Err -> Err + end. + +update_clientid(#{clientid := Clientid}, Params) -> + Password = get_value(<<"password">>, Params), + case validate([password], [Password]) of + ok -> return(emqx_auth_mnesia_cli:update_user({clientid, urldecode(Clientid)}, urldecode(Password))); + Err -> return(Err) + end. + +delete_clientid(#{clientid := Clientid}, _) -> + return(emqx_auth_mnesia_cli:remove_user({clientid, urldecode(Clientid)})). + +%%------------------------------------------------------------------------------ +%% Auth Username Api +%%------------------------------------------------------------------------------ + +list_username(_Bindings, Params) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {username, Username}, Password, CreatedAt}) -> {?TABLE, {username, Username}, Password, CreatedAt} end), + return({ok, paginate(?TABLE, MatchSpec, Params, fun emqx_auth_mnesia_cli:comparing/2, fun({?TABLE, {username, X}, _, _}) -> #{username => X} end)}). + +lookup_username(#{username := Username}, _Params) -> + return({ok, format(emqx_auth_mnesia_cli:lookup_user({username, urldecode(Username)}))}). + +add_username(_Bindings, Params) -> + [ P | _] = Params, + case is_list(P) of + true -> return(do_add_username(Params, [])); + false -> + case do_add_username(Params) of + ok -> return(ok); + <<"ok">> -> return(ok); + Error -> return({error, format_msg(Error)}) + end + end. + +do_add_username([ Params | ParamsN ], ReList ) -> + Username = urldecode(get_value(<<"username">>, Params)), + do_add_username(ParamsN, [{Username, format_msg(do_add_username(Params))} | ReList]); + +do_add_username([], ReList) -> + {ok, ReList}. + +do_add_username(Params) -> + Username = urldecode(get_value(<<"username">>, Params)), + Password = urldecode(get_value(<<"password">>, Params)), + Login = {username, Username}, + case validate([login, password], [Login, Password]) of + ok -> + emqx_auth_mnesia_cli:add_user(Login, Password); + Err -> Err + end. + +update_username(#{username := Username}, Params) -> + Password = get_value(<<"password">>, Params), + case validate([password], [Password]) of + ok -> return(emqx_auth_mnesia_cli:update_user({username, urldecode(Username)}, urldecode(Password))); + Err -> return(Err) + end. + +delete_username(#{username := Username}, _) -> + return(emqx_auth_mnesia_cli:remove_user({username, urldecode(Username)})). + +%%------------------------------------------------------------------------------ +%% Paging Query +%%------------------------------------------------------------------------------ + +paginate(Tables, MatchSpec, Params, ComparingFun, RowFun) -> + Qh = query_handle(Tables, MatchSpec), + Count = count(Tables, MatchSpec), + Page = page(Params), + Limit = limit(Params), + Cursor = qlc:cursor(Qh), + case Page > 1 of + true -> qlc:next_answers(Cursor, (Page - 1) * Limit); + false -> ok + end, + Rows = qlc:next_answers(Cursor, Limit), + qlc:delete_cursor(Cursor), + #{meta => #{page => Page, limit => Limit, count => Count}, + data => [RowFun(Row) || Row <- lists:sort(ComparingFun, Rows)]}. + +query_handle(Table, MatchSpec) when is_atom(Table) -> + Options = {traverse, {select, MatchSpec}}, + qlc:q([R|| R <- ets:table(Table, Options)]); +query_handle([Table], MatchSpec) when is_atom(Table) -> + Options = {traverse, {select, MatchSpec}}, + qlc:q([R|| R <- ets:table(Table, Options)]); +query_handle(Tables, MatchSpec) -> + Options = {traverse, {select, MatchSpec}}, + qlc:append([qlc:q([E || E <- ets:table(T, Options)]) || T <- Tables]). + +count(Table, MatchSpec) when is_atom(Table) -> + [{MatchPattern, Where, _Re}] = MatchSpec, + NMatchSpec = [{MatchPattern, Where, [true]}], + ets:select_count(Table, NMatchSpec); +count([Table], MatchSpec) when is_atom(Table) -> + [{MatchPattern, Where, _Re}] = MatchSpec, + NMatchSpec = [{MatchPattern, Where, [true]}], + ets:select_count(Table, NMatchSpec); +count(Tables, MatchSpec) -> + lists:sum([count(T, MatchSpec) || T <- Tables]). + +page(Params) -> + binary_to_integer(proplists:get_value(<<"_page">>, Params, <<"1">>)). + +limit(Params) -> + case proplists:get_value(<<"_limit">>, Params) of + undefined -> 10; + Size -> binary_to_integer(Size) + end. + +%%------------------------------------------------------------------------------ +%% Interval Funcs +%%------------------------------------------------------------------------------ + +format({?TABLE, {clientid, ClientId}, Password, _InterTime}) -> + #{clientid => ClientId, + password => Password}; + +format({?TABLE, {username, Username}, Password, _InterTime}) -> + #{username => Username, + password => Password}; + +format([{?TABLE, {clientid, ClientId}, Password, _InterTime}]) -> + #{clientid => ClientId, + password => Password}; + +format([{?TABLE, {username, Username}, Password, _InterTime}]) -> + #{username => Username, + password => Password}; + +format([]) -> + #{}. + +validate([], []) -> + ok; +validate([K|Keys], [V|Values]) -> + case do_validation(K, V) of + false -> {error, K}; + true -> validate(Keys, Values) + end. + +do_validation(login, {clientid, V}) when is_binary(V) + andalso byte_size(V) > 0 -> + true; +do_validation(login, {username, V}) when is_binary(V) + andalso byte_size(V) > 0 -> + true; +do_validation(password, V) when is_binary(V) + andalso byte_size(V) > 0 -> + true; +do_validation(_, _) -> + false. + +format_msg(Message) + when is_atom(Message); + is_binary(Message) -> Message; + +format_msg(Message) when is_tuple(Message) -> + iolist_to_binary(io_lib:format("~p", [Message])). + +-if(?OTP_RELEASE >= 23). +urldecode(S) -> + [{R, _}] = uri_string:dissect_query(S), R. +-else. +urldecode(S) -> + http_uri:decode(S). +-endif. + diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_app.erl b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_app.erl new file mode 100644 index 000000000..e55e45ed4 --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_app.erl @@ -0,0 +1,68 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mnesia_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_mnesia.hrl"). + +%% Application callbacks +-export([ start/2 + , prep_stop/1 + , stop/1 + ]). + +%%-------------------------------------------------------------------- +%% Application callbacks +%%-------------------------------------------------------------------- + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqx_auth_mnesia_sup:start_link(), + emqx_ctl:register_command(clientid, {emqx_auth_mnesia_cli, auth_clientid_cli}, []), + emqx_ctl:register_command(user, {emqx_auth_mnesia_cli, auth_username_cli}, []), + emqx_ctl:register_command(acl, {emqx_acl_mnesia_cli, cli}, []), + load_auth_hook(), + load_acl_hook(), + {ok, Sup}. + +prep_stop(State) -> + emqx:unhook('client.authenticate', fun emqx_auth_mnesia:check/3), + emqx:unhook('client.check_acl', fun emqx_acl_mnesia:check_acl/5), + emqx_ctl:unregister_command(clientid), + emqx_ctl:unregister_command(user), + emqx_ctl:unregister_command(acl), + State. + +stop(_State) -> + ok. + +load_auth_hook() -> + ClientidList = application:get_env(?APP, clientid_list, []), + UsernameList = application:get_env(?APP, username_list, []), + ok = emqx_auth_mnesia:init(#{clientid_list => ClientidList, username_list => UsernameList}), + ok = emqx_auth_mnesia:register_metrics(), + Params = #{ + hash_type => application:get_env(emqx_auth_mnesia, hash_type, sha256) + }, + emqx:hook('client.authenticate', fun emqx_auth_mnesia:check/3, [Params]). + +load_acl_hook() -> + ok = emqx_acl_mnesia:init(), + ok = emqx_acl_mnesia:register_metrics(), + emqx:hook('client.check_acl', fun emqx_acl_mnesia:check_acl/5, [#{}]). diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_cli.erl b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_cli.erl new file mode 100644 index 000000000..7c0181e47 --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_cli.erl @@ -0,0 +1,181 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mnesia_cli). + +-include("emqx_auth_mnesia.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("stdlib/include/ms_transform.hrl"). +-define(TABLE, emqx_user). +%% Auth APIs +-export([ add_user/2 + , update_user/2 + , remove_user/1 + , lookup_user/1 + , all_users/0 + , all_users/1 + ]). +%% Cli +-export([ auth_clientid_cli/1 + , auth_username_cli/1 + ]). + +%% Helper +-export([comparing/2]). + +%%-------------------------------------------------------------------- +%% Auth APIs +%%-------------------------------------------------------------------- + +%% @doc Add User +-spec(add_user(tuple(), binary()) -> ok | {error, any()}). +add_user(Login, Password) -> + User = #emqx_user{login = Login, password = encrypted_data(Password), created_at = erlang:system_time(millisecond)}, + ret(mnesia:transaction(fun insert_user/1, [User])). + +insert_user(User = #emqx_user{login = Login}) -> + case mnesia:read(?TABLE, Login) of + [] -> mnesia:write(User); + [_|_] -> mnesia:abort(existed) + end. + +%% @doc Update User +-spec(update_user(tuple(), binary()) -> ok | {error, any()}). +update_user(Login, NewPassword) -> + User = #emqx_user{login = Login, password = encrypted_data(NewPassword)}, + ret(mnesia:transaction(fun do_update_user/1, [User])). + +do_update_user(User = #emqx_user{login = Login}) -> + case mnesia:read(?TABLE, Login) of + [{?TABLE, Login, _, CreateAt}] -> mnesia:write(User#emqx_user{created_at = CreateAt}); + [] -> mnesia:abort(noexisted) + end. + +%% @doc Lookup user by login +-spec(lookup_user(tuple()) -> list()). +lookup_user(undefined) -> []; +lookup_user(Login) -> + case mnesia:dirty_read(?TABLE, Login) of + {error, Reason} -> + ?LOG(error, "[Mnesia] do_check_user error: ~p~n", [Reason]), + []; + Re -> + lists:sort(fun comparing/2, Re) + end. + +%% @doc Remove user +-spec(remove_user(tuple()) -> ok | {error, any()}). +remove_user(Login) -> + ret(mnesia:transaction(fun mnesia:delete/1, [{?TABLE, Login}])). + +%% @doc All logins +-spec(all_users() -> list()). +all_users() -> mnesia:dirty_all_keys(?TABLE). + +all_users(clientid) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {clientid, Clientid}, Password, CreatedAt}) -> {?TABLE, {clientid, Clientid}, Password, CreatedAt} end), + lists:sort(fun comparing/2, ets:select(?TABLE, MatchSpec)); + +all_users(username) -> + MatchSpec = ets:fun2ms(fun({?TABLE, {username, Username}, Password, CreatedAt}) -> {?TABLE, {username, Username}, Password, CreatedAt} end), + lists:sort(fun comparing/2, ets:select(?TABLE, MatchSpec)). + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +comparing({?TABLE, _, _, CreatedAt1}, + {?TABLE, _, _, CreatedAt2}) -> + CreatedAt1 >= CreatedAt2. + +ret({atomic, ok}) -> ok; +ret({aborted, Error}) -> {error, Error}. + +encrypted_data(Password) -> + HashType = application:get_env(emqx_auth_mnesia, password_hash, sha256), + SaltBin = salt(), + <>. + +hash(undefined, SaltBin, HashType) -> + hash(<<>>, SaltBin, HashType); +hash(Password, SaltBin, HashType) -> + emqx_passwd:hash(HashType, <>). + +salt() -> + rand:seed(exsplus, erlang:timestamp()), + Salt = rand:uniform(16#ffffffff), <>. + +%%-------------------------------------------------------------------- +%% Auth Clientid Cli +%%-------------------------------------------------------------------- + +auth_clientid_cli(["list"]) -> + [emqx_ctl:print("~s~n", [ClientId]) || {?TABLE, {clientid, ClientId}, _Password, _CreatedAt} <- all_users(clientid)]; + +auth_clientid_cli(["add", ClientId, Password]) -> + case add_user({clientid, iolist_to_binary(ClientId)}, iolist_to_binary(Password)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +auth_clientid_cli(["update", ClientId, NewPassword]) -> + case update_user({clientid, iolist_to_binary(ClientId)}, iolist_to_binary(NewPassword)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +auth_clientid_cli(["del", ClientId]) -> + case remove_user({clientid, iolist_to_binary(ClientId)}) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +auth_clientid_cli(_) -> + emqx_ctl:usage([{"clientid list", "List clientid auth rules"}, + {"clientid add ", "Add clientid auth rule"}, + {"clientid update ", "Update clientid auth rule"}, + {"clientid del ", "Delete clientid auth rule"}]). + +%%-------------------------------------------------------------------- +%% Auth Username Cli +%%-------------------------------------------------------------------- + +auth_username_cli(["list"]) -> + [emqx_ctl:print("~s~n", [Username]) || {?TABLE, {username, Username}, _Password, _CreatedAt}<- all_users(username)]; + +auth_username_cli(["add", Username, Password]) -> + case add_user({username, iolist_to_binary(Username)}, iolist_to_binary(Password)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +auth_username_cli(["update", Username, NewPassword]) -> + case update_user({username, iolist_to_binary(Username)}, iolist_to_binary(NewPassword)) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +auth_username_cli(["del", Username]) -> + case remove_user({username, iolist_to_binary(Username)}) of + ok -> emqx_ctl:print("ok~n"); + {error, Reason} -> emqx_ctl:print("Error: ~p~n", [Reason]) + end; + +auth_username_cli(_) -> + emqx_ctl:usage([{"user list", "List username auth rules"}, + {"user add ", "Add username auth rule"}, + {"user update ", "Update username auth rule"}, + {"user del ", "Delete username auth rule"}]). diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_sup.erl b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_sup.erl new file mode 100644 index 000000000..ed32b31e7 --- /dev/null +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_sup.erl @@ -0,0 +1,36 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mnesia_sup). + +-behaviour(supervisor). + +-include("emqx_auth_mnesia.hrl"). + +-export([start_link/0]). + +%% Supervisor callbacks +-export([init/1]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +%%-------------------------------------------------------------------- +%% Supervisor callbacks +%%-------------------------------------------------------------------- + +init([]) -> + {ok, {{one_for_one, 10, 100}, []}}. \ No newline at end of file diff --git a/apps/emqx_auth_mnesia/test/emqx_acl_mnesia_SUITE.erl b/apps/emqx_auth_mnesia/test/emqx_acl_mnesia_SUITE.erl new file mode 100644 index 000000000..61356dd24 --- /dev/null +++ b/apps/emqx_auth_mnesia/test/emqx_acl_mnesia_SUITE.erl @@ -0,0 +1,215 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_mnesia_SUITE). + +-compile(export_all). + +-include("emqx_auth_mnesia.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). + +-import(emqx_ct_http, [ request_api/3 + , request_api/5 + , get_http_data/1 + , create_default_app/0 + , default_auth_header/0 + ]). + +-define(HOST, "http://127.0.0.1:8081/"). +-define(API_VERSION, "v4"). +-define(BASE_PATH, "api"). + +all() -> + emqx_ct:all(?MODULE). + +groups() -> + []. + +init_per_suite(Config) -> + emqx_ct_helpers:start_apps([emqx_management, emqx_auth_mnesia], fun set_special_configs/1), + create_default_app(), + Config. + +end_per_suite(_Config) -> + emqx_ct_helpers:stop_apps([emqx_management, emqx_auth_mnesia]). + +init_per_testcase(t_check_acl_as_clientid, Config) -> + emqx:hook('client.check_acl', fun emqx_acl_mnesia:check_acl/5, [#{key_as => clientid}]), + Config; + +init_per_testcase(_, Config) -> + emqx:hook('client.check_acl', fun emqx_acl_mnesia:check_acl/5, [#{key_as => username}]), + Config. + +end_per_testcase(_, Config) -> + emqx:unhook('client.check_acl', fun emqx_acl_mnesia:check_acl/5), + Config. + +set_special_configs(emqx) -> + application:set_env(emqx, allow_anonymous, true), + application:set_env(emqx, enable_acl_cache, false), + LoadedPluginPath = filename:join(["test", "emqx_SUITE_data", "loaded_plugins"]), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, LoadedPluginPath)); + +set_special_configs(_App) -> + ok. + +%%------------------------------------------------------------------------------ +%% Testcases +%%------------------------------------------------------------------------------ + +t_management(_Config) -> + clean_all_acls(), + ?assertEqual("Acl with Mnesia", emqx_acl_mnesia:description()), + ?assertEqual([], emqx_acl_mnesia_cli:all_acls()), + + ok = emqx_acl_mnesia_cli:add_acl({clientid, <<"test_clientid">>}, <<"topic/%c">>, sub, allow), + ok = emqx_acl_mnesia_cli:add_acl({clientid, <<"test_clientid">>}, <<"topic/+">>, pub, deny), + ok = emqx_acl_mnesia_cli:add_acl({username, <<"test_username">>}, <<"topic/%u">>, sub, deny), + ok = emqx_acl_mnesia_cli:add_acl({username, <<"test_username">>}, <<"topic/+">>, pub, allow), + ok = emqx_acl_mnesia_cli:add_acl(all, <<"#">>, pubsub, deny), + + ?assertEqual(2, length(emqx_acl_mnesia_cli:lookup_acl({clientid, <<"test_clientid">>}))), + ?assertEqual(2, length(emqx_acl_mnesia_cli:lookup_acl({username, <<"test_username">>}))), + ?assertEqual(1, length(emqx_acl_mnesia_cli:lookup_acl(all))), + ?assertEqual(5, length(emqx_acl_mnesia_cli:all_acls())), + + User1 = #{zone => external, clientid => <<"test_clientid">>}, + User2 = #{zone => external, clientid => <<"no_exist">>, username => <<"test_username">>}, + User3 = #{zone => external, clientid => <<"test_clientid">>, username => <<"test_username">>}, + allow = emqx_access_control:check_acl(User1, subscribe, <<"topic/test_clientid">>), + deny = emqx_access_control:check_acl(User1, publish, <<"topic/A">>), + deny = emqx_access_control:check_acl(User2, subscribe, <<"topic/test_username">>), + allow = emqx_access_control:check_acl(User2, publish, <<"topic/A">>), + allow = emqx_access_control:check_acl(User3, subscribe, <<"topic/test_clientid">>), + deny = emqx_access_control:check_acl(User3, subscribe, <<"topic/test_username">>), + deny = emqx_access_control:check_acl(User3, publish, <<"topic/A">>), + deny = emqx_access_control:check_acl(User3, subscribe, <<"topic/A/B">>), + deny = emqx_access_control:check_acl(User3, publish, <<"topic/A/B">>), + + ok = emqx_acl_mnesia_cli:remove_acl({clientid, <<"test_clientid">>}, <<"topic/%c">>), + ok = emqx_acl_mnesia_cli:remove_acl({clientid, <<"test_clientid">>}, <<"topic/+">>), + ok = emqx_acl_mnesia_cli:remove_acl({username, <<"test_username">>}, <<"topic/%u">>), + ok = emqx_acl_mnesia_cli:remove_acl({username, <<"test_username">>}, <<"topic/+">>), + ok = emqx_acl_mnesia_cli:remove_acl(all, <<"#">>), + + ?assertEqual([], emqx_acl_mnesia_cli:all_acls()). + +t_acl_cli(_Config) -> + meck:new(emqx_ctl, [non_strict, passthrough]), + meck:expect(emqx_ctl, print, fun(Arg) -> emqx_ctl:format(Arg) end), + meck:expect(emqx_ctl, print, fun(Msg, Arg) -> emqx_ctl:format(Msg, Arg) end), + meck:expect(emqx_ctl, usage, fun(Usages) -> emqx_ctl:format_usage(Usages) end), + meck:expect(emqx_ctl, usage, fun(Cmd, Descr) -> emqx_ctl:format_usage(Cmd, Descr) end), + + clean_all_acls(), + + ?assertEqual(0, length(emqx_acl_mnesia_cli:cli(["list"]))), + + emqx_acl_mnesia_cli:cli(["add", "clientid", "test_clientid", "topic/A", "pub", "allow"]), + ?assertMatch(["Acl(clientid = <<\"test_clientid\">> topic = <<\"topic/A\">> action = pub access = allow)\n"], emqx_acl_mnesia_cli:cli(["show", "clientid", "test_clientid"])), + ?assertMatch(["Acl(clientid = <<\"test_clientid\">> topic = <<\"topic/A\">> action = pub access = allow)\n"], emqx_acl_mnesia_cli:cli(["list", "clientid"])), + + emqx_acl_mnesia_cli:cli(["add", "username", "test_username", "topic/B", "sub", "deny"]), + ?assertMatch(["Acl(username = <<\"test_username\">> topic = <<\"topic/B\">> action = sub access = deny)\n"], emqx_acl_mnesia_cli:cli(["show", "username", "test_username"])), + ?assertMatch(["Acl(username = <<\"test_username\">> topic = <<\"topic/B\">> action = sub access = deny)\n"], emqx_acl_mnesia_cli:cli(["list", "username"])), + + emqx_acl_mnesia_cli:cli(["add", "_all", "#", "pubsub", "deny"]), + ?assertMatch(["Acl($all topic = <<\"#\">> action = pubsub access = deny)\n"], emqx_acl_mnesia_cli:cli(["list", "_all"])), + ?assertEqual(3, length(emqx_acl_mnesia_cli:cli(["list"]))), + + emqx_acl_mnesia_cli:cli(["del", "clientid", "test_clientid", "topic/A"]), + emqx_acl_mnesia_cli:cli(["del", "username", "test_username", "topic/B"]), + emqx_acl_mnesia_cli:cli(["del", "_all", "#"]), + ?assertEqual(0, length(emqx_acl_mnesia_cli:cli(["list"]))), + + meck:unload(emqx_ctl). + +t_rest_api(_Config) -> + clean_all_acls(), + + Params1 = [#{<<"clientid">> => <<"test_clientid">>, <<"topic">> => <<"topic/A">>, <<"action">> => <<"pub">>, <<"access">> => <<"allow">>}, + #{<<"clientid">> => <<"test_clientid">>, <<"topic">> => <<"topic/B">>, <<"action">> => <<"sub">>, <<"access">> => <<"allow">>}, + #{<<"clientid">> => <<"test_clientid">>, <<"topic">> => <<"topic/C">>, <<"action">> => <<"pubsub">>, <<"access">> => <<"deny">>}], + {ok, _} = request_http_rest_add([], Params1), + {ok, Re1} = request_http_rest_list(["clientid", "test_clientid"]), + ?assertMatch(3, length(get_http_data(Re1))), + {ok, _} = request_http_rest_delete(["clientid", "test_clientid", "topic", "topic/A"]), + {ok, _} = request_http_rest_delete(["clientid", "test_clientid", "topic", "topic/B"]), + {ok, _} = request_http_rest_delete(["clientid", "test_clientid", "topic", "topic/C"]), + {ok, Res1} = request_http_rest_list(["clientid"]), + ?assertMatch([], get_http_data(Res1)), + + Params2 = [#{<<"username">> => <<"test_username">>, <<"topic">> => <<"topic/A">>, <<"action">> => <<"pub">>, <<"access">> => <<"allow">>}, + #{<<"username">> => <<"test_username">>, <<"topic">> => <<"topic/B">>, <<"action">> => <<"sub">>, <<"access">> => <<"allow">>}, + #{<<"username">> => <<"test_username">>, <<"topic">> => <<"topic/C">>, <<"action">> => <<"pubsub">>, <<"access">> => <<"deny">>}], + {ok, _} = request_http_rest_add([], Params2), + {ok, Re2} = request_http_rest_list(["username", "test_username"]), + ?assertMatch(3, length(get_http_data(Re2))), + {ok, _} = request_http_rest_delete(["username", "test_username", "topic", "topic/A"]), + {ok, _} = request_http_rest_delete(["username", "test_username", "topic", "topic/B"]), + {ok, _} = request_http_rest_delete(["username", "test_username", "topic", "topic/C"]), + {ok, Res2} = request_http_rest_list(["username"]), + ?assertMatch([], get_http_data(Res2)), + + Params3 = [#{<<"topic">> => <<"topic/A">>, <<"action">> => <<"pub">>, <<"access">> => <<"allow">>}, + #{<<"topic">> => <<"topic/B">>, <<"action">> => <<"sub">>, <<"access">> => <<"allow">>}, + #{<<"topic">> => <<"topic/C">>, <<"action">> => <<"pubsub">>, <<"access">> => <<"deny">>}], + {ok, _} = request_http_rest_add([], Params3), + {ok, Re3} = request_http_rest_list(["$all"]), + ?assertMatch(3, length(get_http_data(Re3))), + {ok, _} = request_http_rest_delete(["$all", "topic", "topic/A"]), + {ok, _} = request_http_rest_delete(["$all", "topic", "topic/B"]), + {ok, _} = request_http_rest_delete(["$all", "topic", "topic/C"]), + {ok, Res3} = request_http_rest_list(["$all"]), + ?assertMatch([], get_http_data(Res3)). + +%%------------------------------------------------------------------------------ +%% Helpers +%%------------------------------------------------------------------------------ + +clean_all_acls() -> + [ mnesia:dirty_delete({emqx_acl, Login}) + || Login <- mnesia:dirty_all_keys(emqx_acl)]. + +%%-------------------------------------------------------------------- +%% HTTP Request +%%-------------------------------------------------------------------- + +request_http_rest_list(Path) -> + request_api(get, uri(Path), default_auth_header()). + +request_http_rest_lookup(Path) -> + request_api(get, uri(Path), default_auth_header()). + +request_http_rest_add(Path, Params) -> + request_api(post, uri(Path), [], default_auth_header(), Params). + +request_http_rest_delete(Path) -> + request_api(delete, uri(Path), default_auth_header()). + +uri() -> uri([]). +uri(Parts) when is_list(Parts) -> + NParts = [b2l(E) || E <- Parts], + ?HOST ++ filename:join([?BASE_PATH, ?API_VERSION, "acl"| NParts]). + +%% @private +b2l(B) when is_binary(B) -> + http_uri:encode(binary_to_list(B)); +b2l(L) when is_list(L) -> + http_uri:encode(L). diff --git a/apps/emqx_auth_mnesia/test/emqx_auth_mnesia_SUITE.erl b/apps/emqx_auth_mnesia/test/emqx_auth_mnesia_SUITE.erl new file mode 100644 index 000000000..0f4884247 --- /dev/null +++ b/apps/emqx_auth_mnesia/test/emqx_auth_mnesia_SUITE.erl @@ -0,0 +1,284 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mnesia_SUITE). + +-compile(export_all). + +-include("emqx_auth_mnesia.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). + +-import(emqx_ct_http, [ request_api/3 + , request_api/5 + , get_http_data/1 + , create_default_app/0 + , default_auth_header/0 + ]). + +-define(HOST, "http://127.0.0.1:8081/"). +-define(API_VERSION, "v4"). +-define(BASE_PATH, "api"). + +-define(TABLE, emqx_user). +-define(CLIENTID, <<"clientid_for_ct">>). +-define(USERNAME, <<"username_for_ct">>). +-define(PASSWORD, <<"password">>). +-define(NPASSWORD, <<"new_password">>). + +all() -> + emqx_ct:all(?MODULE). + +groups() -> + []. + +init_per_suite(Config) -> + ok = emqx_ct_helpers:start_apps([emqx_management, emqx_auth_mnesia], fun set_special_configs/1), + create_default_app(), + Config. + +end_per_suite(_Config) -> + emqx_ct_helpers:stop_apps([emqx_management, emqx_auth_mnesia]). + +init_per_testcase(t_check_as_clientid, Config) -> + Params = #{ + hash_type => application:get_env(emqx_auth_mnesia, hash_type, sha256), + key_as => clientid + }, + emqx:hook('client.authenticate', fun emqx_auth_mnesia:check/3, [Params]), + Config; + +init_per_testcase(_, Config) -> + Params = #{ + hash_type => application:get_env(emqx_auth_mnesia, hash_type, sha256), + key_as => username + }, + emqx:hook('client.authenticate', fun emqx_auth_mnesia:check/3, [Params]), + Config. + +end_per_suite(_, Config) -> + emqx:unhook('client.authenticate', fun emqx_auth_mnesia:check/3), + Config. + +set_special_configs(emqx) -> + application:set_env(emqx, allow_anonymous, true), + application:set_env(emqx, enable_acl_cache, false), + LoadedPluginPath = filename:join(["test", "emqx_SUITE_data", "loaded_plugins"]), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, LoadedPluginPath)); + +set_special_configs(_App) -> + ok. + +%%------------------------------------------------------------------------------ +%% Testcases +%%------------------------------------------------------------------------------ + +t_management(_Config) -> + clean_all_users(), + + ok = emqx_auth_mnesia_cli:add_user({username,?USERNAME}, ?PASSWORD), + {error, existed} = emqx_auth_mnesia_cli:add_user({username,?USERNAME}, ?PASSWORD), + ?assertMatch([{?TABLE, {username, ?USERNAME}, _Password, _InterTime}], emqx_auth_mnesia_cli:all_users(username)), + + ok = emqx_auth_mnesia_cli:add_user({clientid,?CLIENTID}, ?PASSWORD), + {error, existed} = emqx_auth_mnesia_cli:add_user({clientid,?CLIENTID}, ?PASSWORD), + ?assertMatch([{?TABLE, {clientid, ?CLIENTID}, _Password, _InterTime}], emqx_auth_mnesia_cli:all_users(clientid)), + + ?assertEqual(2,length(emqx_auth_mnesia_cli:all_users())), + + ok = emqx_auth_mnesia_cli:update_user({username,?USERNAME}, ?NPASSWORD), + {error,noexisted} = emqx_auth_mnesia_cli:update_user({username, <<"no_existed_user">>}, ?PASSWORD), + + ok = emqx_auth_mnesia_cli:update_user({clientid,?CLIENTID}, ?NPASSWORD), + {error,noexisted} = emqx_auth_mnesia_cli:update_user({clientid, <<"no_existed_user">>}, ?PASSWORD), + + + ?assertMatch([{?TABLE, {username, ?USERNAME}, _Password, _InterTime}], emqx_auth_mnesia_cli:lookup_user({username, ?USERNAME})), + ?assertMatch([{?TABLE, {clientid, ?CLIENTID}, _Password, _InterTime}], emqx_auth_mnesia_cli:lookup_user({clientid, ?CLIENTID})), + + User1 = #{username => ?USERNAME, + clientid => undefined, + password => ?NPASSWORD, + zone => external}, + + {ok, #{auth_result := success, + anonymous := false}} = emqx_access_control:authenticate(User1), + + {error,password_error} = emqx_access_control:authenticate(User1#{password => <<"error_password">>}), + + ok = emqx_auth_mnesia_cli:remove_user({username,?USERNAME}), + {ok, #{auth_result := success, + anonymous := true }} = emqx_access_control:authenticate(User1), + + User2 = #{clientid => ?CLIENTID, + password => ?NPASSWORD, + zone => external}, + + {ok, #{auth_result := success, + anonymous := false}} = emqx_access_control:authenticate(User2), + + {error,password_error} = emqx_access_control:authenticate(User2#{password => <<"error_password">>}), + + ok = emqx_auth_mnesia_cli:remove_user({clientid,?CLIENTID}), + {ok, #{auth_result := success, + anonymous := true }} = emqx_access_control:authenticate(User2), + + [] = emqx_auth_mnesia_cli:all_users(). + +t_auth_clientid_cli(_) -> + clean_all_users(), + + HashType = application:get_env(emqx_auth_mnesia, password_hash, sha256), + + emqx_auth_mnesia_cli:auth_clientid_cli(["add", ?CLIENTID, ?PASSWORD]), + [{_, {clientid, ?CLIENTID}, <>, _}] = emqx_auth_mnesia_cli:lookup_user({clientid, ?CLIENTID}), + ?assertEqual(Hash, emqx_passwd:hash(HashType, <>)), + + emqx_auth_mnesia_cli:auth_clientid_cli(["update", ?CLIENTID, ?NPASSWORD]), + [{_, {clientid, ?CLIENTID}, <>, _}] = emqx_auth_mnesia_cli:lookup_user({clientid, ?CLIENTID}), + ?assertEqual(Hash1, emqx_passwd:hash(HashType, <>)), + + emqx_auth_mnesia_cli:auth_clientid_cli(["del", ?CLIENTID]), + ?assertEqual([], emqx_auth_mnesia_cli:lookup_user(?CLIENTID)), + + emqx_auth_mnesia_cli:auth_clientid_cli(["add", "user1", "pass1"]), + emqx_auth_mnesia_cli:auth_clientid_cli(["add", "user2", "pass2"]), + ?assertEqual(2, length(emqx_auth_mnesia_cli:auth_clientid_cli(["list"]))), + + emqx_auth_mnesia_cli:auth_clientid_cli(usage). + +t_auth_username_cli(_) -> + clean_all_users(), + + HashType = application:get_env(emqx_auth_mnesia, password_hash, sha256), + + emqx_auth_mnesia_cli:auth_username_cli(["add", ?USERNAME, ?PASSWORD]), + [{_, {username, ?USERNAME}, <>, _}] = emqx_auth_mnesia_cli:lookup_user({username, ?USERNAME}), + ?assertEqual(Hash, emqx_passwd:hash(HashType, <>)), + + emqx_auth_mnesia_cli:auth_username_cli(["update", ?USERNAME, ?NPASSWORD]), + [{_, {username, ?USERNAME}, <>, _}] = emqx_auth_mnesia_cli:lookup_user({username, ?USERNAME}), + ?assertEqual(Hash1, emqx_passwd:hash(HashType, <>)), + + emqx_auth_mnesia_cli:auth_username_cli(["del", ?USERNAME]), + ?assertEqual([], emqx_auth_mnesia_cli:lookup_user(?USERNAME)), + + emqx_auth_mnesia_cli:auth_username_cli(["add", "user1", "pass1"]), + emqx_auth_mnesia_cli:auth_username_cli(["add", "user2", "pass2"]), + ?assertEqual(2, length(emqx_auth_mnesia_cli:auth_username_cli(["list"]))), + + emqx_auth_mnesia_cli:auth_username_cli(usage). + + +t_clientid_rest_api(_Config) -> + clean_all_users(), + + {ok, Result1} = request_http_rest_list(["auth_clientid"]), + [] = get_http_data(Result1), + + Params1 = #{<<"clientid">> => ?CLIENTID, <<"password">> => ?PASSWORD}, + {ok, _} = request_http_rest_add(["auth_clientid"], Params1), + + Params2 = #{<<"clientid">> => ?CLIENTID, <<"password">> => ?NPASSWORD}, + {ok, _} = request_http_rest_update(["auth_clientid/" ++ binary_to_list(?CLIENTID)], Params2), + + {ok, Result2} = request_http_rest_lookup(["auth_clientid/" ++ binary_to_list(?CLIENTID)]), + ?assertMatch(#{<<"clientid">> := ?CLIENTID}, get_http_data(Result2)), + + Params3 = [ #{<<"clientid">> => ?CLIENTID, <<"password">> => ?PASSWORD} + , #{<<"clientid">> => <<"clientid1">>, <<"password">> => ?PASSWORD} + , #{<<"clientid">> => <<"clientid2">>, <<"password">> => ?PASSWORD} + ], + {ok, Result3} = request_http_rest_add(["auth_clientid"], Params3), + ?assertMatch(#{ ?CLIENTID := <<"{error,existed}">> + , <<"clientid1">> := <<"ok">> + , <<"clientid2">> := <<"ok">> + }, get_http_data(Result3)), + + {ok, Result4} = request_http_rest_list(["auth_clientid"]), + ?assertEqual(3, length(get_http_data(Result4))), + + {ok, _} = request_http_rest_delete(["auth_clientid/" ++ binary_to_list(?CLIENTID)]), + {ok, Result5} = request_http_rest_lookup(["auth_clientid/" ++ binary_to_list(?CLIENTID)]), + ?assertMatch(#{}, get_http_data(Result5)). + +t_username_rest_api(_Config) -> + clean_all_users(), + + {ok, Result1} = request_http_rest_list(["auth_username"]), + [] = get_http_data(Result1), + + Params1 = #{<<"username">> => ?USERNAME, <<"password">> => ?PASSWORD}, + {ok, _} = request_http_rest_add(["auth_username"], Params1), + + Params2 = #{<<"username">> => ?USERNAME, <<"password">> => ?NPASSWORD}, + {ok, _} = request_http_rest_update(["auth_username/" ++ binary_to_list(?USERNAME)], Params2), + + {ok, Result2} = request_http_rest_lookup(["auth_username/" ++ binary_to_list(?USERNAME)]), + ?assertMatch(#{<<"username">> := ?USERNAME}, get_http_data(Result2)), + + Params3 = [ #{<<"username">> => ?USERNAME, <<"password">> => ?PASSWORD} + , #{<<"username">> => <<"username1">>, <<"password">> => ?PASSWORD} + , #{<<"username">> => <<"username2">>, <<"password">> => ?PASSWORD} + ], + {ok, Result3} = request_http_rest_add(["auth_username"], Params3), + ?assertMatch(#{ ?USERNAME := <<"{error,existed}">> + , <<"username1">> := <<"ok">> + , <<"username2">> := <<"ok">> + }, get_http_data(Result3)), + + {ok, Result4} = request_http_rest_list(["auth_username"]), + ?assertEqual(3, length(get_http_data(Result4))), + + {ok, _} = request_http_rest_delete(["auth_username/" ++ binary_to_list(?USERNAME)]), + {ok, Result5} = request_http_rest_lookup(["auth_username/" ++ binary_to_list(?USERNAME)]), + ?assertMatch(#{}, get_http_data(Result5)). + +%%------------------------------------------------------------------------------ +%% Helpers +%%------------------------------------------------------------------------------ + +clean_all_users() -> + [ mnesia:dirty_delete({emqx_user, Login}) + || Login <- mnesia:dirty_all_keys(emqx_user)]. + +%%-------------------------------------------------------------------- +%% HTTP Request +%%-------------------------------------------------------------------- + +request_http_rest_list(Path) -> + request_api(get, uri(Path), default_auth_header()). + +request_http_rest_lookup(Path) -> + request_api(get, uri([Path]), default_auth_header()). + +request_http_rest_add(Path, Params) -> + request_api(post, uri(Path), [], default_auth_header(), Params). + +request_http_rest_update(Path, Params) -> + request_api(put, uri([Path]), [], default_auth_header(), Params). + +request_http_rest_delete(Login) -> + request_api(delete, uri([Login]), default_auth_header()). + +uri() -> uri([]). +uri(Parts) when is_list(Parts) -> + NParts = [b2l(E) || E <- Parts], + ?HOST ++ filename:join([?BASE_PATH, ?API_VERSION | NParts]). + +%% @private +b2l(B) when is_binary(B) -> + binary_to_list(B); +b2l(L) when is_list(L) -> + L. diff --git a/apps/emqx_auth_mongo/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_mongo/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..94217cacb --- /dev/null +++ b/apps/emqx_auth_mongo/.github/workflows/run_test_cases.yaml @@ -0,0 +1,59 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + strategy: + matrix: + mongo_tag: + - 3 + - 4 + network_type: + - ipv4 + - ipv6 + connect_type: + - ssl + - tcp + + steps: + - name: install docker-compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - uses: actions/checkout@v1 + - name: run test cases + env: + MONGO_TAG: ${{ matrix.mongo_tag }} + NETWORK_TYPE: ${{ matrix.network_type }} + CONNECT_TYPE: ${{ matrix.connect_type }} + run: | + set -e -u -x + if [ "$NETWORK_TYPE" = "ipv6" ];then docker network create --driver bridge --ipv6 --subnet fd15:555::/64 tests_emqx_bridge --attachable; fi + if [ "$CONNECT_TYPE" = "ssl" ]; then + docker-compose -f ./docker-compose-ssl.yml -p tests up -d + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "echo 'auth.mongo.ssl = true' >> /emqx_auth_mongo/etc/emqx_auth_mongo.conf" + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "echo 'auth.mongo.ssl_opts.cacertfile = /emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca.pem' >> /emqx_auth_mongo/etc/emqx_auth_mongo.conf" + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "echo 'auth.mongo.ssl_opts.certfile = /emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-cert.pem' >> /emqx_auth_mongo/etc/emqx_auth_mongo.conf" + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "echo 'auth.mongo.ssl_opts.keyfile = /emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-key.pem' >> /emqx_auth_mongo/etc/emqx_auth_mongo.conf" + else + docker-compose -f ./docker-compose.yml -p tests up -d + fi + if [ "$NETWORK_TYPE" != "ipv6" ];then + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "sed -i '/auth.mongo.server/c auth.mongo.server = mongo_server:27017' /emqx_auth_mongo/etc/emqx_auth_mongo.conf" + else + ipv6_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' $(docker ps -a -f name=tests_mongo_server_1 -q)) + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "sed -i '/auth.mongo.server/c auth.mongo.server = $ipv6_address:27017' /emqx_auth_mongo/etc/emqx_auth_mongo.conf" + fi + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_mongo xref" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_mongo eunit" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_mongo ct" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_mongo cover" + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: logs_mongo${{ matrix.mongo_tag}}_${{ matrix.network_type }} + path: _build/test/logs + diff --git a/apps/emqx_auth_mongo/.gitignore b/apps/emqx_auth_mongo/.gitignore new file mode 100644 index 000000000..a6635ffa0 --- /dev/null +++ b/apps/emqx_auth_mongo/.gitignore @@ -0,0 +1,24 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.DS_Store +.erlang.mk/ +emqx_auth_mongo.d +ct.coverdata +logs/ +test/ct.cover.spec +data/ +cover/ +eunit.coverdata +_build/ +rebar.lock +erlang.mk +etc/emqx_auth_mongo.conf.rendered +.rebar3 diff --git a/apps/emqx_auth_mongo/CHANGES b/apps/emqx_auth_mongo/CHANGES new file mode 100644 index 000000000..4bddd63a9 --- /dev/null +++ b/apps/emqx_auth_mongo/CHANGES @@ -0,0 +1,31 @@ + +2.0.7 (2017-01-20) +------------------ + +Tag 2.0.7 - use `cuttlefish:unset()` for commented ACL/super config + +2.0.1 (2016-11-30) +------------------ + +Tag 2.0.1 + +2.0-beta.1 (2016-08-24) +----------------------- + +gen_conf + +1.1.3-beta (2016-08-19) +----------------------- + +Bump version to 1.1.3 + +1.1.2-beta (2016-06-30) +----------------------- + +Bump version to 1.1.2 + +1.1-beta (2016-05-28) +--------------------- + +First public release + diff --git a/apps/emqx_auth_mongo/LICENSE b/apps/emqx_auth_mongo/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_auth_mongo/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_mongo/Makefile b/apps/emqx_auth_mongo/Makefile new file mode 100644 index 000000000..8e8a20cb0 --- /dev/null +++ b/apps/emqx_auth_mongo/Makefile @@ -0,0 +1,37 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_auth_mongo.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_auth_mongo.conf -i priv/emqx_auth_mongo.schema -d data diff --git a/apps/emqx_auth_mongo/README.md b/apps/emqx_auth_mongo/README.md new file mode 100644 index 000000000..3bacfca5b --- /dev/null +++ b/apps/emqx_auth_mongo/README.md @@ -0,0 +1,192 @@ +emqx_auth_mongo +=============== + +EMQ X Authentication/ACL with MongoDB + +Build the Plugin +---------------- + +``` +make & make tests +``` + +Configuration +------------- + +File: etc/emqx_auth_mongo.conf + +``` +## MongoDB Topology Type. +## +## Value: single | unknown | sharded | rs +auth.mongo.type = single + +## Sets the set name if type is rs. +## +## Value: String +## auth.mongo.rs_set_name = + +## MongoDB server list. +## +## Value: String +## +## Examples: 127.0.0.1:27017,127.0.0.2:27017... +auth.mongo.server = 127.0.0.1:27017 + +## MongoDB pool size +## +## Value: Number +auth.mongo.pool = 8 + +## MongoDB login user. +## +## Value: String +## auth.mongo.login = + +## MongoDB password. +## +## Value: String +## auth.mongo.password = + +## MongoDB AuthSource +## +## Value: String +## Default: mqtt +## auth.mongo.auth_source = admin + +## MongoDB database +## +## Value: String +auth.mongo.database = mqtt + +## MongoDB write mode. +## +## Value: unsafe | safe +## auth.mongo.w_mode = + +## Mongo read mode. +## +## Value: master | slave_ok +## auth.mongo.r_mode = + +## MongoDB topology options. +auth.mongo.topology.pool_size = 1 +auth.mongo.topology.max_overflow = 0 +## auth.mongo.topology.overflow_ttl = 1000 +## auth.mongo.topology.overflow_check_period = 1000 +## auth.mongo.topology.local_threshold_ms = 1000 +## auth.mongo.topology.connect_timeout_ms = 20000 +## auth.mongo.topology.socket_timeout_ms = 100 +## auth.mongo.topology.server_selection_timeout_ms = 30000 +## auth.mongo.topology.wait_queue_timeout_ms = 1000 +## auth.mongo.topology.heartbeat_frequency_ms = 10000 +## auth.mongo.topology.min_heartbeat_frequency_ms = 1000 + +## Authentication query. +auth.mongo.auth_query.collection = mqtt_user + +auth.mongo.auth_query.password_field = password + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.mongo.auth_query.password_hash = sha256 + +## sha256 with salt suffix +## auth.mongo.auth_query.password_hash = sha256,salt + +## sha256 with salt prefix +## auth.mongo.auth_query.password_hash = salt,sha256 + +## bcrypt with salt prefix +## auth.mongo.auth_query.password_hash = salt,bcrypt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.mongo.auth_query.password_hash = pbkdf2,sha256,1000,20 + +auth.mongo.auth_query.selector = username=%u + +## Enable superuser query. +auth.mongo.super_query = on + +auth.mongo.super_query.collection = mqtt_user + +auth.mongo.super_query.super_field = is_superuser + +auth.mongo.super_query.selector = username=%u + +## Enable ACL query. +auth.mongo.acl_query = on + +auth.mongo.acl_query.collection = mqtt_acl + +auth.mongo.acl_query.selector = username=%u +``` + +Load the Plugin +--------------- + +``` +./bin/emqx_ctl plugins load emqx_auth_mongo +``` + +MongoDB Database +---------------- + +``` +use mqtt +db.createCollection("mqtt_user") +db.createCollection("mqtt_acl") +db.mqtt_user.ensureIndex({"username":1}) +``` + +mqtt_user Collection +-------------------- + +``` +{ + username: "user", + password: "password hash", + salt: "password salt", + is_superuser: boolean (true, false), + created: "datetime" +} +``` + +For example: +``` +db.mqtt_user.insert({username: "test", password: "password hash", salt: "password salt", is_superuser: false}) +db.mqtt_user.insert({username: "root", is_superuser: true}) +``` + +mqtt_acl Collection +------------------- + +``` +{ + username: "username", + clientid: "clientid", + publish: ["topic1", "topic2", ...], + subscribe: ["subtop1", "subtop2", ...], + pubsub: ["topic/#", "topic1", ...] +} +``` + +For example: + +``` +db.mqtt_acl.insert({username: "test", publish: ["t/1", "t/2"], subscribe: ["user/%u", "client/%c"]}) +db.mqtt_acl.insert({username: "admin", pubsub: ["#"]}) +``` + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. + diff --git a/apps/emqx_auth_mongo/docker-compose-ssl.yml b/apps/emqx_auth_mongo/docker-compose-ssl.yml new file mode 100644 index 000000000..7af0981b1 --- /dev/null +++ b/apps/emqx_auth_mongo/docker-compose-ssl.yml @@ -0,0 +1,31 @@ +version: '3' + +services: + erlang: + image: erlang:22.1 + volumes: + - ./:/emqx_auth_mongo + networks: + - emqx_bridge + depends_on: + - mongo_server + tty: true + + mongo_server: + image: mongo:${MONGO_TAG} + restart: always + environment: + MONGO_INITDB_DATABASE: mqtt + volumes: + - ./test/emqx_auth_mongo_SUITE_data/mongodb.pem/:/etc/certs/mongodb.pem + networks: + - emqx_bridge + command: + --ipv6 + --bind_ip_all + --sslMode requireSSL + --sslPEMKeyFile /etc/certs/mongodb.pem + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_mongo/docker-compose.yml b/apps/emqx_auth_mongo/docker-compose.yml new file mode 100644 index 000000000..9ff9cce23 --- /dev/null +++ b/apps/emqx_auth_mongo/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3' + +services: + erlang: + image: erlang:22.1 + volumes: + - ./:/emqx_auth_mongo + networks: + - emqx_bridge + depends_on: + - mongo_server + tty: true + + mongo_server: + image: mongo:${MONGO_TAG} + restart: always + environment: + MONGO_INITDB_DATABASE: mqtt + networks: + - emqx_bridge + command: + --ipv6 + --bind_ip_all + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_mongo/etc/emqx_auth_mongo.conf b/apps/emqx_auth_mongo/etc/emqx_auth_mongo.conf new file mode 100644 index 000000000..cf1614efa --- /dev/null +++ b/apps/emqx_auth_mongo/etc/emqx_auth_mongo.conf @@ -0,0 +1,172 @@ +##-------------------------------------------------------------------- +## MongoDB Auth/ACL Plugin +##-------------------------------------------------------------------- + +## MongoDB Topology Type. +## +## Value: single | unknown | sharded | rs +auth.mongo.type = single + +## The set name if type is rs. +## +## Value: String +## auth.mongo.rs_set_name = + +## MongoDB server list. +## +## Value: String +## +## Examples: 127.0.0.1:27017,127.0.0.2:27017... +auth.mongo.server = 127.0.0.1:27017 + +## MongoDB pool size +## +## Value: Number +auth.mongo.pool = 8 + +## MongoDB login user. +## +## Value: String +## auth.mongo.login = + +## MongoDB password. +## +## Value: String +## auth.mongo.password = + +## MongoDB AuthSource +## +## Value: String +## Default: mqtt +## auth.mongo.auth_source = admin + +## MongoDB database +## +## Value: String +auth.mongo.database = mqtt + +## MongoDB query timeout +## +## Value: Duration +## auth.mongo.query_timeout = 5s + +## Whether to enable SSL connection. +## +## Value: true | false +## auth.mongo.ssl = false + +## SSL keyfile. +## +## Value: File +## auth.mongo.ssl_opts.keyfile = + +## SSL certfile. +## +## Value: File +## auth.mongo.ssl_opts.certfile = + +## SSL cacertfile. +## +## Value: File +## auth.mongo.ssl_opts.cacertfile = + +## MongoDB write mode. +## +## Value: unsafe | safe +## auth.mongo.w_mode = + +## Mongo read mode. +## +## Value: master | slave_ok +## auth.mongo.r_mode = + +## MongoDB topology options. +auth.mongo.topology.pool_size = 1 +auth.mongo.topology.max_overflow = 0 +## auth.mongo.topology.overflow_ttl = 1000 +## auth.mongo.topology.overflow_check_period = 1000 +## auth.mongo.topology.local_threshold_ms = 1000 +## auth.mongo.topology.connect_timeout_ms = 20000 +## auth.mongo.topology.socket_timeout_ms = 100 +## auth.mongo.topology.server_selection_timeout_ms = 30000 +## auth.mongo.topology.wait_queue_timeout_ms = 1000 +## auth.mongo.topology.heartbeat_frequency_ms = 10000 +## auth.mongo.topology.min_heartbeat_frequency_ms = 1000 + +## ------------------------------------------------- +## Auth Query +## ------------------------------------------------- +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.mongo.auth_query.password_hash = sha256 + +## sha256 with salt suffix +## auth.mongo.auth_query.password_hash = sha256,salt + +## sha256 with salt prefix +## auth.mongo.auth_query.password_hash = salt,sha256 + +## bcrypt with salt prefix +## auth.mongo.auth_query.password_hash = salt,bcrypt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.mongo.auth_query.password_hash = pbkdf2,sha256,1000,20 + +## Authentication query. +auth.mongo.auth_query.collection = mqtt_user + +## Password mainly fields +## +## Value: password | password,salt +auth.mongo.auth_query.password_field = password + +## Authentication Selector. +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## auth.mongo.auth_query.selector = {Field}={Placeholder} +auth.mongo.auth_query.selector = username=%u + +## ------------------------------------------------- +## Super User Query +## ------------------------------------------------- +auth.mongo.super_query.collection = mqtt_user +auth.mongo.super_query.super_field = is_superuser +#auth.mongo.super_query.selector = username=%u, clientid=%c +auth.mongo.super_query.selector = username=%u + +## ACL Selector. +## +## Multiple selectors could be combined with '$or' +## when query acl from mongo. +## +## e.g. +## +## With following 2 selectors configured: +## +## auth.mongo.acl_query.selector.1 = username=%u +## auth.mongo.acl_query.selector.2 = username=$all +## +## And if a client connected using username 'ilyas', +## then the following mongo command will be used to +## retrieve acl entries: +## +## db.mqtt_acl.find({$or: [{username: "ilyas"}, {username: "$all"}]}); +## +## Variables: +## - %u: username +## - %c: clientid +## +## Examples: +## +## auth.mongo.acl_query.selector.1 = username=%u,clientid=%c +## auth.mongo.acl_query.selector.2 = username=$all +## auth.mongo.acl_query.selector.3 = clientid=$all +auth.mongo.acl_query.collection = mqtt_acl +auth.mongo.acl_query.selector = username=%u diff --git a/apps/emqx_auth_mongo/include/emqx_auth_mongo.hrl b/apps/emqx_auth_mongo/include/emqx_auth_mongo.hrl new file mode 100644 index 000000000..97ecf9973 --- /dev/null +++ b/apps/emqx_auth_mongo/include/emqx_auth_mongo.hrl @@ -0,0 +1,37 @@ + +-define(APP, emqx_auth_mongo). + +-define(DEFAULT_SELECTORS, [{<<"username">>, <<"%u">>}]). + +-record(superquery, {collection = <<"mqtt_user">>, + field = <<"is_superuser">>, + selector = {<<"username">>, <<"%u">>}}). + +-record(authquery, {collection = <<"mqtt_user">>, + field = <<"password">>, + hash = sha256, + selector = {<<"username">>, <<"%u">>}}). + +-record(aclquery, {collection = <<"mqtt_acl">>, + selector = {<<"username">>, <<"%u">>}}). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). diff --git a/apps/emqx_auth_mongo/priv/emqx_auth_mongo.schema b/apps/emqx_auth_mongo/priv/emqx_auth_mongo.schema new file mode 100644 index 000000000..9b331e6c4 --- /dev/null +++ b/apps/emqx_auth_mongo/priv/emqx_auth_mongo.schema @@ -0,0 +1,292 @@ +%%-*- mode: erlang -*- +%% emqx_auth_mongo config mapping + +{mapping, "auth.mongo.type", "emqx_auth_mongo.server", [ + {default, single}, + {datatype, {enum, [single, unknown, sharded, rs]}} +]}. + +{mapping, "auth.mongo.rs_set_name", "emqx_auth_mongo.server", [ + {default, "mqtt"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.server", "emqx_auth_mongo.server", [ + {default, "127.0.0.1:27017"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.pool", "emqx_auth_mongo.server", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "auth.mongo.login", "emqx_auth_mongo.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mongo.password", "emqx_auth_mongo.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mongo.database", "emqx_auth_mongo.server", [ + {default, "mqtt"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.auth_source", "emqx_auth_mongo.server", [ + {default, "mqtt"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.ssl", "emqx_auth_mongo.server", [ + {default, false}, + {datatype, {enum, [true, false]}} +]}. + +{mapping, "auth.mongo.ssl_opts.keyfile", "emqx_auth_mongo.server", [ + {datatype, string} +]}. + +{mapping, "auth.mongo.ssl_opts.certfile", "emqx_auth_mongo.server", [ + {datatype, string} +]}. + +{mapping, "auth.mongo.ssl_opts.cacertfile", "emqx_auth_mongo.server", [ + {datatype, string} +]}. + +{mapping, "auth.mongo.w_mode", "emqx_auth_mongo.server", [ + {default, undef}, + {datatype, {enum, [safe, unsafe, undef]}} +]}. + +{mapping, "auth.mongo.r_mode", "emqx_auth_mongo.server", [ + {default, undef}, + {datatype, {enum, [master, slave_ok, undef]}} +]}. + +{mapping, "auth.mongo.topology.$name", "emqx_auth_mongo.server", [ + {datatype, integer} +]}. + +{translation, "emqx_auth_mongo.server", fun(Conf) -> + H = cuttlefish:conf_get("auth.mongo.server", Conf), + Hosts = string:tokens(H, ","), + Type0 = cuttlefish:conf_get("auth.mongo.type", Conf), + Pool = cuttlefish:conf_get("auth.mongo.pool", Conf), + Login = cuttlefish:conf_get("auth.mongo.login", Conf), + Passwd = cuttlefish:conf_get("auth.mongo.password", Conf), + DB = cuttlefish:conf_get("auth.mongo.database", Conf), + AuthSrc = cuttlefish:conf_get("auth.mongo.auth_source", Conf), + R = cuttlefish:conf_get("auth.mongo.w_mode", Conf), + W = cuttlefish:conf_get("auth.mongo.r_mode", Conf), + Login0 = case Login =:= [] of + true -> []; + false -> [{login, list_to_binary(Login)}] + end, + Passwd0 = case Passwd =:= [] of + true -> []; + false -> [{password, list_to_binary(Passwd)}] + end, + W0 = case W =:= undef of + true -> []; + false -> [{w_mode, W}] + end, + R0 = case R =:= undef of + true -> []; + false -> [{r_mode, R}] + end, + Ssl = case cuttlefish:conf_get("auth.mongo.ssl", Conf) of + true -> + Filter = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end, + SslOpts = fun(Prefix) -> + Filter([{keyfile, cuttlefish:conf_get(Prefix ++ ".keyfile", Conf, undefined)}, + {certfile, cuttlefish:conf_get(Prefix ++ ".certfile", Conf, undefined)}, + {cacertfile, cuttlefish:conf_get(Prefix ++ ".cacertfile", Conf, undefined)}]) + end, + [{ssl, true}, {ssl_opts, SslOpts("auth.mongo.ssl_opts")}]; + false -> + [] + end, + WorkerOptions = [{database, list_to_binary(DB)}, {auth_source, list_to_binary(AuthSrc)}] + ++ Login0 ++ Passwd0 ++ W0 ++ R0 ++ Ssl, + + Vars = cuttlefish_variable:fuzzy_matches(["auth", "mongo", "topology", "$name"], Conf), + Options = lists:map(fun({_, Name}) -> + Name2 = case Name of + "local_threshold_ms" -> "localThresholdMS"; + "connect_timeout_ms" -> "connectTimeoutMS"; + "socket_timeout_ms" -> "socketTimeoutMS"; + "server_selection_timeout_ms" -> "serverSelectionTimeoutMS"; + "wait_queue_timeout_ms" -> "waitQueueTimeoutMS"; + "heartbeat_frequency_ms" -> "heartbeatFrequencyMS"; + "min_heartbeat_frequency_ms" -> "minHeartbeatFrequencyMS"; + _ -> Name + end, + {list_to_atom(Name2), cuttlefish:conf_get("auth.mongo.topology."++Name, Conf)} + end, Vars), + + Type = case Type0 =:= rs of + true -> {Type0, list_to_binary(cuttlefish:conf_get("auth.mongo.rs_set_name", Conf))}; + false -> Type0 + end, + [{type, Type}, + {hosts, Hosts}, + {options, Options}, + {worker_options, WorkerOptions}, + {auto_reconnect, 1}, + {pool_size, Pool}] +end}. + +%% The mongodb operation timeout is specified by the value of `cursor_timeout` from application config, +%% or `infinity` if `cursor_timeout` not specified +{mapping, "auth.mongo.query_timeout", "mongodb.cursor_timeout", [ + {datatype, string} +]}. + +{translation, "mongodb.cursor_timeout", fun(Conf) -> + case cuttlefish:conf_get("auth.mongo.query_timeout", Conf, undefined) of + undefined -> infinity; + Duration -> + case cuttlefish_duration:parse(Duration, ms) of + {error, Reason} -> error(Reason); + Ms when is_integer(Ms) -> Ms + end + end +end}. + +{mapping, "auth.mongo.auth_query.collection", "emqx_auth_mongo.auth_query", [ + {default, "mqtt_user"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.auth_query.password_field", "emqx_auth_mongo.auth_query", [ + {default, "password"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.auth_query.password_hash", "emqx_auth_mongo.auth_query", [ + {datatype, string} +]}. + +{mapping, "auth.mongo.auth_query.selector", "emqx_auth_mongo.auth_query", [ + {default, ""}, + {datatype, string} +]}. + +{translation, "emqx_auth_mongo.auth_query", fun(Conf) -> + case cuttlefish:conf_get("auth.mongo.auth_query.collection", Conf) of + undefined -> cuttlefish:unset(); + Collection -> + PasswordField = cuttlefish:conf_get("auth.mongo.auth_query.password_field", Conf), + PasswordHash = cuttlefish:conf_get("auth.mongo.auth_query.password_hash", Conf), + SelectorStr = cuttlefish:conf_get("auth.mongo.auth_query.selector", Conf), + SelectorList = + lists:map(fun(Selector) -> + case string:tokens(Selector, "=") of + [Field, Val] -> {list_to_binary(Field), list_to_binary(Val)}; + _ -> {<<"username">>, <<"%u">>} + end + end, string:tokens(SelectorStr, ", ")), + + PasswordFields = [list_to_binary(Field) || Field <- string:tokens(PasswordField, ",")], + HashValue = + case string:tokens(PasswordHash, ",") of + [Hash] -> list_to_atom(Hash); + [Prefix, Suffix] -> {list_to_atom(Prefix), list_to_atom(Suffix)}; + [Hash, MacFun, Iterations, Dklen] -> {list_to_atom(Hash), list_to_atom(MacFun), list_to_integer(Iterations), list_to_integer(Dklen)}; + _ -> plain + end, + [{collection, Collection}, + {password_field, PasswordFields}, + {password_hash, HashValue}, + {selector, SelectorList}] + end +end}. + +{mapping, "auth.mongo.super_query", "emqx_auth_mongo.super_query", [ + {default, off}, + {datatype, flag} +]}. + +{mapping, "auth.mongo.super_query.collection", "emqx_auth_mongo.super_query", [ + {default, "mqtt_user"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.super_query.super_field", "emqx_auth_mongo.super_query", [ + {default, "is_superuser"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.super_query.selector", "emqx_auth_mongo.super_query", [ + {default, ""}, + {datatype, string} +]}. + +{translation, "emqx_auth_mongo.super_query", fun(Conf) -> + case cuttlefish:conf_get("auth.mongo.super_query.collection", Conf) of + undefined -> cuttlefish:unset(); + Collection -> + SuperField = cuttlefish:conf_get("auth.mongo.super_query.super_field", Conf), + SelectorStr = cuttlefish:conf_get("auth.mongo.super_query.selector", Conf), + SelectorList = + lists:map(fun(Selector) -> + case string:tokens(Selector, "=") of + [Field, Val] -> {list_to_binary(Field), list_to_binary(Val)}; + _ -> {<<"username">>, <<"%u">>} + end + end, string:tokens(SelectorStr, ", ")), + [{collection, Collection}, {super_field, SuperField}, {selector, SelectorList}] + end +end}. + +{mapping, "auth.mongo.acl_query", "emqx_auth_mongo.acl_query", [ + {default, off}, + {datatype, flag} +]}. + +{mapping, "auth.mongo.acl_query.collection", "emqx_auth_mongo.acl_query", [ + {default, "mqtt_user"}, + {datatype, string} +]}. + +{mapping, "auth.mongo.acl_query.selector", "emqx_auth_mongo.acl_query", [ + {default, ""}, + {datatype, string} +]}. +{mapping, "auth.mongo.acl_query.selector.$id", "emqx_auth_mongo.acl_query", [ + {default, ""}, + {datatype, string} +]}. + +{translation, "emqx_auth_mongo.acl_query", fun(Conf) -> + case cuttlefish:conf_get("auth.mongo.acl_query.collection", Conf) of + undefined -> cuttlefish:unset(); + Collection -> + SelectorStrList = + lists:map( + fun + ({["auth","mongo","acl_query","selector"], ConfEntry}) -> + ConfEntry; + ({["auth","mongo","acl_query","selector", _], ConfEntry}) -> + ConfEntry + end, + cuttlefish_variable:filter_by_prefix("auth.mongo.acl_query.selector", Conf)), + SelectorListList = + lists:map( + fun(SelectorStr) -> + lists:map(fun(Selector) -> + case string:tokens(Selector, "=") of + [Field, Val] -> {list_to_binary(Field), list_to_binary(Val)}; + _ -> {<<"username">>, <<"%u">>} + end + end, string:tokens(SelectorStr, ", ")) + end, + SelectorStrList), + [{collection, Collection}, {selector, SelectorListList}] + end +end}. diff --git a/apps/emqx_auth_mongo/rebar.config b/apps/emqx_auth_mongo/rebar.config new file mode 100644 index 000000000..b946b5a95 --- /dev/null +++ b/apps/emqx_auth_mongo/rebar.config @@ -0,0 +1,35 @@ +{deps, + [{mongodb, {git,"https://github.com/emqx/mongodb-erlang", {tag, "v3.0.7"}}}, + {ecpool, {git,"https://github.com/emqx/ecpool", {tag, "0.5.0"}}}, + {emqx_passwd, {git, "https://github.com/emqx/emqx-passwd", {tag, "v1.1.1"}}} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + compressed, + {parse_transform} + ]}. +{overrides, [{add, [{erl_opts, [compressed]}]}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions + ]}. + +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helper, {git, "https://github.com/emqx/emqx-ct-helper", {tag, "1.2.2"}}}, + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}} + ]}, + {erl_opts, [debug_info]} + ]} + ]}. diff --git a/apps/emqx_auth_mongo/rebar.config.script b/apps/emqx_auth_mongo/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_mongo/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_mongo/src/emqx_acl_mongo.erl b/apps/emqx_auth_mongo/src/emqx_acl_mongo.erl new file mode 100644 index 000000000..db6268f69 --- /dev/null +++ b/apps/emqx_auth_mongo/src/emqx_acl_mongo.erl @@ -0,0 +1,90 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_mongo). + +-include("emqx_auth_mongo.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +%% ACL callbacks +-export([ register_metrics/0 + , check_acl/5 + , description/0 + ]). +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +check_acl(#{username := <<$$, _/binary>>}, _PubSub, _Topic, _AclResult, _State) -> + ok; + +check_acl(ClientInfo, PubSub, Topic, _AclResult, #{aclquery := AclQuery , pool := Pool}) -> + #aclquery{collection = Coll, selector = SelectorList} = AclQuery, + SelectorMapList = + lists:map(fun(Selector) -> + maps:from_list(emqx_auth_mongo:replvars(Selector, ClientInfo)) + end, SelectorList), + case emqx_auth_mongo:query_multi(Pool, Coll, SelectorMapList) of + [] -> ok; + Rows -> + try match(ClientInfo, Topic, topics(PubSub, Rows)) of + matched -> emqx_metrics:inc(?ACL_METRICS(allow)), + {stop, allow}; + nomatch -> emqx_metrics:inc(?ACL_METRICS(deny)), + {stop, deny} + catch + _Err:Reason-> + ?LOG(error, "[MongoDB] Check mongo ~p ACL failed, got ACL config: ~p, error: :~p", + [PubSub, Rows, Reason]), + emqx_metrics:inc(?ACL_METRICS(ignore)), + ignore + end + end. + + +match(_ClientInfo, _Topic, []) -> + nomatch; +match(ClientInfo, Topic, [TopicFilter|More]) -> + case emqx_topic:match(Topic, feedvar(ClientInfo, TopicFilter)) of + true -> matched; + false -> match(ClientInfo, Topic, More) + end. + +topics(publish, Rows) -> + lists:foldl(fun(Row, Acc) -> + Topics = maps:get(<<"publish">>, Row, []) ++ maps:get(<<"pubsub">>, Row, []), + lists:umerge(Acc, Topics) + end, [], Rows); + +topics(subscribe, Rows) -> + lists:foldl(fun(Row, Acc) -> + Topics = maps:get(<<"subscribe">>, Row, []) ++ maps:get(<<"pubsub">>, Row, []), + lists:umerge(Acc, Topics) + end, [], Rows). + +feedvar(#{clientid := ClientId, username := Username}, Str) -> + lists:foldl(fun({Var, Val}, Acc) -> + feedvar(Acc, Var, Val) + end, Str, [{"%u", Username}, {"%c", ClientId}]). + +feedvar(Str, _Var, undefined) -> + Str; +feedvar(Str, Var, Val) -> + re:replace(Str, Var, Val, [global, {return, binary}]). + +description() -> "ACL with MongoDB". + diff --git a/apps/emqx_auth_mongo/src/emqx_auth_mongo.app.src b/apps/emqx_auth_mongo/src/emqx_auth_mongo.app.src new file mode 100644 index 000000000..71bb7fa92 --- /dev/null +++ b/apps/emqx_auth_mongo/src/emqx_auth_mongo.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_mongo, + [{description, "EMQ X Authentication/ACL with MongoDB"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_mongo_sup]}, + {applications, [kernel,stdlib,mongodb,ecpool,emqx_passwd]}, + {mod, {emqx_auth_mongo_app,[]}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-mongo"} + ]} + ]}. diff --git a/apps/emqx_auth_mongo/src/emqx_auth_mongo.app.src.script b/apps/emqx_auth_mongo/src/emqx_auth_mongo.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_mongo/src/emqx_auth_mongo.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_mongo/src/emqx_auth_mongo.erl b/apps/emqx_auth_mongo/src/emqx_auth_mongo.erl new file mode 100644 index 000000000..3a7deaf87 --- /dev/null +++ b/apps/emqx_auth_mongo/src/emqx_auth_mongo.erl @@ -0,0 +1,133 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mongo). + +-behaviour(ecpool_worker). + +-include("emqx_auth_mongo.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/types.hrl"). + +-export([ register_metrics/0 + , check/3 + , description/0 + ]). + +-export([ replvar/2 + , replvars/2 + , connect/1 + , query/3 + , query_multi/3 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +check(ClientInfo = #{password := Password}, AuthResult, + #{authquery := AuthQuery, superquery := SuperQuery, pool := Pool}) -> + #authquery{collection = Collection, field = Fields, + hash = HashType, selector = Selector} = AuthQuery, + case query(Pool, Collection, maps:from_list(replvars(Selector, ClientInfo))) of + undefined -> emqx_metrics:inc(?AUTH_METRICS(ignore)); + {error, Reason} -> + ?LOG(error, "[MongoDB] Can't connect to MongoDB server: ~0p", [Reason]), + ok = emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{auth_result => not_authorized, anonymous => false}}; + UserMap -> + Result = case [maps:get(Field, UserMap, undefined) || Field <- Fields] of + [undefined] -> {error, password_error}; + [PassHash] -> + check_pass({PassHash, Password}, HashType); + [PassHash, Salt|_] -> + check_pass({PassHash, Salt, Password}, HashType) + end, + case Result of + ok -> + ok = emqx_metrics:inc(?AUTH_METRICS(success)), + {stop, AuthResult#{is_superuser => is_superuser(Pool, SuperQuery, ClientInfo), + anonymous => false, + auth_result => success}}; + {error, Error} -> + ?LOG(error, "[MongoDB] check auth fail: ~p", [Error]), + ok = emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{auth_result => Error, anonymous => false}} + end + end. + +check_pass(Password, HashType) -> + case emqx_passwd:check_pass(Password, HashType) of + ok -> ok; + {error, _Reason} -> {error, not_authorized} + end. + +description() -> "Authentication with MongoDB". + +%%-------------------------------------------------------------------- +%% Is Superuser? +%%-------------------------------------------------------------------- + +-spec(is_superuser(string(), maybe(#superquery{}), emqx_types:clientinfo()) -> boolean()). +is_superuser(_Pool, undefined, _ClientInfo) -> + false; +is_superuser(Pool, #superquery{collection = Coll, field = Field, selector = Selector}, ClientInfo) -> + Row = query(Pool, Coll, maps:from_list(replvars(Selector, ClientInfo))), + case maps:get(Field, Row, false) of + true -> true; + _False -> false + end. + +replvars(VarList, ClientInfo) -> + lists:map(fun(Var) -> replvar(Var, ClientInfo) end, VarList). + +replvar({Field, <<"%u">>}, #{username := Username}) -> + {Field, Username}; +replvar({Field, <<"%c">>}, #{clientid := ClientId}) -> + {Field, ClientId}; +replvar({Field, <<"%C">>}, #{cn := CN}) -> + {Field, CN}; +replvar({Field, <<"%d">>}, #{dn := DN}) -> + {Field, DN}; +replvar(Selector, _ClientInfo) -> + Selector. + +%%-------------------------------------------------------------------- +%% MongoDB Connect/Query +%%-------------------------------------------------------------------- + +connect(Opts) -> + Type = proplists:get_value(type, Opts, single), + Hosts = proplists:get_value(hosts, Opts, []), + Options = proplists:get_value(options, Opts, []), + WorkerOptions = proplists:get_value(worker_options, Opts, []), + mongo_api:connect(Type, Hosts, Options, WorkerOptions). + +query(Pool, Collection, Selector) -> + ecpool:with_client(Pool, fun(Conn) -> mongo_api:find_one(Conn, Collection, Selector, #{}) end). + +query_multi(Pool, Collection, SelectorList) -> + lists:reverse(lists:flatten(lists:foldl(fun(Selector, Acc1) -> + Batch = ecpool:with_client(Pool, fun(Conn) -> + case mongo_api:find(Conn, Collection, Selector, #{}) of + [] -> []; + {ok, Cursor} -> + mc_cursor:foldl(fun(O, Acc2) -> [O|Acc2] end, [], Cursor, 1000) + end + end), + [Batch|Acc1] + end, [], SelectorList))). diff --git a/apps/emqx_auth_mongo/src/emqx_auth_mongo_app.erl b/apps/emqx_auth_mongo/src/emqx_auth_mongo_app.erl new file mode 100644 index 000000000..e13fe30b7 --- /dev/null +++ b/apps/emqx_auth_mongo/src/emqx_auth_mongo_app.erl @@ -0,0 +1,87 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mongo_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_mongo.hrl"). + +-import(proplists, [get_value/3]). + +%% Application callbacks +-export([ start/2 + , prep_stop/1 + , stop/1 + ]). + +%%-------------------------------------------------------------------- +%% Application callbacks +%%-------------------------------------------------------------------- + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqx_auth_mongo_sup:start_link(), + with_env(auth_query, fun reg_authmod/1), + with_env(acl_query, fun reg_aclmod/1), + {ok, Sup}. + +prep_stop(State) -> + ok = emqx:unhook('client.authenticate', fun emqx_auth_mongo:check/3), + ok = emqx:unhook('client.check_acl', fun emqx_acl_mongo:check_acl/5), + State. + +stop(_State) -> + ok. + +reg_authmod(AuthQuery) -> + emqx_auth_mongo:register_metrics(), + SuperQuery = r(super_query, application:get_env(?APP, super_query, undefined)), + ok = emqx:hook('client.authenticate', fun emqx_auth_mongo:check/3, + [#{authquery => AuthQuery, superquery => SuperQuery, pool => ?APP}]). + +reg_aclmod(AclQuery) -> + emqx_acl_mongo:register_metrics(), + ok = emqx:hook('client.check_acl', fun emqx_acl_mongo:check_acl/5, [#{aclquery => AclQuery, pool => ?APP}]). + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +with_env(Name, Fun) -> + case application:get_env(?APP, Name) of + undefined -> ok; + {ok, Config} -> Fun(r(Name, Config)) + end. + +r(super_query, undefined) -> + undefined; +r(super_query, Config) -> + #superquery{collection = list_to_binary(get_value(collection, Config, "mqtt_user")), + field = list_to_binary(get_value(super_field, Config, "is_superuser")), + selector = get_value(selector, Config, ?DEFAULT_SELECTORS)}; + +r(auth_query, Config) -> + #authquery{collection = list_to_binary(get_value(collection, Config, "mqtt_user")), + field = get_value(password_field, Config, [<<"password">>]), + hash = get_value(password_hash, Config, sha256), + selector = get_value(selector, Config, ?DEFAULT_SELECTORS)}; + +r(acl_query, Config) -> + #aclquery{collection = list_to_binary(get_value(collection, Config, "mqtt_acl")), + selector = get_value(selector, Config, [?DEFAULT_SELECTORS])}. + diff --git a/apps/emqx_auth_mongo/src/emqx_auth_mongo_sup.erl b/apps/emqx_auth_mongo/src/emqx_auth_mongo_sup.erl new file mode 100644 index 000000000..dc2c37fd4 --- /dev/null +++ b/apps/emqx_auth_mongo/src/emqx_auth_mongo_sup.erl @@ -0,0 +1,34 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mongo_sup). + +-behaviour(supervisor). + +-include("emqx_auth_mongo.hrl"). + +-export([start_link/0]). + +-export([init/1]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +init([]) -> + {ok, PoolEnv} = application:get_env(?APP, server), + PoolSpec = ecpool:pool_spec(?APP, ?APP, ?APP, PoolEnv), + {ok, {{one_for_all, 10, 100}, [PoolSpec]}}. + diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl new file mode 100644 index 000000000..dffd5b423 --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl @@ -0,0 +1,173 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mongo_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("common_test/include/ct.hrl"). +-include_lib("eunit/include/eunit.hrl"). + +-define(APP, emqx_auth_mongo). + +-define(POOL(App), ecpool_worker:client(gproc_pool:pick_worker({ecpool, App}))). + +-define(MONGO_CL_ACL, <<"mqtt_acl">>). +-define(MONGO_CL_USER, <<"mqtt_user">>). + +-define(INIT_ACL, [{<<"username">>, <<"testuser">>, <<"clientid">>, <<"null">>, <<"subscribe">>, [<<"#">>]}, + {<<"username">>, <<"dashboard">>, <<"clientid">>, <<"null">>, <<"pubsub">>, [<<"$SYS/#">>]}, + {<<"username">>, <<"user3">>, <<"clientid">>, <<"null">>, <<"publish">>, [<<"a/b/c">>]}]). + +-define(INIT_AUTH, [{<<"username">>, <<"plain">>, <<"password">>, <<"plain">>, <<"salt">>, <<"salt">>, <<"is_superuser">>, true}, + {<<"username">>, <<"md5">>, <<"password">>, <<"1bc29b36f623ba82aaf6724fd3b16718">>, <<"salt">>, <<"salt">>, <<"is_superuser">>, false}, + {<<"username">>, <<"sha">>, <<"password">>, <<"d8f4590320e1343a915b6394170650a8f35d6926">>, <<"salt">>, <<"salt">>, <<"is_superuser">>, false}, + {<<"username">>, <<"sha256">>, <<"password">>, <<"5d5b09f6dcb2d53a5fffc60c4ac0d55fabdf556069d6631545f42aa6e3500f2e">>, <<"salt">>, <<"salt">>, <<"is_superuser">>, false}, + {<<"username">>, <<"pbkdf2_password">>, <<"password">>, <<"cdedb5281bb2f801565a1122b2563515">>, <<"salt">>, <<"ATHENA.MIT.EDUraeburn">>, <<"is_superuser">>, false}, + {<<"username">>, <<"bcrypt_foo">>, <<"password">>, <<"$2a$12$sSS8Eg.ovVzaHzi1nUHYK.HbUIOdlQI0iS22Q5rd5z.JVVYH6sfm6">>, <<"salt">>, <<"$2a$12$sSS8Eg.ovVzaHzi1nUHYK.">>, <<"is_superuser">>, false} + ]). + +%%-------------------------------------------------------------------- +%% Setups +%%-------------------------------------------------------------------- + +all() -> + emqx_ct:all(?MODULE). + +init_per_suite(Cfg) -> + emqx_ct_helpers:start_apps([emqx_auth_mongo], fun set_special_confs/1), + init_mongo_data(), + Cfg. + +end_per_suite(_Cfg) -> + deinit_mongo_data(), + emqx_ct_helpers:stop_apps([emqx_auth_mongo]). + +set_special_confs(emqx) -> + application:set_env(emqx, acl_nomatch, deny), + application:set_env(emqx, acl_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/acl.conf")), + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, enable_acl_cache, false), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/loaded_plugins")); +set_special_confs(_App) -> + ok. + +init_mongo_data() -> + %% Users + {ok, Connection} = ?POOL(?APP), + mongo_api:delete(Connection, ?MONGO_CL_USER, {}), + ?assertMatch({{true, _}, _}, mongo_api:insert(Connection, ?MONGO_CL_USER, ?INIT_AUTH)), + %% ACLs + mongo_api:delete(Connection, ?MONGO_CL_ACL, {}), + ?assertMatch({{true, _}, _}, mongo_api:insert(Connection, ?MONGO_CL_ACL, ?INIT_ACL)). + +deinit_mongo_data() -> + {ok, Connection} = ?POOL(?APP), + mongo_api:delete(Connection, ?MONGO_CL_USER, {}), + mongo_api:delete(Connection, ?MONGO_CL_ACL, {}). + +%%-------------------------------------------------------------------- +%% Test cases +%%-------------------------------------------------------------------- + +t_check_auth(_) -> + Plain = #{zone => external, clientid => <<"client1">>, username => <<"plain">>}, + Plain1 = #{zone => external, clientid => <<"client1">>, username => <<"plain2">>}, + Md5 = #{zone => external, clientid => <<"md5">>, username => <<"md5">>}, + Sha = #{zone => external, clientid => <<"sha">>, username => <<"sha">>}, + Sha256 = #{zone => external, clientid => <<"sha256">>, username => <<"sha256">>}, + Pbkdf2 = #{zone => external, clientid => <<"pbkdf2_password">>, username => <<"pbkdf2_password">>}, + Bcrypt = #{zone => external, clientid => <<"bcrypt_foo">>, username => <<"bcrypt_foo">>}, + User1 = #{zone => external, clientid => <<"bcrypt_foo">>, username => <<"user">>}, + reload({auth_query, [{password_hash, plain}]}), + %% With exactly username/password, connection success + {ok, #{is_superuser := true}} = emqx_access_control:authenticate(Plain#{password => <<"plain">>}), + %% With exactly username and wrong password, connection fail + {error, _} = emqx_access_control:authenticate(Plain#{password => <<"error_pwd">>}), + %% With wrong username and wrong password, emqx_auth_mongo auth fail, then allow anonymous authentication + {error, _} = emqx_access_control:authenticate(Plain1#{password => <<"error_pwd">>}), + %% With wrong username and exactly password, emqx_auth_mongo auth fail, then allow anonymous authentication + {error, _} = emqx_access_control:authenticate(Plain1#{password => <<"plain">>}), + reload({auth_query, [{password_hash, md5}]}), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Md5#{password => <<"md5">>}), + reload({auth_query, [{password_hash, sha}]}), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Sha#{password => <<"sha">>}), + reload({auth_query, [{password_hash, sha256}]}), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Sha256#{password => <<"sha256">>}), + %%pbkdf2 sha + reload({auth_query, [{password_hash, {pbkdf2, sha, 1, 16}}, {password_field, [<<"password">>, <<"salt">>]}]}), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Pbkdf2#{password => <<"password">>}), + reload({auth_query, [{password_hash, {salt, bcrypt}}]}), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Bcrypt#{password => <<"foo">>}), + {error, _} = emqx_access_control:authenticate(User1#{password => <<"foo">>}). + +t_check_acl(_) -> + {ok, Connection} = ?POOL(?APP), + User1 = #{zone => external, clientid => <<"client1">>, username => <<"testuser">>}, + User2 = #{zone => external, clientid => <<"client2">>, username => <<"dashboard">>}, + User3 = #{zone => external, clientid => <<"client2">>, username => <<"user3">>}, + User4 = #{zone => external, clientid => <<"$$client2">>, username => <<"$$user3">>}, + 3 = mongo_api:count(Connection, ?MONGO_CL_ACL, {}, 17), + %% ct log output + allow = emqx_access_control:check_acl(User1, subscribe, <<"users/testuser/1">>), + deny = emqx_access_control:check_acl(User1, subscribe, <<"$SYS/testuser/1">>), + deny = emqx_access_control:check_acl(User2, subscribe, <<"a/b/c">>), + allow = emqx_access_control:check_acl(User2, subscribe, <<"$SYS/testuser/1">>), + allow = emqx_access_control:check_acl(User3, publish, <<"a/b/c">>), + deny = emqx_access_control:check_acl(User3, publish, <<"c">>), + deny = emqx_access_control:check_acl(User4, publish, <<"a/b/c">>). + +t_acl_super(_) -> + reload({auth_query, [{password_hash, plain}, {password_field, [<<"password">>]}]}), + {ok, C} = emqtt:start_link([{clientid, <<"simpleClient">>}, + {username, <<"plain">>}, + {password, <<"plain">>}]), + {ok, _} = emqtt:connect(C), + timer:sleep(10), + emqtt:subscribe(C, <<"TopicA">>, qos2), + timer:sleep(1000), + emqtt:publish(C, <<"TopicA">>, <<"Payload">>, qos2), + timer:sleep(1000), + receive + {publish, #{payload := Payload}} -> + ?assertEqual(<<"Payload">>, Payload) + after + 1000 -> + ct:fail({receive_timeout, <<"Payload">>}), + ok + end, + emqtt:disconnect(C). + +%%-------------------------------------------------------------------- +%% Utils +%%-------------------------------------------------------------------- + +reload({Par, Vals}) when is_list(Vals) -> + application:stop(?APP), + {ok, TupleVals} = application:get_env(?APP, Par), + NewVals = + lists:filtermap(fun({K, V}) -> + case lists:keymember(K, 1, Vals) of + false ->{true, {K, V}}; + _ -> false + end + end, TupleVals), + application:set_env(?APP, Par, lists:append(NewVals, Vals)), + application:start(?APP). diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca-key.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca-key.pem new file mode 100644 index 000000000..e9717011e --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA0kGUBi9NDp65jgdxKfizIfuSr2wpwb44yM9SuP4oUQSULOA2 +4iFpLR/c5FAYHU81y9Vx91dQjdZfffaBZuv2zVvteXUkol8Nez7boKbo2E41MTew +8edtNKZAQVvnaHAC2NCZxjchCzUCDEoUUcl+cIERZ8R48FBqK5iTVcMRIx1akwus ++dhBqP0ykA5TGOWZkJrLM9aUXSPQha9+wXlOpkvu0Ur2nkX8PPJnifWao9UShSar +ll1IqPZNCSlZMwcFYcQNBCpdvITUUYlHvMRQV64bUpOxUGDuJkQL3dLKBlNuBRlJ +BcjBAKw7rFnwwHZcMmQ9tan/dZzpzwjo/T0XjwIDAQABAoIBAQCSHvUqnzDkWjcG +l/Fzg92qXlYBCCC0/ugj1sHcwvVt6Mq5rVE3MpUPwTcYjPlVVTlD4aEEjm/zQuq2 +ddxUlOS+r4aIhHrjRT/vSS4FpjnoKeIZxGR6maVxk6DQS3i1QjMYT1CvSpzyVvKH +a+xXMrtmoKxh+085ZAmFJtIuJhUA2yEa4zggCxWnvz8ecLClUPfVDPhdLBHc3KmL +CRpHEC6L/wanvDPRdkkzfKyaJuIJlTDaCg63AY5sDkTW2I57iI/nJ3haSeidfQKz +39EfbnM1A/YprIakafjAu3frBIsjBVcxwGihZmL/YriTHjOggJF841kT5zFkkv2L +/530Wk6xAoGBAOqZLZ4DIi/zLndEOz1mRbUfjc7GQUdYplBnBwJ22VdS0P4TOXnd +UbJth2MA92NM7ocTYVFl4TVIZY/Y+Prxk7KQdHWzR7JPpKfx9OEVgtSqV0vF9eGI +rKp79Y1T4Mvc3UcQCXX6TP7nHLihEzpS8odm2LW4txrOiLsn4Fq/IWrLAoGBAOVv +6U4tm3lImotUupKLZPKEBYwruo9qRysoug9FiorP4TjaBVOfltiiHbAQD6aGfVtN +SZpZZtrs17wL7Xl4db5asgMcZd+8Hkfo5siR7AuGW9FZloOjDcXb5wCh9EvjJ74J +Cjw7RqyVymq9t7IP6wnVwj5Ck48YhlOZCz/mzlnNAoGAWq7NYFgLvgc9feLFF23S +IjpJQZWHJEITP98jaYNxbfzYRm49+GphqxwFinKULjFNvq7yHlnIXSVYBOu1CqOZ +GRwXuGuNmlKI7lZr9xmukfAqgGLMMdr4C4qRF4lFyufcLRz42z7exmWlx4ST/yaT +E13hBRWayeTuG5JFei6Jh1MCgYEAqmX4LyC+JFBgvvQZcLboLRkSCa18bADxhENG +FAuAvmFvksqRRC71WETmqZj0Fqgxt7pp3KFjO1rFSprNLvbg85PmO1s+6fCLyLpX +lESTu2d5D71qhK93jigooxalGitFm+SY3mzjq0/AOpBWOn+J/w7rqVPGxXLgaHv0 +l+vx+00CgYBOvo9/ImjwYii2jFl+sHEoCzlvpITi2temRlT2j6ulSjCLJgjwEFw9 +8e+vvfQumQOsutakUVyURrkMGNDiNlIv8kv5YLCCkrwN22E6Ghyi69MJUvHQXkc/ +QZhjn/luyfpB5f/BeHFS2bkkxAXo+cfG45ApY3Qfz6/7o+H+vDa6/A== +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca.pem new file mode 100644 index 000000000..00b31d8a4 --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAzCCAeugAwIBAgIBATANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowPDE6MDgGA1UEAwwxTXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9DQV9DZXJ0aWZpY2F0ZTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANJBlAYvTQ6euY4HcSn4syH7kq9s +KcG+OMjPUrj+KFEElCzgNuIhaS0f3ORQGB1PNcvVcfdXUI3WX332gWbr9s1b7Xl1 +JKJfDXs+26Cm6NhONTE3sPHnbTSmQEFb52hwAtjQmcY3IQs1AgxKFFHJfnCBEWfE +ePBQaiuYk1XDESMdWpMLrPnYQaj9MpAOUxjlmZCayzPWlF0j0IWvfsF5TqZL7tFK +9p5F/DzyZ4n1mqPVEoUmq5ZdSKj2TQkpWTMHBWHEDQQqXbyE1FGJR7zEUFeuG1KT +sVBg7iZEC93SygZTbgUZSQXIwQCsO6xZ8MB2XDJkPbWp/3Wc6c8I6P09F48CAwEA +AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEADKz6bIpP5anp +GgLB0jkclRWuMlS4qqIt4itSsMXPJ/ezpHwECixmgW2TIQl6S1woRkUeMxhT2/Ay +Sn/7aKxuzRagyE5NEGOvrOuAP5RO2ZdNJ/X3/Rh533fK1sOTEEbSsWUvW6iSkZef +rsfZBVP32xBhRWkKRdLeLB4W99ADMa0IrTmZPCXHSSE2V4e1o6zWLXcOZeH1Qh8N +SkelBweR+8r1Fbvy1r3s7eH7DCbYoGEDVLQGOLvzHKBisQHmoDnnF5E9g1eeNRdg +o+vhOKfYCOzeNREJIqS42PHcGhdNRk90ycigPmfUJclz1mDHoMjKR2S5oosTpr65 +tNPx3CL7GA== +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-cert.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-cert.pem new file mode 100644 index 000000000..aad1404ca --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAzANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0N1oXDTMwMDYwOTAzMzg0N1owQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9DbGllbnRfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVYSWpOvCTupz82fc85Opv +EQ7rkB8X2oOMyBCpkyHKBIr1ZQgRDWBp9UVOASq3GnSElm6+T3Kb1QbOffa8GIlw +sjAueKdq5L2eSkmPIEQ7eoO5kEW+4V866hE1LeL/PmHg2lGP0iqZiJYtElhHNQO8 +3y9I7cm3xWMAA3SSWikVtpJRn3qIp2QSrH+tK+/HHbE5QwtPxdir4ULSCSOaM5Yh +Wi5Oto88TZqe1v7SXC864JVvO4LuS7TuSreCdWZyPXTJFBFeCEWSAxonKZrqHbBe +CwKML6/0NuzjaQ51c2tzmVI6xpHj3nnu4cSRx6Jf9WBm+35vm0wk4pohX3ptdzeV +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAByQ5zSNeFUH +Aw7JlpZHtHaSEeiiyBHke20ziQ07BK1yi/ms2HAWwQkpZv149sjNuIRH8pkTmkZn +g8PDzSefjLbC9AsWpWV0XNV22T/cdobqLqMBDDZ2+5bsV+jTrOigWd9/AHVZ93PP +IJN8HJn6rtvo2l1bh/CdsX14uVSdofXnuWGabNTydqtMvmCerZsdf6qKqLL+PYwm +RDpgWiRUY7KPBSSlKm/9lJzA+bOe4dHeJzxWFVCJcbpoiTFs1je1V8kKQaHtuW39 +ifX6LTKUMlwEECCbDKM8Yq2tm8NjkjCcnFDtKg8zKGPUu+jrFMN5otiC3wnKcP7r +O9EkaPcgYH8= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-key.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-key.pem new file mode 100644 index 000000000..6789d0291 --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA1WElqTrwk7qc/Nn3POTqbxEO65AfF9qDjMgQqZMhygSK9WUI +EQ1gafVFTgEqtxp0hJZuvk9ym9UGzn32vBiJcLIwLninauS9nkpJjyBEO3qDuZBF +vuFfOuoRNS3i/z5h4NpRj9IqmYiWLRJYRzUDvN8vSO3Jt8VjAAN0klopFbaSUZ96 +iKdkEqx/rSvvxx2xOUMLT8XYq+FC0gkjmjOWIVouTraPPE2antb+0lwvOuCVbzuC +7ku07kq3gnVmcj10yRQRXghFkgMaJyma6h2wXgsCjC+v9Dbs42kOdXNrc5lSOsaR +49557uHEkceiX/VgZvt+b5tMJOKaIV96bXc3lQIDAQABAoIBAF7yjXmSOn7h6P0y +WCuGiTLG2mbDiLJqj2LTm2Z5i+2Cu/qZ7E76Ls63TxF4v3MemH5vGfQhEhR5ZD/6 +GRJ1sKKvB3WGRqjwA9gtojHH39S/nWGy6vYW/vMOOH37XyjIr3EIdIaUtFQBTSHd +Kd71niYrAbVn6fyWHolhADwnVmTMOl5OOAhCdEF4GN3b5aIhIu8BJ7EUzTtHBJIj +CAEfjZFjDs1y1cIgGFJkuIQxMfCpq5recU2qwip7YO6fk//WEjOPu7kSf5IEswL8 +jg1dea9rGBV6KaD2xsgsC6Ll6Sb4BbsrHMfflG3K2Lk3RdVqqTFp1Fn1PTLQE/1S +S/SZPYECgYEA9qYcHKHd0+Q5Ty5wgpxKGa4UCWkpwvfvyv4bh8qlmxueB+l2AIdo +ZvkM8gTPagPQ3WypAyC2b9iQu70uOJo1NizTtKnpjDdN1YpDjISJuS/P0x73gZwy +gmoM5AzMtN4D6IbxXtXnPaYICvwLKU80ouEN5ZPM4/ODLUu6gsp0v2UCgYEA3Xgi +zMC4JF0vEKEaK0H6QstaoXUmw/lToZGH3TEojBIkb/2LrHUclygtONh9kJSFb89/ +jbmRRLAOrx3HZKCNGUmF4H9k5OQyAIv6OGBinvLGqcbqnyNlI+Le8zxySYwKMlEj +EMrBCLmSyi0CGFrbZ3mlj/oCET/ql9rNvcK+DHECgYAEx5dH3sMjtgp+RFId1dWB +xePRgt4yTwewkVgLO5wV82UOljGZNQaK6Eyd7AXw8f38LHzh+KJQbIvxd2sL4cEi +OaAoohpKg0/Y0YMZl//rPMf0OWdmdZZs/I0fZjgZUSwWN3c59T8z7KG/RL8an9RP +S7kvN7wCttdV61/D5RR6GQKBgDxCe/WKWpBKaovzydMLWLTj7/0Oi0W3iXHkzzr4 +LTgvl4qBSofaNbVLUUKuZTv5rXUG2IYPf99YqCYtzBstNDc1MiAriaBeFtzfOW4t +i6gEFtoLLbuvPc3N5Sv5vn8Ug5G9UfU3td5R4AbyyCcoUZqOFuZd+EIJSiOXfXOs +kVmBAoGBAIU9aPAqhU5LX902oq8KsrpdySONqv5mtoStvl3wo95WIqXNEsFY60wO +q02jKQmJJ2MqhkJm2EoF2Mq8+40EZ5sz8LdgeQ/M0yQ9lAhPi4rftwhpe55Ma9dk +SE9X1c/DMCBEaIjJqVXdy0/EeArwpb8sHkguVVAZUWxzD+phm1gs +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/mongodb.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/mongodb.pem new file mode 100644 index 000000000..1fe94891a --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/mongodb.pem @@ -0,0 +1,46 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAjANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9TZXJ2ZXJfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCcEnEm5hqP1EbEJycOz8Ua +NWp29QdpFUzTWhkKGhVXk+0msmNTw4NBAFB42moY44OU8wvDideOlJNhPRWveD8z +G2lxzJA91p0UK4et8ia9MmeuCGhdC9jxJ8X69WNlUiPyy0hI/ZsqRq9Z0C2eW0iL +JPXsy4X8Xpw3SFwoXf5pR9RFY5Pb2tuyxqmSestu2VXT/NQjJg4CVDR3mFcHPXZB +4elRzH0WshExEGkgy0bg20MJeRc2Qdb5Xx+EakbmwroDWaCn3NSGqQ7jv6Vw0doy +TGvS6h6RHBxnyqRfRgKGlCoOMG9/5+rFJC00QpCUG2vHXHWGoWlMlJ3foN7rj5v9 +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJ5zt2rj4Ag6 +zpN59AWC1Fur8g8l41ksHkSpKPp+PtyO/ngvbMqBpfmK1e7JCKZv/68QXfMyWWAI +hwalqZkXXWHKjuz3wE7dE25PXFXtGJtcZAaj10xt98fzdqt8lQSwh2kbfNwZIz1F +sgAStgE7+ZTcqTgvNB76Os1UK0to+/P0VBWktaVFdyub4Nc2SdPVnZNvrRBXBwOD +3V8ViwywDOFoE7DvCvwx/SVsvoC0Z4j3AMMovO6oHicP7uU83qsQgm1Qru3YeoLR ++DoVi7IPHbWvN7MqFYn3YjNlByO2geblY7MR0BlqbFlmFrqLsUfjsh2ys7/U/knC +dN/klu446fI= +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAnBJxJuYaj9RGxCcnDs/FGjVqdvUHaRVM01oZChoVV5PtJrJj +U8ODQQBQeNpqGOODlPMLw4nXjpSTYT0Vr3g/MxtpccyQPdadFCuHrfImvTJnrgho +XQvY8SfF+vVjZVIj8stISP2bKkavWdAtnltIiyT17MuF/F6cN0hcKF3+aUfURWOT +29rbssapknrLbtlV0/zUIyYOAlQ0d5hXBz12QeHpUcx9FrIRMRBpIMtG4NtDCXkX +NkHW+V8fhGpG5sK6A1mgp9zUhqkO47+lcNHaMkxr0uoekRwcZ8qkX0YChpQqDjBv +f+fqxSQtNEKQlBtrx1x1hqFpTJSd36De64+b/QIDAQABAoIBAFiah66Dt9SruLkn +WR8piUaFyLlcBib8Nq9OWSTJBhDAJERxxb4KIvvGB+l0ZgNXNp5bFPSfzsZdRwZP +PX5uj8Kd71Dxx3mz211WESMJdEC42u+MSmN4lGLkJ5t/sDwXU91E1vbJM0ve8THV +4/Ag9qA4DX2vVZOeyqT/6YHpSsPNZplqzrbAiwrfHwkctHfgqwOf3QLfhmVQgfCS +VwidBldEUv2whSIiIxh4Rv5St4kA68IBCbJxdpOpyuQBkk6CkxZ7VN9FqOuSd4Pk +Wm7iWyBMZsCmELZh5XAXld4BEt87C5R4CvbPBDZxAv3THk1DNNvpy3PFQfwARRFb +SAToYMECgYEAyL7U8yxpzHDYWd3oCx6vTi9p9N/z0FfAkWrRF6dm4UcSklNiT1Aq +EOnTA+SaW8tV3E64gCWcY23gNP8so/ZseWj6L+peHwtchaP9+KB7yGw2A+05+lOx +VetLTjAOmfpiUXFe5w1q4C1RGhLjZjjzW+GvwdAuchQgUEFaomrV+PUCgYEAxwfH +cmVGFbAktcjU4HSRjKSfawCrut+3YUOLybyku3Q/hP9amG8qkVTFe95CTLjLe2D0 +ccaTTpofFEJ32COeck0g0Ujn/qQ+KXRoauOYs4FB1DtqMpqB78wufWEUpDpbd9/h +J+gJdC/IADd4tJW9zA92g8IA7ZtFmqDtiSpQ0ekCgYAQGkaorvJZpN+l7cf0RGTZ +h7IfI2vCVZer0n6tQA9fmLzjoe6r4AlPzAHSOR8sp9XeUy43kUzHKQQoHCPvjw/K +eWJAP7OHF/k2+x2fOPhU7mEy1W+mJdp+wt4Kio5RSaVjVQ3AyPG+w8PSrJszEvRq +dWMMz+851WV2KpfjmWBKlQKBgQC++4j4DZQV5aMkSKV1CIZOBf3vaIJhXKEUFQPD +PmB4fBEjpwCg+zNGp6iktt65zi17o8qMjrb1mtCt2SY04eD932LZUHNFlwcLMmes +Ad+aiDLJ24WJL1f16eDGcOyktlblDZB5gZ/ovJzXEGOkLXglosTfo77OQculmDy2 +/UL2WQKBgGeKasmGNfiYAcWio+KXgFkHXWtAXB9B91B1OFnCa40wx+qnl71MIWQH +PQ/CZFNWOfGiNEJIZjrHsfNJoeXkhq48oKcT0AVCDYyLV0VxDO4ejT95mGW6njNd +JpvmhwwAjOvuWVr0tn4iXlSK8irjlJHmwcRjLTJq97vE9fsA2MjI +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/private_key.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/private_key.pem new file mode 100644 index 000000000..8fbf6bdec --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/private_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA1zVmMhPqpSPMmYkKh5wwlRD5XuS8YWJKEM6tjFx61VK8qxHE +YngkC2KnL5EuKAjQZIF3tJskwt0hAat047CCCZxrkNEpbVvSnvnk+A/8bg/Ww1n3 +qxzfifhsWfpUKlDnwrtH+ftt+5rZeEkf37XAPy7ZjzecAF9SDV6WSiPeAxUX2+hN +dId42Pf45woo4LFGUlQeagCFkD/R0dpNIMGwcnkKCUikiBqr2ijSIgvRtBfZ9fBG +jFGER2uE/Eay4AgcQsHue8skRwDCng8OnqtPnBtTytmqTy9V/BRgsVKUoksm6wsx +kUYwgHeaq7UCvlCm25SZ7yRyd4k8t0BKDf2h+wIDAQABAoIBAEQcrHmRACTADdNS +IjkFYALt2l8EOfMAbryfDSJtapr1kqz59JPNvmq0EIHnixo0n/APYdmReLML1ZR3 +tYkSpjVwgkLVUC1CcIjMQoGYXaZf8PLnGJHZk45RR8m6hsTV0mQ5bfBaeVa2jbma +OzJMjcnxg/3l9cPQZ2G/3AUfEPccMxOXp1KRz3mUQcGnKJGtDbN/kfmntcwYoxaE +Zg4RoeKAoMpK1SSHAiJKe7TnztINJ7uygR9XSzNd6auY8A3vomSIjpYO7XL+lh7L +izm4Ir3Gb/eCYBvWgQyQa2KCJgK/sQyEs3a09ngofSEUhQJQYhgZDwUj+fDDOGqj +hCZOA8ECgYEA+ZWuHdcUQ3ygYhLds2QcogUlIsx7C8n/Gk/FUrqqXJrTkuO0Eqqa +B47lCITvmn2zm0ODfSFIARgKEUEDLS/biZYv7SUTrFqBLcet+aGI7Dpv91CgB75R +tNzcIf8VxoiP0jPqdbh9mLbbxGi5Uc4p9TVXRljC4hkswaouebWee0sCgYEA3L2E +YB3kiHrhPI9LHS5Px9C1w+NOu5wP5snxrDGEgaFCvL6zgY6PflacppgnmTXl8D1x +im0IDKSw5dP3FFonSVXReq3CXDql7UnhfTCiLDahV7bLxTH42FofcBpDN3ERdOal +58RwQh6VrLkzQRVoObo+hbGlFiwwSAfQC509FhECgYBsRSBpVXo25IN2yBRg09cP ++gdoFyhxrsj5kw1YnB13WrrZh+oABv4WtUhp77E5ZbpaamlKCPwBbXpAjeFg4tfr +0bksuN7V79UGFQ9FsWuCfr8/nDwv38H2IbFlFhFONMOfPmJBey0Q6JJhm8R41mSh +OOiJXcv85UrjIH5U0hLUDQKBgQDVLOU5WcUJlPoOXSgiT0ZW5xWSzuOLRUUKEf6l +19BqzAzCcLy0orOrRAPW01xylt2v6/bJw1Ahva7k1ZZo/kOwjANYoZPxM+ZoSZBN +MXl8j2mzZuJVV1RFxItV3NcLJNPB/Lk+IbRz9kt/2f9InF7iWR3mSU/wIM6j0X+2 +p6yFsQKBgQCM/ldWb511lA+SNkqXB2P6WXAgAM/7+jwsNHX2ia2Ikufm4SUEKMSv +mti/nZkHDHsrHU4wb/2cOAywMELzv9EHzdcoenjBQP65OAc/1qWJs+LnBcCXfqKk +aHjEZW6+brkHdRGLLY3YAHlt/AUL+RsKPJfN72i/FSpmu+52G36eeQ== +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/public_key.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/public_key.pem new file mode 100644 index 000000000..f9772b533 --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/public_key.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1zVmMhPqpSPMmYkKh5ww +lRD5XuS8YWJKEM6tjFx61VK8qxHEYngkC2KnL5EuKAjQZIF3tJskwt0hAat047CC +CZxrkNEpbVvSnvnk+A/8bg/Ww1n3qxzfifhsWfpUKlDnwrtH+ftt+5rZeEkf37XA +Py7ZjzecAF9SDV6WSiPeAxUX2+hNdId42Pf45woo4LFGUlQeagCFkD/R0dpNIMGw +cnkKCUikiBqr2ijSIgvRtBfZ9fBGjFGER2uE/Eay4AgcQsHue8skRwDCng8OnqtP +nBtTytmqTy9V/BRgsVKUoksm6wsxkUYwgHeaq7UCvlCm25SZ7yRyd4k8t0BKDf2h ++wIDAQAB +-----END PUBLIC KEY----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/server-cert.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/server-cert.pem new file mode 100644 index 000000000..a2f9688df --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/server-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAjANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9TZXJ2ZXJfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCcEnEm5hqP1EbEJycOz8Ua +NWp29QdpFUzTWhkKGhVXk+0msmNTw4NBAFB42moY44OU8wvDideOlJNhPRWveD8z +G2lxzJA91p0UK4et8ia9MmeuCGhdC9jxJ8X69WNlUiPyy0hI/ZsqRq9Z0C2eW0iL +JPXsy4X8Xpw3SFwoXf5pR9RFY5Pb2tuyxqmSestu2VXT/NQjJg4CVDR3mFcHPXZB +4elRzH0WshExEGkgy0bg20MJeRc2Qdb5Xx+EakbmwroDWaCn3NSGqQ7jv6Vw0doy +TGvS6h6RHBxnyqRfRgKGlCoOMG9/5+rFJC00QpCUG2vHXHWGoWlMlJ3foN7rj5v9 +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJ5zt2rj4Ag6 +zpN59AWC1Fur8g8l41ksHkSpKPp+PtyO/ngvbMqBpfmK1e7JCKZv/68QXfMyWWAI +hwalqZkXXWHKjuz3wE7dE25PXFXtGJtcZAaj10xt98fzdqt8lQSwh2kbfNwZIz1F +sgAStgE7+ZTcqTgvNB76Os1UK0to+/P0VBWktaVFdyub4Nc2SdPVnZNvrRBXBwOD +3V8ViwywDOFoE7DvCvwx/SVsvoC0Z4j3AMMovO6oHicP7uU83qsQgm1Qru3YeoLR ++DoVi7IPHbWvN7MqFYn3YjNlByO2geblY7MR0BlqbFlmFrqLsUfjsh2ys7/U/knC +dN/klu446fI= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/server-key.pem b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/server-key.pem new file mode 100644 index 000000000..a1dfd5f78 --- /dev/null +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/server-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAnBJxJuYaj9RGxCcnDs/FGjVqdvUHaRVM01oZChoVV5PtJrJj +U8ODQQBQeNpqGOODlPMLw4nXjpSTYT0Vr3g/MxtpccyQPdadFCuHrfImvTJnrgho +XQvY8SfF+vVjZVIj8stISP2bKkavWdAtnltIiyT17MuF/F6cN0hcKF3+aUfURWOT +29rbssapknrLbtlV0/zUIyYOAlQ0d5hXBz12QeHpUcx9FrIRMRBpIMtG4NtDCXkX +NkHW+V8fhGpG5sK6A1mgp9zUhqkO47+lcNHaMkxr0uoekRwcZ8qkX0YChpQqDjBv +f+fqxSQtNEKQlBtrx1x1hqFpTJSd36De64+b/QIDAQABAoIBAFiah66Dt9SruLkn +WR8piUaFyLlcBib8Nq9OWSTJBhDAJERxxb4KIvvGB+l0ZgNXNp5bFPSfzsZdRwZP +PX5uj8Kd71Dxx3mz211WESMJdEC42u+MSmN4lGLkJ5t/sDwXU91E1vbJM0ve8THV +4/Ag9qA4DX2vVZOeyqT/6YHpSsPNZplqzrbAiwrfHwkctHfgqwOf3QLfhmVQgfCS +VwidBldEUv2whSIiIxh4Rv5St4kA68IBCbJxdpOpyuQBkk6CkxZ7VN9FqOuSd4Pk +Wm7iWyBMZsCmELZh5XAXld4BEt87C5R4CvbPBDZxAv3THk1DNNvpy3PFQfwARRFb +SAToYMECgYEAyL7U8yxpzHDYWd3oCx6vTi9p9N/z0FfAkWrRF6dm4UcSklNiT1Aq +EOnTA+SaW8tV3E64gCWcY23gNP8so/ZseWj6L+peHwtchaP9+KB7yGw2A+05+lOx +VetLTjAOmfpiUXFe5w1q4C1RGhLjZjjzW+GvwdAuchQgUEFaomrV+PUCgYEAxwfH +cmVGFbAktcjU4HSRjKSfawCrut+3YUOLybyku3Q/hP9amG8qkVTFe95CTLjLe2D0 +ccaTTpofFEJ32COeck0g0Ujn/qQ+KXRoauOYs4FB1DtqMpqB78wufWEUpDpbd9/h +J+gJdC/IADd4tJW9zA92g8IA7ZtFmqDtiSpQ0ekCgYAQGkaorvJZpN+l7cf0RGTZ +h7IfI2vCVZer0n6tQA9fmLzjoe6r4AlPzAHSOR8sp9XeUy43kUzHKQQoHCPvjw/K +eWJAP7OHF/k2+x2fOPhU7mEy1W+mJdp+wt4Kio5RSaVjVQ3AyPG+w8PSrJszEvRq +dWMMz+851WV2KpfjmWBKlQKBgQC++4j4DZQV5aMkSKV1CIZOBf3vaIJhXKEUFQPD +PmB4fBEjpwCg+zNGp6iktt65zi17o8qMjrb1mtCt2SY04eD932LZUHNFlwcLMmes +Ad+aiDLJ24WJL1f16eDGcOyktlblDZB5gZ/ovJzXEGOkLXglosTfo77OQculmDy2 +/UL2WQKBgGeKasmGNfiYAcWio+KXgFkHXWtAXB9B91B1OFnCa40wx+qnl71MIWQH +PQ/CZFNWOfGiNEJIZjrHsfNJoeXkhq48oKcT0AVCDYyLV0VxDO4ejT95mGW6njNd +JpvmhwwAjOvuWVr0tn4iXlSK8irjlJHmwcRjLTJq97vE9fsA2MjI +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mysql/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_mysql/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..90f2d7437 --- /dev/null +++ b/apps/emqx_auth_mysql/.github/workflows/run_test_cases.yaml @@ -0,0 +1,59 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + strategy: + matrix: + mysql_tag: + - 5.7 + - 8 + network_type: + - ipv4 + - ipv6 + connect_type: + - ssl + - tcp + + steps: + - name: install docker-compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - uses: actions/checkout@v1 + - name: run test cases + env: + MYSQL_TAG: ${{ matrix.mysql_tag }} + NETWORK_TYPE: ${{ matrix.network_type }} + CONNECT_TYPE: ${{ matrix.connect_type }} + run: | + if [ "$NETWORK_TYPE" = "ipv6" ];then docker network create --driver bridge --ipv6 --subnet fd15:555::/64 test_emqx_bridge --attachable; fi + if [ "$CONNECT_TYPE" = "ssl" ]; then + docker-compose -f ./docker-compose-ssl.yml -p test up -d + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.mysql.ssl.cafile = /emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca.pem' >> /emqx_auth_mysql/etc/emqx_auth_mysql.conf" + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.mysql.ssl.certfile = /emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-cert.pem' >> /emqx_auth_mysql/etc/emqx_auth_mysql.conf" + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.mysql.ssl.keyfile = /emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-key.pem' >> /emqx_auth_mysql/etc/emqx_auth_mysql.conf" + else + docker-compose -f ./docker-compose.yml -p test up -d + fi + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.mysql.username = root' >> /emqx_auth_mysql/etc/emqx_auth_mysql.conf " + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "echo 'auth.mysql.password = public' >> /emqx_auth_mysql/etc/emqx_auth_mysql.conf" + if [ "$NETWORK_TYPE" != "ipv6" ];then + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.mysql.server/c auth.mysql.server = mysql_server:3306' /emqx_auth_mysql/etc/emqx_auth_mysql.conf" + else + ipv6_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' $(docker ps -a -f name=test_mysql_server_1 -q)) + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "sed -i '/auth.mysql.server/c auth.mysql.server = $ipv6_address:3306' /emqx_auth_mysql/etc/emqx_auth_mysql.conf" + fi + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_mysql xref" + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_mysql eunit" + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_mysql ct" + docker exec -i $(docker ps -a -f name=test_erlang_1 -q) sh -c "make -C /emqx_auth_mysql cover" + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: logs_mysql${{ matrix.mysql_tag }}_${{ matrix.network_type }} + path: _build/test/logs + diff --git a/apps/emqx_auth_mysql/.gitignore b/apps/emqx_auth_mysql/.gitignore new file mode 100644 index 000000000..bc6fa0f2f --- /dev/null +++ b/apps/emqx_auth_mysql/.gitignore @@ -0,0 +1,31 @@ +.eunit +deps +*.so +.iml +.idea +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.erlang.mk/ +emqx_auth_mysql.d +ct.coverdata +logs/ +test/ct.cover.spec +test/*.beam +cover/ +eunit.coverdata +data +.placeholder +_build/ +rebar.lock +erlang.mk +rebar3.crashdump +etc/emqx_auth_mysql.conf.rendered +.rebar3/ +*.swp +.DS_Store diff --git a/apps/emqx_auth_mysql/LICENSE b/apps/emqx_auth_mysql/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_auth_mysql/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_mysql/Makefile b/apps/emqx_auth_mysql/Makefile new file mode 100644 index 000000000..ba2e57af3 --- /dev/null +++ b/apps/emqx_auth_mysql/Makefile @@ -0,0 +1,43 @@ + +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v + +clean: distclean + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +dialyzer: + $(REBAR) dialyzer + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_auth_mysql.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_auth_mysql.conf -i priv/emqx_auth_mysql.schema -d data diff --git a/apps/emqx_auth_mysql/README.md b/apps/emqx_auth_mysql/README.md new file mode 100644 index 000000000..e55a2103f --- /dev/null +++ b/apps/emqx_auth_mysql/README.md @@ -0,0 +1,167 @@ +emqx_auth_mysql +=============== + +Authentication, ACL with MySQL Database. + +Notice: changed mysql driver to [mysql-otp](https://github.com/mysql-otp/mysql-otp). + +Features +--------- + +- Full *Authentication*, *Superuser*, *ACL* support +- IPv4, IPv6 and TLS support +- Connection pool by [ecpool](https://github.com/emqx/ecpool) +- Completely cover MySQL 5.7, MySQL 8 in our tests + +Build Plugin +------------- + +make && make tests + +Configure Plugin +---------------- + +File: etc/emqx_auth_mysql.conf + +``` +## MySQL server address. +## +## Value: Port | IP:Port +## +## Examples: 3306, 127.0.0.1:3306, localhost:3306 +auth.mysql.server = 127.0.0.1:3306 + +## MySQL pool size. +## +## Value: Number +auth.mysql.pool = 8 + +## MySQL username. +## +## Value: String +## auth.mysql.username = + +## MySQL Password. +## +## Value: String +## auth.mysql.password = + +## MySQL database. +## +## Value: String +auth.mysql.database = mqtt + +## Variables: %u = username, %c = clientid + +## Authentication query. +## +## Note that column names should be 'password' and 'salt' (if used). +## In case column names differ in your DB - please use aliases, +## e.g. "my_column_name as password". +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +auth.mysql.auth_query = select password from mqtt_user where username = '%u' limit 1 +## auth.mysql.auth_query = select password_hash as password from mqtt_user where username = '%u' limit 1 + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.mysql.password_hash = sha256 + +## sha256 with salt prefix +## auth.mysql.password_hash = salt,sha256 + +## bcrypt with salt only prefix +## auth.mysql.password_hash = salt,bcrypt + +## sha256 with salt suffix +## auth.mysql.password_hash = sha256,salt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.mysql.password_hash = pbkdf2,sha256,1000,20 + +## Superuser query. +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +auth.mysql.super_query = select is_superuser from mqtt_user where username = '%u' limit 1 + +## ACL query. +## +## Value: SQL +## +## Variables: +## - %a: ipaddr +## - %u: username +## - %c: clientid +## Note: You can add the 'ORDER BY' statement to control the rules match order +auth.mysql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c' + +``` + +Import mqtt.sql +--------------- + +Import mqtt.sql into your database. + +Load Plugin +----------- + +./bin/emqx_ctl plugins load emqx_auth_mysql + +Auth Table +---------- + +Notice: This is a demo table. You could authenticate with any user table. + +```sql +CREATE TABLE `mqtt_user` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(100) DEFAULT NULL, + `password` varchar(100) DEFAULT NULL, + `salt` varchar(35) DEFAULT NULL, + `is_superuser` tinyint(1) DEFAULT 0, + `created` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `mqtt_username` (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +``` + +ACL Table +---------- + +```sql +CREATE TABLE `mqtt_acl` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `allow` int(1) DEFAULT NULL COMMENT '0: deny, 1: allow', + `ipaddr` varchar(60) DEFAULT NULL COMMENT 'IpAddress', + `username` varchar(100) DEFAULT NULL COMMENT 'Username', + `clientid` varchar(100) DEFAULT NULL COMMENT 'ClientId', + `access` int(2) NOT NULL COMMENT '1: subscribe, 2: publish, 3: pubsub', + `topic` varchar(100) NOT NULL DEFAULT '' COMMENT 'Topic Filter', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +``` + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. diff --git a/apps/emqx_auth_mysql/docker-compose-ssl.yml b/apps/emqx_auth_mysql/docker-compose-ssl.yml new file mode 100644 index 000000000..fe7d442fe --- /dev/null +++ b/apps/emqx_auth_mysql/docker-compose-ssl.yml @@ -0,0 +1,41 @@ +version: '3' + +services: + erlang: + image: erlang:22.3 + volumes: + - ./:/emqx_auth_mysql + networks: + - emqx_bridge + depends_on: + - mysql_server + tty: true + + mysql_server: + image: mysql:${MYSQL_TAG} + restart: always + environment: + MYSQL_ROOT_PASSWORD: public + MYSQL_DATABASE: mqtt + volumes: + - ./test/emqx_auth_mysql_SUITE_data/ca.pem:/etc/certs/ca-cert.pem + - ./test/emqx_auth_mysql_SUITE_data/server-cert.pem:/etc/certs/server-cert.pem + - ./test/emqx_auth_mysql_SUITE_data/server-key.pem:/etc/certs/server-key.pem + networks: + - emqx_bridge + command: + --bind-address "::" + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 + --max_allowed_packet=128M + --skip-symbolic-links + --ssl-ca=/etc/certs/ca.pem + --ssl-cert=/etc/certs/server-cert.pem + --ssl-key=/etc/certs/server-key.pem + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_mysql/docker-compose.yml b/apps/emqx_auth_mysql/docker-compose.yml new file mode 100644 index 000000000..c37bf983b --- /dev/null +++ b/apps/emqx_auth_mysql/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3' + +services: + erlang: + image: erlang:22.3 + volumes: + - ./:/emqx_auth_mysql + networks: + - emqx_bridge + depends_on: + - mysql_server + tty: true + + mysql_server: + image: mysql:${MYSQL_TAG} + restart: always + environment: + MYSQL_ROOT_PASSWORD: public + MYSQL_DATABASE: mqtt + networks: + - emqx_bridge + command: + --bind-address "::" + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 + --max_allowed_packet=128M + --skip-symbolic-links + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_mysql/etc/emqx_auth_mysql.conf b/apps/emqx_auth_mysql/etc/emqx_auth_mysql.conf new file mode 100644 index 000000000..0efccce29 --- /dev/null +++ b/apps/emqx_auth_mysql/etc/emqx_auth_mysql.conf @@ -0,0 +1,116 @@ +##-------------------------------------------------------------------- +## MySQL Auth/ACL Plugin +##-------------------------------------------------------------------- + +## MySQL server address. +## +## Value: Port | IP:Port +## +## Examples: 3306, 127.0.0.1:3306, localhost:3306 +auth.mysql.server = 127.0.0.1:3306 + +## MySQL pool size. +## +## Value: Number +auth.mysql.pool = 8 + +## MySQL username. +## +## Value: String +## auth.mysql.username = + +## MySQL password. +## +## Value: String +## auth.mysql.password = + +## MySQL database. +## +## Value: String +auth.mysql.database = mqtt + +## MySQL query timeout +## +## Value: Duration +## auth.mysql.query_timeout = 5s + +## Variables: %u = username, %c = clientid + +## Authentication query. +## +## Note that column names should be 'password' and 'salt' (if used). +## In case column names differ in your DB - please use aliases, +## e.g. "my_column_name as password". +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +auth.mysql.auth_query = select password from mqtt_user where username = '%u' limit 1 +## auth.mysql.auth_query = select password_hash as password from mqtt_user where username = '%u' limit 1 + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.mysql.password_hash = sha256 + +## sha256 with salt prefix +## auth.mysql.password_hash = salt,sha256 + +## bcrypt with salt only prefix +## auth.mysql.password_hash = salt,bcrypt + +## sha256 with salt suffix +## auth.mysql.password_hash = sha256,salt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.mysql.password_hash = pbkdf2,sha256,1000,20 + +## Superuser query. +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +auth.mysql.super_query = select is_superuser from mqtt_user where username = '%u' limit 1 + +## ACL query. +## +## Value: SQL +## +## Variables: +## - %a: ipaddr +## - %u: username +## - %c: clientid +## +## Note: You can add the 'ORDER BY' statement to control the rules match order +auth.mysql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c' + +## Mysql ssl configuration. +## +## Value: on | off +auth.mysql.ssl = off + +## CA certificate. +## +## Value: File +## auth.mysql.ssl.cafile = path to your ca file + +## Client ssl certificate. +## +## Value: File +## auth.mysql.ssl.certfile = path to your clientcert file + +## Client ssl keyfile. +## +## Value: File +## auth.mysql.ssl.keyfile = path to your clientkey file diff --git a/apps/emqx_auth_mysql/include/emqx_auth_mysql.hrl b/apps/emqx_auth_mysql/include/emqx_auth_mysql.hrl new file mode 100644 index 000000000..fca431e81 --- /dev/null +++ b/apps/emqx_auth_mysql/include/emqx_auth_mysql.hrl @@ -0,0 +1,23 @@ + +-define(APP, emqx_auth_mysql). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). diff --git a/apps/emqx_auth_mysql/mqtt.sql b/apps/emqx_auth_mysql/mqtt.sql new file mode 100644 index 000000000..9635bee58 --- /dev/null +++ b/apps/emqx_auth_mysql/mqtt.sql @@ -0,0 +1,41 @@ + +DROP TABLE IF EXISTS `mqtt_acl`; + +CREATE TABLE `mqtt_acl` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `allow` int(1) DEFAULT NULL COMMENT '0: deny, 1: allow', + `ipaddr` varchar(60) DEFAULT NULL COMMENT 'IpAddress', + `username` varchar(100) DEFAULT NULL COMMENT 'Username', + `clientid` varchar(100) DEFAULT NULL COMMENT 'ClientId', + `access` int(2) NOT NULL COMMENT '1: subscribe, 2: publish, 3: pubsub', + `topic` varchar(100) NOT NULL DEFAULT '' COMMENT 'Topic Filter', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +LOCK TABLES `mqtt_acl` WRITE; + +INSERT INTO `mqtt_acl` (`id`, `allow`, `ipaddr`, `username`, `clientid`, `access`, `topic`) +VALUES + (1,1,NULL,'$all',NULL,2,'#'), + (2,0,NULL,'$all',NULL,1,'$SYS/#'), + (3,0,NULL,'$all',NULL,1,'eq #'), + (4,1,'127.0.0.1',NULL,NULL,2,'$SYS/#'), + (5,1,'127.0.0.1',NULL,NULL,2,'#'), + (6,1,NULL,'dashboard',NULL,1,'$SYS/#'); + +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `mqtt_user`; + +CREATE TABLE `mqtt_user` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(100) DEFAULT NULL, + `password` varchar(100) DEFAULT NULL, + `salt` varchar(35) DEFAULT NULL, + `is_superuser` tinyint(1) DEFAULT 0, + `created` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `mqtt_username` (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; + diff --git a/apps/emqx_auth_mysql/priv/emqx_auth_mysql.schema b/apps/emqx_auth_mysql/priv/emqx_auth_mysql.schema new file mode 100644 index 000000000..37eed8a5f --- /dev/null +++ b/apps/emqx_auth_mysql/priv/emqx_auth_mysql.schema @@ -0,0 +1,129 @@ +%%-*- mode: erlang -*- +%% emqx_auth_mysql config mapping +{mapping, "auth.mysql.server", "emqx_auth_mysql.server", [ + {default, {"127.0.0.1", 3306}}, + {datatype, [integer, ip, string]} +]}. + +{mapping, "auth.mysql.pool", "emqx_auth_mysql.server", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "auth.mysql.username", "emqx_auth_mysql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mysql.password", "emqx_auth_mysql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mysql.database", "emqx_auth_mysql.server", [ + {default, "mqtt"}, + {datatype, string} +]}. + +{mapping, "auth.mysql.query_timeout", "emqx_auth_mysql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mysql.ssl", "emqx_auth_mysql.server", [ + {default, off}, + {datatype, flag} +]}. + +{mapping, "auth.mysql.ssl.cafile", "emqx_auth_mysql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mysql.ssl.certfile", "emqx_auth_mysql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.mysql.ssl.keyfile", "emqx_auth_mysql.server", [ + {default, ""}, + {datatype, string} +]}. + +{translation, "emqx_auth_mysql.server", fun(Conf) -> + {MyHost, MyPort} = + case cuttlefish:conf_get("auth.mysql.server", Conf) of + {Ip, Port} -> {Ip, Port}; + S -> case string:tokens(S, ":") of + [Domain] -> {Domain, 3306}; + [Domain, Port] -> {Domain, list_to_integer(Port)} + end + end, + Pool = cuttlefish:conf_get("auth.mysql.pool", Conf), + Username = cuttlefish:conf_get("auth.mysql.username", Conf), + Passwd = cuttlefish:conf_get("auth.mysql.password", Conf), + DB = cuttlefish:conf_get("auth.mysql.database", Conf), + Timeout = case cuttlefish:conf_get("auth.mysql.query_timeout", Conf) of + "" -> 300000; + Duration -> + case cuttlefish_duration:parse(Duration, ms) of + {error, Reason} -> error(Reason); + Ms when is_integer(Ms) -> Ms + end + end, + Options = [{pool_size, Pool}, + {auto_reconnect, 1}, + {host, MyHost}, + {port, MyPort}, + {user, Username}, + {password, Passwd}, + {database, DB}, + {encoding, utf8}, + {query_timeout, Timeout}, + {keep_alive, true}], + Options1 = + case cuttlefish:conf_get("auth.mysql.ssl", Conf) of + true -> + CA = cuttlefish:conf_get("auth.mysql.ssl.cafile", Conf), + Cert = cuttlefish:conf_get("auth.mysql.ssl.certfile", Conf), + Key = cuttlefish:conf_get("auth.mysql.ssl.keyfile", Conf), + Options ++ [{ssl, {server_name_indication, disable}, + {cacertfile, CA}, + {certfile, Cert}, + {keyfile, Key}}]; + _ -> + Options + end, + case inet:parse_address(MyHost) of + {ok, IpAddr} when tuple_size(IpAddr) =:= 8 -> + [{tcp_options, [inet6]} | Options1]; + _ -> + Options1 + end +end}. + +{mapping, "auth.mysql.auth_query", "emqx_auth_mysql.auth_query", [ + {datatype, string} +]}. + +{mapping, "auth.mysql.password_hash", "emqx_auth_mysql.password_hash", [ + {datatype, string} +]}. + +{mapping, "auth.mysql.super_query", "emqx_auth_mysql.super_query", [ + {datatype, string} +]}. + +{mapping, "auth.mysql.acl_query", "emqx_auth_mysql.acl_query", [ + {datatype, string} +]}. + +{translation, "emqx_auth_mysql.password_hash", fun(Conf) -> + HashValue = cuttlefish:conf_get("auth.mysql.password_hash", Conf), + case string:tokens(HashValue, ",") of + [Hash] -> list_to_atom(Hash); + [Prefix, Suffix] -> {list_to_atom(Prefix), list_to_atom(Suffix)}; + [Hash, MacFun, Iterations, Dklen] -> {list_to_atom(Hash), list_to_atom(MacFun), list_to_integer(Iterations), list_to_integer(Dklen)}; + _ -> plain + end +end}. diff --git a/apps/emqx_auth_mysql/rebar.config b/apps/emqx_auth_mysql/rebar.config new file mode 100644 index 000000000..cd0c71b50 --- /dev/null +++ b/apps/emqx_auth_mysql/rebar.config @@ -0,0 +1,35 @@ +{deps, + [{ecpool, {git,"https://github.com/emqx/ecpool", {tag, "0.5.0"}}}, + {emqx_passwd, {git, "https://github.com/emqx/emqx-passwd", {tag, "v1.1.1"}}}, + {mysql, {git, "https://github.com/emqx/mysql-otp", {tag, "1.6.1"}}} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + compressed, + {parse_transform} + ]}. +{overrides, [{add, [{erl_opts, [compressed]}]}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions + ]}. + +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}, + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}} + ]}, + {erl_opts, [debug_info]} + ]} + ]}. diff --git a/apps/emqx_auth_mysql/rebar.config.script b/apps/emqx_auth_mysql/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_mysql/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_mysql/src/emqx_acl_mysql.erl b/apps/emqx_auth_mysql/src/emqx_acl_mysql.erl new file mode 100644 index 000000000..174e3cd27 --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_acl_mysql.erl @@ -0,0 +1,119 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_mysql). + +-include("emqx_auth_mysql.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +%% ACL Callbacks +-export([ register_metrics/0 + , check_acl/5 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +check_acl(ClientInfo, PubSub, Topic, NoMatchAction, #{pool := Pool} = State) -> + case do_check_acl(Pool, ClientInfo, PubSub, Topic, NoMatchAction, State) of + ok -> emqx_metrics:inc(?ACL_METRICS(ignore)), ok; + {stop, allow} -> emqx_metrics:inc(?ACL_METRICS(allow)), {stop, allow}; + {stop, deny} -> emqx_metrics:inc(?ACL_METRICS(deny)), {stop, deny} + end. + +do_check_acl(_Pool, #{username := <<$$, _/binary>>}, _PubSub, _Topic, _NoMatchAction, _State) -> + ok; +do_check_acl(Pool, ClientInfo, PubSub, Topic, _NoMatchAction, #{acl_query := {AclSql, AclParams}}) -> + case emqx_auth_mysql_cli:query(Pool, AclSql, AclParams, ClientInfo) of + {ok, _Columns, []} -> ok; + {ok, _Columns, Rows} -> + Rules = filter(PubSub, compile(Rows)), + case match(ClientInfo, Topic, Rules) of + {matched, allow} -> {stop, allow}; + {matched, deny} -> {stop, deny}; + nomatch -> ok + end; + {error, Reason} -> + ?LOG(error, "[MySQL] do_check_acl error: ~p~n", [Reason]), + ok + end. + +match(_ClientInfo, _Topic, []) -> + nomatch; + +match(ClientInfo, Topic, [Rule|Rules]) -> + case emqx_access_rule:match(ClientInfo, Topic, Rule) of + nomatch -> + match(ClientInfo, Topic, Rules); + {matched, AllowDeny} -> + {matched, AllowDeny} + end. + +filter(PubSub, Rules) -> + [Term || Term = {_, _, Access, _} <- Rules, + Access =:= PubSub orelse Access =:= pubsub]. + +compile(Rows) -> + compile(Rows, []). +compile([], Acc) -> + Acc; +compile([[Allow, IpAddr, Username, ClientId, Access, Topic]|T], Acc) -> + Who = who(IpAddr, Username, ClientId), + Term = {allow(Allow), Who, access(Access), [topic(Topic)]}, + compile(T, [emqx_access_rule:compile(Term) | Acc]). + +who(_, <<"$all">>, _) -> + all; +who(null, null, null) -> + throw(undefined_who); +who(CIDR, Username, ClientId) -> + Cols = [{ipaddr, b2l(CIDR)}, {user, Username}, {client, ClientId}], + case [{C, V} || {C, V} <- Cols, not empty(V)] of + [Who] -> Who; + Conds -> {'and', Conds} + end. + +allow(1) -> allow; +allow(0) -> deny; +allow(<<"1">>) -> allow; +allow(<<"0">>) -> deny. + +access(1) -> subscribe; +access(2) -> publish; +access(3) -> pubsub; +access(<<"1">>) -> subscribe; +access(<<"2">>) -> publish; +access(<<"3">>) -> pubsub. + +topic(<<"eq ", Topic/binary>>) -> + {eq, Topic}; +topic(Topic) -> + Topic. + +description() -> + "ACL with Mysql". + +b2l(null) -> null; +b2l(B) -> binary_to_list(B). + +empty(null) -> true; +empty("") -> true; +empty(<<>>) -> true; +empty(_) -> false. diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql.app.src b/apps/emqx_auth_mysql/src/emqx_auth_mysql.app.src new file mode 100644 index 000000000..3e21de565 --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_mysql, + [{description, "EMQ X Authentication/ACL with MySQL"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_mysql_sup]}, + {applications, [kernel,stdlib,mysql,ecpool,emqx_passwd]}, + {mod, {emqx_auth_mysql_app,[]}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-mysql"} + ]} + ]}. diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql.app.src.script b/apps/emqx_auth_mysql/src/emqx_auth_mysql.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql.appup.src b/apps/emqx_auth_mysql/src/emqx_auth_mysql.appup.src new file mode 100644 index 000000000..1c40f2abc --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql.appup.src @@ -0,0 +1,16 @@ +%% -*-: erlang -*- + +{VSN, + [ + {"4.2.0", [ + {load_module, emqx_auth_mysql_cli, brutal_purge, soft_purge, []} + ]}, + {<<".*">>, []} + ], + [ + {"4.2.0", [ + {load_module, emqx_auth_mysql_cli, brutal_purge, soft_purge, []} + ]}, + {<<".*">>, []} + ] + }. diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql.erl b/apps/emqx_auth_mysql/src/emqx_auth_mysql.erl new file mode 100644 index 000000000..9cd9d5a25 --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql.erl @@ -0,0 +1,91 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mysql). + +-include("emqx_auth_mysql.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/types.hrl"). + +-export([ register_metrics/0 + , check/3 + , description/0 + ]). + +-define(EMPTY(Username), (Username =:= undefined orelse Username =:= <<>>)). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +check(ClientInfo = #{password := Password}, AuthResult, + #{auth_query := {AuthSql, AuthParams}, + super_query := SuperQuery, + hash_type := HashType, + pool := Pool}) -> + CheckPass = case emqx_auth_mysql_cli:query(Pool, AuthSql, AuthParams, ClientInfo) of + {ok, [<<"password">>], [[PassHash]]} -> + check_pass({PassHash, Password}, HashType); + {ok, [<<"password">>, <<"salt">>], [[PassHash, Salt]]} -> + check_pass({PassHash, Salt, Password}, HashType); + {ok, _Columns, []} -> + {error, not_found}; + {error, Reason} -> + ?LOG(error, "[MySQL] query '~p' failed: ~p", [AuthSql, Reason]), + {error, Reason} + end, + case CheckPass of + ok -> + emqx_metrics:inc(?AUTH_METRICS(success)), + {stop, AuthResult#{is_superuser => is_superuser(Pool, SuperQuery, ClientInfo), + anonymous => false, + auth_result => success}}; + {error, not_found} -> + emqx_metrics:inc(?AUTH_METRICS(ignore)), ok; + {error, ResultCode} -> + ?LOG(error, "[MySQL] Auth from mysql failed: ~p", [ResultCode]), + emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{auth_result => ResultCode, anonymous => false}} + end. + +%%-------------------------------------------------------------------- +%% Is Superuser? +%%-------------------------------------------------------------------- + +-spec(is_superuser(atom(), maybe({string(), list()}), emqx_types:client()) -> boolean()). +is_superuser(_Pool, undefined, _ClientInfo) -> false; +is_superuser(Pool, {SuperSql, Params}, ClientInfo) -> + case emqx_auth_mysql_cli:query(Pool, SuperSql, Params, ClientInfo) of + {ok, [_Super], [[1]]} -> + true; + {ok, [_Super], [[_False]]} -> + false; + {ok, [_Super], []} -> + false; + {error, _Error} -> + false + end. + +check_pass(Password, HashType) -> + case emqx_passwd:check_pass(Password, HashType) of + ok -> ok; + {error, _Reason} -> {error, not_authorized} + end. + +description() -> "Authentication with MySQL". + diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql_app.erl b/apps/emqx_auth_mysql/src/emqx_auth_mysql_app.erl new file mode 100644 index 000000000..26895cd9a --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql_app.erl @@ -0,0 +1,74 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mysql_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_mysql.hrl"). + +-import(emqx_auth_mysql_cli, [parse_query/1]). + +%% Application callbacks +-export([ start/2 + , prep_stop/1 + , stop/1 + ]). + +%%-------------------------------------------------------------------- +%% Application callbacks +%%-------------------------------------------------------------------- + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqx_auth_mysql_sup:start_link(), + if_enabled(auth_query, fun load_auth_hook/1), + if_enabled(acl_query, fun load_acl_hook/1), + + {ok, Sup}. + +prep_stop(State) -> + emqx:unhook('client.authenticate', fun emqx_auth_mysql:check/3), + emqx:unhook('client.check_acl', fun emqx_acl_mysql:check_acl/5), + State. + +stop(_State) -> + ok. + +load_auth_hook(AuthQuery) -> + ok = emqx_auth_mysql:register_metrics(), + SuperQuery = parse_query(application:get_env(?APP, super_query, undefined)), + {ok, HashType} = application:get_env(?APP, password_hash), + Params = #{auth_query => AuthQuery, + super_query => SuperQuery, + hash_type => HashType, + pool => ?APP}, + emqx:hook('client.authenticate', fun emqx_auth_mysql:check/3, [Params]). + +load_acl_hook(AclQuery) -> + ok = emqx_acl_mysql:register_metrics(), + emqx:hook('client.check_acl', fun emqx_acl_mysql:check_acl/5, [#{acl_query => AclQuery, pool =>?APP}]). + +%%-------------------------------------------------------------------- +%% Internal function +%%-------------------------------------------------------------------- + +if_enabled(Cfg, Fun) -> + case application:get_env(?APP, Cfg) of + {ok, Query} -> Fun(parse_query(Query)); + undefined -> ok + end. diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql_cli.erl b/apps/emqx_auth_mysql/src/emqx_auth_mysql_cli.erl new file mode 100644 index 000000000..c3ee3b02a --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql_cli.erl @@ -0,0 +1,91 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mysql_cli). + +-behaviour(ecpool_worker). + +-include("emqx_auth_mysql.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-export([ parse_query/1 + , connect/1 + , query/4 + ]). + +%%-------------------------------------------------------------------- +%% Avoid SQL Injection: Parse SQL to Parameter Query. +%%-------------------------------------------------------------------- + +parse_query(undefined) -> + undefined; +parse_query(Sql) -> + case re:run(Sql, "'%[ucCad]'", [global, {capture, all, list}]) of + {match, Variables} -> + Params = [Var || [Var] <- Variables], + {re:replace(Sql, "'%[ucCad]'", "?", [global, {return, list}]), Params}; + nomatch -> + {Sql, []} + end. + +%%-------------------------------------------------------------------- +%% MySQL Connect/Query +%%-------------------------------------------------------------------- + +connect(Options) -> + case mysql:start_link(Options) of + {ok, Pid} -> {ok, Pid}; + ignore -> {error, ignore}; + {error, Reason = {{_, {error, econnrefused}}, _}} -> + ?LOG(error, "[MySQL] Can't connect to MySQL server: Connection refused."), + {error, Reason}; + {error, Reason = {ErrorCode, _, Error}} -> + ?LOG(error, "[MySQL] Can't connect to MySQL server: ~p - ~p", [ErrorCode, Error]), + {error, Reason}; + {error, Reason} -> + ?LOG(error, "[MySQL] Can't connect to MySQL server: ~p", [Reason]), + {error, Reason} + end. + +query(Pool, Sql, Params, ClientInfo) -> + ecpool:with_client(Pool, fun(C) -> mysql:query(C, Sql, replvar(Params, ClientInfo)) end). + +replvar(Params, ClientInfo) -> + replvar(Params, ClientInfo, []). + +replvar([], _ClientInfo, Acc) -> + lists:reverse(Acc); + +replvar(["'%u'" | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [safe_get(username, ClientInfo) | Acc]); +replvar(["'%c'" | Params], ClientInfo = #{clientid := ClientId}, Acc) -> + replvar(Params, ClientInfo, [ClientId | Acc]); +replvar(["'%a'" | Params], ClientInfo = #{peerhost := IpAddr}, Acc) -> + replvar(Params, ClientInfo, [inet_parse:ntoa(IpAddr) | Acc]); +replvar(["'%C'" | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [safe_get(cn, ClientInfo)| Acc]); +replvar(["'%d'" | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [safe_get(dn, ClientInfo)| Acc]); +replvar([Param | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [Param | Acc]). + +safe_get(K, ClientInfo) -> + bin(maps:get(K, ClientInfo, "undefined")). + +bin(A) when is_atom(A) -> atom_to_binary(A, utf8); +bin(B) when is_binary(B) -> B; +bin(X) -> X. diff --git a/apps/emqx_auth_mysql/src/emqx_auth_mysql_sup.erl b/apps/emqx_auth_mysql/src/emqx_auth_mysql_sup.erl new file mode 100644 index 000000000..0b2bf2c38 --- /dev/null +++ b/apps/emqx_auth_mysql/src/emqx_auth_mysql_sup.erl @@ -0,0 +1,40 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mysql_sup). + +-behaviour(supervisor). + +-include("emqx_auth_mysql.hrl"). + +-export([start_link/0]). + +%% Supervisor callbacks +-export([init/1]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +%%-------------------------------------------------------------------- +%% Supervisor callbacks +%%-------------------------------------------------------------------- + +init([]) -> + %% MySQL Connection Pool. + {ok, Server} = application:get_env(?APP, server), + PoolSpec = ecpool:pool_spec(?APP, ?APP, emqx_auth_mysql_cli, Server), + {ok, {{one_for_one, 10, 100}, [PoolSpec]}}. + diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE.erl b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE.erl new file mode 100644 index 000000000..044655ac1 --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE.erl @@ -0,0 +1,234 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_mysql_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-define(APP, emqx_auth_mysql). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). + +-define(DROP_ACL_TABLE, <<"DROP TABLE IF EXISTS mqtt_acl">>). + +-define(CREATE_ACL_TABLE, <<"CREATE TABLE mqtt_acl (" + " id int(11) unsigned NOT NULL AUTO_INCREMENT," + " allow int(1) DEFAULT NULL COMMENT '0: deny, 1: allow'," + " ipaddr varchar(60) DEFAULT NULL COMMENT 'IpAddress'," + " username varchar(100) DEFAULT NULL COMMENT 'Username'," + " clientid varchar(100) DEFAULT NULL COMMENT 'ClientId'," + " access int(2) NOT NULL COMMENT '1: subscribe, 2: publish, 3: pubsub'," + " topic varchar(100) NOT NULL DEFAULT '' COMMENT 'Topic Filter'," + " PRIMARY KEY (`id`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4">>). + +-define(INIT_ACL, <<"INSERT INTO mqtt_acl (id, allow, ipaddr, username, clientid, access, topic)" + "VALUES (1,1,'127.0.0.1','u1','c1',1,'t1')," + "(2,0,'127.0.0.1','u2','c2',1,'t1')," + "(3,1,'10.10.0.110','u1','c1',1,'t1')," + "(4,1,'127.0.0.1','u3','c3',3,'t1')">>). + +-define(DROP_AUTH_TABLE, <<"DROP TABLE IF EXISTS `mqtt_user`">>). + +-define(CREATE_AUTH_TABLE, <<"CREATE TABLE `mqtt_user` (" + "`id` int(11) unsigned NOT NULL AUTO_INCREMENT," + "`username` varchar(100) DEFAULT NULL," + "`password` varchar(100) DEFAULT NULL," + "`salt` varchar(100) DEFAULT NULL," + "`is_superuser` tinyint(1) DEFAULT 0," + "`created` datetime DEFAULT NULL," + "PRIMARY KEY (`id`)," + "UNIQUE KEY `mqtt_username` (`username`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4">>). + +-define(INIT_AUTH, <<"INSERT INTO mqtt_user (id, is_superuser, username, password, salt)" + "VALUES (1, 1, 'plain', 'plain', 'salt')," + "(2, 0, 'md5', '1bc29b36f623ba82aaf6724fd3b16718', 'salt')," + "(3, 0, 'sha', 'd8f4590320e1343a915b6394170650a8f35d6926', 'salt')," + "(4, 0, 'sha256', '5d5b09f6dcb2d53a5fffc60c4ac0d55fabdf556069d6631545f42aa6e3500f2e', 'salt')," + "(5, 0, 'pbkdf2_password', 'cdedb5281bb2f801565a1122b2563515', 'ATHENA.MIT.EDUraeburn')," + "(6, 0, 'bcrypt_foo', '$2a$12$sSS8Eg.ovVzaHzi1nUHYK.HbUIOdlQI0iS22Q5rd5z.JVVYH6sfm6', '$2a$12$sSS8Eg.ovVzaHzi1nUHYK.')," + "(7, 0, 'bcrypt', '$2y$16$rEVsDarhgHYB0TGnDFJzyu5f.T.Ha9iXMTk9J36NCMWWM7O16qyaK', 'salt')," + "(8, 0, 'bcrypt_wrong', '$2y$16$rEVsDarhgHYB0TGnDFJzyu', 'salt')">>). + +%%-------------------------------------------------------------------- +%% Setups +%%-------------------------------------------------------------------- + +all() -> + emqx_ct:all(?MODULE). + +init_per_suite(Cfg) -> + emqx_ct_helpers:start_apps([emqx_auth_mysql], fun set_special_configs/1), + init_mysql_data(), + Cfg. + +end_per_suite(_) -> + deinit_mysql_data(), + emqx_ct_helpers:stop_apps([emqx_auth_mysql]), + ok. + +set_special_configs(emqx) -> + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, enable_acl_cache, false), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/loaded_plugins")); + +set_special_configs(_App) -> + ok. + +init_mysql_data() -> + {ok, Pid} = ecpool_worker:client(gproc_pool:pick_worker({ecpool, ?APP})), + %% Users + ok = mysql:query(Pid, ?DROP_AUTH_TABLE), + ok = mysql:query(Pid, ?CREATE_AUTH_TABLE), + ok = mysql:query(Pid, ?INIT_AUTH), + + %% ACLs + ok = mysql:query(Pid, ?DROP_ACL_TABLE), + ok = mysql:query(Pid, ?CREATE_ACL_TABLE), + ok = mysql:query(Pid, ?INIT_ACL). + +deinit_mysql_data() -> + {ok, Pid} = ecpool_worker:client(gproc_pool:pick_worker({ecpool, ?APP})), + ok = mysql:query(Pid, ?DROP_AUTH_TABLE), + ok = mysql:query(Pid, ?DROP_ACL_TABLE). + +%%-------------------------------------------------------------------- +%% Test cases +%%-------------------------------------------------------------------- + +t_check_acl(_) -> + User0 = #{zone => external,peerhost => {127,0,0,1}}, + allow = emqx_access_control:check_acl(User0, subscribe, <<"t1">>), + User1 = #{zone => external, clientid => <<"c1">>, username => <<"u1">>, peerhost => {127,0,0,1}}, + User2 = #{zone => external, clientid => <<"c2">>, username => <<"u2">>, peerhost => {127,0,0,1}}, + allow = emqx_access_control:check_acl(User1, subscribe, <<"t1">>), + deny = emqx_access_control:check_acl(User2, subscribe, <<"t1">>), + + User3 = #{zone => external, peerhost => {10,10,0,110}, clientid => <<"c1">>, username => <<"u1">>}, + User4 = #{zone => external, peerhost => {10,10,10,110}, clientid => <<"c1">>, username => <<"u1">>}, + allow = emqx_access_control:check_acl(User3, subscribe, <<"t1">>), + allow = emqx_access_control:check_acl(User3, subscribe, <<"t1">>), + allow = emqx_access_control:check_acl(User3, subscribe, <<"t2">>),%% nomatch -> ignore -> emqx acl + allow = emqx_access_control:check_acl(User4, subscribe, <<"t1">>),%% nomatch -> ignore -> emqx acl + User5 = #{zone => external, peerhost => {127,0,0,1}, clientid => <<"c3">>, username => <<"u3">>}, + allow = emqx_access_control:check_acl(User5, subscribe, <<"t1">>), + allow = emqx_access_control:check_acl(User5, publish, <<"t1">>). + +t_acl_super(_Config) -> + reload([{password_hash, plain}, + {auth_query, "select password from mqtt_user where username = '%u' limit 1"}]), + {ok, C} = emqtt:start_link([{host, "localhost"}, + {clientid, <<"simpleClient">>}, + {username, <<"plain">>}, + {password, <<"plain">>}]), + {ok, _} = emqtt:connect(C), + timer:sleep(10), + emqtt:subscribe(C, <<"TopicA">>, qos2), + timer:sleep(1000), + emqtt:publish(C, <<"TopicA">>, <<"Payload">>, qos2), + timer:sleep(1000), + receive + {publish, #{payload := Payload}} -> + ?assertEqual(<<"Payload">>, Payload) + after + 1000 -> + ct:fail({receive_timeout, <<"Payload">>}), + ok + end, + emqtt:disconnect(C). + +t_check_auth(_) -> + Plain = #{clientid => <<"client1">>, username => <<"plain">>, zone => external}, + Md5 = #{clientid => <<"md5">>, username => <<"md5">>, zone => external}, + Sha = #{clientid => <<"sha">>, username => <<"sha">>, zone => external}, + Sha256 = #{clientid => <<"sha256">>, username => <<"sha256">>, zone => external}, + Pbkdf2 = #{clientid => <<"pbkdf2_password">>, username => <<"pbkdf2_password">>, zone => external}, + BcryptFoo = #{clientid => <<"bcrypt_foo">>, username => <<"bcrypt_foo">>, zone => external}, + User1 = #{clientid => <<"bcrypt_foo">>, username => <<"user">>, zone => external}, + Bcrypt = #{clientid => <<"bcrypt">>, username => <<"bcrypt">>, zone => external}, + BcryptWrong = #{clientid => <<"bcrypt_wrong">>, username => <<"bcrypt_wrong">>, zone => external}, + reload([{password_hash, plain}]), + {ok,#{is_superuser := true}} = + emqx_access_control:authenticate(Plain#{password => <<"plain">>}), + reload([{password_hash, md5}]), + {ok,#{is_superuser := false}} = + emqx_access_control:authenticate(Md5#{password => <<"md5">>}), + reload([{password_hash, sha}]), + {ok,#{is_superuser := false}} = + emqx_access_control:authenticate(Sha#{password => <<"sha">>}), + reload([{password_hash, sha256}]), + {ok,#{is_superuser := false}} = + emqx_access_control:authenticate(Sha256#{password => <<"sha256">>}), + reload([{password_hash, bcrypt}]), + {ok,#{is_superuser := false}} = + emqx_access_control:authenticate(Bcrypt#{password => <<"password">>}), + {error, not_authorized} = + emqx_access_control:authenticate(BcryptWrong#{password => <<"password">>}), + %%pbkdf2 sha + reload([{password_hash, {pbkdf2, sha, 1, 16}}, + {auth_query, "select password, salt from mqtt_user where username = '%u' limit 1"}]), + {ok,#{is_superuser := false}} = + emqx_access_control:authenticate(Pbkdf2#{password => <<"password">>}), + reload([{password_hash, {salt, bcrypt}}]), + {ok,#{is_superuser := false}} = + emqx_access_control:authenticate(BcryptFoo#{password => <<"foo">>}), + {error, _} = emqx_access_control:authenticate(User1#{password => <<"foo">>}), + {error, not_authorized} = emqx_access_control:authenticate(Bcrypt#{password => <<"password">>}). + +t_comment_config(_) -> + application:stop(?APP), + [application:unset_env(?APP, Par) || Par <- [acl_query, auth_query]], + application:start(?APP). + +t_placeholders(_) -> + ClientA = #{username => <<"plain">>, clientid => <<"plain">>, zone => external}, + + reload([{password_hash, plain}, + {auth_query, "select password from mqtt_user where username = '%u' and 'a_cn_val' = '%C' limit 1"}]), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>}), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, cn => undefined}), + {ok, _} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, cn => <<"a_cn_val">>}), + + reload([{auth_query, "select password from mqtt_user where username = '%c' and 'a_dn_val' = '%d' limit 1"}]), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>}), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, dn => undefined}), + {ok, _} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, dn => <<"a_dn_val">>}), + + reload([{auth_query, "select password from mqtt_user where username = '%u' and '192.168.1.5' = '%a' limit 1"}]), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>}), + {ok, _} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, peerhost => {192,168,1,5}}). + +%%-------------------------------------------------------------------- +%% Internal funcs +%%-------------------------------------------------------------------- + +reload(Config) when is_list(Config) -> + application:stop(?APP), + [application:set_env(?APP, K, V) || {K, V} <- Config], + application:start(?APP). diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca-key.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca-key.pem new file mode 100644 index 000000000..e9717011e --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA0kGUBi9NDp65jgdxKfizIfuSr2wpwb44yM9SuP4oUQSULOA2 +4iFpLR/c5FAYHU81y9Vx91dQjdZfffaBZuv2zVvteXUkol8Nez7boKbo2E41MTew +8edtNKZAQVvnaHAC2NCZxjchCzUCDEoUUcl+cIERZ8R48FBqK5iTVcMRIx1akwus ++dhBqP0ykA5TGOWZkJrLM9aUXSPQha9+wXlOpkvu0Ur2nkX8PPJnifWao9UShSar +ll1IqPZNCSlZMwcFYcQNBCpdvITUUYlHvMRQV64bUpOxUGDuJkQL3dLKBlNuBRlJ +BcjBAKw7rFnwwHZcMmQ9tan/dZzpzwjo/T0XjwIDAQABAoIBAQCSHvUqnzDkWjcG +l/Fzg92qXlYBCCC0/ugj1sHcwvVt6Mq5rVE3MpUPwTcYjPlVVTlD4aEEjm/zQuq2 +ddxUlOS+r4aIhHrjRT/vSS4FpjnoKeIZxGR6maVxk6DQS3i1QjMYT1CvSpzyVvKH +a+xXMrtmoKxh+085ZAmFJtIuJhUA2yEa4zggCxWnvz8ecLClUPfVDPhdLBHc3KmL +CRpHEC6L/wanvDPRdkkzfKyaJuIJlTDaCg63AY5sDkTW2I57iI/nJ3haSeidfQKz +39EfbnM1A/YprIakafjAu3frBIsjBVcxwGihZmL/YriTHjOggJF841kT5zFkkv2L +/530Wk6xAoGBAOqZLZ4DIi/zLndEOz1mRbUfjc7GQUdYplBnBwJ22VdS0P4TOXnd +UbJth2MA92NM7ocTYVFl4TVIZY/Y+Prxk7KQdHWzR7JPpKfx9OEVgtSqV0vF9eGI +rKp79Y1T4Mvc3UcQCXX6TP7nHLihEzpS8odm2LW4txrOiLsn4Fq/IWrLAoGBAOVv +6U4tm3lImotUupKLZPKEBYwruo9qRysoug9FiorP4TjaBVOfltiiHbAQD6aGfVtN +SZpZZtrs17wL7Xl4db5asgMcZd+8Hkfo5siR7AuGW9FZloOjDcXb5wCh9EvjJ74J +Cjw7RqyVymq9t7IP6wnVwj5Ck48YhlOZCz/mzlnNAoGAWq7NYFgLvgc9feLFF23S +IjpJQZWHJEITP98jaYNxbfzYRm49+GphqxwFinKULjFNvq7yHlnIXSVYBOu1CqOZ +GRwXuGuNmlKI7lZr9xmukfAqgGLMMdr4C4qRF4lFyufcLRz42z7exmWlx4ST/yaT +E13hBRWayeTuG5JFei6Jh1MCgYEAqmX4LyC+JFBgvvQZcLboLRkSCa18bADxhENG +FAuAvmFvksqRRC71WETmqZj0Fqgxt7pp3KFjO1rFSprNLvbg85PmO1s+6fCLyLpX +lESTu2d5D71qhK93jigooxalGitFm+SY3mzjq0/AOpBWOn+J/w7rqVPGxXLgaHv0 +l+vx+00CgYBOvo9/ImjwYii2jFl+sHEoCzlvpITi2temRlT2j6ulSjCLJgjwEFw9 +8e+vvfQumQOsutakUVyURrkMGNDiNlIv8kv5YLCCkrwN22E6Ghyi69MJUvHQXkc/ +QZhjn/luyfpB5f/BeHFS2bkkxAXo+cfG45ApY3Qfz6/7o+H+vDa6/A== +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca.pem new file mode 100644 index 000000000..00b31d8a4 --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAzCCAeugAwIBAgIBATANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowPDE6MDgGA1UEAwwxTXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9DQV9DZXJ0aWZpY2F0ZTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANJBlAYvTQ6euY4HcSn4syH7kq9s +KcG+OMjPUrj+KFEElCzgNuIhaS0f3ORQGB1PNcvVcfdXUI3WX332gWbr9s1b7Xl1 +JKJfDXs+26Cm6NhONTE3sPHnbTSmQEFb52hwAtjQmcY3IQs1AgxKFFHJfnCBEWfE +ePBQaiuYk1XDESMdWpMLrPnYQaj9MpAOUxjlmZCayzPWlF0j0IWvfsF5TqZL7tFK +9p5F/DzyZ4n1mqPVEoUmq5ZdSKj2TQkpWTMHBWHEDQQqXbyE1FGJR7zEUFeuG1KT +sVBg7iZEC93SygZTbgUZSQXIwQCsO6xZ8MB2XDJkPbWp/3Wc6c8I6P09F48CAwEA +AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEADKz6bIpP5anp +GgLB0jkclRWuMlS4qqIt4itSsMXPJ/ezpHwECixmgW2TIQl6S1woRkUeMxhT2/Ay +Sn/7aKxuzRagyE5NEGOvrOuAP5RO2ZdNJ/X3/Rh533fK1sOTEEbSsWUvW6iSkZef +rsfZBVP32xBhRWkKRdLeLB4W99ADMa0IrTmZPCXHSSE2V4e1o6zWLXcOZeH1Qh8N +SkelBweR+8r1Fbvy1r3s7eH7DCbYoGEDVLQGOLvzHKBisQHmoDnnF5E9g1eeNRdg +o+vhOKfYCOzeNREJIqS42PHcGhdNRk90ycigPmfUJclz1mDHoMjKR2S5oosTpr65 +tNPx3CL7GA== +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-cert.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-cert.pem new file mode 100644 index 000000000..aad1404ca --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAzANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0N1oXDTMwMDYwOTAzMzg0N1owQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9DbGllbnRfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVYSWpOvCTupz82fc85Opv +EQ7rkB8X2oOMyBCpkyHKBIr1ZQgRDWBp9UVOASq3GnSElm6+T3Kb1QbOffa8GIlw +sjAueKdq5L2eSkmPIEQ7eoO5kEW+4V866hE1LeL/PmHg2lGP0iqZiJYtElhHNQO8 +3y9I7cm3xWMAA3SSWikVtpJRn3qIp2QSrH+tK+/HHbE5QwtPxdir4ULSCSOaM5Yh +Wi5Oto88TZqe1v7SXC864JVvO4LuS7TuSreCdWZyPXTJFBFeCEWSAxonKZrqHbBe +CwKML6/0NuzjaQ51c2tzmVI6xpHj3nnu4cSRx6Jf9WBm+35vm0wk4pohX3ptdzeV +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAByQ5zSNeFUH +Aw7JlpZHtHaSEeiiyBHke20ziQ07BK1yi/ms2HAWwQkpZv149sjNuIRH8pkTmkZn +g8PDzSefjLbC9AsWpWV0XNV22T/cdobqLqMBDDZ2+5bsV+jTrOigWd9/AHVZ93PP +IJN8HJn6rtvo2l1bh/CdsX14uVSdofXnuWGabNTydqtMvmCerZsdf6qKqLL+PYwm +RDpgWiRUY7KPBSSlKm/9lJzA+bOe4dHeJzxWFVCJcbpoiTFs1je1V8kKQaHtuW39 +ifX6LTKUMlwEECCbDKM8Yq2tm8NjkjCcnFDtKg8zKGPUu+jrFMN5otiC3wnKcP7r +O9EkaPcgYH8= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-key.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-key.pem new file mode 100644 index 000000000..6789d0291 --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA1WElqTrwk7qc/Nn3POTqbxEO65AfF9qDjMgQqZMhygSK9WUI +EQ1gafVFTgEqtxp0hJZuvk9ym9UGzn32vBiJcLIwLninauS9nkpJjyBEO3qDuZBF +vuFfOuoRNS3i/z5h4NpRj9IqmYiWLRJYRzUDvN8vSO3Jt8VjAAN0klopFbaSUZ96 +iKdkEqx/rSvvxx2xOUMLT8XYq+FC0gkjmjOWIVouTraPPE2antb+0lwvOuCVbzuC +7ku07kq3gnVmcj10yRQRXghFkgMaJyma6h2wXgsCjC+v9Dbs42kOdXNrc5lSOsaR +49557uHEkceiX/VgZvt+b5tMJOKaIV96bXc3lQIDAQABAoIBAF7yjXmSOn7h6P0y +WCuGiTLG2mbDiLJqj2LTm2Z5i+2Cu/qZ7E76Ls63TxF4v3MemH5vGfQhEhR5ZD/6 +GRJ1sKKvB3WGRqjwA9gtojHH39S/nWGy6vYW/vMOOH37XyjIr3EIdIaUtFQBTSHd +Kd71niYrAbVn6fyWHolhADwnVmTMOl5OOAhCdEF4GN3b5aIhIu8BJ7EUzTtHBJIj +CAEfjZFjDs1y1cIgGFJkuIQxMfCpq5recU2qwip7YO6fk//WEjOPu7kSf5IEswL8 +jg1dea9rGBV6KaD2xsgsC6Ll6Sb4BbsrHMfflG3K2Lk3RdVqqTFp1Fn1PTLQE/1S +S/SZPYECgYEA9qYcHKHd0+Q5Ty5wgpxKGa4UCWkpwvfvyv4bh8qlmxueB+l2AIdo +ZvkM8gTPagPQ3WypAyC2b9iQu70uOJo1NizTtKnpjDdN1YpDjISJuS/P0x73gZwy +gmoM5AzMtN4D6IbxXtXnPaYICvwLKU80ouEN5ZPM4/ODLUu6gsp0v2UCgYEA3Xgi +zMC4JF0vEKEaK0H6QstaoXUmw/lToZGH3TEojBIkb/2LrHUclygtONh9kJSFb89/ +jbmRRLAOrx3HZKCNGUmF4H9k5OQyAIv6OGBinvLGqcbqnyNlI+Le8zxySYwKMlEj +EMrBCLmSyi0CGFrbZ3mlj/oCET/ql9rNvcK+DHECgYAEx5dH3sMjtgp+RFId1dWB +xePRgt4yTwewkVgLO5wV82UOljGZNQaK6Eyd7AXw8f38LHzh+KJQbIvxd2sL4cEi +OaAoohpKg0/Y0YMZl//rPMf0OWdmdZZs/I0fZjgZUSwWN3c59T8z7KG/RL8an9RP +S7kvN7wCttdV61/D5RR6GQKBgDxCe/WKWpBKaovzydMLWLTj7/0Oi0W3iXHkzzr4 +LTgvl4qBSofaNbVLUUKuZTv5rXUG2IYPf99YqCYtzBstNDc1MiAriaBeFtzfOW4t +i6gEFtoLLbuvPc3N5Sv5vn8Ug5G9UfU3td5R4AbyyCcoUZqOFuZd+EIJSiOXfXOs +kVmBAoGBAIU9aPAqhU5LX902oq8KsrpdySONqv5mtoStvl3wo95WIqXNEsFY60wO +q02jKQmJJ2MqhkJm2EoF2Mq8+40EZ5sz8LdgeQ/M0yQ9lAhPi4rftwhpe55Ma9dk +SE9X1c/DMCBEaIjJqVXdy0/EeArwpb8sHkguVVAZUWxzD+phm1gs +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/private_key.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/private_key.pem new file mode 100644 index 000000000..8fbf6bdec --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/private_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA1zVmMhPqpSPMmYkKh5wwlRD5XuS8YWJKEM6tjFx61VK8qxHE +YngkC2KnL5EuKAjQZIF3tJskwt0hAat047CCCZxrkNEpbVvSnvnk+A/8bg/Ww1n3 +qxzfifhsWfpUKlDnwrtH+ftt+5rZeEkf37XAPy7ZjzecAF9SDV6WSiPeAxUX2+hN +dId42Pf45woo4LFGUlQeagCFkD/R0dpNIMGwcnkKCUikiBqr2ijSIgvRtBfZ9fBG +jFGER2uE/Eay4AgcQsHue8skRwDCng8OnqtPnBtTytmqTy9V/BRgsVKUoksm6wsx +kUYwgHeaq7UCvlCm25SZ7yRyd4k8t0BKDf2h+wIDAQABAoIBAEQcrHmRACTADdNS +IjkFYALt2l8EOfMAbryfDSJtapr1kqz59JPNvmq0EIHnixo0n/APYdmReLML1ZR3 +tYkSpjVwgkLVUC1CcIjMQoGYXaZf8PLnGJHZk45RR8m6hsTV0mQ5bfBaeVa2jbma +OzJMjcnxg/3l9cPQZ2G/3AUfEPccMxOXp1KRz3mUQcGnKJGtDbN/kfmntcwYoxaE +Zg4RoeKAoMpK1SSHAiJKe7TnztINJ7uygR9XSzNd6auY8A3vomSIjpYO7XL+lh7L +izm4Ir3Gb/eCYBvWgQyQa2KCJgK/sQyEs3a09ngofSEUhQJQYhgZDwUj+fDDOGqj +hCZOA8ECgYEA+ZWuHdcUQ3ygYhLds2QcogUlIsx7C8n/Gk/FUrqqXJrTkuO0Eqqa +B47lCITvmn2zm0ODfSFIARgKEUEDLS/biZYv7SUTrFqBLcet+aGI7Dpv91CgB75R +tNzcIf8VxoiP0jPqdbh9mLbbxGi5Uc4p9TVXRljC4hkswaouebWee0sCgYEA3L2E +YB3kiHrhPI9LHS5Px9C1w+NOu5wP5snxrDGEgaFCvL6zgY6PflacppgnmTXl8D1x +im0IDKSw5dP3FFonSVXReq3CXDql7UnhfTCiLDahV7bLxTH42FofcBpDN3ERdOal +58RwQh6VrLkzQRVoObo+hbGlFiwwSAfQC509FhECgYBsRSBpVXo25IN2yBRg09cP ++gdoFyhxrsj5kw1YnB13WrrZh+oABv4WtUhp77E5ZbpaamlKCPwBbXpAjeFg4tfr +0bksuN7V79UGFQ9FsWuCfr8/nDwv38H2IbFlFhFONMOfPmJBey0Q6JJhm8R41mSh +OOiJXcv85UrjIH5U0hLUDQKBgQDVLOU5WcUJlPoOXSgiT0ZW5xWSzuOLRUUKEf6l +19BqzAzCcLy0orOrRAPW01xylt2v6/bJw1Ahva7k1ZZo/kOwjANYoZPxM+ZoSZBN +MXl8j2mzZuJVV1RFxItV3NcLJNPB/Lk+IbRz9kt/2f9InF7iWR3mSU/wIM6j0X+2 +p6yFsQKBgQCM/ldWb511lA+SNkqXB2P6WXAgAM/7+jwsNHX2ia2Ikufm4SUEKMSv +mti/nZkHDHsrHU4wb/2cOAywMELzv9EHzdcoenjBQP65OAc/1qWJs+LnBcCXfqKk +aHjEZW6+brkHdRGLLY3YAHlt/AUL+RsKPJfN72i/FSpmu+52G36eeQ== +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/public_key.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/public_key.pem new file mode 100644 index 000000000..f9772b533 --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/public_key.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1zVmMhPqpSPMmYkKh5ww +lRD5XuS8YWJKEM6tjFx61VK8qxHEYngkC2KnL5EuKAjQZIF3tJskwt0hAat047CC +CZxrkNEpbVvSnvnk+A/8bg/Ww1n3qxzfifhsWfpUKlDnwrtH+ftt+5rZeEkf37XA +Py7ZjzecAF9SDV6WSiPeAxUX2+hNdId42Pf45woo4LFGUlQeagCFkD/R0dpNIMGw +cnkKCUikiBqr2ijSIgvRtBfZ9fBGjFGER2uE/Eay4AgcQsHue8skRwDCng8OnqtP +nBtTytmqTy9V/BRgsVKUoksm6wsxkUYwgHeaq7UCvlCm25SZ7yRyd4k8t0BKDf2h ++wIDAQAB +-----END PUBLIC KEY----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/server-cert.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/server-cert.pem new file mode 100644 index 000000000..a2f9688df --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/server-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAjANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9TZXJ2ZXJfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCcEnEm5hqP1EbEJycOz8Ua +NWp29QdpFUzTWhkKGhVXk+0msmNTw4NBAFB42moY44OU8wvDideOlJNhPRWveD8z +G2lxzJA91p0UK4et8ia9MmeuCGhdC9jxJ8X69WNlUiPyy0hI/ZsqRq9Z0C2eW0iL +JPXsy4X8Xpw3SFwoXf5pR9RFY5Pb2tuyxqmSestu2VXT/NQjJg4CVDR3mFcHPXZB +4elRzH0WshExEGkgy0bg20MJeRc2Qdb5Xx+EakbmwroDWaCn3NSGqQ7jv6Vw0doy +TGvS6h6RHBxnyqRfRgKGlCoOMG9/5+rFJC00QpCUG2vHXHWGoWlMlJ3foN7rj5v9 +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJ5zt2rj4Ag6 +zpN59AWC1Fur8g8l41ksHkSpKPp+PtyO/ngvbMqBpfmK1e7JCKZv/68QXfMyWWAI +hwalqZkXXWHKjuz3wE7dE25PXFXtGJtcZAaj10xt98fzdqt8lQSwh2kbfNwZIz1F +sgAStgE7+ZTcqTgvNB76Os1UK0to+/P0VBWktaVFdyub4Nc2SdPVnZNvrRBXBwOD +3V8ViwywDOFoE7DvCvwx/SVsvoC0Z4j3AMMovO6oHicP7uU83qsQgm1Qru3YeoLR ++DoVi7IPHbWvN7MqFYn3YjNlByO2geblY7MR0BlqbFlmFrqLsUfjsh2ys7/U/knC +dN/klu446fI= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/server-key.pem b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/server-key.pem new file mode 100644 index 000000000..a1dfd5f78 --- /dev/null +++ b/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/server-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAnBJxJuYaj9RGxCcnDs/FGjVqdvUHaRVM01oZChoVV5PtJrJj +U8ODQQBQeNpqGOODlPMLw4nXjpSTYT0Vr3g/MxtpccyQPdadFCuHrfImvTJnrgho +XQvY8SfF+vVjZVIj8stISP2bKkavWdAtnltIiyT17MuF/F6cN0hcKF3+aUfURWOT +29rbssapknrLbtlV0/zUIyYOAlQ0d5hXBz12QeHpUcx9FrIRMRBpIMtG4NtDCXkX +NkHW+V8fhGpG5sK6A1mgp9zUhqkO47+lcNHaMkxr0uoekRwcZ8qkX0YChpQqDjBv +f+fqxSQtNEKQlBtrx1x1hqFpTJSd36De64+b/QIDAQABAoIBAFiah66Dt9SruLkn +WR8piUaFyLlcBib8Nq9OWSTJBhDAJERxxb4KIvvGB+l0ZgNXNp5bFPSfzsZdRwZP +PX5uj8Kd71Dxx3mz211WESMJdEC42u+MSmN4lGLkJ5t/sDwXU91E1vbJM0ve8THV +4/Ag9qA4DX2vVZOeyqT/6YHpSsPNZplqzrbAiwrfHwkctHfgqwOf3QLfhmVQgfCS +VwidBldEUv2whSIiIxh4Rv5St4kA68IBCbJxdpOpyuQBkk6CkxZ7VN9FqOuSd4Pk +Wm7iWyBMZsCmELZh5XAXld4BEt87C5R4CvbPBDZxAv3THk1DNNvpy3PFQfwARRFb +SAToYMECgYEAyL7U8yxpzHDYWd3oCx6vTi9p9N/z0FfAkWrRF6dm4UcSklNiT1Aq +EOnTA+SaW8tV3E64gCWcY23gNP8so/ZseWj6L+peHwtchaP9+KB7yGw2A+05+lOx +VetLTjAOmfpiUXFe5w1q4C1RGhLjZjjzW+GvwdAuchQgUEFaomrV+PUCgYEAxwfH +cmVGFbAktcjU4HSRjKSfawCrut+3YUOLybyku3Q/hP9amG8qkVTFe95CTLjLe2D0 +ccaTTpofFEJ32COeck0g0Ujn/qQ+KXRoauOYs4FB1DtqMpqB78wufWEUpDpbd9/h +J+gJdC/IADd4tJW9zA92g8IA7ZtFmqDtiSpQ0ekCgYAQGkaorvJZpN+l7cf0RGTZ +h7IfI2vCVZer0n6tQA9fmLzjoe6r4AlPzAHSOR8sp9XeUy43kUzHKQQoHCPvjw/K +eWJAP7OHF/k2+x2fOPhU7mEy1W+mJdp+wt4Kio5RSaVjVQ3AyPG+w8PSrJszEvRq +dWMMz+851WV2KpfjmWBKlQKBgQC++4j4DZQV5aMkSKV1CIZOBf3vaIJhXKEUFQPD +PmB4fBEjpwCg+zNGp6iktt65zi17o8qMjrb1mtCt2SY04eD932LZUHNFlwcLMmes +Ad+aiDLJ24WJL1f16eDGcOyktlblDZB5gZ/ovJzXEGOkLXglosTfo77OQculmDy2 +/UL2WQKBgGeKasmGNfiYAcWio+KXgFkHXWtAXB9B91B1OFnCa40wx+qnl71MIWQH +PQ/CZFNWOfGiNEJIZjrHsfNJoeXkhq48oKcT0AVCDYyLV0VxDO4ejT95mGW6njNd +JpvmhwwAjOvuWVr0tn4iXlSK8irjlJHmwcRjLTJq97vE9fsA2MjI +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_pgsql/.ci/docker-compose.yml b/apps/emqx_auth_pgsql/.ci/docker-compose.yml new file mode 100644 index 000000000..8782a841d --- /dev/null +++ b/apps/emqx_auth_pgsql/.ci/docker-compose.yml @@ -0,0 +1,30 @@ +version: '3' + +services: + erlang: + image: erlang:22.3 + volumes: + - ../:/emqx_auth_pgsql + networks: + - emqx_bridge + depends_on: + - pgsql_server + tty: true + + pgsql_server: + build: + context: ./pgsql + args: + BUILD_FROM: postgres:${PGSQL_TAG} + image: emqx-pgsql + restart: always + environment: + POSTGRES_PASSWORD: public + POSTGRES_USER: root + POSTGRES_DB: mqtt + networks: + - emqx_bridge + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_pgsql/.ci/pgsql/Dockerfile b/apps/emqx_auth_pgsql/.ci/pgsql/Dockerfile new file mode 100644 index 000000000..785bb875f --- /dev/null +++ b/apps/emqx_auth_pgsql/.ci/pgsql/Dockerfile @@ -0,0 +1,8 @@ +ARG BUILD_FROM=postgres:11 +FROM ${BUILD_FROM} +COPY pg.conf /etc/postgresql/postgresql.conf +COPY server-cert.pem /etc/postgresql/server-cert.pem +COPY server-key.pem /etc/postgresql/server-key.pem +RUN chown -R postgres:postgres /etc/postgresql \ + && chmod 600 /etc/postgresql/*.pem +CMD ["-c", "config_file=/etc/postgresql/postgresql.conf"] diff --git a/apps/emqx_auth_pgsql/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_pgsql/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..389359fb3 --- /dev/null +++ b/apps/emqx_auth_pgsql/.github/workflows/run_test_cases.yaml @@ -0,0 +1,51 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + strategy: + matrix: + pgsql_tag: + - 9 + - 10 + - 11 + - 12 + - 13 + network_type: + - ipv4 + - ipv6 + steps: + - name: install docker-compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - uses: actions/checkout@v1 + - name: run test cases + env: + PGSQL_TAG: ${{ matrix.pgsql_tag }} + NETWORK_TYPE: ${{ matrix.network_type }} + run: | + set -e -u -x + if [ "$NETWORK_TYPE" = "ipv6" ]; then docker network create --driver bridge --ipv6 --subnet fd15:555::/64 tests_emqx_bridge --attachable; fi + + cp test/emqx_auth_pgsql_SUITE_data/* .ci/pgsql/ + docker-compose -f .ci/docker-compose.yml -p tests up -d --build + if [ "$NETWORK_TYPE" != "ipv6" ]; then + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "sed -i '/auth.pgsql.server/c auth.pgsql.server = pgsql_server:5432' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf" + else + ipv6_address=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' $(docker ps -a -f name=tests_pgsql_server_1 -q)) + docker exec -i $(docker ps -a -f name=tests_erlang_1 -q) sh -c "sed -i '/auth.pgsql.server/c auth.pgsql.server = $ipv6_address:5432' /emqx_auth_pgsql/etc/emqx_auth_pgsql.conf" + fi + + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_pgsql xref" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_pgsql eunit" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_pgsql ct" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_pgsql cover" + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: logs_for_pgsql${{ matrix.pgsql_tag }}_{{matrix.network_type}} + path: _build/test/logs diff --git a/apps/emqx_auth_pgsql/.gitignore b/apps/emqx_auth_pgsql/.gitignore new file mode 100644 index 000000000..672d34c0c --- /dev/null +++ b/apps/emqx_auth_pgsql/.gitignore @@ -0,0 +1,20 @@ +ebin +.rebar +.eunit +.DS_Store +.erlang.mk/ +deps/ +emqx_auth_pgsql.d +ct.coverdata +logs/ +test/ct.cover.spec +test/*.beam +data/ +.DS_Store +cover/ +eunit.coverdata +_build/ +rebar.lock +erlang.mk +*.conf.rendered +.rebar3/ diff --git a/apps/emqx_auth_pgsql/LICENSE b/apps/emqx_auth_pgsql/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_auth_pgsql/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_pgsql/Makefile b/apps/emqx_auth_pgsql/Makefile new file mode 100644 index 000000000..3c379d2bf --- /dev/null +++ b/apps/emqx_auth_pgsql/Makefile @@ -0,0 +1,37 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_auth_pgsql.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_auth_pgsql.conf -i priv/emqx_auth_pgsql.schema -d data diff --git a/apps/emqx_auth_pgsql/README.md b/apps/emqx_auth_pgsql/README.md new file mode 100644 index 000000000..2dccd6f53 --- /dev/null +++ b/apps/emqx_auth_pgsql/README.md @@ -0,0 +1,183 @@ +emqx_auth_pgsql +=============== + +Authentication/ACL with PostgreSQL Database. + +Build Plugin +------------ + +make && make tests + +Configuration +------------- + +File: etc/emqx_auth_pgsql.conf + +``` +## PostgreSQL server address. +## +## Value: Port | IP:Port +## +## Examples: 5432, 127.0.0.1:5432, localhost:5432 +auth.pgsql.server = 127.0.0.1:5432 + +## PostgreSQL pool size. +## +## Value: Number +auth.pgsql.pool = 8 + +## PostgreSQL username. +## +## Value: String +auth.pgsql.username = root + +## PostgreSQL password. +## +## Value: String +## auth.pgsql.password = + +## PostgreSQL database. +## +## Value: String +auth.pgsql.database = mqtt + +## PostgreSQL database encoding. +## +## Value: String +auth.pgsql.encoding = utf8 + +## Whether to enable SSL connection. +## +## Value: true | false +auth.pgsql.ssl = false + +## SSL keyfile. +## +## Value: File +## auth.pgsql.ssl_opts.keyfile = + +## SSL certfile. +## +## Value: File +## auth.pgsql.ssl_opts.certfile = + +## SSL cacertfile. +## +## Value: File +## auth.pgsql.ssl_opts.cacertfile = + +## Authentication query. +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## +auth.pgsql.auth_query = select password from mqtt_user where username = '%u' limit 1 + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.pgsql.password_hash = sha256 + +## sha256 with salt prefix +## auth.pgsql.password_hash = salt,sha256 + +## sha256 with salt suffix +## auth.pgsql.password_hash = sha256,salt + +## bcrypt with salt prefix +## auth.pgsql.password_hash = salt,bcrypt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.pgsql.password_hash = pbkdf2,sha256,1000,20 + +## Superuser query. +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +auth.pgsql.super_query = select is_superuser from mqtt_user where username = '%u' limit 1 + +## ACL query. Comment this query, the ACL will be disabled. +## +## Value: SQL +## +## Variables: +## - %a: ipaddress +## - %u: username +## - %c: clientid +auth.pgsql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c' +``` + +Load Plugin +----------- + +./bin/emqx_ctl plugins load emqx_auth_pgsql + +Auth Table +---------- + +Notice: This is a demo table. You could authenticate with any user table. + +```sql +CREATE TABLE mqtt_user ( + id SERIAL primary key, + is_superuser boolean, + username character varying(100), + password character varying(100), + salt character varying(40) +) +``` + +ACL Table +--------- + +```sql +CREATE TABLE mqtt_acl ( + id SERIAL primary key, + allow integer, + ipaddr character varying(60), + username character varying(100), + clientid character varying(100), + access integer, + topic character varying(100) +) + +INSERT INTO mqtt_acl (id, allow, ipaddr, username, clientid, access, topic) +VALUES + (1,1,NULL,'$all',NULL,2,'#'), + (2,0,NULL,'$all',NULL,1,'$SYS/#'), + (3,0,NULL,'$all',NULL,1,'eq #'), + (5,1,'127.0.0.1',NULL,NULL,2,'$SYS/#'), + (6,1,'127.0.0.1',NULL,NULL,2,'#'), + (7,1,NULL,'dashboard',NULL,1,'$SYS/#'); +``` +**allow:** Client's permission to access a topic. '0' means that the client does not have permission to access the topic, '1' means that the client have permission to access the topic. + +**ipaddr:** Client IP address. For all ip addresses it can be '$all' or 'NULL'. + +**username:** Client username. For all users it can be '$all' or 'NULL'. + +**clientid:** Client id. For all client ids it can be '$all' or 'NULL'. + +**access:** Operations that the client can perform. '1' means that the client can subscribe to a topic, '2' means that the client can publish to a topic, '3' means that the client can subscribe and can publish to a topic. + +**topic:** Topic name. Topic wildcards are supported. + +**Notice that only one value allowed for ipaddr, username and clientid fields.** + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. + diff --git a/apps/emqx_auth_pgsql/etc/emqx_auth_pgsql.conf b/apps/emqx_auth_pgsql/etc/emqx_auth_pgsql.conf new file mode 100644 index 000000000..3e79d96d8 --- /dev/null +++ b/apps/emqx_auth_pgsql/etc/emqx_auth_pgsql.conf @@ -0,0 +1,110 @@ +##-------------------------------------------------------------------- +## PostgreSQL Auth/ACL Plugin +##-------------------------------------------------------------------- + +## PostgreSQL server address. +## +## Value: Port | IP:Port +## +## Examples: 5432, 127.0.0.1:5432, localhost:5432 +auth.pgsql.server = 127.0.0.1:5432 + +## PostgreSQL pool size. +## +## Value: Number +auth.pgsql.pool = 8 + +## PostgreSQL username. +## +## Value: String +auth.pgsql.username = root + +## PostgreSQL password. +## +## Value: String +## auth.pgsql.password = + +## PostgreSQL database. +## +## Value: String +auth.pgsql.database = mqtt + +## PostgreSQL database encoding. +## +## Value: String +auth.pgsql.encoding = utf8 + +## Whether to enable SSL connection. +## +## Value: true | false +auth.pgsql.ssl = false + +## SSL keyfile. +## +## Value: File +## auth.pgsql.ssl_opts.keyfile = + +## SSL certfile. +## +## Value: File +## auth.pgsql.ssl_opts.certfile = + +## SSL cacertfile. +## +## Value: File +## auth.pgsql.ssl_opts.cacertfile = + +## Authentication query. +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +auth.pgsql.auth_query = select password from mqtt_user where username = '%u' limit 1 + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.pgsql.password_hash = sha256 + +## sha256 with salt prefix +## auth.pgsql.password_hash = salt,sha256 + +## sha256 with salt suffix +## auth.pgsql.password_hash = sha256,salt + +## bcrypt with salt prefix +## auth.pgsql.password_hash = salt,bcrypt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.pgsql.password_hash = pbkdf2,sha256,1000,20 + +## Superuser query. +## +## Value: SQL +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +auth.pgsql.super_query = select is_superuser from mqtt_user where username = '%u' limit 1 + +## ACL query. Comment this query, the ACL will be disabled. +## +## Value: SQL +## +## Variables: +## - %a: ipaddress +## - %u: username +## - %c: clientid +## +## Note: You can add the 'ORDER BY' statement to control the rules match order +auth.pgsql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c' + diff --git a/apps/emqx_auth_pgsql/include/emqx_auth_pgsql.hrl b/apps/emqx_auth_pgsql/include/emqx_auth_pgsql.hrl new file mode 100644 index 000000000..b86692752 --- /dev/null +++ b/apps/emqx_auth_pgsql/include/emqx_auth_pgsql.hrl @@ -0,0 +1,23 @@ +-define(APP, emqx_auth_pgsql). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). + diff --git a/apps/emqx_auth_pgsql/mqtt.sql b/apps/emqx_auth_pgsql/mqtt.sql new file mode 100644 index 000000000..933b0058a --- /dev/null +++ b/apps/emqx_auth_pgsql/mqtt.sql @@ -0,0 +1,28 @@ + +CREATE TABLE mqtt_user ( + id SERIAL primary key, + is_superuser boolean, + username character varying(100), + password character varying(100), + salt character varying(40) +); + +CREATE TABLE mqtt_acl ( + id SERIAL primary key, + allow integer, + ipaddr character varying(60), + username character varying(100), + clientid character varying(100), + access integer, + topic character varying(100) +); + +INSERT INTO mqtt_acl (id, allow, ipaddr, username, clientid, access, topic) +VALUES + (1,1,NULL,'$all',NULL,2,'#'), + (2,0,NULL,'$all',NULL,1,'$SYS/#'), + (3,0,NULL,'$all',NULL,1,'eq #'), + (5,1,'127.0.0.1',NULL,NULL,2,'$SYS/#'), + (6,1,'127.0.0.1',NULL,NULL,2,'#'), + (7,1,NULL,'dashboard',NULL,1,'$SYS/#'); + diff --git a/apps/emqx_auth_pgsql/priv/emqx_auth_pgsql.schema b/apps/emqx_auth_pgsql/priv/emqx_auth_pgsql.schema new file mode 100644 index 000000000..4a475ee0e --- /dev/null +++ b/apps/emqx_auth_pgsql/priv/emqx_auth_pgsql.schema @@ -0,0 +1,127 @@ +%%-*- mode: erlang -*- +%% emqx_auth_pgsl config mapping + +{mapping, "auth.pgsql.server", "emqx_auth_pgsql.server", [ + {default, {"127.0.0.1", 5432}}, + {datatype, [integer, ip, string]} +]}. + +{mapping, "auth.pgsql.pool", "emqx_auth_pgsql.server", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "auth.pgsql.database", "emqx_auth_pgsql.server", [ + {datatype, string} +]}. + +{mapping, "auth.pgsql.username", "emqx_auth_pgsql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.pgsql.password", "emqx_auth_pgsql.server", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.pgsql.encoding", "emqx_auth_pgsql.server", [ + {default, utf8}, + {datatype, atom} +]}. + +{mapping, "auth.pgsql.ssl", "emqx_auth_pgsql.server", [ + {default, false}, + {datatype, {enum, [true, false]}} +]}. + +{mapping, "auth.pgsql.ssl_opts.keyfile", "emqx_auth_pgsql.server", [ + {datatype, string} +]}. + +{mapping, "auth.pgsql.ssl_opts.certfile", "emqx_auth_pgsql.server", [ + {datatype, string} +]}. + +{mapping, "auth.pgsql.ssl_opts.cacertfile", "emqx_auth_pgsql.server", [ + {datatype, string} +]}. + +{translation, "emqx_auth_pgsql.server", fun(Conf) -> + {PgHost, PgPort} = + case cuttlefish:conf_get("auth.pgsql.server", Conf) of + {Ip, Port} -> {Ip, Port}; + S -> case string:tokens(S, ":") of + [Domain] -> {Domain, 5432}; + [Domain, Port] -> {Domain, list_to_integer(Port)} + end + end, + Pool = cuttlefish:conf_get("auth.pgsql.pool", Conf), + Username = cuttlefish:conf_get("auth.pgsql.username", Conf), + Passwd = cuttlefish:conf_get("auth.pgsql.password", Conf, ""), + DB = cuttlefish:conf_get("auth.pgsql.database", Conf), + Encoding = cuttlefish:conf_get("auth.pgsql.encoding", Conf), + Ssl = cuttlefish:conf_get("auth.pgsql.ssl", Conf), + + Filter = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end, + SslOpts = fun(Prefix) -> + Filter([{keyfile, cuttlefish:conf_get(Prefix ++ ".keyfile", Conf, undefined)}, + {certfile, cuttlefish:conf_get(Prefix ++ ".certfile", Conf, undefined)}, + {cacertfile, cuttlefish:conf_get(Prefix ++ ".cacertfile", Conf, undefined)}]) + end, + + TempHost = case inet:parse_address(PgHost) of + {ok, IpAddr} -> + IpAddr; + _ -> + PgHost + end, + [{pool_size, Pool}, + {auto_reconnect, 1}, + {host, TempHost}, + {port, PgPort}, + {username, Username}, + {password, Passwd}, + {database, DB}, + {encoding, Encoding}, + {ssl, Ssl}, + {ssl_opts, SslOpts("auth.pgsql.ssl_opts")}] +end}. + +{mapping, "auth.pgsql.auth_query", "emqx_auth_pgsql.auth_query", [ + {datatype, string} +]}. + +{mapping, "auth.pgsql.password_hash", "emqx_auth_pgsql.password_hash", [ + {datatype, string} +]}. + +{mapping, "auth.pgsql.pbkdf2_macfun", "emqx_auth_pgsql.pbkdf2_macfun", [ + {datatype, atom} +]}. + +{mapping, "auth.pgsql.pbkdf2_iterations", "emqx_auth_pgsql.pbkdf2_iterations", [ + {datatype, integer} +]}. + +{mapping, "auth.pgsql.pbkdf2_dklen", "emqx_auth_pgsql.pbkdf2_dklen", [ + {datatype, integer} +]}. + +{mapping, "auth.pgsql.super_query", "emqx_auth_pgsql.super_query", [ + {datatype, string} +]}. + +{mapping, "auth.pgsql.acl_query", "emqx_auth_pgsql.acl_query", [ + {datatype, string} +]}. + +{translation, "emqx_auth_pgsql.password_hash", fun(Conf) -> + HashValue = cuttlefish:conf_get("auth.pgsql.password_hash", Conf), + case string:tokens(HashValue, ",") of + [Hash] -> list_to_atom(Hash); + [Prefix, Suffix] -> {list_to_atom(Prefix), list_to_atom(Suffix)}; + [Hash, MacFun, Iterations, Dklen] -> {list_to_atom(Hash), list_to_atom(MacFun), list_to_integer(Iterations), list_to_integer(Dklen)}; + _ -> plain + end +end}. diff --git a/apps/emqx_auth_pgsql/rebar.config b/apps/emqx_auth_pgsql/rebar.config new file mode 100644 index 000000000..98b95fce7 --- /dev/null +++ b/apps/emqx_auth_pgsql/rebar.config @@ -0,0 +1,34 @@ +{deps, + [{epgsql, {git, "https://github.com/epgsql/epgsql", {tag, "4.4.0"}}}, + {ecpool, {git,"https://github.com/emqx/ecpool", {tag, "0.5.0"}}}, + {emqx_passwd, {git, "https://github.com/emqx/emqx-passwd", {tag, "v1.1.1"}}} + ]}. + +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + compressed + ]}. +{overrides, [{add, [{erl_opts, [compressed]}]}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions + ]}. + +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helper, {git, "https://github.com/emqx/emqx-ct-helper", {branch, "1.2.2"}}}, + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}} + ]}, + {erl_opts, [debug_info]} + ]} + ]}. + diff --git a/apps/emqx_auth_pgsql/rebar.config.script b/apps/emqx_auth_pgsql/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_pgsql/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_pgsql/src/emqx_acl_pgsql.erl b/apps/emqx_auth_pgsql/src/emqx_acl_pgsql.erl new file mode 100644 index 000000000..c1792f1e2 --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_acl_pgsql.erl @@ -0,0 +1,117 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_pgsql). + +-include("emqx_auth_pgsql.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +%% ACL callbacks +-export([ register_metrics/0 + , check_acl/5 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +check_acl(ClientInfo, PubSub, Topic, NoMatchAction, #{pool := Pool} = State) -> + case do_check_acl(Pool, ClientInfo, PubSub, Topic, NoMatchAction, State) of + ok -> emqx_metrics:inc(?ACL_METRICS(ignore)), ok; + {stop, allow} -> emqx_metrics:inc(?ACL_METRICS(allow)), {stop, allow}; + {stop, deny} -> emqx_metrics:inc(?ACL_METRICS(deny)), {stop, deny} + end. + +do_check_acl(_Pool, #{username := <<$$, _/binary>>}, _PubSub, _Topic, _NoMatchAction, _State) -> + ok; +do_check_acl(Pool, ClientInfo, PubSub, Topic, _NoMatchAction, #{acl_query := {AclSql, AclParams}}) -> + case emqx_auth_pgsql_cli:equery(Pool, AclSql, AclParams, ClientInfo) of + {ok, _, []} -> ok; + {ok, _, Rows} -> + Rules = filter(PubSub, compile(Rows)), + case match(ClientInfo, Topic, Rules) of + {matched, allow} -> {stop, allow}; + {matched, deny} -> {stop, deny}; + nomatch -> ok + end; + {error, Reason} -> + ?LOG(error, "[Postgres] do_check_acl error: ~p~n", [Reason]), + ok + end. + +match(_ClientInfo, _Topic, []) -> + nomatch; + +match(ClientInfo, Topic, [Rule|Rules]) -> + case emqx_access_rule:match(ClientInfo, Topic, Rule) of + nomatch -> match(ClientInfo, Topic, Rules); + {matched, AllowDeny} -> {matched, AllowDeny} + end. + +filter(PubSub, Rules) -> + [Term || Term = {_, _, Access, _} <- Rules, + Access =:= PubSub orelse Access =:= pubsub]. + +compile(Rows) -> + compile(Rows, []). +compile([], Acc) -> + Acc; +compile([{Allow, IpAddr, Username, ClientId, Access, Topic}|T], Acc) -> + Who = who(IpAddr, Username, ClientId), + Term = {allow(Allow), Who, access(Access), [topic(Topic)]}, + compile(T, [emqx_access_rule:compile(Term) | Acc]). + +who(_, <<"$all">>, _) -> + all; +who(null, null, null) -> + throw(undefined_who); +who(CIDR, Username, ClientId) -> + Cols = [{ipaddr, b2l(CIDR)}, {user, Username}, {client, ClientId}], + case [{C, V} || {C, V} <- Cols, not empty(V)] of + [Who] -> Who; + Conds -> {'and', Conds} + end. + +allow(1) -> allow; +allow(0) -> deny; +allow(<<"1">>) -> allow; +allow(<<"0">>) -> deny. + +access(1) -> subscribe; +access(2) -> publish; +access(3) -> pubsub; +access(<<"1">>) -> subscribe; +access(<<"2">>) -> publish; +access(<<"3">>) -> pubsub. + +topic(<<"eq ", Topic/binary>>) -> + {eq, Topic}; +topic(Topic) -> + Topic. + +description() -> + "ACL with Postgres". + +b2l(null) -> null; +b2l(B) -> binary_to_list(B). + +empty(null) -> true; +empty("") -> true; +empty(<<>>) -> true; +empty(_) -> false. + diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.app.src b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.app.src new file mode 100644 index 000000000..fcfb74d33 --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_pgsql, + [{description, "EMQ X Authentication/ACL with PostgreSQL"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_pgsql_sup]}, + {applications, [kernel,stdlib,epgsql,ecpool,emqx_passwd]}, + {mod, {emqx_auth_pgsql_app,[]}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-pgsql"} + ]} + ]}. diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.app.src.script b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src new file mode 100644 index 000000000..47c0ab24f --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src @@ -0,0 +1,16 @@ +%% -*-: erlang -*- + +{VSN, + [ + {"4.2.0", [ + {load_module, emqx_auth_pgsql_cli, brutal_purge, soft_purge, []} + ]}, + {<<".*">>, []} + ], + [ + {"4.2.0", [ + {load_module, emqx_auth_pgsql_cli, brutal_purge, soft_purge, []} + ]}, + {<<".*">>, []} + ] + }. diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.erl b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.erl new file mode 100644 index 000000000..2dee5ef50 --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.erl @@ -0,0 +1,91 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_pgsql). + +-include("emqx_auth_pgsql.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-export([ register_metrics/0 + , check/3 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +%%-------------------------------------------------------------------- +%% Auth Module Callbacks +%%-------------------------------------------------------------------- + +check(ClientInfo = #{password := Password}, AuthResult, + #{auth_query := {AuthSql, AuthParams}, + super_query := SuperQuery, + hash_type := HashType, + pool := Pool}) -> + CheckPass = case emqx_auth_pgsql_cli:equery(Pool, AuthSql, AuthParams, ClientInfo) of + {ok, _, [Record]} -> + check_pass(erlang:append_element(Record, Password), HashType); + {ok, _, []} -> + {error, not_found}; + {error, Reason} -> + ?LOG(error, "[Postgres] query '~p' failed: ~p", [AuthSql, Reason]), + {error, not_found} + end, + case CheckPass of + ok -> + emqx_metrics:inc(?AUTH_METRICS(success)), + {stop, AuthResult#{is_superuser => is_superuser(Pool, SuperQuery, ClientInfo), + anonymous => false, + auth_result => success}}; + {error, not_found} -> + emqx_metrics:inc(?AUTH_METRICS(ignore)), ok; + {error, ResultCode} -> + ?LOG(error, "[Postgres] Auth from pgsql failed: ~p", [ResultCode]), + emqx_metrics:inc(?AUTH_METRICS(failure)), + {stop, AuthResult#{auth_result => ResultCode, anonymous => false}} + end. + +%%-------------------------------------------------------------------- +%% Is Superuser? +%%-------------------------------------------------------------------- + +-spec(is_superuser(atom(),undefined | {string(), list()}, emqx_types:client()) -> boolean()). +is_superuser(_Pool, undefined, _Client) -> + false; +is_superuser(Pool, {SuperSql, Params}, ClientInfo) -> + case emqx_auth_pgsql_cli:equery(Pool, SuperSql, Params, ClientInfo) of + {ok, [_Super], [{true}]} -> + true; + {ok, [_Super], [_False]} -> + false; + {ok, [_Super], []} -> + false; + {error, _Error} -> + false + end. + +check_pass(Password, HashType) -> + case emqx_passwd:check_pass(Password, HashType) of + ok -> ok; + {error, _Reason} -> {error, not_authorized} + end. + +description() -> "Authentication with PostgreSQL". + diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_app.erl b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_app.erl new file mode 100644 index 000000000..1d05f6b8a --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_app.erl @@ -0,0 +1,63 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_pgsql_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_pgsql.hrl"). + +-import(emqx_auth_pgsql_cli, [parse_query/2]). + +%% Application callbacks +-export([ start/2 + , stop/1 + ]). + +%%-------------------------------------------------------------------- +%% Application callbacks +%%-------------------------------------------------------------------- + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqx_auth_pgsql_sup:start_link(), + if_enabled(auth_query, fun(AuthQuery) -> + SuperQuery = parse_query(super_query, application:get_env(?APP, super_query, undefined)), + {ok, HashType} = application:get_env(?APP, password_hash), + AuthEnv = #{auth_query => AuthQuery, + super_query => SuperQuery, + hash_type => HashType, + pool => ?APP}, + ok = emqx_auth_pgsql:register_metrics(), + ok = emqx:hook('client.authenticate', fun emqx_auth_pgsql:check/3, [AuthEnv]) + end), + if_enabled(acl_query, fun(AclQuery) -> + ok = emqx_acl_pgsql:register_metrics(), + ok = emqx:hook('client.check_acl', fun emqx_acl_pgsql:check_acl/5, [#{acl_query => AclQuery, pool => ?APP}]) + end), + {ok, Sup}. + +stop(_State) -> + ok = emqx:unhook('client.authenticate', fun emqx_auth_pgsql:check/3), + ok = emqx:unhook('client.check_acl', fun emqx_acl_pgsql:check_acl/5). + +if_enabled(Par, Fun) -> + case application:get_env(?APP, Par) of + {ok, Query} -> Fun(parse_query(Par, Query)); + undefined -> ok + end. + diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_cli.erl b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_cli.erl new file mode 100644 index 000000000..27d25f35b --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_cli.erl @@ -0,0 +1,138 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_pgsql_cli). + +-behaviour(ecpool_worker). + +-include("emqx_auth_pgsql.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-export([connect/1]). +-export([parse_query/2]). +-export([ equery/4 + , equery/3 + ]). + +%%-------------------------------------------------------------------- +%% Avoid SQL Injection: Parse SQL to Parameter Query. +%%-------------------------------------------------------------------- + +parse_query(_Par, undefined) -> + undefined; +parse_query(Par, Sql) -> + case re:run(Sql, "'%[ucCad]'", [global, {capture, all, list}]) of + {match, Variables} -> + Params = [Var || [Var] <- Variables], + {atom_to_list(Par), Params}; + nomatch -> + {atom_to_list(Par), []} + end. + +pgvar(Sql, Params) -> + Vars = ["$" ++ integer_to_list(I) || I <- lists:seq(1, length(Params))], + lists:foldl(fun({Param, Var}, S) -> + re:replace(S, Param, Var, [{return, list}]) + end, Sql, lists:zip(Params, Vars)). + +%%-------------------------------------------------------------------- +%% PostgreSQL Connect/Query +%%-------------------------------------------------------------------- + +connect(Opts) -> + Host = proplists:get_value(host, Opts), + Username = proplists:get_value(username, Opts), + Password = proplists:get_value(password, Opts), + case epgsql:connect(Host, Username, Password, conn_opts(Opts)) of + {ok, C} -> + conn_post(C), + {ok, C}; + {error, Reason = econnrefused} -> + ?LOG(error, "[Postgres] Can't connect to Postgres server: Connection refused."), + {error, Reason}; + {error, Reason = invalid_authorization_specification} -> + ?LOG(error, "[Postgres] Can't connect to Postgres server: Invalid authorization specification."), + {error, Reason}; + {error, Reason = invalid_password} -> + ?LOG(error, "[Postgres] Can't connect to Postgres server: Invalid password."), + {error, Reason}; + {error, Reason} -> + ?LOG(error, "[Postgres] Can't connect to Postgres server: ~p", [Reason]), + {error, Reason} + end. + +conn_post(Connection) -> + lists:foreach(fun(Par) -> + Sql0 = application:get_env(?APP, Par, undefined), + case parse_query(Par, Sql0) of + undefined -> ok; + {_, Params} -> + Sql = pgvar(Sql0, Params), + epgsql:parse(Connection, atom_to_list(Par), Sql, []) + end + end, [auth_query, acl_query, super_query]). + +conn_opts(Opts) -> + conn_opts(Opts, []). +conn_opts([], Acc) -> + Acc; +conn_opts([Opt = {database, _}|Opts], Acc) -> + conn_opts(Opts, [Opt|Acc]); +conn_opts([Opt = {ssl, _}|Opts], Acc) -> + conn_opts(Opts, [Opt|Acc]); +conn_opts([Opt = {port, _}|Opts], Acc) -> + conn_opts(Opts, [Opt|Acc]); +conn_opts([Opt = {timeout, _}|Opts], Acc) -> + conn_opts(Opts, [Opt|Acc]); +conn_opts([Opt = {ssl_opts, _}|Opts], Acc) -> + conn_opts(Opts, [Opt|Acc]); +conn_opts([_Opt|Opts], Acc) -> + conn_opts(Opts, Acc). + +equery(Pool, Sql, Params) -> + ecpool:with_client(Pool, fun(C) -> epgsql:prepared_query(C, Sql, Params) end). + +equery(Pool, Sql, Params, ClientInfo) -> + ecpool:with_client(Pool, fun(C) -> epgsql:prepared_query(C, Sql, replvar(Params, ClientInfo)) end). + +replvar(Params, ClientInfo) -> + replvar(Params, ClientInfo, []). + +replvar([], _ClientInfo, Acc) -> + lists:reverse(Acc); + +replvar(["'%u'" | Params], ClientInfo = #{username := Username}, Acc) -> + replvar(Params, ClientInfo, [Username | Acc]); +replvar(["'%c'" | Params], ClientInfo = #{clientid := ClientId}, Acc) -> + replvar(Params, ClientInfo, [ClientId | Acc]); +replvar(["'%a'" | Params], ClientInfo = #{peerhost := IpAddr}, Acc) -> + replvar(Params, ClientInfo, [inet_parse:ntoa(IpAddr) | Acc]); +replvar(["'%C'" | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [safe_get(cn, ClientInfo)| Acc]); +replvar(["'%d'" | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [safe_get(dn, ClientInfo)| Acc]); +replvar([Param | Params], ClientInfo, Acc) -> + replvar(Params, ClientInfo, [Param | Acc]). + +safe_get(K, ClientInfo) -> + bin(maps:get(K, ClientInfo, undefined)). + +bin(A) when is_atom(A) -> atom_to_binary(A, utf8); +bin(B) when is_binary(B) -> B; +bin(X) -> X. + diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_sup.erl b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_sup.erl new file mode 100644 index 000000000..162d04747 --- /dev/null +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql_sup.erl @@ -0,0 +1,37 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_pgsql_sup). + +-behaviour(supervisor). + +-include("emqx_auth_pgsql.hrl"). + +%% API +-export([start_link/0]). + +%% Supervisor callbacks +-export([init/1]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +init([]) -> + %% PgSQL Connection Pool + {ok, Opts} = application:get_env(?APP, server), + PoolSpec = ecpool:pool_spec(?APP, ?APP, emqx_auth_pgsql_cli, Opts), + {ok, {{one_for_one, 10, 100}, [PoolSpec]}}. + diff --git a/apps/emqx_auth_pgsql/test/.placeholder b/apps/emqx_auth_pgsql/test/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE.erl b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE.erl new file mode 100644 index 000000000..84aa5e800 --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE.erl @@ -0,0 +1,247 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_pgsql_SUITE). + +-compile(export_all). + +-define(POOL, emqx_auth_pgsql). + +-define(APP, emqx_auth_pgsql). + +-include_lib("emqx/include/emqx.hrl"). + +-include_lib("eunit/include/eunit.hrl"). + +-include_lib("common_test/include/ct.hrl"). + +%%setp1 init table +-define(DROP_ACL_TABLE, "DROP TABLE IF EXISTS mqtt_acl_test"). + +-define(CREATE_ACL_TABLE, "CREATE TABLE mqtt_acl_test ( + id SERIAL primary key, + allow integer, + ipaddr character varying(60), + username character varying(100), + clientid character varying(100), + access integer, + topic character varying(100))"). + +-define(INIT_ACL, "INSERT INTO mqtt_acl_test (id, allow, ipaddr, username, clientid, access, topic) + VALUES + (1,1,'127.0.0.1','u1','c1',1,'t1'), + (2,0,'127.0.0.1','u2','c2',1,'t1'), + (3,1,'10.10.0.110','u1','c1',1,'t1'), + (4,1,'127.0.0.1','u3','c3',3,'t1')"). + +-define(DROP_AUTH_TABLE, "DROP TABLE IF EXISTS mqtt_user_test"). + +-define(CREATE_AUTH_TABLE, "CREATE TABLE mqtt_user_test ( + id SERIAL primary key, + is_superuser boolean, + username character varying(100), + password character varying(100), + salt character varying(40))"). + +-define(INIT_AUTH, "INSERT INTO mqtt_user_test (id, is_superuser, username, password, salt) + VALUES + (1, true, 'plain', 'plain', 'salt'), + (2, false, 'md5', '1bc29b36f623ba82aaf6724fd3b16718', 'salt'), + (3, false, 'sha', 'd8f4590320e1343a915b6394170650a8f35d6926', 'salt'), + (4, false, 'sha256', '5d5b09f6dcb2d53a5fffc60c4ac0d55fabdf556069d6631545f42aa6e3500f2e', 'salt'), + (5, false, 'pbkdf2_password', 'cdedb5281bb2f801565a1122b2563515', 'ATHENA.MIT.EDUraeburn'), + (6, false, 'bcrypt_foo', '$2a$12$sSS8Eg.ovVzaHzi1nUHYK.HbUIOdlQI0iS22Q5rd5z.JVVYH6sfm6', '$2a$12$sSS8Eg.ovVzaHzi1nUHYK.'), + (7, false, 'bcrypt', '$2y$16$rEVsDarhgHYB0TGnDFJzyu5f.T.Ha9iXMTk9J36NCMWWM7O16qyaK', 'salt')"). + +all() -> + [{group, ssl}, {group, nossl}]. + +groups() -> + Cases = emqx_ct:all(?MODULE), + [{ssl, [sequence], Cases}, {nossl, [sequence], Cases}]. + +init_per_group(Name, Config) -> + case Name of + ssl -> + emqx_ct_helpers:start_apps([emqx_auth_pgsql], fun set_special_configs_ssl/1); + nossl -> + emqx_ct_helpers:start_apps([emqx_auth_pgsql], fun set_special_configs/1) + end, + init_auth_(), + init_acl_(), + Config. + +end_per_group(_, Config) -> + drop_auth_(), + drop_acl_(), + emqx_ct_helpers:stop_apps([emqx_auth_pgsql]), + Config. + +set_special_configs_ssl(Name) -> + Server = application:get_env(?APP, server, []), + Path = emqx_ct_helpers:deps_path(emqx_auth_pgsql, "test/emqx_auth_pgsql_SUITE_data/"), + Sslopts = [{keyfile, Path ++ "/client-key.pem"}, + {certfile, Path ++ "/client-cert.pem"}, + {cacertfile, Path ++ "/ca.pem"}], + Temp = lists:keyreplace(ssl, 1, Server, {ssl, true}), + application:set_env(?APP, server, Temp), + application:set_env(?APP, server, lists:keyreplace(ssl_opts, 1, Temp, {ssl_opts, Sslopts})), + set_special_configs(Name). + +set_special_configs(emqx) -> + application:set_env(emqx, acl_nomatch, deny), + application:set_env(emqx, acl_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/acl.conf")), + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, enable_acl_cache, false), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/loaded_plugins")); + +set_special_configs(emqx_auth_pgsql) -> + Server = application:get_env(?APP, server, []), + application:set_env(?APP, server, + lists:keyreplace(password, + 1, + lists:keyreplace(pool_size, 1, Server, {pool_size, 1}), + {password, "public"})), + application:set_env(?APP, acl_query, "select allow, ipaddr, username, clientid, access, topic from mqtt_acl_test where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'"), + application:set_env(?APP, super_query, "select is_superuser from mqtt_user_test where username = '%u' limit 1"), + application:set_env(?APP, auth_query, "select password from mqtt_user_test where username = '%u' limit 1"); +set_special_configs(_App) -> + ok. + +t_comment_config(_) -> + AuthCount = length(emqx_hooks:lookup('client.authenticate')), + AclCount = length(emqx_hooks:lookup('client.check_acl')), + application:stop(?APP), + [application:unset_env(?APP, Par) || Par <- [acl_query, auth_query]], + application:start(?APP), + ?assertEqual([], emqx_hooks:lookup('client.authenticate')), + ?assertEqual(AuthCount - 1, length(emqx_hooks:lookup('client.authenticate'))), + ?assertEqual(AclCount - 1, length(emqx_hooks:lookup('client.check_acl'))). + +t_placeholders(_) -> + ClientA = #{username => <<"plain">>, clientid => <<"plain">>, zone => external}, + reload([{password_hash, plain}, + {auth_query, "select password from mqtt_user_test where username = '%u' and 'a_cn_val' = '%C' limit 1"}]), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>}), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, cn => undefined}), + {ok, _} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, cn => <<"a_cn_val">>}), + + reload([{auth_query, "select password from mqtt_user_test where username = '%c' and 'a_dn_val' = '%d' limit 1"}]), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>}), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, dn => undefined}), + {ok, _} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, dn => <<"a_dn_val">>}), + + reload([{auth_query, "select password from mqtt_user_test where username = '%u' and '192.168.1.5' = '%a' limit 1"}]), + {error, not_authorized} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>}), + {ok, _} = + emqx_access_control:authenticate(ClientA#{password => <<"plain">>, peerhost => {192,168,1,5}}). + +t_check_auth(_) -> + Plain = #{clientid => <<"client1">>, username => <<"plain">>, zone => external}, + Md5 = #{clientid => <<"md5">>, username => <<"md5">>, zone => external}, + Sha = #{clientid => <<"sha">>, username => <<"sha">>, zone => external}, + Sha256 = #{clientid => <<"sha256">>, username => <<"sha256">>, zone => external}, + Pbkdf2 = #{clientid => <<"pbkdf2_password">>, username => <<"pbkdf2_password">>, zone => external}, + BcryptFoo = #{clientid => <<"bcrypt_foo">>, username => <<"bcrypt_foo">>, zone => external}, + User1 = #{clientid => <<"bcrypt_foo">>, username => <<"user">>, zone => external}, + Bcrypt = #{clientid => <<"bcrypt">>, username => <<"bcrypt">>, zone => external}, + reload([{password_hash, plain}, + {auth_query, "select password from mqtt_user_test where username = '%u' limit 1"}]), + {ok, #{is_superuser := true}} = emqx_access_control:authenticate(Plain#{password => <<"plain">>}), + reload([{password_hash, md5}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Md5#{password => <<"md5">>}), + reload([{password_hash, sha}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Sha#{password => <<"sha">>}), + reload([{password_hash, sha256}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Sha256#{password => <<"sha256">>}), + reload([{password_hash, bcrypt}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Bcrypt#{password => <<"password">>}), + %%pbkdf2 sha + reload([{password_hash, {pbkdf2, sha, 1, 16}}, {auth_query, "select password, salt from mqtt_user_test where username = '%u' limit 1"}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Pbkdf2#{password => <<"password">>}), + reload([{password_hash, {salt, bcrypt}}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(BcryptFoo#{password => <<"foo">>}), + {error, _} = emqx_access_control:authenticate(User1#{password => <<"foo">>}), + {error, not_authorized} = emqx_access_control:authenticate(Bcrypt#{password => <<"password">>}). +t_check_acl(_) -> + % emqx_modules:load_module(emqx_mod_acl_internal, false), + User1 = #{zone => external, peerhost => {127,0,0,1}, clientid => <<"c1">>, username => <<"u1">>}, + User2 = #{zone => external, peerhost => {127,0,0,1}, clientid => <<"c2">>, username => <<"u2">>}, + reload([{acl_query, "select allow, ipaddr, username, clientid, access, topic from mqtt_acl_test where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'"}]), + allow = emqx_access_control:check_acl(User1, subscribe, <<"t1">>), + deny = emqx_access_control:check_acl(User2, subscribe, <<"t1">>), + User3 = #{zone => external, peerhost => {10,10,0,110}, clientid => <<"c1">>, username => <<"u1">>}, + User4 = #{zone => external, peerhost => {10,10,10,110}, clientid => <<"c1">>, username => <<"u1">>}, + allow = emqx_access_control:check_acl(User3, subscribe, <<"t1">>), + allow = emqx_access_control:check_acl(User3, subscribe, <<"t1">>), + deny = emqx_access_control:check_acl(User3, subscribe, <<"t2">>),%% nomatch -> ignore -> emqttd acl + deny = emqx_access_control:check_acl(User4, subscribe, <<"t1">>), + User5 = #{zone => external, peerhost => {127,0,0,1}, clientid => <<"c3">>, username => <<"u3">>}, + allow = emqx_access_control:check_acl(User5, subscribe, <<"t1">>), + allow = emqx_access_control:check_acl(User5, publish, <<"t1">>). + +t_acl_super(_) -> + reload([{password_hash, plain}, {auth_query, "select password from mqtt_user_test where username = '%u' limit 1"}]), + {ok, C} = emqtt:start_link([{host, "localhost"}, {clientid, <<"simpleClient">>}, + {username, <<"plain">>}, {password, <<"plain">>}]), + {ok, _} = emqtt:connect(C), + timer:sleep(10), + emqtt:subscribe(C, <<"TopicA">>, qos2), + emqtt:publish(C, <<"TopicA">>, <<"Payload">>, qos2), + timer:sleep(1000), + receive + {publish, #{payload := Payload}} -> + ?assertEqual(<<"Payload">>, Payload) + after + 1000 -> + ct:fail({receive_timeout, <<"Payload">>}), + ok + end, + emqtt:disconnect(C). + +reload(Config) when is_list(Config) -> + application:stop(?APP), + [application:set_env(?APP, K, V) || {K, V} <- Config], + application:start(?APP). + +init_acl_() -> + {ok, Pid} = ecpool_worker:client(gproc_pool:pick_worker({ecpool, ?POOL})), + {ok, [], []} = epgsql:squery(Pid, ?DROP_ACL_TABLE), + {ok, [], []} = epgsql:squery(Pid, ?CREATE_ACL_TABLE), + {ok, _} = epgsql:equery(Pid, ?INIT_ACL). + +drop_acl_() -> + {ok, Pid} = ecpool_worker:client(gproc_pool:pick_worker({ecpool, ?POOL})), + {ok, [], []}= epgsql:squery(Pid, ?DROP_ACL_TABLE). + +init_auth_() -> + {ok, Pid} = ecpool_worker:client(gproc_pool:pick_worker({ecpool, ?POOL})), + {ok, [], []} = epgsql:squery(Pid, ?DROP_AUTH_TABLE), + {ok, [], []} = epgsql:squery(Pid, ?CREATE_AUTH_TABLE), + {ok, _} = epgsql:equery(Pid, ?INIT_AUTH). + +drop_auth_() -> + {ok, Pid} = ecpool_worker:client(gproc_pool:pick_worker({ecpool, ?POOL})), + {ok, [], []} = epgsql:squery(Pid, ?DROP_AUTH_TABLE). diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/ca.pem b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/ca.pem new file mode 100644 index 000000000..00b31d8a4 --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/ca.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDAzCCAeugAwIBAgIBATANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowPDE6MDgGA1UEAwwxTXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9DQV9DZXJ0aWZpY2F0ZTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANJBlAYvTQ6euY4HcSn4syH7kq9s +KcG+OMjPUrj+KFEElCzgNuIhaS0f3ORQGB1PNcvVcfdXUI3WX332gWbr9s1b7Xl1 +JKJfDXs+26Cm6NhONTE3sPHnbTSmQEFb52hwAtjQmcY3IQs1AgxKFFHJfnCBEWfE +ePBQaiuYk1XDESMdWpMLrPnYQaj9MpAOUxjlmZCayzPWlF0j0IWvfsF5TqZL7tFK +9p5F/DzyZ4n1mqPVEoUmq5ZdSKj2TQkpWTMHBWHEDQQqXbyE1FGJR7zEUFeuG1KT +sVBg7iZEC93SygZTbgUZSQXIwQCsO6xZ8MB2XDJkPbWp/3Wc6c8I6P09F48CAwEA +AaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEADKz6bIpP5anp +GgLB0jkclRWuMlS4qqIt4itSsMXPJ/ezpHwECixmgW2TIQl6S1woRkUeMxhT2/Ay +Sn/7aKxuzRagyE5NEGOvrOuAP5RO2ZdNJ/X3/Rh533fK1sOTEEbSsWUvW6iSkZef +rsfZBVP32xBhRWkKRdLeLB4W99ADMa0IrTmZPCXHSSE2V4e1o6zWLXcOZeH1Qh8N +SkelBweR+8r1Fbvy1r3s7eH7DCbYoGEDVLQGOLvzHKBisQHmoDnnF5E9g1eeNRdg +o+vhOKfYCOzeNREJIqS42PHcGhdNRk90ycigPmfUJclz1mDHoMjKR2S5oosTpr65 +tNPx3CL7GA== +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-cert.pem b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-cert.pem new file mode 100644 index 000000000..aad1404ca --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAzANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0N1oXDTMwMDYwOTAzMzg0N1owQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9DbGllbnRfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVYSWpOvCTupz82fc85Opv +EQ7rkB8X2oOMyBCpkyHKBIr1ZQgRDWBp9UVOASq3GnSElm6+T3Kb1QbOffa8GIlw +sjAueKdq5L2eSkmPIEQ7eoO5kEW+4V866hE1LeL/PmHg2lGP0iqZiJYtElhHNQO8 +3y9I7cm3xWMAA3SSWikVtpJRn3qIp2QSrH+tK+/HHbE5QwtPxdir4ULSCSOaM5Yh +Wi5Oto88TZqe1v7SXC864JVvO4LuS7TuSreCdWZyPXTJFBFeCEWSAxonKZrqHbBe +CwKML6/0NuzjaQ51c2tzmVI6xpHj3nnu4cSRx6Jf9WBm+35vm0wk4pohX3ptdzeV +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAByQ5zSNeFUH +Aw7JlpZHtHaSEeiiyBHke20ziQ07BK1yi/ms2HAWwQkpZv149sjNuIRH8pkTmkZn +g8PDzSefjLbC9AsWpWV0XNV22T/cdobqLqMBDDZ2+5bsV+jTrOigWd9/AHVZ93PP +IJN8HJn6rtvo2l1bh/CdsX14uVSdofXnuWGabNTydqtMvmCerZsdf6qKqLL+PYwm +RDpgWiRUY7KPBSSlKm/9lJzA+bOe4dHeJzxWFVCJcbpoiTFs1je1V8kKQaHtuW39 +ifX6LTKUMlwEECCbDKM8Yq2tm8NjkjCcnFDtKg8zKGPUu+jrFMN5otiC3wnKcP7r +O9EkaPcgYH8= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-key.pem b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-key.pem new file mode 100644 index 000000000..6789d0291 --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA1WElqTrwk7qc/Nn3POTqbxEO65AfF9qDjMgQqZMhygSK9WUI +EQ1gafVFTgEqtxp0hJZuvk9ym9UGzn32vBiJcLIwLninauS9nkpJjyBEO3qDuZBF +vuFfOuoRNS3i/z5h4NpRj9IqmYiWLRJYRzUDvN8vSO3Jt8VjAAN0klopFbaSUZ96 +iKdkEqx/rSvvxx2xOUMLT8XYq+FC0gkjmjOWIVouTraPPE2antb+0lwvOuCVbzuC +7ku07kq3gnVmcj10yRQRXghFkgMaJyma6h2wXgsCjC+v9Dbs42kOdXNrc5lSOsaR +49557uHEkceiX/VgZvt+b5tMJOKaIV96bXc3lQIDAQABAoIBAF7yjXmSOn7h6P0y +WCuGiTLG2mbDiLJqj2LTm2Z5i+2Cu/qZ7E76Ls63TxF4v3MemH5vGfQhEhR5ZD/6 +GRJ1sKKvB3WGRqjwA9gtojHH39S/nWGy6vYW/vMOOH37XyjIr3EIdIaUtFQBTSHd +Kd71niYrAbVn6fyWHolhADwnVmTMOl5OOAhCdEF4GN3b5aIhIu8BJ7EUzTtHBJIj +CAEfjZFjDs1y1cIgGFJkuIQxMfCpq5recU2qwip7YO6fk//WEjOPu7kSf5IEswL8 +jg1dea9rGBV6KaD2xsgsC6Ll6Sb4BbsrHMfflG3K2Lk3RdVqqTFp1Fn1PTLQE/1S +S/SZPYECgYEA9qYcHKHd0+Q5Ty5wgpxKGa4UCWkpwvfvyv4bh8qlmxueB+l2AIdo +ZvkM8gTPagPQ3WypAyC2b9iQu70uOJo1NizTtKnpjDdN1YpDjISJuS/P0x73gZwy +gmoM5AzMtN4D6IbxXtXnPaYICvwLKU80ouEN5ZPM4/ODLUu6gsp0v2UCgYEA3Xgi +zMC4JF0vEKEaK0H6QstaoXUmw/lToZGH3TEojBIkb/2LrHUclygtONh9kJSFb89/ +jbmRRLAOrx3HZKCNGUmF4H9k5OQyAIv6OGBinvLGqcbqnyNlI+Le8zxySYwKMlEj +EMrBCLmSyi0CGFrbZ3mlj/oCET/ql9rNvcK+DHECgYAEx5dH3sMjtgp+RFId1dWB +xePRgt4yTwewkVgLO5wV82UOljGZNQaK6Eyd7AXw8f38LHzh+KJQbIvxd2sL4cEi +OaAoohpKg0/Y0YMZl//rPMf0OWdmdZZs/I0fZjgZUSwWN3c59T8z7KG/RL8an9RP +S7kvN7wCttdV61/D5RR6GQKBgDxCe/WKWpBKaovzydMLWLTj7/0Oi0W3iXHkzzr4 +LTgvl4qBSofaNbVLUUKuZTv5rXUG2IYPf99YqCYtzBstNDc1MiAriaBeFtzfOW4t +i6gEFtoLLbuvPc3N5Sv5vn8Ug5G9UfU3td5R4AbyyCcoUZqOFuZd+EIJSiOXfXOs +kVmBAoGBAIU9aPAqhU5LX902oq8KsrpdySONqv5mtoStvl3wo95WIqXNEsFY60wO +q02jKQmJJ2MqhkJm2EoF2Mq8+40EZ5sz8LdgeQ/M0yQ9lAhPi4rftwhpe55Ma9dk +SE9X1c/DMCBEaIjJqVXdy0/EeArwpb8sHkguVVAZUWxzD+phm1gs +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/pg.conf b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/pg.conf new file mode 100644 index 000000000..7b78cd1e3 --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/pg.conf @@ -0,0 +1,21 @@ +# - Connection Settings - + +listen_addresses = '*' +port = 5432 # (change requires restart) +max_connections = 100 # (change requires restart) +# - SSL - + +ssl = on +ssl_cert_file = '/etc/postgresql/server-cert.pem' +ssl_key_file = '/etc/postgresql/server-key.pem' +shared_buffers = 128MB # min 128kB +checkpoint_timeout = 5min # range 30s-1d +max_wal_size = 1GB +min_wal_size = 80MB +datestyle = 'iso, mdy' +timezone = 'Etc/UTC' +lc_messages = 'en_US.utf8' # locale for system error message +lc_monetary = 'en_US.utf8' # locale for monetary formatting +lc_numeric = 'en_US.utf8' # locale for number formatting +lc_time = 'en_US.utf8' # locale for time formatting +default_text_search_config = 'pg_catalog.english' diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/server-cert.pem b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/server-cert.pem new file mode 100644 index 000000000..a2f9688df --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/server-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAeygAwIBAgIBAjANBgkqhkiG9w0BAQsFADA8MTowOAYDVQQDDDFNeVNR +TF9TZXJ2ZXJfOC4wLjE5X0F1dG9fR2VuZXJhdGVkX0NBX0NlcnRpZmljYXRlMB4X +DTIwMDYxMTAzMzg0NloXDTMwMDYwOTAzMzg0NlowQDE+MDwGA1UEAww1TXlTUUxf +U2VydmVyXzguMC4xOV9BdXRvX0dlbmVyYXRlZF9TZXJ2ZXJfQ2VydGlmaWNhdGUw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCcEnEm5hqP1EbEJycOz8Ua +NWp29QdpFUzTWhkKGhVXk+0msmNTw4NBAFB42moY44OU8wvDideOlJNhPRWveD8z +G2lxzJA91p0UK4et8ia9MmeuCGhdC9jxJ8X69WNlUiPyy0hI/ZsqRq9Z0C2eW0iL +JPXsy4X8Xpw3SFwoXf5pR9RFY5Pb2tuyxqmSestu2VXT/NQjJg4CVDR3mFcHPXZB +4elRzH0WshExEGkgy0bg20MJeRc2Qdb5Xx+EakbmwroDWaCn3NSGqQ7jv6Vw0doy +TGvS6h6RHBxnyqRfRgKGlCoOMG9/5+rFJC00QpCUG2vHXHWGoWlMlJ3foN7rj5v9 +AgMBAAGjDTALMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJ5zt2rj4Ag6 +zpN59AWC1Fur8g8l41ksHkSpKPp+PtyO/ngvbMqBpfmK1e7JCKZv/68QXfMyWWAI +hwalqZkXXWHKjuz3wE7dE25PXFXtGJtcZAaj10xt98fzdqt8lQSwh2kbfNwZIz1F +sgAStgE7+ZTcqTgvNB76Os1UK0to+/P0VBWktaVFdyub4Nc2SdPVnZNvrRBXBwOD +3V8ViwywDOFoE7DvCvwx/SVsvoC0Z4j3AMMovO6oHicP7uU83qsQgm1Qru3YeoLR ++DoVi7IPHbWvN7MqFYn3YjNlByO2geblY7MR0BlqbFlmFrqLsUfjsh2ys7/U/knC +dN/klu446fI= +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/server-key.pem b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/server-key.pem new file mode 100644 index 000000000..a1dfd5f78 --- /dev/null +++ b/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/server-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAnBJxJuYaj9RGxCcnDs/FGjVqdvUHaRVM01oZChoVV5PtJrJj +U8ODQQBQeNpqGOODlPMLw4nXjpSTYT0Vr3g/MxtpccyQPdadFCuHrfImvTJnrgho +XQvY8SfF+vVjZVIj8stISP2bKkavWdAtnltIiyT17MuF/F6cN0hcKF3+aUfURWOT +29rbssapknrLbtlV0/zUIyYOAlQ0d5hXBz12QeHpUcx9FrIRMRBpIMtG4NtDCXkX +NkHW+V8fhGpG5sK6A1mgp9zUhqkO47+lcNHaMkxr0uoekRwcZ8qkX0YChpQqDjBv +f+fqxSQtNEKQlBtrx1x1hqFpTJSd36De64+b/QIDAQABAoIBAFiah66Dt9SruLkn +WR8piUaFyLlcBib8Nq9OWSTJBhDAJERxxb4KIvvGB+l0ZgNXNp5bFPSfzsZdRwZP +PX5uj8Kd71Dxx3mz211WESMJdEC42u+MSmN4lGLkJ5t/sDwXU91E1vbJM0ve8THV +4/Ag9qA4DX2vVZOeyqT/6YHpSsPNZplqzrbAiwrfHwkctHfgqwOf3QLfhmVQgfCS +VwidBldEUv2whSIiIxh4Rv5St4kA68IBCbJxdpOpyuQBkk6CkxZ7VN9FqOuSd4Pk +Wm7iWyBMZsCmELZh5XAXld4BEt87C5R4CvbPBDZxAv3THk1DNNvpy3PFQfwARRFb +SAToYMECgYEAyL7U8yxpzHDYWd3oCx6vTi9p9N/z0FfAkWrRF6dm4UcSklNiT1Aq +EOnTA+SaW8tV3E64gCWcY23gNP8so/ZseWj6L+peHwtchaP9+KB7yGw2A+05+lOx +VetLTjAOmfpiUXFe5w1q4C1RGhLjZjjzW+GvwdAuchQgUEFaomrV+PUCgYEAxwfH +cmVGFbAktcjU4HSRjKSfawCrut+3YUOLybyku3Q/hP9amG8qkVTFe95CTLjLe2D0 +ccaTTpofFEJ32COeck0g0Ujn/qQ+KXRoauOYs4FB1DtqMpqB78wufWEUpDpbd9/h +J+gJdC/IADd4tJW9zA92g8IA7ZtFmqDtiSpQ0ekCgYAQGkaorvJZpN+l7cf0RGTZ +h7IfI2vCVZer0n6tQA9fmLzjoe6r4AlPzAHSOR8sp9XeUy43kUzHKQQoHCPvjw/K +eWJAP7OHF/k2+x2fOPhU7mEy1W+mJdp+wt4Kio5RSaVjVQ3AyPG+w8PSrJszEvRq +dWMMz+851WV2KpfjmWBKlQKBgQC++4j4DZQV5aMkSKV1CIZOBf3vaIJhXKEUFQPD +PmB4fBEjpwCg+zNGp6iktt65zi17o8qMjrb1mtCt2SY04eD932LZUHNFlwcLMmes +Ad+aiDLJ24WJL1f16eDGcOyktlblDZB5gZ/ovJzXEGOkLXglosTfo77OQculmDy2 +/UL2WQKBgGeKasmGNfiYAcWio+KXgFkHXWtAXB9B91B1OFnCa40wx+qnl71MIWQH +PQ/CZFNWOfGiNEJIZjrHsfNJoeXkhq48oKcT0AVCDYyLV0VxDO4ejT95mGW6njNd +JpvmhwwAjOvuWVr0tn4iXlSK8irjlJHmwcRjLTJq97vE9fsA2MjI +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_redis/.ci/docker-compose-tls.yml b/apps/emqx_auth_redis/.ci/docker-compose-tls.yml new file mode 100644 index 000000000..2247cd21b --- /dev/null +++ b/apps/emqx_auth_redis/.ci/docker-compose-tls.yml @@ -0,0 +1,31 @@ +version: '3' + +services: + erlang: + image: erlang:22.3 + volumes: + - ../:/emqx_auth_redis + networks: + - emqx_bridge + depends_on: + - redis_server + tty: true + + redis_server: + image: redis:6.0.9 + volumes: + - ../test/emqx_auth_redis_SUITE_data/certs:/tls + command: + - redis-server + - "--bind 0.0.0.0 ::" + - --tls-port 6380 + - --tls-cert-file /tls/redis.crt + - --tls-key-file /tls/redis.key + - --tls-ca-cert-file /tls/ca.crt + restart: always + networks: + - emqx_bridge + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_redis/.ci/docker-compose.yml b/apps/emqx_auth_redis/.ci/docker-compose.yml new file mode 100644 index 000000000..6716262ad --- /dev/null +++ b/apps/emqx_auth_redis/.ci/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3' + +services: + erlang: + image: erlang:22.3 + volumes: + - ../:/emqx_auth_redis + networks: + - emqx_bridge + depends_on: + - redis_server + tty: true + + redis_server: + image: redis:${REDIS_TAG} + command: + - redis-server + - "--bind 0.0.0.0 ::" + restart: always + networks: + - emqx_bridge + +networks: + emqx_bridge: + driver: bridge diff --git a/apps/emqx_auth_redis/.github/workflows/run_test_cases.yaml b/apps/emqx_auth_redis/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..5af7bdbc3 --- /dev/null +++ b/apps/emqx_auth_redis/.github/workflows/run_test_cases.yaml @@ -0,0 +1,80 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_tests_cases: + runs-on: ubuntu-latest + + strategy: + matrix: + redis_tag: + - 5.0.9 + - 6.0.9 + network_type: + - ipv4 + - ipv6 + connect_type: + - tcp + - tls + + steps: + - name: install docker-compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - uses: actions/checkout@v1 + - name: setup + if: matrix.connect_type == 'tcp' && matrix.network_type == 'ipv6' + env: + REDIS_TAG: ${{ matrix.redis_tag}} + run: | + set -e -u -x + docker network create --driver bridge --ipv6 --subnet fd15:555::/64 tests_emqx_bridge --attachable; + docker-compose -f ./.ci/docker-compose.yml -p tests up -d + ipv6_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' $(docker ps -a -f name=tests_redis_server_1 -q)) + sed -i "/auth.redis.server/c auth.redis.server = $ipv6_address:6379" ./etc/emqx_auth_redis.conf + - name: setup + if: matrix.connect_type == 'tcp' && matrix.network_type == 'ipv4' + env: + REDIS_TAG: ${{ matrix.redis_tag}} + run: | + set -e -u -x + docker-compose -f ./.ci/docker-compose.yml -p tests up -d + sed -i '/auth.redis.server/c auth.redis.server = redis_server:6379' ./etc/emqx_auth_redis.conf + - name: setup + if: matrix.connect_type == 'tls' && matrix.network_type == 'ipv6' && matrix.redis_tag == '6.0.9' + run: | + set -e -u -x + docker network create --driver bridge --ipv6 --subnet fd15:555::/64 tests_emqx_bridge --attachable; + docker-compose -f ./.ci/docker-compose-tls.yml -p tests up -d + ipv6_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' $(docker ps -a -f name=tests_redis_server_1 -q)) + sed -i "/auth.redis.server/c auth.redis.server = $ipv6_address:6380" ./etc/emqx_auth_redis.conf + echo '\n' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.ssl = on' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.cafile = /emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.crt' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.certfile = /emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.crt' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.keyfile = /emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.key' >> ./etc/emqx_auth_redis.conf + - name: setup + if: matrix.connect_type == 'tls' && matrix.network_type == 'ipv4' && matrix.redis_tag == '6.0.9' + run: | + set -e -u -x + docker-compose -f ./.ci/docker-compose-tls.yml -p tests up -d + sed -i '/auth.redis.server/c auth.redis.server = redis_server:6380' ./etc/emqx_auth_redis.conf + echo '\n' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.ssl = on' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.cafile = /emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.crt' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.certfile = /emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.crt' >> ./etc/emqx_auth_redis.conf + echo 'auth.redis.keyfile = /emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.key' >> ./etc/emqx_auth_redis.conf + - name: run test cases + if: matrix.connect_type == 'tcp' || (matrix.connect_type == 'tls' && matrix.redis_tag == '6.0.9') + run: | + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_redis xref" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_redis eunit" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_redis ct" + docker exec -i tests_erlang_1 sh -c "make -C /emqx_auth_redis cover" + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: logs_redis${{ matrix.redis_tag}}_${{ matrix.network_type }}_${{ matrix.connect_type }} + path: _build/test/logs diff --git a/apps/emqx_auth_redis/.gitignore b/apps/emqx_auth_redis/.gitignore new file mode 100644 index 000000000..d7472fa8f --- /dev/null +++ b/apps/emqx_auth_redis/.gitignore @@ -0,0 +1,24 @@ +.rebar/ +.eunit/ +.erlang.mk/ +emqttd_auth_redis.d +deps/ +ct.coverdata +logs/ +test/ct.cover.spec +ebin/ +*.o +*.beam +*.plt +erl_crash.dump +data +emqx_auth_redis.d +cover/ +eunit.coverdata +_build/ +rebar.lock +erlang.mk +*.conf.rendered +.rebar3/ +*.swp +rebar.lock diff --git a/apps/emqx_auth_redis/LICENSE b/apps/emqx_auth_redis/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_auth_redis/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_auth_redis/Makefile b/apps/emqx_auth_redis/Makefile new file mode 100644 index 000000000..d435f3681 --- /dev/null +++ b/apps/emqx_auth_redis/Makefile @@ -0,0 +1,37 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_auth_redis.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_auth_redis.conf -i priv/emqx_auth_redis.schema -d data diff --git a/apps/emqx_auth_redis/README.md b/apps/emqx_auth_redis/README.md new file mode 100644 index 000000000..9aa851f88 --- /dev/null +++ b/apps/emqx_auth_redis/README.md @@ -0,0 +1,171 @@ +emqx_auth_redis +=============== + +EMQ X Redis Authentication/ACL Plugin + +Features +--------- + +- Full *Authentication*, *Superuser*, *ACL* support +- IPv4, IPv6 support +- Connection pool by [ecpool](https://github.com/emqx/ecpool) +- Support `single`, `sentinel`, `cluster` deployment structures of Redis +- Completely cover Redis 5, Redis 6 in our tests + + +Build Plugin +------------ + +``` +make && make tests +``` + +Configure Plugin +---------------- + +File: etc/emqx_auth_redis.conf + +``` +## Redis server address. +## +## Value: Port | IP:Port +## +## Redis Server: 6379, 127.0.0.1:6379, localhost:6379, Redis Sentinel: 127.0.0.1:26379 +auth.redis.server = 127.0.0.1:6379 + +## redis sentinel cluster name +## auth.redis.sentinel = mymaster + +## Redis pool size. +## +## Value: Number +auth.redis.pool = 8 + +## Redis database no. +## +## Value: Number +auth.redis.database = 0 + +## Redis password. +## +## Value: String +## auth.redis.password = + +## Authentication query command. +## +## Value: Redis cmd +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## Examples: +## - HGET mqtt_user:%u password +## - HMGET mqtt_user:%u password +## - HMGET mqtt_user:%u password salt +auth.redis.auth_cmd = HMGET mqtt_user:%u password + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.redis.password_hash = plain + +## sha256 with salt prefix +## auth.redis.password_hash = salt,sha256 + +## sha256 with salt suffix +## auth.redis.password_hash = sha256,salt + +## bcrypt with salt prefix +## auth.redis.password_hash = salt,bcrypt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.redis.password_hash = pbkdf2,sha256,1000,20 + +## Superuser query command. +## +## Value: Redis cmd +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +auth.redis.super_cmd = HGET mqtt_user:%u is_superuser + +## ACL query command. +## +## Value: Redis cmd +## +## Variables: +## - %u: username +## - %c: clientid +auth.redis.acl_cmd = HGETALL mqtt_acl:%u +``` + +SuperUser +--------- + +``` +HSET mqtt_user: is_superuser 1 +``` + +User Hash with Password Salt +---------------------------- + +Set a 'user' hash with 'password' 'salt' field, for example: + +``` +HMSET mqtt_user: password "password" salt "salt" +``` + +User Set with Password +----------------------- + +Set a 'user' Set with 'password' field for example: + +``` +HSET mqtt_user: password "password" +``` + +ACL Rule Hash +------------- + +The plugin uses a redis hash to store ACL rules: + +``` +HSET mqtt_acl: topic1 1 +HSET mqtt_acl: topic2 2 +HSET mqtt_acl: topic3 3 +``` + +NOTE: 1: subscribe, 2: publish, 3: pubsub + +Subscription Hash +----------------- + +NOTICE: Move to emqx_backend_redis... + +The plugin could store the static subscriptions into a redis Hash: + +``` +HSET mqtt_sub: topic1 0 +HSET mqtt_sub: topic2 1 +HSET mqtt_sub: topic3 2 +``` + +Load Plugin +----------- + +``` +./bin/emqx_ctl plugins load emqx_auth_redis +``` + +Author +------ + +EMQ X Team. + diff --git a/apps/emqx_auth_redis/etc/emqx_auth_redis.conf b/apps/emqx_auth_redis/etc/emqx_auth_redis.conf new file mode 100644 index 000000000..4d6b19b15 --- /dev/null +++ b/apps/emqx_auth_redis/etc/emqx_auth_redis.conf @@ -0,0 +1,116 @@ +##-------------------------------------------------------------------- +## Redis Auth/ACL Plugin +##-------------------------------------------------------------------- +## Redis Server cluster type +## single Single redis server +## sentinel Redis cluster through sentinel +## cluster Redis through cluster +auth.redis.type = single + +## Redis server address. +## +## Value: Port | IP:Port +## +## Single Redis Server: 127.0.0.1:6379, localhost:6379 +## Redis Sentinel: 127.0.0.1:26379,127.0.0.2:26379,127.0.0.3:26379 +## Redis Cluster: 127.0.0.1:6379,127.0.0.2:6379,127.0.0.3:6379 +auth.redis.server = 127.0.0.1:6379 + +## Redis sentinel cluster name. +## +## Value: String +## auth.redis.sentinel = mymaster + +## Redis pool size. +## +## Value: Number +auth.redis.pool = 8 + +## Redis database no. +## +## Value: Number +auth.redis.database = 0 + +## Redis password. +## +## Value: String +## auth.redis.password = + +## Redis query timeout +## +## Value: Duration +## auth.redis.query_timeout = 5s + +## Authentication query command. +## +## Value: Redis cmd +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +## +## Examples: +## - HGET mqtt_user:%u password +## - HMGET mqtt_user:%u password +## - HMGET mqtt_user:%u password salt +auth.redis.auth_cmd = HMGET mqtt_user:%u password + +## Password hash. +## +## Value: plain | md5 | sha | sha256 | bcrypt +auth.redis.password_hash = plain + +## sha256 with salt prefix +## auth.redis.password_hash = salt,sha256 + +## sha256 with salt suffix +## auth.redis.password_hash = sha256,salt + +## bcrypt with salt prefix +## auth.redis.password_hash = salt,bcrypt + +## pbkdf2 with macfun iterations dklen +## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512 +## auth.redis.password_hash = pbkdf2,sha256,1000,20 + +## Superuser query command. +## +## Value: Redis cmd +## +## Variables: +## - %u: username +## - %c: clientid +## - %C: common name of client TLS cert +## - %d: subject of client TLS cert +auth.redis.super_cmd = HGET mqtt_user:%u is_superuser + +## ACL query command. +## +## Value: Redis cmd +## +## Variables: +## - %u: username +## - %c: clientid +auth.redis.acl_cmd = HGETALL mqtt_acl:%u + +## Redis ssl configuration. +## +## Value: on | off +#auth.redis.ssl = off + +## CA certificate. +## +## Value: File +#auth.redis.cafile = path/to/your/cafile + +## Client ssl certificate. +## +## Value: File +#auth.redis.certfile = path/to/your/certfile + +## Client ssl keyfile. +## +## Value: File +#auth.redis.keyfile = path/to/your/keyfile \ No newline at end of file diff --git a/apps/emqx_auth_redis/include/emqx_auth_redis.hrl b/apps/emqx_auth_redis/include/emqx_auth_redis.hrl new file mode 100644 index 000000000..204d8ef70 --- /dev/null +++ b/apps/emqx_auth_redis/include/emqx_auth_redis.hrl @@ -0,0 +1,23 @@ + +-define(APP, emqx_auth_redis). + +-record(auth_metrics, { + success = 'client.auth.success', + failure = 'client.auth.failure', + ignore = 'client.auth.ignore' + }). + +-record(acl_metrics, { + allow = 'client.acl.allow', + deny = 'client.acl.deny', + ignore = 'client.acl.ignore' + }). + +-define(METRICS(Type), tl(tuple_to_list(#Type{}))). +-define(METRICS(Type, K), #Type{}#Type.K). + +-define(AUTH_METRICS, ?METRICS(auth_metrics)). +-define(AUTH_METRICS(K), ?METRICS(auth_metrics, K)). + +-define(ACL_METRICS, ?METRICS(acl_metrics)). +-define(ACL_METRICS(K), ?METRICS(acl_metrics, K)). diff --git a/apps/emqx_auth_redis/priv/emqx_auth_redis.schema b/apps/emqx_auth_redis/priv/emqx_auth_redis.schema new file mode 100644 index 000000000..59283cf11 --- /dev/null +++ b/apps/emqx_auth_redis/priv/emqx_auth_redis.schema @@ -0,0 +1,139 @@ +%%-*- mode: erlang -*- +%% emqx_auth_redis config mapping + +{mapping, "auth.redis.type", "emqx_auth_redis.server", [ + {default, single}, + {datatype, {enum, [single, sentinel, cluster]}} +]}. + +{mapping, "auth.redis.server", "emqx_auth_redis.server", [ + {default, "127.0.0.1:6379"}, + {datatype, [string]} +]}. + +{mapping, "auth.redis.sentinel", "emqx_auth_redis.server", [ + {default, ""}, + {datatype, string}, + hidden +]}. + +{mapping, "auth.redis.pool", "emqx_auth_redis.server", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "auth.redis.database", "emqx_auth_redis.server", [ + {default, 0}, + {datatype, integer} +]}. + +{mapping, "auth.redis.password", "emqx_auth_redis.server", [ + {default, ""}, + {datatype, string}, + hidden +]}. + +{mapping, "auth.redis.ssl", "emqx_auth_redis.options", [ + {default, off}, + {datatype, flag} +]}. + +{mapping, "auth.redis.cafile", "emqx_auth_redis.options", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.redis.certfile", "emqx_auth_redis.options", [ + {default, ""}, + {datatype, string} +]}. + +{mapping, "auth.redis.keyfile", "emqx_auth_redis.options", [ + {default, ""}, + {datatype, string} +]}. + +{translation, "emqx_auth_redis.options", fun(Conf) -> + Ssl = cuttlefish:conf_get("auth.redis.ssl", Conf, off), + case Ssl of + true -> + CA = cuttlefish:conf_get("auth.redis.cafile", Conf), + Cert = cuttlefish:conf_get("auth.redis.certfile", Conf), + Key = cuttlefish:conf_get("auth.redis.keyfile", Conf), + [{options, [{ssl_options, [{cacertfile, CA}, + {certfile, Cert}, + {keyfile, Key}]}]}]; + _ -> [{options, []}] + end +end}. + +{translation, "emqx_auth_redis.server", fun(Conf) -> + Fun = fun(S) -> + case string:split(S, ":", trailing) of + [Domain] -> {Domain, 6379}; + [Domain, Port] -> {Domain, list_to_integer(Port)} + end + end, + Servers = cuttlefish:conf_get("auth.redis.server", Conf), + Type = cuttlefish:conf_get("auth.redis.type", Conf), + Server = case Type of + single -> + {Host, Port} = Fun(Servers), + [{host, Host}, {port, Port}]; + _ -> + S = string:tokens(Servers, ","), + [{servers, [Fun(S1) || S1 <- S]}] + end, + Pool = cuttlefish:conf_get("auth.redis.pool", Conf), + Passwd = cuttlefish:conf_get("auth.redis.password", Conf), + DB = cuttlefish:conf_get("auth.redis.database", Conf), + Sentinel = cuttlefish:conf_get("auth.redis.sentinel", Conf), + [{type, Type}, + {pool_size, Pool}, + {auto_reconnect, 1}, + {database, DB}, + {password, Passwd}, + {sentinel, Sentinel}] ++ Server +end}. + +{mapping, "auth.redis.query_timeout", "emqx_auth_redis.query_timeout", [ + {default, ""}, + {datatype, string} +]}. + +{translation, "emqx_auth_redis.query_timeout", fun(Conf) -> + case cuttlefish:conf_get("auth.redis.query_timeout", Conf) of + "" -> infinity; + Duration -> + case cuttlefish_duration:parse(Duration, ms) of + {error, Reason} -> error(Reason); + Ms when is_integer(Ms) -> Ms + end + end +end}. + +{mapping, "auth.redis.auth_cmd", "emqx_auth_redis.auth_cmd", [ + {datatype, string} +]}. + +{mapping, "auth.redis.password_hash", "emqx_auth_redis.password_hash", [ + {datatype, string} +]}. + +{mapping, "auth.redis.super_cmd", "emqx_auth_redis.super_cmd", [ + {datatype, string} +]}. + +{mapping, "auth.redis.acl_cmd", "emqx_auth_redis.acl_cmd", [ + {datatype, string} +]}. + +{translation, "emqx_auth_redis.password_hash", fun(Conf) -> + HashValue = cuttlefish:conf_get("auth.redis.password_hash", Conf), + case string:tokens(HashValue, ",") of + [Hash] -> list_to_atom(Hash); + [Prefix, Suffix] -> {list_to_atom(Prefix), list_to_atom(Suffix)}; + [Hash, MacFun, Iterations, Dklen] -> {list_to_atom(Hash), list_to_atom(MacFun), list_to_integer(Iterations), list_to_integer(Dklen)}; + _ -> plain + end +end}. diff --git a/apps/emqx_auth_redis/rebar.config b/apps/emqx_auth_redis/rebar.config new file mode 100644 index 000000000..182a4c47c --- /dev/null +++ b/apps/emqx_auth_redis/rebar.config @@ -0,0 +1,33 @@ +{deps, + [{eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.6.4"}}}, + {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.0"}}}, + {emqx_passwd, {git, "https://github.com/emqx/emqx-passwd", {tag, "v1.1.1"}}} + ]}. + +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + compressed + ]}. +{overrides, [{add, [{erl_opts, [compressed]}]}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions + ]}. + +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helper, {git, "https://github.com/emqx/emqx-ct-helper", {tag, "1.2.2"}}}, + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}} + ]}, + {erl_opts, [debug_info]} + ]} + ]}. diff --git a/apps/emqx_auth_redis/rebar.config.script b/apps/emqx_auth_redis/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_auth_redis/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_auth_redis/src/emqx_acl_redis.erl b/apps/emqx_auth_redis/src/emqx_acl_redis.erl new file mode 100644 index 000000000..096523487 --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_acl_redis.erl @@ -0,0 +1,86 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_acl_redis). + +-include("emqx_auth_redis.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-export([ register_metrics/0 + , check_acl/5 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?ACL_METRICS). + +check_acl(ClientInfo, PubSub, Topic, AclResult, Config) -> + case do_check_acl(ClientInfo, PubSub, Topic, AclResult, Config) of + ok -> emqx_metrics:inc(?ACL_METRICS(ignore)), ok; + {stop, allow} -> emqx_metrics:inc(?ACL_METRICS(allow)), {stop, allow}; + {stop, deny} -> emqx_metrics:inc(?ACL_METRICS(deny)), {stop, deny} + end. + +do_check_acl(#{username := <<$$, _/binary>>}, _PubSub, _Topic, _AclResult, _Config) -> + ok; +do_check_acl(ClientInfo, PubSub, Topic, _AclResult, + #{acl_cmd := AclCmd, timeout := Timeout, type := Type, pool := Pool}) -> + case emqx_auth_redis_cli:q(Pool, Type, AclCmd, ClientInfo, Timeout) of + {ok, []} -> ok; + {ok, Rules} -> + case match(ClientInfo, PubSub, Topic, Rules) of + allow -> {stop, allow}; + nomatch -> {stop, deny} + end; + {error, Reason} -> + ?LOG(error, "[Redis] do_check_acl error: ~p", [Reason]), + ok + end. + +match(_ClientInfo, _PubSub, _Topic, []) -> + nomatch; +match(ClientInfo, PubSub, Topic, [Filter, Access | Rules]) -> + case {match_topic(Topic, feed_var(ClientInfo, Filter)), + match_access(PubSub, b2i(Access))} of + {true, true} -> allow; + {_, _} -> match(ClientInfo, PubSub, Topic, Rules) + end. + +match_topic(Topic, Filter) -> + emqx_topic:match(Topic, Filter). + +match_access(subscribe, Access) -> + (1 band Access) > 0; +match_access(publish, Access) -> + (2 band Access) > 0. + +feed_var(#{clientid := ClientId, username := Username}, Str) -> + lists:foldl(fun({Var, Val}, Acc) -> + feed_var(Acc, Var, Val) + end, Str, [{"%u", Username}, {"%c", ClientId}]). + +feed_var(Str, _Var, undefined) -> + Str; +feed_var(Str, Var, Val) -> + re:replace(Str, Var, Val, [global, {return, binary}]). + +b2i(Bin) -> list_to_integer(binary_to_list(Bin)). + +description() -> "Redis ACL Module". + diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis.app.src b/apps/emqx_auth_redis/src/emqx_auth_redis.app.src new file mode 100644 index 000000000..1bd044e7f --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis.app.src @@ -0,0 +1,14 @@ +{application, emqx_auth_redis, + [{description, "EMQ X Authentication/ACL with Redis"}, + {vsn, "git"}, + {modules, []}, + {registered, [emqx_auth_redis_sup]}, + {applications, [kernel,stdlib,eredis,eredis_cluster,ecpool,emqx_passwd]}, + {mod, {emqx_auth_redis_app, []}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-auth-redis"} + ]} + ]}. diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis.app.src.script b/apps/emqx_auth_redis/src/emqx_auth_redis.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis.appup.src b/apps/emqx_auth_redis/src/emqx_auth_redis.appup.src new file mode 100644 index 000000000..2e4a43be0 --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis.appup.src @@ -0,0 +1,14 @@ +{VSN, + [ + {"4.2.0", [{load_module, emqx_auth_redis_cli, brutal_purge, soft_purge, []}, + {load_module, emqx_auth_redis_sup, brutal_purge, soft_purge, []}] + }, + {<<".*">>, []} + ], + [ + {"4.2.0", [{load_module, emqx_auth_redis_cli, brutal_purge, soft_purge, []}, + {load_module, emqx_auth_redis_sup, brutal_purge, soft_purge, []}] + }, + {<<".*">>, []} + ] +}. diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis.erl b/apps/emqx_auth_redis/src/emqx_auth_redis.erl new file mode 100644 index 000000000..65f4d9735 --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis.erl @@ -0,0 +1,85 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_redis). + +-include("emqx_auth_redis.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-export([ register_metrics/0 + , check/3 + , description/0 + ]). + +-spec(register_metrics() -> ok). +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, ?AUTH_METRICS). + +check(ClientInfo = #{password := Password}, AuthResult, + #{auth_cmd := AuthCmd, + super_cmd := SuperCmd, + hash_type := HashType, + timeout := Timeout, + type := Type, + pool := Pool}) -> + CheckPass = case emqx_auth_redis_cli:q(Pool, Type, AuthCmd, ClientInfo, Timeout) of + {ok, PassHash} when is_binary(PassHash) -> + check_pass({PassHash, Password}, HashType); + {ok, [undefined|_]} -> + {error, not_found}; + {ok, [PassHash]} -> + check_pass({PassHash, Password}, HashType); + {ok, [PassHash, Salt|_]} -> + check_pass({PassHash, Salt, Password}, HashType); + {error, Reason} -> + ?LOG(error, "[Redis] Command: ~p failed: ~p", [AuthCmd, Reason]), + {error, not_found} + end, + case CheckPass of + ok -> + ok = emqx_metrics:inc(?AUTH_METRICS(success)), + IsSuperuser = is_superuser(Pool, Type, SuperCmd, ClientInfo, Timeout), + {stop, AuthResult#{is_superuser => IsSuperuser, + anonymous => false, + auth_result => success}}; + {error, not_found} -> + ok = emqx_metrics:inc(?AUTH_METRICS(ignore)); + {error, ResultCode} -> + ok = emqx_metrics:inc(?AUTH_METRICS(failure)), + ?LOG(error, "[Redis] Auth from redis failed: ~p", [ResultCode]), + {stop, AuthResult#{auth_result => ResultCode, anonymous => false}} + end. + +description() -> "Authentication with Redis". + +-spec(is_superuser(atom(), atom(), undefined|list(), emqx_types:client(), timeout()) -> boolean()). +is_superuser(_Pool, _Type, undefined, _ClientInfo, _Timeout) -> false; +is_superuser(Pool, Type, SuperCmd, ClientInfo, Timeout) -> + case emqx_auth_redis_cli:q(Pool, Type, SuperCmd, ClientInfo, Timeout) of + {ok, undefined} -> false; + {ok, <<"1">>} -> true; + {ok, _Other} -> false; + {error, _Error} -> false + end. + +check_pass(Password, HashType) -> + case emqx_passwd:check_pass(Password, HashType) of + ok -> ok; + {error, _Reason} -> {error, not_authorized} + end. + diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis_app.erl b/apps/emqx_auth_redis/src/emqx_auth_redis_app.erl new file mode 100644 index 000000000..345f9f87d --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis_app.erl @@ -0,0 +1,70 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_redis_app). + +-behaviour(application). + +-emqx_plugin(auth). + +-include("emqx_auth_redis.hrl"). + +-export([ start/2 + , stop/1 + ]). + +start(_StartType, _StartArgs) -> + {ok, Sup} = emqx_auth_redis_sup:start_link(), + if_cmd_enabled(auth_cmd, fun load_auth_hook/1), + if_cmd_enabled(acl_cmd, fun load_acl_hook/1), + {ok, Sup}. + +stop(_State) -> + emqx:unhook('client.authenticate', fun emqx_auth_redis:check/3), + emqx:unhook('client.check_acl', fun emqx_acl_redis:check_acl/5), + %% Ensure stop cluster pool if the server type is cluster + eredis_cluster:stop_pool(?APP). + +load_auth_hook(AuthCmd) -> + SuperCmd = application:get_env(?APP, super_cmd, undefined), + {ok, HashType} = application:get_env(?APP, password_hash), + {ok, Timeout} = application:get_env(?APP, query_timeout), + Type = proplists:get_value(type, application:get_env(?APP, server, [])), + Config = #{auth_cmd => AuthCmd, + super_cmd => SuperCmd, + hash_type => HashType, + timeout => Timeout, + type => Type, + pool => ?APP}, + ok = emqx_auth_redis:register_metrics(), + emqx:hook('client.authenticate', fun emqx_auth_redis:check/3, [Config]). + +load_acl_hook(AclCmd) -> + {ok, Timeout} = application:get_env(?APP, query_timeout), + Type = proplists:get_value(type, application:get_env(?APP, server, [])), + Config = #{acl_cmd => AclCmd, + timeout => Timeout, + type => Type, + pool => ?APP}, + ok = emqx_acl_redis:register_metrics(), + emqx:hook('client.check_acl', fun emqx_acl_redis:check_acl/5, [Config]). + +if_cmd_enabled(Par, Fun) -> + case application:get_env(?APP, Par) of + {ok, Cmd} -> Fun(Cmd); + undefined -> ok + end. + diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis_cli.erl b/apps/emqx_auth_redis/src/emqx_auth_redis_cli.erl new file mode 100644 index 000000000..31cb67505 --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis_cli.erl @@ -0,0 +1,89 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_redis_cli). + +-behaviour(ecpool_worker). + +-include("emqx_auth_redis.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-import(proplists, [get_value/2, get_value/3]). + +-export([ connect/1 + , q/5 + ]). + +%%-------------------------------------------------------------------- +%% Redis Connect/Query +%%-------------------------------------------------------------------- + +connect(Opts) -> + Sentinel = get_value(sentinel, Opts), + Host = case Sentinel =:= "" of + true -> get_value(host, Opts); + false -> + eredis_sentinel:start_link(get_value(servers, Opts)), + "sentinel:" ++ Sentinel + end, + case eredis:start_link(Host, + get_value(port, Opts, 6379), + get_value(database, Opts, 0), + get_value(password, Opts, ""), + 3000, + 5000, + get_value(options, Opts, [])) of + {ok, Pid} -> {ok, Pid}; + {error, Reason = {connection_error, _}} -> + ?LOG(error, "[Redis] Can't connect to Redis server: Connection refused."), + {error, Reason}; + {error, Reason = {authentication_error, _}} -> + ?LOG(error, "[Redis] Can't connect to Redis server: Authentication failed."), + {error, Reason}; + {error, Reason} -> + ?LOG(error, "[Redis] Can't connect to Redis server: ~p", [Reason]), + {error, Reason} + end. + +%% Redis Query. +-spec(q(atom(), atom(), string(), emqx_types:credentials(), timeout()) + -> {ok, undefined | binary() | list()} | {error, atom() | binary()}). +q(Pool, Type, CmdStr, Credentials, Timeout) -> + Cmd = string:tokens(replvar(CmdStr, Credentials), " "), + case Type of + cluster -> eredis_cluster:q(Pool, Cmd); + _ -> ecpool:with_client(Pool, fun(C) -> eredis:q(C, Cmd, Timeout) end) + end. + +replvar(Cmd, Credentials = #{cn := CN}) -> + replvar(repl(Cmd, "%C", CN), maps:remove(cn, Credentials)); +replvar(Cmd, Credentials = #{dn := DN}) -> + replvar(repl(Cmd, "%d", DN), maps:remove(dn, Credentials)); +replvar(Cmd, Credentials = #{clientid := ClientId}) -> + replvar(repl(Cmd, "%c", ClientId), maps:remove(clientid, Credentials)); +replvar(Cmd, Credentials = #{username := Username}) -> + replvar(repl(Cmd, "%u", Username), maps:remove(username, Credentials)); +replvar(Cmd, _) -> + Cmd. + +repl(S, _Var, undefined) -> + S; +repl(S, Var, Val) -> + NVal = re:replace(Val, "&", "\\\\&", [global, {return, list}]), + re:replace(S, Var, NVal, [{return, list}]). + diff --git a/apps/emqx_auth_redis/src/emqx_auth_redis_sup.erl b/apps/emqx_auth_redis/src/emqx_auth_redis_sup.erl new file mode 100644 index 000000000..6066a306a --- /dev/null +++ b/apps/emqx_auth_redis/src/emqx_auth_redis_sup.erl @@ -0,0 +1,43 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_redis_sup). + +-behaviour(supervisor). + +-include("emqx_auth_redis.hrl"). + +-export([start_link/0]). + +-export([init/1]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +init([]) -> + {ok, Server} = application:get_env(?APP, server), + {ok, {{one_for_one, 10, 100}, pool_spec(Server)}}. + +pool_spec(Server) -> + Options = application:get_env(?APP, options, []), + case proplists:get_value(type, Server) of + cluster -> + eredis_cluster:start_pool(?APP, Server ++ Options), + []; + _ -> + [ecpool:pool_spec(?APP, ?APP, emqx_auth_redis_cli, Server ++ Options)] + end. + diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE.erl b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE.erl new file mode 100644 index 000000000..2160fd4e4 --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE.erl @@ -0,0 +1,173 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_auth_redis_SUITE). + +-compile(export_all). + +-include_lib("emqx/include/emqx.hrl"). + +-include_lib("common_test/include/ct.hrl"). + +-include_lib("eunit/include/eunit.hrl"). + +-define(APP, emqx_auth_redis). + +-define(POOL(App), ecpool_worker:client(gproc_pool:pick_worker({ecpool, App}))). + +-define(INIT_ACL, [{"mqtt_acl:test1", "topic1", "2"}, + {"mqtt_acl:test2", "topic2", "1"}, + {"mqtt_acl:test3", "topic3", "3"}]). + +-define(INIT_AUTH, [{"mqtt_user:plain", ["password", "plain", "salt", "salt", "is_superuser", "1"]}, + {"mqtt_user:special&symbol", ["password", "plain", "salt", "salt", "is_superuser", "0"]}, + {"mqtt_user:md5", ["password", "1bc29b36f623ba82aaf6724fd3b16718", "salt", "salt", "is_superuser", "0"]}, + {"mqtt_user:sha", ["password", "d8f4590320e1343a915b6394170650a8f35d6926", "salt", "salt", "is_superuser", "0"]}, + {"mqtt_user:sha256", ["password", "5d5b09f6dcb2d53a5fffc60c4ac0d55fabdf556069d6631545f42aa6e3500f2e", "salt", "salt", "is_superuser", "0"]}, + {"mqtt_user:pbkdf2_password", ["password", "cdedb5281bb2f801565a1122b2563515", "salt", "ATHENA.MIT.EDUraeburn", "is_superuser", "0"]}, + {"mqtt_user:bcrypt_foo", ["password", "$2a$12$sSS8Eg.ovVzaHzi1nUHYK.HbUIOdlQI0iS22Q5rd5z.JVVYH6sfm6", "salt", "$2a$12$sSS8Eg.ovVzaHzi1nUHYK.", "is_superuser", "0"]}, + {"mqtt_user:bcrypt", ["password", "$2y$16$rEVsDarhgHYB0TGnDFJzyu5f.T.Ha9iXMTk9J36NCMWWM7O16qyaK", "salt", "salt", "is_superuser", "0"]}]). + +%%-------------------------------------------------------------------- +%% Setups +%%-------------------------------------------------------------------- + +all() -> + emqx_ct:all(?MODULE). + +init_per_suite(Cfg) -> + emqx_ct_helpers:start_apps([emqx_auth_redis], fun set_special_configs/1), + init_redis_rows(), + Cfg. + +end_per_suite(_Cfg) -> + deinit_redis_rows(), + emqx_ct_helpers:stop_apps([emqx_auth_redis]). + +set_special_configs(emqx) -> + application:set_env(emqx, allow_anonymous, false), + application:set_env(emqx, acl_nomatch, deny), + application:set_env(emqx, acl_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/acl.conf")), + application:set_env(emqx, enable_acl_cache, false), + application:set_env(emqx, plugins_loaded_file, + emqx_ct_helpers:deps_path(emqx, "test/emqx_SUITE_data/loaded_plugins")); +set_special_configs(_App) -> + ok. + +init_redis_rows() -> + {ok, Connection} = ?POOL(?APP), + %% Users + [eredis:q(Connection, ["HMSET", Key|FiledValue]) || {Key, FiledValue} <- ?INIT_AUTH], + + %% ACLs + Result = [eredis:q(Connection, ["HSET", Key, Filed, Value]) || {Key, Filed, Value} <- ?INIT_ACL], + ct:pal("redis init result: ~p~n", [Result]). + +deinit_redis_rows() -> + {ok, Connection} = ?POOL(?APP), + AuthKeys = [Key || {Key, _Filed, _Value} <- ?INIT_AUTH], + AclKeys = [Key || {Key, _Value} <- ?INIT_ACL], + eredis:q(Connection, ["DEL" | AuthKeys]), + eredis:q(Connection, ["DEL" | AclKeys]). + +%%-------------------------------------------------------------------- +%% Cases +%%-------------------------------------------------------------------- + +t_check_auth(_) -> + Plain = #{clientid => <<"client1">>, username => <<"plain">>, zone => external}, + SpecialSymbol = #{clientid => <<"special_symbol">>, username => <<"special&symbol">>, zone => external}, + Md5 = #{clientid => <<"md5">>, username => <<"md5">>, zone => external}, + Sha = #{clientid => <<"sha">>, username => <<"sha">>, zone => external}, + Sha256 = #{clientid => <<"sha256">>, username => <<"sha256">>, zone => external}, + Pbkdf2 = #{clientid => <<"pbkdf2_password">>, username => <<"pbkdf2_password">>, zone => external}, + BcryptFoo = #{clientid => <<"bcrypt_foo">>, username => <<"bcrypt_foo">>, zone => external}, + User1 = #{clientid => <<"bcrypt_foo">>, username => <<"user">>, zone => external}, + User3 = #{clientid => <<"client3">>, zone => external}, + Bcrypt = #{clientid => <<"bcrypt">>, username => <<"bcrypt">>, zone => external}, + {error, _} = emqx_access_control:authenticate(User3#{password => <<>>}), + reload([{password_hash, plain}]), + {ok, #{is_superuser := true}} = emqx_access_control:authenticate(Plain#{password => <<"plain">>}), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(SpecialSymbol#{password => <<"plain">>}), + reload([{password_hash, md5}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Md5#{password => <<"md5">>}), + reload([{password_hash, sha}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Sha#{password => <<"sha">>}), + reload([{password_hash, sha256}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Sha256#{password => <<"sha256">>}), + reload([{password_hash, bcrypt}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Bcrypt#{password => <<"password">>}), + %%pbkdf2 sha + reload([{password_hash, {pbkdf2, sha, 1, 16}}, {auth_cmd, "HMGET mqtt_user:%u password salt"}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(Pbkdf2#{password => <<"password">>}), + reload([{password_hash, {salt, bcrypt}}]), + {ok, #{is_superuser := false}} = emqx_access_control:authenticate(BcryptFoo#{password => <<"foo">>}), + {error,_} = emqx_access_control:authenticate(User1#{password => <<"foo">>}), + {error, _} = emqx_access_control:authenticate(Bcrypt#{password => <<"password">>}). + +t_check_auth_hget(_) -> + {ok, Connection} = ?POOL(?APP), + eredis:q(Connection, ["HSET", "mqtt_user:hset", "password", "hset"]), + eredis:q(Connection, ["HSET", "mqtt_user:hset", "is_superuser", "1"]), + reload([{password_hash, plain}, {auth_cmd, "HGET mqtt_user:%u password"}]), + Hset = #{clientid => <<"hset">>, username => <<"hset">>, zone => external}, + {ok, #{is_superuser := true}} = emqx_access_control:authenticate(Hset#{password => <<"hset">>}). + +t_check_acl(_) -> + User1 = #{zone => external, clientid => <<"client1">>, username => <<"test1">>}, + User2 = #{zone => external, clientid => <<"client2">>, username => <<"test2">>}, + User3 = #{zone => external, clientid => <<"client3">>, username => <<"test3">>}, + User4 = #{zone => external, clientid => <<"client4">>, username => <<"$$user4">>}, + deny = emqx_access_control:check_acl(User1, subscribe, <<"topic1">>), + allow = emqx_access_control:check_acl(User1, publish, <<"topic1">>), + + deny = emqx_access_control:check_acl(User2, publish, <<"topic2">>), + allow = emqx_access_control:check_acl(User2, subscribe, <<"topic2">>), + allow = emqx_access_control:check_acl(User3, publish, <<"topic3">>), + allow = emqx_access_control:check_acl(User3, subscribe, <<"topic3">>), + deny = emqx_access_control:check_acl(User4, publish, <<"a/b/c">>). + +t_acl_super(_) -> + reload([{password_hash, plain}]), + {ok, C} = emqtt:start_link([{host, "localhost"}, + {clientid, <<"simpleClient">>}, + {username, <<"plain">>}, + {password, <<"plain">>}]), + {ok, _} = emqtt:connect(C), + timer:sleep(10), + emqtt:subscribe(C, <<"TopicA">>, qos2), + timer:sleep(1000), + emqtt:publish(C, <<"TopicA">>, <<"Payload">>, qos2), + timer:sleep(1000), + receive + {publish, #{payload := Payload}} -> + ?assertEqual(<<"Payload">>, Payload) + after + 1000 -> + ct:fail({receive_timeout, <<"Payload">>}), + ok + end, + emqtt:disconnect(C). + +%%-------------------------------------------------------------------- +%% Internal funcs +%%-------------------------------------------------------------------- + +reload(Config) when is_list(Config) -> + application:stop(?APP), + [application:set_env(?APP, K, V) || {K, V} <- Config], + application:start(?APP). diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.crt b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.crt new file mode 100644 index 000000000..b46bef4e5 --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIE5jCCAs4CCQCc1DzEYETfKTANBgkqhkiG9w0BAQsFADA1MRMwEQYDVQQKDApS +ZWRpcyBUZXN0MR4wHAYDVQQDDBVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMjAx +MDI5MDEzNDE2WhcNMzAxMDI3MDEzNDE2WjA1MRMwEQYDVQQKDApSZWRpcyBUZXN0 +MR4wHAYDVQQDDBVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQC/RxC/zQ6+ThI2l+LT5tpuvljE7CPca5erahTjv1Pq +mbmHYIVlige9jvZKR/AaaHuhNRT6C4PDpD98TgrhSLSgMMFImoFMSnmFEOVave3O +y1qV9vtoHLMB9hO+t7P98KRi1sCoMdPIE/o5uEGSd4YgWbk3NllAV6me108UniWU +yZMCSEKmV9OpfQ+YfHFolESV92ajdViDbtRBjfDNwD7qb8zgigxIJvBzEnWF4RZl +4+KIiyoJ55AQ3omdEi0QwiRRRONFtB6kRSqjGS8genGnycX1ZNPRB8JeG3ESuFj9 +1WQUD0EMBXFB5agHoZjvtFwxOkUkA4XbcnpKddHGKRt4BAbm+YcizJaT7mRytGWZ +UoTrDWz8/Cc0BlwAfPEk6ogU/sLSZpdxjxwprCNB89UOI+q7ng7CYiFnxY9HHZeg +GCJxYfvpKM/eOT9mSLUug8EGITd0j2cusflO4Q243clPyRbTSSr39Pcpy8rfKApF +HkUuGIpa/qgAbez+lPlIydzpbrTgrnHvL1P6fCYTnHkcgSn8glBIKv3vh4zQd6df +JvcLv3WEka9+lyoCvJ0QH+/ITqrToyWa8g9fR3ajTlyMANesKxQejo80zCwk/0ns +SFKRIJc6vfnUJ12Vdxpmm1LeoJZnCYODNUeeksL1ahHCBGq4M8UJ+ycUM6N4ndWE +6QIDAQABMA0GCSqGSIb3DQEBCwUAA4ICAQAg0BaIi7lzrNb7xC42c+GJVrBq8Qf8 +7CBzP8SXYGUavQIYNRrtH8UgTOwaju9vOn3zoY8L59N6e+Icyt+Oh1FENcQMCZ2l +SP79iaY9A/dRV56p6NqNd3VWH+EuRGbQVatLdhJf3l5+W1z3Dum1YXmIn26acawF +GZVqLalgvLqPzPHHWEqz9RnmcvTu3w9YVb4NgbmY4byCb6mB2avt0iWQrY/fZSMe +FvRXurr0jwyIXBncqnXu97sCeccNc+fo3qZC1xxH9iXOIzrRg0ud7VGMTKcNLTTc +GqnbjNT8BC96Qp2Bs8J+JGZa3mT/usKBq2TT/3q6oKevuc23u/a5s1rztnqZgIe5 +RzfevJ79xdva6DMSq/8Yyd3I8hrs3oZKJbAce6ux01RsrCcY2O7gi4dAMoEGumxW +CS9XLchNy7QxQ+J2AKBZXd6AZjvTvloDGz/yC5EbdK/MnLz8oApK5Z8U/huEilFa +AymVWQWpmlX2KxW0nkCperlb7lcbPS+ZuH0+Zd9HOvqr9cpYMrwpF54q4vnzUQkR +Hsxoapv/FBsVoxtcOqrcxwGpYWCsV0VBnv9+1fzzZ83aK7CHDIeGVuKPyjkhHzLy +v7Ljuqg400wH0WB9pyEdK+O3F+xO3zJgf4o0JptOKOFBVVSkZWTrqlDjjbcnXBmh +dwgj2xYeigqHJA== +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.key b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.key new file mode 100644 index 000000000..b615a8c1e --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAv0cQv80Ovk4SNpfi0+babr5YxOwj3GuXq2oU479T6pm5h2CF +ZYoHvY72SkfwGmh7oTUU+guDw6Q/fE4K4Ui0oDDBSJqBTEp5hRDlWr3tzstalfb7 +aByzAfYTvrez/fCkYtbAqDHTyBP6ObhBkneGIFm5NzZZQFepntdPFJ4llMmTAkhC +plfTqX0PmHxxaJRElfdmo3VYg27UQY3wzcA+6m/M4IoMSCbwcxJ1heEWZePiiIsq +CeeQEN6JnRItEMIkUUTjRbQepEUqoxkvIHpxp8nF9WTT0QfCXhtxErhY/dVkFA9B +DAVxQeWoB6GY77RcMTpFJAOF23J6SnXRxikbeAQG5vmHIsyWk+5kcrRlmVKE6w1s +/PwnNAZcAHzxJOqIFP7C0maXcY8cKawjQfPVDiPqu54OwmIhZ8WPRx2XoBgicWH7 +6SjP3jk/Zki1LoPBBiE3dI9nLrH5TuENuN3JT8kW00kq9/T3KcvK3ygKRR5FLhiK +Wv6oAG3s/pT5SMnc6W604K5x7y9T+nwmE5x5HIEp/IJQSCr974eM0HenXyb3C791 +hJGvfpcqArydEB/vyE6q06MlmvIPX0d2o05cjADXrCsUHo6PNMwsJP9J7EhSkSCX +Or351CddlXcaZptS3qCWZwmDgzVHnpLC9WoRwgRquDPFCfsnFDOjeJ3VhOkCAwEA +AQKCAgBF1jSPUtcnNGoB9MKki40FEgpnG7CcMcxWkYy++oQxC59phhwuTo807pWN +2WYYvj0lRrQ59ypMrBNh1zyxtFH+is6HK6I5sJddtiWHVAEXl7ejOWHhSVkyRh4/ +a+MTvGDIlZAR2N9yFZkuqc+HIoyeEyREvFsp2tfbXtFIvdUK1e4Oz0NGaJqnLzoa +epUNkdTYzFN1Ksr+ceCdbq2U8bQG9HrhIIYLcewol3zBPMVoviNfpy/aHenDvvyP +lKtPixKneXdhY7osT/SZSACk4w/MKydTyVRs5WBZ67sFErmrM9YuXMNrGDGZ1bfb +0Wx9WGSwtI258G9XCB0OQqYsq6WTMaEei+z8l0iarZi1l2bz2F89J+IBYM8RqSsa +E30F8AtEG32QJUfK3F6k6N4uLx6JZduJgLyzsSh6q51ghAJ8kD1vUkEeXffCzynp +hzwRHUw5O1jNLEBdKYHpSyszlFX6qbzR1YXypzZs/aehZi5d89eBKN8X/Fnbi9a2 +Q0MqpZ5J/1hH7zadJFibNyuOCP4CNO3Hm18PjyEFRrCMbSF293kY9GoiOlQiwNAT +MqrsyLYgHPCXKXpG/R60lyHEfWKO9sOjyh+mSbv3QfNZS32Fweuo0R/vGYmkmtGn +wpn2IeSmX8ychdQrSemJjwzjUl/EUN0lGRAlHEt4ZDf52vHZ4QKCAQEA9k7b2vpU +g3S3GRCMzhl8GKZloNSbnR/ZHE8b9PVNahp0bQcZj+1yimF35p27VZR662ZBoKLy +/MLyPT+ZyynykwypcTVA5U9CABpSlyZMeezLnFlBXeHHMeoXcBZfFqHeXSsNYbhW +OStf4BGwKf7m/V0P/QL9mNsA/iq2uugC1gHoyp422YUIQQvKkBiFyMl34Zp2URsX +yIwb9aVyg2GogKDtbDPIwW89l3BCBiwalvjR6UotbXh3PQgYbsv62rTJ8AN+E+XH +eSQPnmPR6EXtX2nDuov996qlbja+JQE3SAls4EXLbrLyjSlObjcvkA59r+kZgNIY +g88hv7e9ublfqwKCAQEAxs3d9Zmjh9ByCT6jOUVnRMqw0+lVyVOs0kp7nOCb4HKM +CnupZuJQHQVQt7VhgD7FrALmYwkpt2e/WllN9bPFHRJcsw+SylOqyPil9G4DO5XZ +YPvk6PeQ/c0cbREKhsYNXqj5fWdq5pRd8rE72rK82mhdGQtAAN7NOEW5fo5tqHDK +D079SZmpcgd8Wz9luNpnZRpNhO3ccKV5yf0S1LZOZBbG9t875OVNhxlQY5wwIBXv +8ab13zcFKG21tWvLzz80vgkMIp0A9xh0XznIRnH3NnBZB80Yubg4sIaWvX7bqZ4X +EE9HGeiamw6c6Sm/Lvh/H659ri95l7C9TgAfAA7puwKCAQEAgJ/N0BzJ5ZwdwckS +vs4wL+81QzfDy9nF1zK4tsMjGjWWdxkuECs/lWQw6Q2VtqtDRYqw2uI9YiGrvrBn +7+CH/KKwGZ5ltVoebU9Rsf0eEs3FxnAV4qD1FOvaMX59SaReKulAo7dPz6sG9kxG +YqfqmITwxH+7TwePDSvhINnoITn+B1F38z+1f8JYlcc4lhIfuIChKNmtId2I/E7Z +7iIhjIp9cfPY8qrUzzCgSfjeKdjmRZ2m+3PdUNHZcIK1DWE700r/nARylqBuR5h5 +FYLu4tSokdJpXdyPZ27O/SQValkBslzAT57Da1QW0RegjuoCWMqxtsQAaVTRmvyo +50QW4QKCAQBLJFbn1MmFtRjVO7KwG/Z7fu01O7WsIg9pcLOmSRNB06nw8GrIM3Q6 +c97dgRY4RgGrEXGJL1ZwNyuRd73Kx8cSRPV6zMEb7mHYEnuPluFr7Si7ypnsIF7S +P2umIdHLvSIijFW4u5UhUCTubWUFNZfCKb4+kA0CBzSkN150Yls6Vl9ZR+7emdD9 +A61SQ/Ur2IlKIpX4T3uJrFILMbejZMDefel4OEpIKw+Rp9TFwaxDBGer/AJk+0Pc +0xLiXrsrO2WxCnRmxNcvjjO2Jn33em4JSo+sLi5RTDtJJaXmPAPE6bcn9/8U4OFH +CE/wpVHY7B4ImIhyhQk9d5Ul3U/aUsivAoIBAG8zk3CnFAnii1ENxhPtE8GCinvs +NdsluVtvUgMcA8gNzvqLHLQCoIy/b1wkqxPVsdTq1gZ7+FX9D9LzW9JxrWeEZqVV +jrUQIbls6HZei7i5x0tPwh1shOZiijgY24I6HDX9QRKZ7H7lLw0HfJI9YBI1Hl8E +naOtCuzFiaYEPfbGQACL8/UuoOZaD31JQda2EGYysGRxxJ2ZNPJIphCrwRb/nQBG +7WwCSCzu0peFNhZPVvkWHaFN73Uv/MmgFkp8RZzw9TEENB05wluCZB1TYJAOe65n +HnRWSDvWYR4lzMtq5WASFLC0WrFTiJKRCuKPljjoTptbXsJKyskW/t/+XPM= +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.txt b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.txt new file mode 100644 index 000000000..cf4e2aba5 --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.txt @@ -0,0 +1 @@ +BFFAA2A065DFA6FC diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.crt b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.crt new file mode 100644 index 000000000..5eefadf62 --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID1zCCAb8CCQC/+qKgZd+m/DANBgkqhkiG9w0BAQsFADA1MRMwEQYDVQQKDApS +ZWRpcyBUZXN0MR4wHAYDVQQDDBVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMjAx +MDI5MDEzNDE2WhcNMjExMDI5MDEzNDE2WjAmMRMwEQYDVQQKDApSZWRpcyBUZXN0 +MQ8wDQYDVQQDDAZTZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDSs3bQ9sYi2AhFuHU75Ryk1HHSgfzA6pQAJilmJdTy0s5vyiWe1HQJaWkMcS5V +GVzGMK+c+OBqtXtDDninL3betg1YPMjSCOjPMOTC1H9K7+effwf7Iwpnw9Zro8mb +TEmMslIYhhcDedzT9Owli4QAgbgTn4l1BYuKX9CLrrKFtnr21miKu3ydViy9q7T1 +pib3eigvAyk7X2fadHFArGEttsXrD6cetPPkSF/1OLWNlqzUKXzhSyrBXzO44Kks +fwR/EpTiES9g4dNOL2wvKS/YE1fNKhiCENrNxTXQo1l0yOdm2+MeyOeHFzRuS0b/ ++uGDFOPPi04KXeO6dQ5olBCPAgMBAAEwDQYJKoZIhvcNAQELBQADggIBADn0E2vG +iQWe8/I7VbBdPhPNupVNcLvew10eIHxY2g5vSruCSVRQTgk8itVMRmDQxbb7gdDW +jnCRbxykxbLjM9iCRljnOCsIcTi7qO7JRl8niV8dtEpPOs9lZxEdNXjIV1iZoWf3 +arBbPQSyQZvTQHG6qbFnyCdMMyyXGGvEPGQDaBiKH+Ko1qeAbCi0zupChYvxmtZ8 +hSTPlMFezDT9bKoNY0pkJSELfokEPU/Pn6Lz/NVbdzmCMjVa/xmF3s31g+DGhz95 +4AyOnCr6o0aydPVVV3pB/BCezNXPUxpp53BG0w/K2f2DnKYCvGvJbqDAaJ8bG/J1 +EFSOmwobdwVxJz3KNubmo1qJ6xOl/YT7yyqPRQRM1SY8nZW+YcoJSZjOe8wJVlob +d0bOwN1C3HQwomyMWes187bEQP6Y36HuEbR1fK8yIOzGsGDKRFAFwQwMgw2M91lr +EJIP5NRD3OZRuiYDiVfVhDZDaNahrAMZUcPCgeCAwc4YG6Gp2sDtdorOl4kIJYWE +BbBZ0Jplq9+g6ciu5ChjAW8iFl0Ae5U24MxPGXnrxiRF4WWxLeZMVLXLDvlPqReD +CHII5ifyvGEt5+RhqtZC/L+HimL+5wQgOlntqhUdLb6yWRz7YW37PFMnUXU3MXe9 +uY7m73ZLluXiLojcZxU2+cx89u5FOJxrYtrj +-----END CERTIFICATE----- diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.dh b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.dh new file mode 100644 index 000000000..f7dd0569d --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.dh @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBCAKCAQEAo2dgOzTnLK7c8AjkiTXxdmo2MJsyzTlNXUDxLfl2hgwic6benyQ3 +9iL95wKjYg2YpMhzbwux50D+9XeVkRatf1pRi/N9H911f90MO6penzUx/dxfOepN +qoGK/T9xO8e6aFCYOoQjJaZzQYC0HixJVadZd7wRlHkZ3siNKUU5QK68KaN3JE3J +R3yZ9A7MU/TVdwZyVIyoWF2+WJMQW+qaezoqiuVKZXXzzoqbj14ZrtPRmO26vMV/ +bmMuHwPsk9dL7tKnTWEOrs6NVHIQW+RxJuRE9wGa0qqzHAzysEQ8q9QYPRvGo5y+ +XRWosl1bHG4+EmvXsCCs35bcbKToi3NFWwIBAg== +-----END DH PARAMETERS----- diff --git a/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.key b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.key new file mode 100644 index 000000000..b76303f14 --- /dev/null +++ b/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpgIBAAKCAQEA0rN20PbGItgIRbh1O+UcpNRx0oH8wOqUACYpZiXU8tLOb8ol +ntR0CWlpDHEuVRlcxjCvnPjgarV7Qw54py923rYNWDzI0gjozzDkwtR/Su/nn38H ++yMKZ8PWa6PJm0xJjLJSGIYXA3nc0/TsJYuEAIG4E5+JdQWLil/Qi66yhbZ69tZo +irt8nVYsvau09aYm93ooLwMpO19n2nRxQKxhLbbF6w+nHrTz5Ehf9Ti1jZas1Cl8 +4UsqwV8zuOCpLH8EfxKU4hEvYOHTTi9sLykv2BNXzSoYghDazcU10KNZdMjnZtvj +Hsjnhxc0bktG//rhgxTjz4tOCl3junUOaJQQjwIDAQABAoIBAQCP7CJ27nm9B0/v +P+ZkeUWtmaf+IOhjZlieGXMh4SmqjDCSz8QO0BRK8YPeCdmaK27huhPa521ztm9y +CIqFuLg7vKM06KBMR+Wu0TkRlFE3ANR4cC8lbnQHGRB4CjMGL3/16UCGm+FQcIdV +CPHdW4VZS0JPtSQRmS4N4RD0uOocxqGcVbCRqnJoNp1zyXhookgHfZsC3b3cgzC7 +qvI9F1oY4Yg4b9Lw5sNi3JXWtFth8JFOPyImRcE0ngcGZK4iWjiufNKWVeTmSmVy +njMZfj8xKSpfqO3sOTbJMdrH1v5pMrAR/Ed748HheXuL15Ur9n88683hMMATZInn +YzIqNSrBAoGBAO94YBB1hN+jSKw+2FbAhuuM0gWHREmLQuaF2vjeVXL3r6YofFmf ++oJNgoOWXsv4KO2MgKDv4qrz7RohhhQpOFm5PpapSH/di7u6KsbJLYSxv/TEqQFE +NPyGywwNDIkn1wPlnX3LXp26puj2Gtn21Z0trUrpgsDM99BaTBbqTR2xAoGBAOE+ +tw0GHD/6CRPfoBIgVilS/sUJ5VJYTTKo/y6ozovCAq4bt5LkYmAOy6q8paHb58Oc +J890+LEPhelM/ZJDDz9oQFfq5LvuzgNfzDRyIhgDSpghtFrdDxQZP1X1lSdh+MFW +gx0k9h8VuIPksBsIgcmUtyCYitxLFep/0tAA/GI/AoGBAMxexEVntjWSScROgh1P +hBXlAZycO4g0ZK0OEboRLYXHos1AghePM6Ee+0LIAzE6IdvR7DjtYVoagQCrGZ19 +LE1Ojf7QjEIr1kQpdrZeHQ3BERyY9c9R4ZKeiw1G2ar4KEV4Ifeop6AfGrF4z6Oz +R80znVBwhxl6FAhp98QaxCORAoGBAInkc/nEKN09u/rvpzYRl83aol+MDFjZ+ACw +lvBApZnHnw5pp3uE13jI9gRDUv8A+iS1X2XQzULQJwHJgV7eMOJ3dxSbl4Y5zuMf +7YqZ6KdctHjoAVqzBD0gq7Z7DuG6R6hMxx27d/VVvcz43preHV6D7YxF9pSgXv1d +XXi7ccbPAoGBAIeLzCYd+JGufHwbq7oNvSyXJjGMjsAQuErUQ0xXwo7VAyOere2P +Dwk67wq6vsmn38EAs7IkXDgIoTD9z69DNtcjr/3fARYfmDSWyHscRwyUaJ15WQcZ +TCXAPf70Vf0KGBpRkgD+Qnq+lMZ3dr1uINGdalI4AWsXje0dPKpd+W8U +-----END RSA PRIVATE KEY----- diff --git a/apps/emqx_bridge_mqtt/.github/workflows/run_test_cases.yaml b/apps/emqx_bridge_mqtt/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..3b4fa29ec --- /dev/null +++ b/apps/emqx_bridge_mqtt/.github/workflows/run_test_cases.yaml @@ -0,0 +1,28 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + container: + image: erlang:22.1 + + steps: + - uses: actions/checkout@v1 + - name: run test cases + run: | + make eunit + make ct + make cover + - uses: actions/upload-artifact@v1 + if: always() + with: + name: logs + path: _build/test/logs + - uses: actions/upload-artifact@v1 + with: + name: cover + path: _build/test/cover + diff --git a/apps/emqx_bridge_mqtt/.gitignore b/apps/emqx_bridge_mqtt/.gitignore new file mode 100644 index 000000000..bf9523be5 --- /dev/null +++ b/apps/emqx_bridge_mqtt/.gitignore @@ -0,0 +1,21 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin/*.beam +rel +_build +.concrete/DEV_MODE +.rebar +.erlang.mk +data +ebin +emqx_bridge_mqtt.d +*.rendered +.rebar3/ +*.coverdata +rebar.lock +.DS_Store +Mnesia.*/ \ No newline at end of file diff --git a/apps/emqx_bridge_mqtt/LICENSE b/apps/emqx_bridge_mqtt/LICENSE new file mode 100644 index 000000000..70a976fe3 --- /dev/null +++ b/apps/emqx_bridge_mqtt/LICENSE @@ -0,0 +1,191 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2019, GilbertWong . + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/apps/emqx_bridge_mqtt/Makefile b/apps/emqx_bridge_mqtt/Makefile new file mode 100644 index 000000000..b2cc9cbed --- /dev/null +++ b/apps/emqx_bridge_mqtt/Makefile @@ -0,0 +1,43 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 + +CT_NODE_NAME = emqxct@127.0.0.1 + +all: compile + +compile: unlock + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v --readable=false --name $(CT_NODE_NAME) + +eunit: compile + $(REBAR) as test eunit + +unlock: + $(REBAR) unlock + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_bridge_mqtt.conf -i priv/emqx_bridge_mqtt.schema -d data diff --git a/apps/emqx_bridge_mqtt/README.md b/apps/emqx_bridge_mqtt/README.md new file mode 100644 index 000000000..6656aa36f --- /dev/null +++ b/apps/emqx_bridge_mqtt/README.md @@ -0,0 +1,265 @@ +# EMQ Bridge MQTT + +The concept of **Bridge** means that EMQ X supports forwarding messages +of one of its own topics to another MQTT Broker in some way. + +**Bridge** differs from **Cluster** in that the bridge does not +replicate the topic trie and routing tables and only forwards MQTT +messages based on bridging rules. + +At present, the bridging methods supported by EMQ X are as follows: + +- RPC bridge: RPC Bridge only supports message forwarding and does not + support subscribing to the topic of remote nodes to synchronize + data; +- MQTT Bridge: MQTT Bridge supports both forwarding and data + synchronization through subscription topic. + +These concepts are shown below: + +![bridge](docs/images/bridge.png) + +In addition, the EMQ X message broker supports multi-node bridge mode interconnection + +``` + --------- --------- --------- +Publisher --> | Node1 | --Bridge Forward--> | Node2 | --Bridge Forward--> | Node3 | --> Subscriber + --------- --------- --------- +``` + +In EMQ X, bridge is configured by modifying `etc/emqx.conf`. EMQ X distinguishes between different bridges based on different names. E.g + +``` +## Bridge address: node name for local bridge, host:port for remote. +bridge.mqtt.aws.address = 127.0.0.1:1883 +``` + +This configuration declares a bridge named `aws` and specifies that it is bridged to the MQTT broker of 127.0.0.1:1883 by MQTT mode. + +In case of creating multiple bridges, it is convenient to replicate all configuration items of the first bridge, and modify the bridge name and other configuration items if necessary (such as bridge.$name.address, where $name refers to the name of bridge) + +The next two sections describe how to create a bridge in RPC and MQTT mode respectively and create a forwarding rule that forwards the messages from sensors. Assuming that two EMQ X nodes are running on two hosts: + + +| Name | Node | MQTT Port | +|------|-------------------|-----------| +| emqx1| emqx1@192.168.1.1.| 1883 | +| emqx2| emqx2@192.168.1.2 | 1883 | + + +## EMQ X RPC Bridge Configuration + +The following is the basic configuration of RPC bridging. A simplest RPC bridging only requires the following three items + +``` +## Bridge Address: Use node name (nodename@host) for rpc bridging, and host:port for mqtt connection +bridge.mqtt.emqx2.address = emqx2@192.168.1.2 + +## Forwarding topics of the message +bridge.mqtt.emqx2.forwards = sensor1/#,sensor2/# + +## bridged mountpoint +bridge.mqtt.emqx2.mountpoint = bridge/emqx2/${node}/ +``` + +If the messages received by the local node emqx1 matches the topic `sersor1/#` or `sensor2/#`, these messages will be forwarded to the `sensor1/#` or `sensor2/#` topic of the remote node emqx2. + +`forwards` is used to specify topics. Messages of the in `forwards` specified topics on local node are forwarded to the remote node. + +`mountpoint` is used to add a topic prefix when forwarding a message. To use `mountpoint`, the `forwards` directive must be set. In the above example, a message with the topic `sensor1/hello` received by the local node will be forwarded to the remote node with the topic `bridge/emqx2/emqx1@192.168.1.1/sensor1/hello`. + +Limitations of RPC bridging: + +1. The RPC bridge of emqx can only forward local messages to the remote node, and cannot synchronize the messages of the remote node to the local node; + +2. RPC bridge can only bridge two EMQ X broker together and cannot bridge EMQ X broker to other MQTT brokers. + +## EMQ X MQTT Bridge Configuration + +EMQ X 3.0 officially introduced MQTT bridge, so that EMQ X can bridge any MQTT broker. Because of the characteristics of the MQTT protocol, EMQ X can subscribe to the remote mqtt broker's topic through MQTT bridge, and then synchronize the remote MQTT broker's message to the local. + +EMQ X MQTT bridging principle: Create an MQTT client on the EMQ X broker, and connect this MQTT client to the remote MQTT broker. Therefore, in the MQTT bridge configuration, following fields may be set for the EMQ X to connect to the remote broker as an mqtt client + +``` +## Bridge Address: Use node name for rpc bridging, use host:port for mqtt connection +bridge.mqtt.emqx2.address = 192.168.1.2:1883 + +## Bridged Protocol Version +## Enumeration value: mqttv3 | mqttv4 | mqttv5 +bridge.mqtt.emqx2.proto_ver = mqttv4 + +## mqtt client's clientid +bridge.mqtt.emqx2.clientid = bridge_emq + +## mqtt client's clean_start field +## Note: Some MQTT Brokers need to set the clean_start value as `true` +bridge.mqtt.emqx2.clean_start = true + +## mqtt client's username field +bridge.mqtt.emqx2.username = user + +## mqtt client's password field +bridge.mqtt.emqx2.password = passwd + +## Whether the mqtt client uses ssl to connect to a remote serve or not +bridge.mqtt.emqx2.ssl = off + +## CA Certificate of Client SSL Connection (PEM format) +bridge.mqtt.emqx2.cacertfile = etc/certs/cacert.pem + +## SSL certificate of Client SSL connection +bridge.mqtt.emqx2.certfile = etc/certs/client-cert.pem + +## Key file of Client SSL connection +bridge.mqtt.emqx2.keyfile = etc/certs/client-key.pem + +## SSL encryption +bridge.mqtt.emqx2.ciphers = ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384 + +## TTLS PSK password +## Note 'listener.ssl.external.ciphers' and 'listener.ssl.external.psk_ciphers' cannot be configured at the same time +## +## See 'https://tools.ietf.org/html/rfc4279#section-2'. +## bridge.mqtt.emqx2.psk_ciphers = PSK-AES128-CBC-SHA,PSK-AES256-CBC-SHA,PSK-3DES-EDE-CBC-SHA,PSK-RC4-SHA + +## Client's heartbeat interval +bridge.mqtt.emqx2.keepalive = 60s + +## Supported TLS version +bridge.mqtt.emqx2.tls_versions = tlsv1.2,tlsv1.1,tlsv1 + +## Forwarding topics of the message +bridge.mqtt.emqx2.forwards = sensor1/#,sensor2/# + +## Bridged mountpoint +bridge.mqtt.emqx2.mountpoint = bridge/emqx2/${node}/ + +## Subscription topic for bridging +bridge.mqtt.emqx2.subscription.1.topic = cmd/topic1 + +## Subscription qos for bridging +bridge.mqtt.emqx2.subscription.1.qos = 1 + +## Subscription topic for bridging +bridge.mqtt.emqx2.subscription.2.topic = cmd/topic2 + +## Subscription qos for bridging +bridge.mqtt.emqx2.subscription.2.qos = 1 + +## Bridging reconnection interval +## Default: 30s +bridge.mqtt.emqx2.reconnect_interval = 30s + +## QoS1 message retransmission interval +bridge.mqtt.emqx2.retry_interval = 20s + +## Inflight Size. +bridge.mqtt.emqx2.max_inflight_batches = 32 +``` + +## Bridge Cache Configuration + +The bridge of EMQ X has a message caching mechanism. The caching mechanism is applicable to both RPC bridging and MQTT bridging. When the bridge is disconnected (such as when the network connection is unstable), the messages with a topic specified in `forwards` can be cached to the local message queue. Until the bridge is restored, these messages are re-forwarded to the remote node. The configuration of the cache queue is as follows + +``` +## emqx_bridge internal number of messages used for batch +bridge.mqtt.emqx2.queue.batch_count_limit = 32 + +## emqx_bridge internal number of message bytes used for batch +bridge.mqtt.emqx2.queue.batch_bytes_limit = 1000MB + +## The path for placing replayq queue. If it is not specified, then replayq will run in `mem-only` mode and messages will not be cached on disk. +bridge.mqtt.emqx2.queue.replayq_dir = data/emqx_emqx2_bridge/ + +## Replayq data segment size +bridge.mqtt.emqx2.queue.replayq_seg_bytes = 10MB +``` + +`bridge.mqtt.emqx2.queue.replayq_dir` is a configuration parameter for specifying the path of the bridge storage queue. + +`bridge.mqtt.emqx2.queue.replayq_seg_bytes` is used to specify the size of the largest single file of the message queue that is cached on disk. If the message queue size exceeds the specified value, a new file is created to store the message queue. + +## CLI for EMQ X Bridge MQTT + +CLI for EMQ X Bridge MQTT: + +``` bash +$ cd emqx1/ && ./bin/emqx_ctl bridges +bridges list # List bridges +bridges start # Start a bridge +bridges stop # Stop a bridge +bridges forwards # Show a bridge forward topic +bridges add-forward # Add bridge forward topic +bridges del-forward # Delete bridge forward topic +bridges subscriptions # Show a bridge subscriptions topic +bridges add-subscription # Add bridge subscriptions topic +``` + +List all bridge states + +``` bash +$ ./bin/emqx_ctl bridges list +name: emqx status: Stopped $ ./bin/emqx_ctl bridges list +name: emqx status: Stopped +``` + +Start the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges start emqx +Start bridge successfully. +``` + +Stop the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges stop emqx +Stop bridge successfully. +``` +List the forwarding topics for the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges forwards emqx +topic: topic1/# +topic: topic2/# +``` + +Add a forwarding topic for the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges add-forwards emqx topic3/# +Add-forward topic successfully. +``` + +Delete the forwarding topic for the specified bridge + + +``` bash +$ ./bin/emqx_ctl bridges del-forwards emqx topic3/# +Del-forward topic successfully. +``` + +List subscriptions for the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges subscriptions emqx +topic: cmd/topic1, qos: 1 +topic: cmd/topic2, qos: 1 +``` + +Add a subscription topic for the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges add-subscription emqx cmd/topic3 1 +Add-subscription topic successfully. +``` + +Delete the subscription topic for the specified bridge + +``` bash +$ ./bin/emqx_ctl bridges del-subscription emqx cmd/topic3 +Del-subscription topic successfully. +``` + +Note: In case of creating multiple bridges, it is convenient to replicate all configuration items of the first bridge, and modify the bridge name and other configuration items if necessary. + diff --git a/apps/emqx_bridge_mqtt/docs/guide.rst b/apps/emqx_bridge_mqtt/docs/guide.rst new file mode 100644 index 000000000..73350ca1f --- /dev/null +++ b/apps/emqx_bridge_mqtt/docs/guide.rst @@ -0,0 +1,286 @@ + +EMQ Bridge MQTT +=============== + +The concept of **Bridge** means that EMQ X supports forwarding messages +of one of its own topics to another MQTT Broker in some way. + +**Bridge** differs from **Cluster** in that the bridge does not +replicate the topic trie and routing tables and only forwards MQTT +messages based on bridging rules. + +At present, the bridging methods supported by EMQ X are as follows: + + +* RPC bridge: RPC Bridge only supports message forwarding and does not + support subscribing to the topic of remote nodes to synchronize + data; +* MQTT Bridge: MQTT Bridge supports both forwarding and data + synchronization through subscription topic. + +These concepts are shown below: + + +.. image:: images/bridge.png + :target: images/bridge.png + :alt: bridge + + +In addition, the EMQ X message broker supports multi-node bridge mode interconnection + +.. code-block:: + + --------- --------- --------- + Publisher --> | Node1 | --Bridge Forward--> | Node2 | --Bridge Forward--> | Node3 | --> Subscriber + --------- --------- --------- + +In EMQ X, bridge is configured by modifying ``etc/emqx.conf``. EMQ X distinguishes between different bridges based on different names. E.g + +.. code-block:: + + ## Bridge address: node name for local bridge, host:port for remote. + bridge.mqtt.aws.address = 127.0.0.1:1883 + +This configuration declares a bridge named ``aws`` and specifies that it is bridged to the MQTT broker of 127.0.0.1:1883 by MQTT mode. + +In case of creating multiple bridges, it is convenient to replicate all configuration items of the first bridge, and modify the bridge name and other configuration items if necessary (such as bridge.$name.address, where $name refers to the name of bridge) + +The next two sections describe how to create a bridge in RPC and MQTT mode respectively and create a forwarding rule that forwards the messages from sensors. Assuming that two EMQ X nodes are running on two hosts: + +.. list-table:: + :header-rows: 1 + + * - Name + - Node + - MQTT Port + * - emqx1 + - emqx1@192.168.1.1. + - 1883 + * - emqx2 + - emqx2@192.168.1.2 + - 1883 + + +EMQ X RPC Bridge Configuration +------------------------------ + +The following is the basic configuration of RPC bridging. A simplest RPC bridging only requires the following three items + +.. code-block:: + + ## Bridge Address: Use node name (nodename@host) for rpc bridging, and host:port for mqtt connection + bridge.mqtt.emqx2.address = emqx2@192.168.1.2 + + ## Forwarding topics of the message + bridge.mqtt.emqx2.forwards = sensor1/#,sensor2/# + + ## bridged mountpoint + bridge.mqtt.emqx2.mountpoint = bridge/emqx2/${node}/ + +If the messages received by the local node emqx1 matches the topic ``sersor1/#`` or ``sensor2/#``\ , these messages will be forwarded to the ``sensor1/#`` or ``sensor2/#`` topic of the remote node emqx2. + +``forwards`` is used to specify topics. Messages of the in ``forwards`` specified topics on local node are forwarded to the remote node. + +``mountpoint`` is used to add a topic prefix when forwarding a message. To use ``mountpoint``\ , the ``forwards`` directive must be set. In the above example, a message with the topic ``sensor1/hello`` received by the local node will be forwarded to the remote node with the topic ``bridge/emqx2/emqx1@192.168.1.1/sensor1/hello``. + +Limitations of RPC bridging: + + +#. + The RPC bridge of emqx can only forward local messages to the remote node, and cannot synchronize the messages of the remote node to the local node; + +#. + RPC bridge can only bridge two EMQ X broker together and cannot bridge EMQ X broker to other MQTT brokers. + +EMQ X MQTT Bridge Configuration +------------------------------- + +EMQ X 3.0 officially introduced MQTT bridge, so that EMQ X can bridge any MQTT broker. Because of the characteristics of the MQTT protocol, EMQ X can subscribe to the remote mqtt broker's topic through MQTT bridge, and then synchronize the remote MQTT broker's message to the local. + +EMQ X MQTT bridging principle: Create an MQTT client on the EMQ X broker, and connect this MQTT client to the remote MQTT broker. Therefore, in the MQTT bridge configuration, following fields may be set for the EMQ X to connect to the remote broker as an mqtt client + +.. code-block:: + + ## Bridge Address: Use node name for rpc bridging, use host:port for mqtt connection + bridge.mqtt.emqx2.address = 192.168.1.2:1883 + + ## Bridged Protocol Version + ## Enumeration value: mqttv3 | mqttv4 | mqttv5 + bridge.mqtt.emqx2.proto_ver = mqttv4 + + ## mqtt client's clientid + bridge.mqtt.emqx2.clientid = bridge_emq + + ## mqtt client's clean_start field + ## Note: Some MQTT Brokers need to set the clean_start value as `true` + bridge.mqtt.emqx2.clean_start = true + + ## mqtt client's username field + bridge.mqtt.emqx2.username = user + + ## mqtt client's password field + bridge.mqtt.emqx2.password = passwd + + ## Whether the mqtt client uses ssl to connect to a remote serve or not + bridge.mqtt.emqx2.ssl = off + + ## CA Certificate of Client SSL Connection (PEM format) + bridge.mqtt.emqx2.cacertfile = etc/certs/cacert.pem + + ## SSL certificate of Client SSL connection + bridge.mqtt.emqx2.certfile = etc/certs/client-cert.pem + + ## Key file of Client SSL connection + bridge.mqtt.emqx2.keyfile = etc/certs/client-key.pem + + ## SSL encryption + bridge.mqtt.emqx2.ciphers = ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384 + + ## TTLS PSK password + ## Note 'listener.ssl.external.ciphers' and 'listener.ssl.external.psk_ciphers' cannot be configured at the same time + ## + ## See 'https://tools.ietf.org/html/rfc4279#section-2'. + ## bridge.mqtt.emqx2.psk_ciphers = PSK-AES128-CBC-SHA,PSK-AES256-CBC-SHA,PSK-3DES-EDE-CBC-SHA,PSK-RC4-SHA + + ## Client's heartbeat interval + bridge.mqtt.emqx2.keepalive = 60s + + ## Supported TLS version + bridge.mqtt.emqx2.tls_versions = tlsv1.2,tlsv1.1,tlsv1 + + ## Forwarding topics of the message + bridge.mqtt.emqx2.forwards = sensor1/#,sensor2/# + + ## Bridged mountpoint + bridge.mqtt.emqx2.mountpoint = bridge/emqx2/${node}/ + + ## Subscription topic for bridging + bridge.mqtt.emqx2.subscription.1.topic = cmd/topic1 + + ## Subscription qos for bridging + bridge.mqtt.emqx2.subscription.1.qos = 1 + + ## Subscription topic for bridging + bridge.mqtt.emqx2.subscription.2.topic = cmd/topic2 + + ## Subscription qos for bridging + bridge.mqtt.emqx2.subscription.2.qos = 1 + + ## Bridging reconnection interval + ## Default: 30s + bridge.mqtt.emqx2.reconnect_interval = 30s + + ## QoS1 message retransmission interval + bridge.mqtt.emqx2.retry_interval = 20s + + ## Inflight Size. + bridge.mqtt.emqx2.max_inflight_batches = 32 + +Bridge Cache Configuration +-------------------------- + +The bridge of EMQ X has a message caching mechanism. The caching mechanism is applicable to both RPC bridging and MQTT bridging. When the bridge is disconnected (such as when the network connection is unstable), the messages with a topic specified in ``forwards`` can be cached to the local message queue. Until the bridge is restored, these messages are re-forwarded to the remote node. The configuration of the cache queue is as follows + +.. code-block:: + + ## emqx_bridge internal number of messages used for batch + bridge.mqtt.emqx2.queue.batch_count_limit = 32 + + ## emqx_bridge internal number of message bytes used for batch + bridge.mqtt.emqx2.queue.batch_bytes_limit = 1000MB + + ## The path for placing replayq queue. If it is not specified, then replayq will run in `mem-only` mode and messages will not be cached on disk. + bridge.mqtt.emqx2.queue.replayq_dir = data/emqx_emqx2_bridge/ + + ## Replayq data segment size + bridge.mqtt.emqx2.queue.replayq_seg_bytes = 10MB + +``bridge.mqtt.emqx2.queue.replayq_dir`` is a configuration parameter for specifying the path of the bridge storage queue. + +``bridge.mqtt.emqx2.queue.replayq_seg_bytes`` is used to specify the size of the largest single file of the message queue that is cached on disk. If the message queue size exceeds the specified value, a new file is created to store the message queue. + +CLI for EMQ X Bridge MQTT +------------------------- + +CLI for EMQ X Bridge MQTT: + +.. code-block:: bash + + $ cd emqx1/ && ./bin/emqx_ctl bridges + bridges list # List bridges + bridges start # Start a bridge + bridges stop # Stop a bridge + bridges forwards # Show a bridge forward topic + bridges add-forward # Add bridge forward topic + bridges del-forward # Delete bridge forward topic + bridges subscriptions # Show a bridge subscriptions topic + bridges add-subscription # Add bridge subscriptions topic + +List all bridge states + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges list + name: emqx status: Stopped $ ./bin/emqx_ctl bridges list + name: emqx status: Stopped + +Start the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges start emqx + Start bridge successfully. + +Stop the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges stop emqx + Stop bridge successfully. + +List the forwarding topics for the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges forwards emqx + topic: topic1/# + topic: topic2/# + +Add a forwarding topic for the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges add-forwards emqx topic3/# + Add-forward topic successfully. + +Delete the forwarding topic for the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges del-forwards emqx topic3/# + Del-forward topic successfully. + +List subscriptions for the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges subscriptions emqx + topic: cmd/topic1, qos: 1 + topic: cmd/topic2, qos: 1 + +Add a subscription topic for the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges add-subscription emqx cmd/topic3 1 + Add-subscription topic successfully. + +Delete the subscription topic for the specified bridge + +.. code-block:: bash + + $ ./bin/emqx_ctl bridges del-subscription emqx cmd/topic3 + Del-subscription topic successfully. + +Note: In case of creating multiple bridges, it is convenient to replicate all configuration items of the first bridge, and modify the bridge name and other configuration items if necessary. + diff --git a/apps/emqx_bridge_mqtt/docs/images/bridge.png b/apps/emqx_bridge_mqtt/docs/images/bridge.png new file mode 100644 index 000000000..9bb9c024c Binary files /dev/null and b/apps/emqx_bridge_mqtt/docs/images/bridge.png differ diff --git a/apps/emqx_bridge_mqtt/etc/emqx_bridge_mqtt.conf b/apps/emqx_bridge_mqtt/etc/emqx_bridge_mqtt.conf new file mode 100644 index 000000000..93f0f5579 --- /dev/null +++ b/apps/emqx_bridge_mqtt/etc/emqx_bridge_mqtt.conf @@ -0,0 +1,172 @@ +##==================================================================== +## Configuration for EMQ X MQTT Broker Bridge +##==================================================================== + +##-------------------------------------------------------------------- +## Bridges to aws +##-------------------------------------------------------------------- + +## Bridge address: node name for local bridge, host:port for remote. +## +## Value: String +## Example: emqx@127.0.0.1, 127.0.0.1:1883 +bridge.mqtt.aws.address = 127.0.0.1:1883 + +## Protocol version of the bridge. +## +## Value: Enum +## - mqttv5 +## - mqttv4 +## - mqttv3 +bridge.mqtt.aws.proto_ver = mqttv4 + +## Start type of the bridge. +## +## Value: enum +## manual +## auto +bridge.mqtt.aws.start_type = manual + +## Whether to enable bridge mode for mqtt bridge +## +## This option is prepared for the mqtt broker which does not +## support bridge_mode such as the mqtt-plugin of the rabbitmq +## +## Value: boolean +#bridge.mqtt.aws.bridge_mode = false + +## The ClientId of a remote bridge. +## +## Placeholders: +## ${node}: Node name +## +## Value: String +bridge.mqtt.aws.clientid = bridge_aws + +## The Clean start flag of a remote bridge. +## +## Value: boolean +## Default: true +## +## NOTE: Some IoT platforms require clean_start +## must be set to 'true' +bridge.mqtt.aws.clean_start = true + +## The username for a remote bridge. +## +## Value: String +bridge.mqtt.aws.username = user + +## The password for a remote bridge. +## +## Value: String +bridge.mqtt.aws.password = passwd + +## Topics that need to be forward to AWS IoTHUB +## +## Value: String +## Example: topic1/#,topic2/# +bridge.mqtt.aws.forwards = topic1/#,topic2/# + +## Forward messages to the mountpoint of an AWS IoTHUB +## +## Value: String +bridge.mqtt.aws.forward_mountpoint = bridge/aws/${node}/ + +## Need to subscribe to AWS topics +## +## Value: String +## bridge.mqtt.aws.subscription.1.topic = cmd/topic1 + +## Need to subscribe to AWS topics QoS. +## +## Value: Number +## bridge.mqtt.aws.subscription.1.qos = 1 + +## A mountpoint that receives messages from AWS IoTHUB +## +## Value: String +## bridge.mqtt.aws.receive_mountpoint = receive/aws/ + + +## Bribge to remote server via SSL. +## +## Value: on | off +bridge.mqtt.aws.ssl = off + +## PEM-encoded CA certificates of the bridge. +## +## Value: File +bridge.mqtt.aws.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem + +## Client SSL Certfile of the bridge. +## +## Value: File +bridge.mqtt.aws.certfile = {{ platform_etc_dir }}/certs/client-cert.pem + +## Client SSL Keyfile of the bridge. +## +## Value: File +bridge.mqtt.aws.keyfile = {{ platform_etc_dir }}/certs/client-key.pem + +## SSL Ciphers used by the bridge. +## +## Value: String +bridge.mqtt.aws.ciphers = ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-AES256-SHA384,ECDHE-RSA-AES256-SHA384,ECDHE-ECDSA-DES-CBC3-SHA,ECDH-ECDSA-AES256-GCM-SHA384,ECDH-RSA-AES256-GCM-SHA384,ECDH-ECDSA-AES256-SHA384,ECDH-RSA-AES256-SHA384,DHE-DSS-AES256-GCM-SHA384,DHE-DSS-AES256-SHA256,AES256-GCM-SHA384,AES256-SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES128-SHA256,ECDHE-RSA-AES128-SHA256,ECDH-ECDSA-AES128-GCM-SHA256,ECDH-RSA-AES128-GCM-SHA256,ECDH-ECDSA-AES128-SHA256,ECDH-RSA-AES128-SHA256,DHE-DSS-AES128-GCM-SHA256,DHE-DSS-AES128-SHA256,AES128-GCM-SHA256,AES128-SHA256,ECDHE-ECDSA-AES256-SHA,ECDHE-RSA-AES256-SHA,DHE-DSS-AES256-SHA,ECDH-ECDSA-AES256-SHA,ECDH-RSA-AES256-SHA,AES256-SHA,ECDHE-ECDSA-AES128-SHA,ECDHE-RSA-AES128-SHA,DHE-DSS-AES128-SHA,ECDH-ECDSA-AES128-SHA,ECDH-RSA-AES128-SHA,AES128-SHA + +## Ciphers for TLS PSK. +## Note that 'bridge.${BridgeName}.ciphers' and 'bridge.${BridgeName}.psk_ciphers' cannot +## be configured at the same time. +## See 'https://tools.ietf.org/html/rfc4279#section-2'. +#bridge.mqtt.aws.psk_ciphers = PSK-AES128-CBC-SHA,PSK-AES256-CBC-SHA,PSK-3DES-EDE-CBC-SHA,PSK-RC4-SHA + +## Ping interval of a down bridge. +## +## Value: Duration +## Default: 10 seconds +bridge.mqtt.aws.keepalive = 60s + +## TLS versions used by the bridge. +## +## Value: String +bridge.mqtt.aws.tls_versions = tlsv1.2,tlsv1.1,tlsv1 + +## Bridge reconnect time. +## +## Value: Duration +## Default: 30 seconds +bridge.mqtt.aws.reconnect_interval = 30s + +## Retry interval for bridge QoS1 message delivering. +## +## Value: Duration +bridge.mqtt.aws.retry_interval = 20s + +## Publish messages in batches, only RPC Bridge supports +## +## Value: Integer +## default: 32 +bridge.mqtt.aws.batch_size = 32 + +## Inflight size. +## +## Value: Integer +bridge.mqtt.aws.max_inflight_size = 32 + +## Base directory for replayq to store messages on disk +## If this config entry is missing or set to undefined, +## replayq works in a mem-only manner. +## +## Value: String +bridge.mqtt.aws.queue.replayq_dir = {{ platform_data_dir }}/replayq/emqx_aws_bridge/ + +## Replayq segment size +## +## Value: Bytesize +bridge.mqtt.aws.queue.replayq_seg_bytes = 10MB + +## Replayq max total size +## +## Value: Bytesize +bridge.mqtt.aws.queue.max_total_size = 5GB + diff --git a/apps/emqx_bridge_mqtt/include/emqx_bridge_mqtt.hrl b/apps/emqx_bridge_mqtt/include/emqx_bridge_mqtt.hrl new file mode 100644 index 000000000..4bc9ede14 --- /dev/null +++ b/apps/emqx_bridge_mqtt/include/emqx_bridge_mqtt.hrl @@ -0,0 +1,18 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-define(APP, emqx_bridge_mqtt). + diff --git a/apps/emqx_bridge_mqtt/priv/emqx_bridge_mqtt.schema b/apps/emqx_bridge_mqtt/priv/emqx_bridge_mqtt.schema new file mode 100644 index 000000000..301737afd --- /dev/null +++ b/apps/emqx_bridge_mqtt/priv/emqx_bridge_mqtt.schema @@ -0,0 +1,244 @@ +%%-*- mode: erlang -*- +%%-------------------------------------------------------------------- +%% Bridges +%%-------------------------------------------------------------------- +{mapping, "bridge.mqtt.$name.address", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.proto_ver", "emqx_bridge_mqtt.bridges", [ + {datatype, {enum, [mqttv3, mqttv4, mqttv5]}} +]}. + +{mapping, "bridge.mqtt.$name.bridge_mode", "emqx_bridge_mqtt.bridges", [ + {default, false}, + {datatype, {enum, [true, false]}} +]}. + +{mapping, "bridge.mqtt.$name.start_type", "emqx_bridge_mqtt.bridges", [ + {datatype, {enum, [manual, auto]}}, + {default, auto} +]}. + +{mapping, "bridge.mqtt.$name.clientid", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.clean_start", "emqx_bridge_mqtt.bridges", [ + {default, true}, + {datatype, {enum, [true, false]}} +]}. + +{mapping, "bridge.mqtt.$name.username", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.password", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.forwards", "emqx_bridge_mqtt.bridges", [ + {datatype, string}, + {default, ""} +]}. + +{mapping, "bridge.mqtt.$name.forward_mountpoint", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.subscription.$id.topic", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.subscription.$id.qos", "emqx_bridge_mqtt.bridges", [ + {datatype, integer} +]}. + +{mapping, "bridge.mqtt.$name.receive_mountpoint", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.ssl", "emqx_bridge_mqtt.bridges", [ + {datatype, flag}, + {default, off} +]}. + +{mapping, "bridge.mqtt.$name.cacertfile", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.certfile", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.keyfile", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.ciphers", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.psk_ciphers", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.keepalive", "emqx_bridge_mqtt.bridges", [ + {default, "10s"}, + {datatype, {duration, s}} +]}. + +{mapping, "bridge.mqtt.$name.tls_versions", "emqx_bridge_mqtt.bridges", [ + {datatype, string}, + {default, "tlsv1,tlsv1.1,tlsv1.2"} +]}. + +{mapping, "bridge.mqtt.$name.reconnect_interval", "emqx_bridge_mqtt.bridges", [ + {default, "30s"}, + {datatype, {duration, ms}} +]}. + +{mapping, "bridge.mqtt.$name.retry_interval", "emqx_bridge_mqtt.bridges", [ + {default, "20s"}, + {datatype, {duration, s}} +]}. + +{mapping, "bridge.mqtt.$name.max_inflight_size", "emqx_bridge_mqtt.bridges", [ + {default, 0}, + {datatype, integer} + ]}. + +{mapping, "bridge.mqtt.$name.batch_size", "emqx_bridge_mqtt.bridges", [ + {default, 0}, + {datatype, integer} +]}. + +{mapping, "bridge.mqtt.$name.queue.replayq_dir", "emqx_bridge_mqtt.bridges", [ + {datatype, string} +]}. + +{mapping, "bridge.mqtt.$name.queue.replayq_seg_bytes", "emqx_bridge_mqtt.bridges", [ + {datatype, bytesize} +]}. + +{mapping, "bridge.mqtt.$name.queue.max_total_size", "emqx_bridge_mqtt.bridges", [ + {datatype, bytesize} +]}. + +{translation, "emqx_bridge_mqtt.bridges", fun(Conf) -> + + MapPSKCiphers = fun(PSKCiphers) -> + lists:map( + fun("PSK-AES128-CBC-SHA") -> {psk, aes_128_cbc, sha}; + ("PSK-AES256-CBC-SHA") -> {psk, aes_256_cbc, sha}; + ("PSK-3DES-EDE-CBC-SHA") -> {psk, '3des_ede_cbc', sha}; + ("PSK-RC4-SHA") -> {psk, rc4_128, sha} + end, PSKCiphers) + end, + + Split = fun(undefined) -> undefined; (S) -> string:tokens(S, ",") end, + + IsSsl = fun(cacertfile) -> true; + (certfile) -> true; + (keyfile) -> true; + (ciphers) -> true; + (psk_ciphers) -> true; + (tls_versions) -> true; + (_Opt) -> false + end, + + Parse = fun(tls_versions, Vers) -> + [{versions, [list_to_atom(S) || S <- Split(Vers)]}]; + (ciphers, Ciphers) -> + [{ciphers, Split(Ciphers)}]; + (psk_ciphers, Ciphers) -> + [{ciphers, MapPSKCiphers(Split(Ciphers))}, {user_lookup_fun, {fun emqx_psk:lookup/3, <<>>}}]; + (Opt, Val) -> + [{Opt, Val}] + end, + + Merge = fun(forwards, Val, Opts) -> + [{forwards, string:tokens(Val, ",")}|Opts]; + (Opt, Val, Opts) -> + case IsSsl(Opt) of + true -> + SslOpts = Parse(Opt, Val) ++ proplists:get_value(ssl_opts, Opts, []), + lists:ukeymerge(1, [{ssl_opts, SslOpts}], lists:usort(Opts)); + false -> + [{Opt, Val}|Opts] + end + end, + Queue = fun(Name) -> + Configs = cuttlefish_variable:filter_by_prefix("bridge.mqtt." ++ Name ++ ".queue", Conf), + + QOpts = [{list_to_atom(QOpt), QValue}|| {[_, _, _, "queue", QOpt], QValue} <- Configs], + maps:from_list(QOpts) + end, + Subscriptions = fun(Name) -> + Configs = cuttlefish_variable:filter_by_prefix("bridge.mqtt." ++ Name ++ ".subscription", Conf), + lists:zip([Topic || {_, Topic} <- lists:sort([{I, Topic} || {[_, _, _, "subscription", I, "topic"], Topic} <- Configs])], + [QoS || {_, QoS} <- lists:sort([{I, QoS} || {[_, _, _, "subscription", I, "qos"], QoS} <- Configs])]) + end, + IsNodeAddr = fun(Addr) -> + case string:tokens(Addr, "@") of + [_NodeName, _Hostname] -> true; + _ -> false + end + end, + ConnMod = fun(Name) -> + + [AddrConfig] = cuttlefish_variable:filter_by_prefix("bridge.mqtt." ++ Name ++ ".address", Conf), + {_, Addr} = AddrConfig, + + Subs = Subscriptions(Name), + case IsNodeAddr(Addr) of + true when Subs =/= [] -> + error({"subscriptions are not supported when bridging between emqx nodes", Name, Subs}); + true -> + emqx_bridge_rpc; + false -> + emqx_bridge_mqtt + end + end, + + %% to be backward compatible + Translate = + fun Tr(queue, Q, Cfg) -> + NewQ = maps:fold(Tr, #{}, Q), + Cfg#{queue => NewQ}; + Tr(address, Addr0, Cfg) -> + Addr = case IsNodeAddr(Addr0) of + true -> list_to_atom(Addr0); + false -> Addr0 + end, + Cfg#{address => Addr}; + Tr(reconnect_interval, Ms, Cfg) -> + Cfg#{reconnect_delay_ms => Ms}; + Tr(proto_ver, Ver, Cfg) -> + Cfg#{proto_ver => + case Ver of + mqttv3 -> v3; + mqttv4 -> v4; + mqttv5 -> v5; + _ -> v4 + end}; + Tr(max_inflight_size, Size, Cfg) -> + Cfg#{max_inflight => Size}; + Tr(Key, Value, Cfg) -> + Cfg#{Key => Value} + end, + C = lists:foldl( + fun({["bridge", "mqtt", Name, Opt], Val}, Acc) -> + %% e.g #{aws => [{OptKey, OptVal}]} + Init = [{list_to_atom(Opt), Val}, + {connect_module, ConnMod(Name)}, + {subscriptions, Subscriptions(Name)}, + {queue, Queue(Name)}], + maps:update_with(list_to_atom(Name), fun(Opts) -> Merge(list_to_atom(Opt), Val, Opts) end, Init, Acc); + (_, Acc) -> Acc + end, #{}, lists:usort(cuttlefish_variable:filter_by_prefix("bridge.mqtt", Conf))), + C1 = maps:map(fun(Bn, Bc) -> + maps:to_list(maps:fold(Translate, #{}, maps:from_list(Bc))) + end, C), + maps:to_list(C1) +end}. diff --git a/apps/emqx_bridge_mqtt/rebar.config b/apps/emqx_bridge_mqtt/rebar.config new file mode 100644 index 000000000..8440b2e33 --- /dev/null +++ b/apps/emqx_bridge_mqtt/rebar.config @@ -0,0 +1,32 @@ +{deps, + [{replayq, {git, "https://github.com/emqx/replayq", {tag, "v0.2.0"}}}, + {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.0"}}}, + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + {parse_transform}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions]}. +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{shell, [ + % {config, "config/sys.config"}, + {apps, [emqx, emqx_bridge_mqtt]} +]}. + +{profiles, + [{test, + [{deps, + [{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}]} + ]} +]}. diff --git a/apps/emqx_bridge_mqtt/rebar.config.script b/apps/emqx_bridge_mqtt/rebar.config.script new file mode 100644 index 000000000..13e3db39c --- /dev/null +++ b/apps/emqx_bridge_mqtt/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +NewDeps = [{emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, + {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + {emqx_rule_engine, {git, UrlPrefix ++ "emqx-rule-engine", GitDescribe}} + | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_connect.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_connect.erl new file mode 100644 index 000000000..5086ca574 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_connect.erl @@ -0,0 +1,74 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_connect). + +-export([start/2]). + +-export_type([config/0, connection/0]). + +-optional_callbacks([ensure_subscribed/3, ensure_unsubscribed/2]). + +%% map fields depend on implementation +-type(config() :: map()). +-type(connection() :: term()). +-type(batch() :: emqx_protal:batch()). +-type(ack_ref() :: emqx_bridge_worker:ack_ref()). +-type(topic() :: emqx_topic:topic()). +-type(qos() :: emqx_mqtt_types:qos()). + +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[Bridge Connect]"). + +%% establish the connection to remote node/cluster +%% protal worker (the caller process) should be expecting +%% a message {disconnected, conn_ref()} when disconnected. +-callback start(config()) -> {ok, connection()} | {error, any()}. + +%% send to remote node/cluster +%% bridge worker (the caller process) should be expecting +%% a message {batch_ack, reference()} when batch is acknowledged by remote node/cluster +-callback send(connection(), batch()) -> {ok, ack_ref()} | {ok, integer()} | {error, any()}. + +%% called when owner is shutting down. +-callback stop(connection()) -> ok. + +-callback ensure_subscribed(connection(), topic(), qos()) -> ok. + +-callback ensure_unsubscribed(connection(), topic()) -> ok. + +start(Module, Config) -> + case Module:start(Config) of + {ok, Conn} -> + {ok, Conn}; + {error, Reason} -> + Config1 = obfuscate(Config), + ?LOG(error, "Failed to connect with module=~p\n" + "config=~p\nreason:~p", [Module, Config1, Reason]), + {error, Reason} + end. + +obfuscate(Map) -> + maps:fold(fun(K, V, Acc) -> + case is_sensitive(K) of + true -> [{K, '***'} | Acc]; + false -> [{K, V} | Acc] + end + end, [], Map). + +is_sensitive(password) -> true; +is_sensitive(_) -> false. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.app.src b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.app.src new file mode 100644 index 000000000..24ac4eebd --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.app.src @@ -0,0 +1,14 @@ +{application, emqx_bridge_mqtt, + [{description, "EMQ X Bridge to MQTT Broker"}, + {vsn, "git"}, + {modules, []}, + {registered, []}, + {applications, [kernel,stdlib,replayq,emqtt]}, + {mod, {emqx_bridge_mqtt_app, []}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-bridge-mqtt"} + ]} + ]}. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.app.src.script b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.appup.src b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.appup.src new file mode 100644 index 000000000..2e790bbc2 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.appup.src @@ -0,0 +1,26 @@ +%% -*-: erlang -*- + +{VSN, + [ + {<<"4.2.[23]">>, [ + {load_module, emqx_bridge_mqtt, brutal_purge, soft_purge, []}, + {load_module, emqx_bridge_mqtt_actions, brutal_purge, soft_purge, []}, + {load_module, emqx_bridge_worker, brutal_purge, soft_purge, []} + ]}, + {<<"4.2.[01]">>, [ + {restart_application, emqx_bridge_mqtt} + ]}, + {<<".*">>, []} + ], + [ + {<<"4.2.[23]">>, [ + {load_module, emqx_bridge_mqtt, brutal_purge, soft_purge, []}, + {load_module, emqx_bridge_mqtt_actions, brutal_purge, soft_purge, []}, + {load_module, emqx_bridge_worker, brutal_purge, soft_purge, []} + ]}, + {<<"4.2.[01]">>, [ + {restart_application, emqx_bridge_mqtt} + ]}, + {<<".*">>, []} + ] +}. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.erl new file mode 100644 index 000000000..d600ff551 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt.erl @@ -0,0 +1,196 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +%% @doc This module implements EMQX Bridge transport layer on top of MQTT protocol + +-module(emqx_bridge_mqtt). + +-behaviour(emqx_bridge_connect). + +%% behaviour callbacks +-export([ start/1 + , send/2 + , stop/1 + ]). + +%% optional behaviour callbacks +-export([ ensure_subscribed/3 + , ensure_unsubscribed/2 + ]). + +%% callbacks for emqtt +-export([ handle_puback/2 + , handle_publish/2 + , handle_disconnected/2 + ]). + +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). + +-define(ACK_REF(ClientPid, PktId), {ClientPid, PktId}). + +%% Messages towards ack collector process +-define(REF_IDS(Ref, Ids), {Ref, Ids}). + +%%-------------------------------------------------------------------- +%% emqx_bridge_connect callbacks +%%-------------------------------------------------------------------- + +start(Config = #{address := Address}) -> + Parent = self(), + Mountpoint = maps:get(receive_mountpoint, Config, undefined), + Handlers = make_hdlr(Parent, Mountpoint), + {Host, Port} = case string:tokens(Address, ":") of + [H] -> {H, 1883}; + [H, P] -> {H, list_to_integer(P)} + end, + ClientConfig = Config#{msg_handler => Handlers, + host => Host, + port => Port, + force_ping => true + }, + case emqtt:start_link(replvar(ClientConfig)) of + {ok, Pid} -> + case emqtt:connect(Pid) of + {ok, _} -> + try + subscribe_remote_topics(Pid, maps:get(subscriptions, Config, [])), + {ok, #{client_pid => Pid}} + catch + throw : Reason -> + ok = stop(#{client_pid => Pid}), + {error, Reason} + end; + {error, Reason} -> + ok = stop(#{client_pid => Pid}), + {error, Reason} + end; + {error, Reason} -> + {error, Reason} + end. + +stop(#{client_pid := Pid}) -> + safe_stop(Pid, fun() -> emqtt:stop(Pid) end, 1000), + ok. + +ensure_subscribed(#{client_pid := Pid}, Topic, QoS) when is_pid(Pid) -> + case emqtt:subscribe(Pid, Topic, QoS) of + {ok, _, _} -> ok; + Error -> Error + end; +ensure_subscribed(_Conn, _Topic, _QoS) -> + %% return ok for now, next re-connect should should call start with new topic added to config + ok. + +ensure_unsubscribed(#{client_pid := Pid}, Topic) when is_pid(Pid) -> + case emqtt:unsubscribe(Pid, Topic) of + {ok, _, _} -> ok; + Error -> Error + end; +ensure_unsubscribed(_, _) -> + %% return ok for now, next re-connect should should call start with this topic deleted from config + ok. + +safe_stop(Pid, StopF, Timeout) -> + MRef = monitor(process, Pid), + unlink(Pid), + try + StopF() + catch + _ : _ -> + ok + end, + receive + {'DOWN', MRef, _, _, _} -> + ok + after + Timeout -> + exit(Pid, kill) + end. + +send(Conn, Msgs) -> + send(Conn, Msgs, undefined). +send(_Conn, [], PktId) -> + {ok, PktId}; +send(#{client_pid := ClientPid} = Conn, [Msg | Rest], _PktId) -> + case emqtt:publish(ClientPid, Msg) of + ok -> + Ref = make_ref(), + self() ! {batch_ack, Ref}, + send(Conn, Rest, Ref); + {ok, PktId} -> + send(Conn, Rest, PktId); + {error, Reason} -> + %% NOTE: There is no partial sucess of a batch and recover from the middle + %% only to retry all messages in one batch + {error, Reason} + end. + + +handle_puback(#{packet_id := PktId, reason_code := RC}, Parent) + when RC =:= ?RC_SUCCESS; + RC =:= ?RC_NO_MATCHING_SUBSCRIBERS -> + Parent ! {batch_ack, PktId}, ok; +handle_puback(#{packet_id := PktId, reason_code := RC}, _Parent) -> + ?LOG(warning, "Publish ~p to remote node falied, reason_code: ~p", [PktId, RC]). + +handle_publish(Msg, Mountpoint) -> + emqx_broker:publish(emqx_bridge_msg:to_broker_msg(Msg, Mountpoint)). + +handle_disconnected(Reason, Parent) -> + Parent ! {disconnected, self(), Reason}. + +make_hdlr(Parent, Mountpoint) -> + #{puback => {fun ?MODULE:handle_puback/2, [Parent]}, + publish => {fun ?MODULE:handle_publish/2, [Mountpoint]}, + disconnected => {fun ?MODULE:handle_disconnected/2, [Parent]} + }. + +subscribe_remote_topics(ClientPid, Subscriptions) -> + lists:foreach(fun({Topic, Qos}) -> + case emqtt:subscribe(ClientPid, Topic, Qos) of + {ok, _, _} -> ok; + Error -> throw(Error) + end + end, Subscriptions). + +%%-------------------------------------------------------------------- +%% Internal funcs +%%-------------------------------------------------------------------- + +replvar(Options) -> + replvar([clientid, max_inflight], Options). + + +replvar([], Options) -> + Options; +replvar([Key|More], Options) -> + case maps:get(Key, Options, undefined) of + undefined -> + replvar(More, Options); + Val -> + replvar(More, maps:put(Key, feedvar(Key, Val, Options), Options)) + end. + +%% ${node} => node() +feedvar(clientid, ClientId, _) -> + iolist_to_binary(re:replace(ClientId, "\\${node}", atom_to_list(node()))); + +feedvar(max_inflight, 0, _) -> + infinity; + +feedvar(max_inflight, Size, _) -> + Size. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_actions.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_actions.erl new file mode 100644 index 000000000..e522f83a2 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_actions.erl @@ -0,0 +1,594 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +%% @doc This module implements EMQX Bridge transport layer on top of MQTT protocol + +-module(emqx_bridge_mqtt_actions). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx_rule_engine/include/rule_actions.hrl"). + +-import(emqx_rule_utils, [str/1]). + +-export([ on_resource_create/2 + , on_get_resource_status/2 + , on_resource_destroy/2 + ]). + +%% Callbacks of ecpool Worker +-export([connect/1]). + +-export([subscriptions/1]). + +-export([ on_action_create_data_to_mqtt_broker/2 + , on_action_data_to_mqtt_broker/2 + ]). + +-define(RESOURCE_TYPE_MQTT, 'bridge_mqtt'). +-define(RESOURCE_TYPE_RPC, 'bridge_rpc'). + +-define(RESOURCE_CONFIG_SPEC_MQTT, #{ + address => #{ + order => 1, + type => string, + required => true, + default => <<"127.0.0.1:1883">>, + title => #{en => <<" Broker Address">>, + zh => <<"远程 broker 地址"/utf8>>}, + description => #{en => <<"The MQTT Remote Address">>, + zh => <<"远程 MQTT Broker 的地址"/utf8>>} + }, + pool_size => #{ + order => 2, + type => number, + required => true, + default => 8, + title => #{en => <<"Pool Size">>, + zh => <<"连接池大小"/utf8>>}, + description => #{en => <<"MQTT Connection Pool Size">>, + zh => <<"连接池大小"/utf8>>} + }, + clientid => #{ + order => 3, + type => string, + required => true, + default => <<"client">>, + title => #{en => <<"ClientId">>, + zh => <<"客户端 Id"/utf8>>}, + description => #{en => <<"ClientId for connecting to remote MQTT broker">>, + zh => <<"连接远程 Broker 的 ClientId"/utf8>>} + }, + append => #{ + order => 4, + type => boolean, + required => false, + default => true, + title => #{en => <<"Append GUID">>, + zh => <<"附加 GUID"/utf8>>}, + description => #{en => <<"Append GUID to MQTT ClientId?">>, + zh => <<"是否将GUID附加到 MQTT ClientId 后"/utf8>>} + }, + username => #{ + order => 5, + type => string, + required => false, + default => <<"">>, + title => #{en => <<"Username">>, zh => <<"用户名"/utf8>>}, + description => #{en => <<"Username for connecting to remote MQTT Broker">>, + zh => <<"连接远程 Broker 的用户名"/utf8>>} + }, + password => #{ + order => 6, + type => string, + required => false, + default => <<"">>, + title => #{en => <<"Password">>, + zh => <<"密码"/utf8>>}, + description => #{en => <<"Password for connecting to remote MQTT Broker">>, + zh => <<"连接远程 Broker 的密码"/utf8>>} + }, + mountpoint => #{ + order => 7, + type => string, + required => false, + default => <<"bridge/aws/${node}/">>, + title => #{en => <<"Bridge MountPoint">>, + zh => <<"桥接挂载点"/utf8>>}, + description => #{ + en => <<"MountPoint for bridge topic:
" + "Example: The topic of messages sent to `topic1` on local node" + "will be transformed to `bridge/aws/${node}/topic1`">>, + zh => <<"桥接主题的挂载点:
" + "示例: 本地节点向 `topic1` 发消息,远程桥接节点的主题" + "会变换为 `bridge/aws/${node}/topic1`"/utf8>> + } + }, + disk_cache => #{ + order => 8, + type => string, + required => false, + default => <<"off">>, + enum => [<<"on">>, <<"off">>], + title => #{en => <<"Disk Cache">>, + zh => <<"磁盘缓存"/utf8>>}, + description => #{en => <<"The flag which determines whether messages" + "can be cached on local disk when bridge is" + "disconnected">>, + zh => <<"当桥接断开时用于控制是否将消息缓存到本地磁" + "盘队列上"/utf8>>} + }, + proto_ver => #{ + order => 9, + type => string, + required => false, + default => <<"mqttv4">>, + enum => [<<"mqttv3">>, <<"mqttv4">>, <<"mqttv5">>], + title => #{en => <<"Protocol Version">>, + zh => <<"协议版本"/utf8>>}, + description => #{en => <<"MQTTT Protocol version">>, + zh => <<"MQTT 协议版本"/utf8>>} + }, + keepalive => #{ + order => 10, + type => string, + required => false, + default => <<"60s">> , + title => #{en => <<"Keepalive">>, + zh => <<"心跳间隔"/utf8>>}, + description => #{en => <<"Keepalive">>, + zh => <<"心跳间隔"/utf8>>} + }, + reconnect_interval => #{ + order => 11, + type => string, + required => false, + default => <<"30s">>, + title => #{en => <<"Reconnect Interval">>, + zh => <<"重连间隔"/utf8>>}, + description => #{en => <<"Reconnect interval of bridge:
">>, + zh => <<"重连间隔"/utf8>>} + }, + retry_interval => #{ + order => 12, + type => string, + required => false, + default => <<"20s">>, + title => #{en => <<"Retry interval">>, + zh => <<"重传间隔"/utf8>>}, + description => #{en => <<"Retry interval for bridge QoS1 message delivering">>, + zh => <<"消息重传间隔"/utf8>>} + }, + bridge_mode => #{ + order => 13, + type => boolean, + required => false, + default => false, + title => #{en => <<"Bridge Mode">>, + zh => <<"桥接模式"/utf8>>}, + description => #{en => <<"Bridge mode for MQTT bridge connection">>, + zh => <<"MQTT 连接是否为桥接模式"/utf8>>} + }, + ssl => #{ + order => 14, + type => boolean, + default => false, + title => #{en => <<"Enable SSL">>, + zh => <<"开启SSL链接"/utf8>>}, + description => #{en => <<"If enable ssl">>, + zh => <<"是否开启 SSL"/utf8>>} + }, + cacertfile => #{ + order => 15, + type => file, + required => false, + default => <<"etc/certs/cacert.pem">>, + title => #{en => <<"CA certificates">>, + zh => <<"CA 证书"/utf8>>}, + description => #{en => <<"The file path of the CA certificates">>, + zh => <<"CA 证书路径"/utf8>>} + }, + certfile => #{ + order => 16, + type => file, + required => false, + default => <<"etc/certs/client-cert.pem">>, + title => #{en => <<"SSL Certfile">>, + zh => <<"SSL 客户端证书"/utf8>>}, + description => #{en => <<"The file path of the client certfile">>, + zh => <<"客户端证书路径"/utf8>>} + }, + keyfile => #{ + order => 17, + type => file, + required => false, + default => <<"etc/certs/client-key.pem">>, + title => #{en => <<"SSL Keyfile">>, + zh => <<"SSL 密钥文件"/utf8>>}, + description => #{en => <<"The file path of the client keyfile">>, + zh => <<"客户端密钥路径"/utf8>>} + }, + ciphers => #{ + order => 18, + type => string, + required => false, + default => <<"ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,", + "ECDHE-ECDSA-AES256-SHA384,ECDHE-RSA-AES256-SHA384,ECDHE-ECDSA-DES-CBC3-SHA,", + "ECDH-ECDSA-AES256-GCM-SHA384,ECDH-RSA-AES256-GCM-SHA384,ECDH-ECDSA-AES256-SHA384,", + "ECDH-RSA-AES256-SHA384,DHE-DSS-AES256-GCM-SHA384,DHE-DSS-AES256-SHA256,AES256-GCM-SHA384,", + "AES256-SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,", + "ECDHE-ECDSA-AES128-SHA256,ECDHE-RSA-AES128-SHA256,ECDH-ECDSA-AES128-GCM-SHA256,", + "ECDH-RSA-AES128-GCM-SHA256,ECDH-ECDSA-AES128-SHA256,ECDH-RSA-AES128-SHA256,", + "DHE-DSS-AES128-GCM-SHA256,DHE-DSS-AES128-SHA256,AES128-GCM-SHA256,AES128-SHA256,", + "ECDHE-ECDSA-AES256-SHA,ECDHE-RSA-AES256-SHA,DHE-DSS-AES256-SHA,ECDH-ECDSA-AES256-SHA,", + "ECDH-RSA-AES256-SHA,AES256-SHA,ECDHE-ECDSA-AES128-SHA,ECDHE-RSA-AES128-SHA,", + "DHE-DSS-AES128-SHA,ECDH-ECDSA-AES128-SHA,ECDH-RSA-AES128-SHA,AES128-SHA">>, + title => #{en => <<"SSL Ciphers">>, + zh => <<"SSL 加密算法"/utf8>>}, + description => #{en => <<"SSL Ciphers">>, + zh => <<"SSL 加密算法"/utf8>>} + } + }). + + + +-define(RESOURCE_CONFIG_SPEC_RPC, #{ + address => #{ + order => 1, + type => string, + required => true, + default => <<"emqx2@127.0.0.1">>, + title => #{en => <<"EMQ X Node Name">>, + zh => <<"EMQ X 节点名称"/utf8>>}, + description => #{en => <<"EMQ X Remote Node Name">>, + zh => <<"远程 EMQ X 节点名称 "/utf8>>} + }, + mountpoint => #{ + order => 2, + type => string, + required => false, + default => <<"bridge/emqx/${node}/">>, + title => #{en => <<"Bridge MountPoint">>, + zh => <<"桥接挂载点"/utf8>>}, + description => #{en => <<"MountPoint for bridge topic
" + "Example: The topic of messages sent to `topic1` on local node" + "will be transformed to `bridge/aws/${node}/topic1`">>, + zh => <<"桥接主题的挂载点
" + "示例: 本地节点向 `topic1` 发消息,远程桥接节点的主题" + "会变换为 `bridge/aws/${node}/topic1`"/utf8>>} + }, + pool_size => #{ + order => 3, + type => number, + required => true, + default => 8, + title => #{en => <<"Pool Size">>, + zh => <<"连接池大小"/utf8>>}, + description => #{en => <<"MQTT/RPC Connection Pool Size">>, + zh => <<"连接池大小"/utf8>>} + }, + reconnect_interval => #{ + order => 4, + type => string, + required => false, + default => <<"30s">>, + title => #{en => <<"Reconnect Interval">>, + zh => <<"重连间隔"/utf8>>}, + description => #{en => <<"Reconnect Interval of bridge">>, + zh => <<"重连间隔"/utf8>>} + }, + batch_size => #{ + order => 5, + type => number, + required => false, + default => 32, + title => #{en => <<"Batch Size">>, + zh => <<"批处理大小"/utf8>>}, + description => #{en => <<"Batch Size">>, + zh => <<"批处理大小"/utf8>>} + }, + disk_cache => #{ + order => 6, + type => string, + required => false, + default => <<"off">>, + enum => [<<"on">>, <<"off">>], + title => #{en => <<"Disk Cache">>, + zh => <<"磁盘缓存"/utf8>>}, + description => #{en => <<"The flag which determines whether messages" + "can be cached on local disk when bridge is" + "disconnected">>, + zh => <<"当桥接断开时用于控制是否将消息缓存到本地磁" + "盘队列上"/utf8>>} + } + }). + +-define(ACTION_PARAM_RESOURCE, #{ + type => string, + required => true, + title => #{en => <<"Resource ID">>, zh => <<"资源 ID"/utf8>>}, + description => #{en => <<"Bind a resource to this action">>, + zh => <<"给动作绑定一个资源"/utf8>>} + }). + +-resource_type(#{ + name => ?RESOURCE_TYPE_MQTT, + create => on_resource_create, + status => on_get_resource_status, + destroy => on_resource_destroy, + params => ?RESOURCE_CONFIG_SPEC_MQTT, + title => #{en => <<"MQTT Bridge">>, zh => <<"MQTT Bridge"/utf8>>}, + description => #{en => <<"MQTT Message Bridge">>, zh => <<"MQTT 消息桥接"/utf8>>} + }). + + +-resource_type(#{ + name => ?RESOURCE_TYPE_RPC, + create => on_resource_create, + status => on_get_resource_status, + destroy => on_resource_destroy, + params => ?RESOURCE_CONFIG_SPEC_RPC, + title => #{en => <<"EMQX Bridge">>, zh => <<"EMQX Bridge"/utf8>>}, + description => #{en => <<"EMQ X RPC Bridge">>, zh => <<"EMQ X RPC 消息桥接"/utf8>>} + }). + +-rule_action(#{ + name => data_to_mqtt_broker, + category => data_forward, + for => 'message.publish', + types => [?RESOURCE_TYPE_MQTT, ?RESOURCE_TYPE_RPC], + create => on_action_create_data_to_mqtt_broker, + params => #{'$resource' => ?ACTION_PARAM_RESOURCE, + forward_topic => #{ + order => 1, + type => string, + required => false, + default => <<"">>, + title => #{en => <<"Forward Topic">>, + zh => <<"转发消息主题"/utf8>>}, + description => #{en => <<"The topic used when forwarding the message. Defaults to the topic of the bridge message if not provided.">>, + zh => <<"转发消息时使用的主题。如果未提供,则默认为桥接消息的主题。"/utf8>>} + }, + payload_tmpl => #{ + order => 2, + type => string, + input => textarea, + required => false, + default => <<"">>, + title => #{en => <<"Payload Template">>, + zh => <<"消息内容模板"/utf8>>}, + description => #{en => <<"The payload template, variable interpolation is supported. If using empty template (default), then the payload will be all the available vars in JSON format">>, + zh => <<"消息内容模板,支持变量。若使用空模板(默认),消息内容为 JSON 格式的所有字段"/utf8>>} + } + }, + title => #{en => <<"Data bridge to MQTT Broker">>, + zh => <<"桥接数据到 MQTT Broker"/utf8>>}, + description => #{en => <<"Bridge Data to MQTT Broker">>, + zh => <<"桥接数据到 MQTT Broker"/utf8>>} + }). + +on_resource_create(ResId, Params) -> + ?LOG(info, "Initiating Resource ~p, ResId: ~p", [?RESOURCE_TYPE_MQTT, ResId]), + {ok, _} = application:ensure_all_started(ecpool), + PoolName = pool_name(ResId), + Options = options(Params, PoolName, ResId), + start_resource(ResId, PoolName, Options), + case test_resource_status(PoolName) of + true -> ok; + false -> + on_resource_destroy(ResId, #{<<"pool">> => PoolName}), + error({{?RESOURCE_TYPE_MQTT, ResId}, connection_failed}) + end, + #{<<"pool">> => PoolName}. + +start_resource(ResId, PoolName, Options) -> + case ecpool:start_sup_pool(PoolName, ?MODULE, Options) of + {ok, _} -> + ?LOG(info, "Initiated Resource ~p Successfully, ResId: ~p", [?RESOURCE_TYPE_MQTT, ResId]); + {error, {already_started, _Pid}} -> + on_resource_destroy(ResId, #{<<"pool">> => PoolName}), + start_resource(ResId, PoolName, Options); + {error, Reason} -> + ?LOG(error, "Initiate Resource ~p failed, ResId: ~p, ~p", [?RESOURCE_TYPE_MQTT, ResId, Reason]), + on_resource_destroy(ResId, #{<<"pool">> => PoolName}), + error({{?RESOURCE_TYPE_MQTT, ResId}, create_failed}) + end. + +test_resource_status(PoolName) -> + IsConnected = fun(Worker) -> + case ecpool_worker:client(Worker) of + {ok, Bridge} -> + try emqx_bridge_worker:status(Bridge) of + connected -> true; + _ -> false + catch _Error:_Reason -> + false + end; + {error, _} -> + false + end + end, + Status = [IsConnected(Worker) || {_WorkerName, Worker} <- ecpool:workers(PoolName)], + lists:any(fun(St) -> St =:= true end, Status). + +-spec(on_get_resource_status(ResId::binary(), Params::map()) -> Status::map()). +on_get_resource_status(_ResId, #{<<"pool">> := PoolName}) -> + IsAlive = test_resource_status(PoolName), + #{is_alive => IsAlive}. + +on_resource_destroy(ResId, #{<<"pool">> := PoolName}) -> + ?LOG(info, "Destroying Resource ~p, ResId: ~p", [?RESOURCE_TYPE_MQTT, ResId]), + case ecpool:stop_sup_pool(PoolName) of + ok -> + ?LOG(info, "Destroyed Resource ~p Successfully, ResId: ~p", [?RESOURCE_TYPE_MQTT, ResId]); + {error, Reason} -> + ?LOG(error, "Destroy Resource ~p failed, ResId: ~p, ~p", [?RESOURCE_TYPE_MQTT, ResId, Reason]), + error({{?RESOURCE_TYPE_MQTT, ResId}, destroy_failed}) + end. + +on_action_create_data_to_mqtt_broker(ActId, Opts = #{<<"pool">> := PoolName, + <<"forward_topic">> := ForwardTopic, + <<"payload_tmpl">> := PayloadTmpl}) -> + ?LOG(info, "Initiating Action ~p.", [?FUNCTION_NAME]), + PayloadTks = emqx_rule_utils:preproc_tmpl(PayloadTmpl), + TopicTks = case ForwardTopic == <<"">> of + true -> undefined; + false -> emqx_rule_utils:preproc_tmpl(ForwardTopic) + end, + Opts. + +on_action_data_to_mqtt_broker(Msg, _Env = + #{id := Id, clientid := From, flags := Flags, + topic := Topic, timestamp := TimeStamp, qos := QoS, + ?BINDING_KEYS := #{ + 'ActId' := ActId, + 'PoolName' := PoolName, + 'TopicTks' := TopicTks, + 'PayloadTks' := PayloadTks + }}) -> + Topic1 = case TopicTks =:= undefined of + true -> Topic; + false -> emqx_rule_utils:proc_tmpl(TopicTks, Msg) + end, + BrokerMsg = #message{id = Id, + qos = QoS, + from = From, + flags = Flags, + topic = Topic1, + payload = format_data(PayloadTks, Msg), + timestamp = TimeStamp}, + ecpool:with_client(PoolName, + fun(BridgePid) -> + BridgePid ! {deliver, rule_engine, BrokerMsg} + end), + emqx_rule_metrics:inc_actions_success(ActId). + +format_data([], Msg) -> + emqx_json:encode(Msg); + +format_data(Tokens, Msg) -> + emqx_rule_utils:proc_tmpl(Tokens, Msg). + +tls_versions() -> + ['tlsv1.2','tlsv1.1', tlsv1]. + +ciphers(Ciphers) -> + string:tokens(str(Ciphers), ", "). + +subscriptions(Subscriptions) -> + scan_binary(<<"[", Subscriptions/binary, "].">>). + +is_node_addr(Addr0) -> + Addr = binary_to_list(Addr0), + case string:tokens(Addr, "@") of + [_NodeName, _Hostname] -> true; + _ -> false + end. + +scan_binary(Bin) -> + TermString = binary_to_list(Bin), + scan_string(TermString). + +scan_string(TermString) -> + {ok, Tokens, _} = erl_scan:string(TermString), + {ok, Term} = erl_parse:parse_term(Tokens), + Term. + +connect(Options) when is_list(Options) -> + connect(maps:from_list(Options)); +connect(Options = #{disk_cache := DiskCache, ecpool_worker_id := Id, pool_name := Pool}) -> + Options0 = case DiskCache of + true -> + DataDir = filename:join([emqx:get_env(data_dir), replayq, Pool, integer_to_list(Id)]), + QueueOption = #{replayq_dir => DataDir}, + Options#{queue => QueueOption}; + false -> + Options + end, + Options1 = case maps:is_key(append, Options0) of + false -> Options0; + true -> + case maps:get(append, Options0, false) of + true -> + ClientId = lists:concat([str(maps:get(clientid, Options0)), "_", str(emqx_guid:to_hexstr(emqx_guid:gen()))]), + Options0#{clientid => ClientId}; + false -> + Options0 + end + end, + Options2 = maps:without([ecpool_worker_id, pool_name, append], Options1), + emqx_bridge_worker:start_link(name(Pool, Id), Options2). +name(Pool, Id) -> + list_to_atom(atom_to_list(Pool) ++ ":" ++ integer_to_list(Id)). +pool_name(ResId) -> + list_to_atom("bridge_mqtt:" ++ str(ResId)). + +options(Options, PoolName, ResId) -> + GetD = fun(Key, Default) -> maps:get(Key, Options, Default) end, + Get = fun(Key) -> GetD(Key, undefined) end, + Address = Get(<<"address">>), + [{max_inflight_batches, 32}, + {forward_mountpoint, str(Get(<<"mountpoint">>))}, + {disk_cache, cuttlefish_flag:parse(str(GetD(<<"disk_cache">>, "off")))}, + {start_type, auto}, + {reconnect_delay_ms, cuttlefish_duration:parse(str(Get(<<"reconnect_interval">>)), ms)}, + {if_record_metrics, false}, + {pool_size, GetD(<<"pool_size">>, 1)}, + {pool_name, PoolName} + ] ++ case is_node_addr(Address) of + true -> + [{address, binary_to_atom(Get(<<"address">>), utf8)}, + {connect_module, emqx_bridge_rpc}, + {batch_size, Get(<<"batch_size">>)}]; + false -> + [{address, binary_to_list(Address)}, + {bridge_mode, GetD(<<"bridge_mode">>, true)}, + {clean_start, true}, + {clientid, str(Get(<<"clientid">>))}, + {append, Get(<<"append">>)}, + {connect_module, emqx_bridge_mqtt}, + {keepalive, cuttlefish_duration:parse(str(Get(<<"keepalive">>)), s)}, + {username, str(Get(<<"username">>))}, + {password, str(Get(<<"password">>))}, + {proto_ver, mqtt_ver(Get(<<"proto_ver">>))}, + {retry_interval, cuttlefish_duration:parse(str(GetD(<<"retry_interval">>, "30s")), s)} + ] ++ + case convert_key_name(<<"ssl">>, Options) of + true -> + [{ssl, true},{ssl_opts, [{versions, tls_versions()}, + {ciphers, ciphers(Get(<<"ciphers">>))}| + emqx_rule_actions_utils:get_ssl_opts(Options, ResId) + ]}]; + false -> + [] + end + end. + +convert_key_name(<<"ssl">>, Options) -> + SSL = maps:get(<<"ssl">>, Options, <<"off">>), + case is_binary(SSL) of + true -> cuttlefish_flag:parse(str(SSL)); + false -> SSL + end. + + +mqtt_ver(ProtoVer) -> + case ProtoVer of + <<"mqttv3">> -> v3; + <<"mqttv4">> -> v4; + <<"mqttv5">> -> v5; + _ -> v4 + end. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_app.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_app.erl new file mode 100644 index 000000000..2c0a0b9a9 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_app.erl @@ -0,0 +1,33 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_mqtt_app). + +-emqx_plugin(bridge). + +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + emqx_ctl:register_command(bridges, {emqx_bridge_mqtt_cli, cli}, []), + emqx_bridge_worker:register_metrics(), + emqx_bridge_mqtt_sup:start_link(). + +stop(_State) -> + emqx_ctl:unregister_command(bridges), + ok. + diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_cli.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_cli.erl new file mode 100644 index 000000000..1ee5a90c6 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_cli.erl @@ -0,0 +1,98 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_mqtt_cli). + +-include("emqx_bridge_mqtt.hrl"). + +-import(lists, [foreach/2]). + +-export([cli/1]). + +cli(["list"]) -> + foreach(fun({Name, State0}) -> + State = case State0 of + connected -> <<"Running">>; + _ -> <<"Stopped">> + end, + emqx_ctl:print("name: ~s status: ~s~n", [Name, State]) + end, emqx_bridge_mqtt_sup:bridges()); + +cli(["start", Name]) -> + emqx_ctl:print("~s.~n", [try emqx_bridge_worker:ensure_started(Name) of + ok -> <<"Start bridge successfully">>; + connected -> <<"Bridge already started">>; + _ -> <<"Start bridge failed">> + catch + _Error:_Reason -> + <<"Start bridge failed">> + end]); + +cli(["stop", Name]) -> + emqx_ctl:print("~s.~n", [try emqx_bridge_worker:ensure_stopped(Name) of + ok -> <<"Stop bridge successfully">>; + _ -> <<"Stop bridge failed">> + catch + _Error:_Reason -> + <<"Stop bridge failed">> + end]); + +cli(["forwards", Name]) -> + foreach(fun(Topic) -> + emqx_ctl:print("topic: ~s~n", [Topic]) + end, emqx_bridge_worker:get_forwards(Name)); + +cli(["add-forward", Name, Topic]) -> + case emqx_bridge_worker:ensure_forward_present(Name, iolist_to_binary(Topic)) of + ok -> emqx_ctl:print("Add-forward topic successfully.~n"); + {error, Reason} -> emqx_ctl:print("Add-forward failed reason: ~p.~n", [Reason]) + end; + +cli(["del-forward", Name, Topic]) -> + case emqx_bridge_worker:ensure_forward_absent(Name, iolist_to_binary(Topic)) of + ok -> emqx_ctl:print("Del-forward topic successfully.~n"); + {error, Reason} -> emqx_ctl:print("Del-forward failed reason: ~p.~n", [Reason]) + end; + +cli(["subscriptions", Name]) -> + foreach(fun({Topic, Qos}) -> + emqx_ctl:print("topic: ~s, qos: ~p~n", [Topic, Qos]) + end, emqx_bridge_worker:get_subscriptions(Name)); + +cli(["add-subscription", Name, Topic, Qos]) -> + case emqx_bridge_worker:ensure_subscription_present(Name, Topic, list_to_integer(Qos)) of + ok -> emqx_ctl:print("Add-subscription topic successfully.~n"); + {error, Reason} -> emqx_ctl:print("Add-subscription failed reason: ~p.~n", [Reason]) + end; + +cli(["del-subscription", Name, Topic]) -> + case emqx_bridge_worker:ensure_subscription_absent(Name, Topic) of + ok -> emqx_ctl:print("Del-subscription topic successfully.~n"); + {error, Reason} -> emqx_ctl:print("Del-subscription failed reason: ~p.~n", [Reason]) + end; + +cli(_) -> + emqx_ctl:usage([{"bridges list", "List bridges"}, + {"bridges start ", "Start a bridge"}, + {"bridges stop ", "Stop a bridge"}, + {"bridges forwards ", "Show a bridge forward topic"}, + {"bridges add-forward ", "Add bridge forward topic"}, + {"bridges del-forward ", "Delete bridge forward topic"}, + {"bridges subscriptions ", "Show a bridge subscriptions topic"}, + {"bridges add-subscription ", "Add bridge subscriptions topic"}, + {"bridges del-subscription ", "Delete bridge subscriptions topic"}]). + + diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_sup.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_sup.erl new file mode 100644 index 000000000..92d8e4083 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_mqtt_sup.erl @@ -0,0 +1,84 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_mqtt_sup). +-behaviour(supervisor). + +-include("emqx_bridge_mqtt.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[Bridge]"). + +%% APIs +-export([ start_link/0 + , start_link/1 + ]). + +-export([ create_bridge/2 + , drop_bridge/1 + , bridges/0 + , is_bridge_exist/1 + ]). + +%% supervisor callbacks +-export([init/1]). + +-define(SUP, ?MODULE). +-define(WORKER_SUP, emqx_bridge_worker_sup). + +start_link() -> start_link(?SUP). + +start_link(Name) -> + supervisor:start_link({local, Name}, ?MODULE, Name). + +init(?SUP) -> + BridgesConf = application:get_env(?APP, bridges, []), + BridgeSpec = lists:map(fun bridge_spec/1, BridgesConf), + SupFlag = #{strategy => one_for_one, + intensity => 100, + period => 10}, + {ok, {SupFlag, BridgeSpec}}. + +bridge_spec({Name, Config}) -> + #{id => Name, + start => {emqx_bridge_worker, start_link, [Name, Config]}, + restart => permanent, + shutdown => 5000, + type => worker, + modules => [emqx_bridge_worker]}. + +-spec(bridges() -> [{node(), map()}]). +bridges() -> + [{Name, emqx_bridge_worker:status(Pid)} || {Name, Pid, _, _} <- supervisor:which_children(?SUP)]. + +-spec(is_bridge_exist(atom() | pid()) -> boolean()). +is_bridge_exist(Id) -> + case supervisor:get_childspec(?SUP, Id) of + {ok, _ChildSpec} -> true; + {error, _Error} -> false + end. + +create_bridge(Id, Config) -> + supervisor:start_child(?SUP, bridge_spec({Id, Config})). + +drop_bridge(Id) -> + case supervisor:terminate_child(?SUP, Id) of + ok -> + supervisor:delete_child(?SUP, Id); + {error, Error} -> + ?LOG(error, "Delete bridge failed, error : ~p", [Error]), + {error, Error} + end. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_msg.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_msg.erl new file mode 100644 index 000000000..20600282e --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_msg.erl @@ -0,0 +1,98 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_msg). + +-export([ to_binary/1 + , from_binary/1 + , to_export/3 + , to_broker_msgs/1 + , to_broker_msg/1 + , to_broker_msg/2 + , estimate_size/1 + ]). + +-export_type([msg/0]). + +-include_lib("emqx/include/emqx.hrl"). + +-include_lib("emqx_bridge_mqtt/include/emqx_bridge_mqtt.hrl"). +-include_lib("emqtt/include/emqtt.hrl"). + + +-type msg() :: emqx_types:message(). +-type exp_msg() :: emqx_types:message() | #mqtt_msg{}. + +%% @doc Make export format: +%% 1. Mount topic to a prefix +%% 2. Fix QoS to 1 +%% @end +%% Shame that we have to know the callback module here +%% would be great if we can get rid of #mqtt_msg{} record +%% and use #message{} in all places. +-spec to_export(emqx_bridge_rpc | emqx_bridge_worker, + undefined | binary(), msg()) -> exp_msg(). +to_export(emqx_bridge_mqtt, Mountpoint, + #message{topic = Topic, + payload = Payload, + flags = Flags, + qos = QoS + }) -> + Retain = maps:get(retain, Flags, false), + #mqtt_msg{qos = QoS, + retain = Retain, + topic = topic(Mountpoint, Topic), + payload = Payload}; +to_export(_Module, Mountpoint, + #message{topic = Topic} = Msg) -> + Msg#message{topic = topic(Mountpoint, Topic)}. + +%% @doc Make `binary()' in order to make iodata to be persisted on disk. +-spec to_binary(msg()) -> binary(). +to_binary(Msg) -> term_to_binary(Msg). + +%% @doc Unmarshal binary into `msg()'. +-spec from_binary(binary()) -> msg(). +from_binary(Bin) -> binary_to_term(Bin). + +%% @doc Estimate the size of a message. +%% Count only the topic length + payload size +-spec estimate_size(msg()) -> integer(). +estimate_size(#message{topic = Topic, payload = Payload}) -> + size(Topic) + size(Payload). + +%% @doc By message/batch receiver, transform received batch into +%% messages to deliver to local brokers. +to_broker_msgs(Batch) -> lists:map(fun to_broker_msg/1, Batch). + +to_broker_msg(#message{} = Msg) -> + %% internal format from another EMQX node via rpc + Msg; +to_broker_msg(Msg) -> + to_broker_msg(Msg, undefined). +to_broker_msg(#{qos := QoS, dup := Dup, retain := Retain, topic := Topic, + properties := Props, payload := Payload}, Mountpoint) -> + %% published from remote node over a MQTT connection + set_headers(Props, + emqx_message:set_flags(#{dup => Dup, retain => Retain}, + emqx_message:make(bridge, QoS, topic(Mountpoint, Topic), Payload))). + +set_headers(undefined, Msg) -> + Msg; +set_headers(Val, Msg) -> + emqx_message:set_headers(Val, Msg). +topic(undefined, Topic) -> Topic; +topic(Prefix, Topic) -> emqx_topic:prepend(Prefix, Topic). diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_rpc.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_rpc.erl new file mode 100644 index 000000000..92ef0c60a --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_rpc.erl @@ -0,0 +1,99 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +%% @doc This module implements EMQX Bridge transport layer based on gen_rpc. + +-module(emqx_bridge_rpc). + +-behaviour(emqx_bridge_connect). + +%% behaviour callbacks +-export([ start/1 + , send/2 + , stop/1 + ]). + +%% Internal exports +-export([ handle_send/1 + , heartbeat/2 + ]). + +-type ack_ref() :: emqx_bridge_worker:ack_ref(). +-type batch() :: emqx_bridge_worker:batch(). + +-define(HEARTBEAT_INTERVAL, timer:seconds(1)). + +-define(RPC, emqx_rpc). + +start(#{address := Remote}) -> + case poke(Remote) of + ok -> + Pid = proc_lib:spawn_link(?MODULE, heartbeat, [self(), Remote]), + {ok, #{client_pid => Pid, address => Remote}}; + Error -> + Error + end. + +stop(#{client_pid := Pid}) when is_pid(Pid) -> + Ref = erlang:monitor(process, Pid), + unlink(Pid), + Pid ! stop, + receive + {'DOWN', Ref, process, Pid, _Reason} -> + ok + after + 1000 -> + exit(Pid, kill) + end, + ok. + +%% @doc Callback for `emqx_bridge_connect' behaviour +-spec send(node(), batch()) -> {ok, ack_ref()} | {error, any()}. +send(#{address := Remote}, Batch) -> + case ?RPC:call(Remote, ?MODULE, handle_send, [Batch]) of + ok -> + Ref = make_ref(), + self() ! {batch_ack, Ref}, + {ok, Ref}; + {badrpc, Reason} -> {error, Reason} + end. + +%% @doc Handle send on receiver side. +-spec handle_send(batch()) -> ok. +handle_send(Batch) -> + lists:foreach(fun(Msg) -> emqx_broker:publish(Msg) end, Batch). + +%% @hidden Heartbeat loop +heartbeat(Parent, RemoteNode) -> + Interval = ?HEARTBEAT_INTERVAL, + receive + stop -> exit(normal) + after + Interval -> + case poke(RemoteNode) of + ok -> + ?MODULE:heartbeat(Parent, RemoteNode); + {error, Reason} -> + Parent ! {disconnected, self(), Reason}, + exit(normal) + end + end. + +poke(Node) -> + case ?RPC:call(Node, erlang, node, []) of + Node -> ok; + {badrpc, Reason} -> {error, Reason} + end. diff --git a/apps/emqx_bridge_mqtt/src/emqx_bridge_worker.erl b/apps/emqx_bridge_mqtt/src/emqx_bridge_worker.erl new file mode 100644 index 000000000..b8e57c4a6 --- /dev/null +++ b/apps/emqx_bridge_mqtt/src/emqx_bridge_worker.erl @@ -0,0 +1,602 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +%% @doc Bridge works in two layers (1) batching layer (2) transport layer +%% The `bridge' batching layer collects local messages in batches and sends over +%% to remote MQTT node/cluster via `connection' transport layer. +%% In case `REMOTE' is also an EMQX node, `connection' is recommended to be +%% the `gen_rpc' based implementation `emqx_bridge_rpc'. Otherwise `connection' +%% has to be `emqx_bridge_mqtt'. +%% +%% ``` +%% +------+ +--------+ +%% | EMQX | | REMOTE | +%% | | | | +%% | (bridge) <==(connection)==> | | +%% | | | | +%% | | | | +%% +------+ +--------+ +%% ''' +%% +%% +%% This module implements 2 kinds of APIs with regards to batching and +%% messaging protocol. (1) A `gen_statem' based local batch collector; +%% (2) APIs for incoming remote batches/messages. +%% +%% Batch collector state diagram +%% +%% [idle] --(0) --> [connecting] --(2)--> [connected] +%% | ^ | +%% | | | +%% '--(1)---'--------(3)------' +%% +%% (0): auto or manual start +%% (1): retry timeout +%% (2): successfuly connected to remote node/cluster +%% (3): received {disconnected, Reason} OR +%% failed to send to remote node/cluster. +%% +%% NOTE: A bridge worker may subscribe to multiple (including wildcard) +%% local topics, and the underlying `emqx_bridge_connect' may subscribe to +%% multiple remote topics, however, worker/connections are not designed +%% to support automatic load-balancing, i.e. in case it can not keep up +%% with the amount of messages comming in, administrator should split and +%% balance topics between worker/connections manually. +%% +%% NOTES: +%% * Local messages are all normalised to QoS-1 when exporting to remote + +-module(emqx_bridge_worker). +-behaviour(gen_statem). + +%% APIs +-export([ start_link/1 + , start_link/2 + , register_metrics/0 + , stop/1 + ]). + +%% gen_statem callbacks +-export([ terminate/3 + , code_change/4 + , init/1 + , callback_mode/0 + ]). + +%% state functions +-export([ idle/3 + , connected/3 + ]). + +%% management APIs +-export([ ensure_started/1 + , ensure_stopped/1 + , ensure_stopped/2 + , status/1 + ]). + +-export([ get_forwards/1 + , ensure_forward_present/2 + , ensure_forward_absent/2 + ]). + +-export([ get_subscriptions/1 + , ensure_subscription_present/3 + , ensure_subscription_absent/2 + ]). + +%% Internal +-export([msg_marshaller/1]). + +-export_type([ config/0 + , batch/0 + , ack_ref/0 + ]). + +-type id() :: atom() | string() | pid(). +-type qos() :: emqx_mqtt_types:qos(). +-type config() :: map(). +-type batch() :: [emqx_bridge_msg:exp_msg()]. +-type ack_ref() :: term(). +-type topic() :: emqx_topic:topic(). + +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). + +-logger_header("[Bridge]"). + +%% same as default in-flight limit for emqtt +-define(DEFAULT_BATCH_SIZE, 32). +-define(DEFAULT_RECONNECT_DELAY_MS, timer:seconds(5)). +-define(DEFAULT_SEG_BYTES, (1 bsl 20)). +-define(DEFAULT_MAX_TOTAL_SIZE, (1 bsl 31)). +-define(NO_BRIDGE_HANDLER, undefined). + +%% @doc Start a bridge worker. Supported configs: +%% start_type: 'manual' (default) or 'auto', when manual, bridge will stay +%% at 'idle' state until a manual call to start it. +%% connect_module: The module which implements emqx_bridge_connect behaviour +%% and work as message batch transport layer +%% reconnect_delay_ms: Delay in milli-seconds for the bridge worker to retry +%% in case of transportation failure. +%% max_inflight: Max number of batches allowed to send-ahead before +%% receiving confirmation from remote node/cluster +%% mountpoint: The topic mount point for messages sent to remote node/cluster +%% `undefined', `<<>>' or `""' to disable +%% forwards: Local topics to subscribe. +%% queue.batch_bytes_limit: Max number of bytes to collect in a batch for each +%% send call towards emqx_bridge_connect +%% queue.batch_count_limit: Max number of messages to collect in a batch for +%% each send call towards emqx_bridge_connect +%% queue.replayq_dir: Directory where replayq should persist messages +%% queue.replayq_seg_bytes: Size in bytes for each replayq segment file +%% +%% Find more connection specific configs in the callback modules +%% of emqx_bridge_connect behaviour. +start_link(Config) when is_list(Config) -> + start_link(maps:from_list(Config)); +start_link(Config) -> + gen_statem:start_link(?MODULE, Config, []). + +start_link(Name, Config) when is_list(Config) -> + start_link(Name, maps:from_list(Config)); +start_link(Name, Config) -> + Name1 = name(Name), + gen_statem:start_link({local, Name1}, ?MODULE, Config#{name => Name1}, []). + +ensure_started(Name) -> + gen_statem:call(name(Name), ensure_started). + +%% @doc Manually stop bridge worker. State idempotency ensured. +ensure_stopped(Id) -> + ensure_stopped(Id, 1000). + +ensure_stopped(Id, Timeout) -> + Pid = case id(Id) of + P when is_pid(P) -> P; + N -> whereis(N) + end, + case Pid of + undefined -> + ok; + _ -> + MRef = monitor(process, Pid), + unlink(Pid), + _ = gen_statem:call(id(Id), ensure_stopped, Timeout), + receive + {'DOWN', MRef, _, _, _} -> + ok + after + Timeout -> + exit(Pid, kill) + end + end. + +stop(Pid) -> gen_statem:stop(Pid). + +status(Pid) when is_pid(Pid) -> + gen_statem:call(Pid, status); +status(Id) -> + gen_statem:call(name(Id), status). + +%% @doc Return all forwards (local subscriptions). +-spec get_forwards(id()) -> [topic()]. +get_forwards(Id) -> gen_statem:call(id(Id), get_forwards, timer:seconds(1000)). + +%% @doc Return all subscriptions (subscription over mqtt connection to remote broker). +-spec get_subscriptions(id()) -> [{emqx_topic:topic(), qos()}]. +get_subscriptions(Id) -> gen_statem:call(id(Id), get_subscriptions). + +%% @doc Add a new forward (local topic subscription). +-spec ensure_forward_present(id(), topic()) -> ok. +ensure_forward_present(Id, Topic) -> + gen_statem:call(id(Id), {ensure_present, forwards, topic(Topic)}). + +%% @doc Ensure a forward topic is deleted. +-spec ensure_forward_absent(id(), topic()) -> ok. +ensure_forward_absent(Id, Topic) -> + gen_statem:call(id(Id), {ensure_absent, forwards, topic(Topic)}). + +%% @doc Ensure subscribed to remote topic. +%% NOTE: only applicable when connection module is emqx_bridge_mqtt +%% return `{error, no_remote_subscription_support}' otherwise. +-spec ensure_subscription_present(id(), topic(), qos()) -> ok | {error, any()}. +ensure_subscription_present(Id, Topic, QoS) -> + gen_statem:call(id(Id), {ensure_present, subscriptions, {topic(Topic), QoS}}). + +%% @doc Ensure unsubscribed from remote topic. +%% NOTE: only applicable when connection module is emqx_bridge_mqtt +-spec ensure_subscription_absent(id(), topic()) -> ok. +ensure_subscription_absent(Id, Topic) -> + gen_statem:call(id(Id), {ensure_absent, subscriptions, topic(Topic)}). + +callback_mode() -> [state_functions]. + +%% @doc Config should be a map(). +init(Config) -> + erlang:process_flag(trap_exit, true), + ConnectModule = maps:get(connect_module, Config), + Subscriptions = maps:get(subscriptions, Config, []), + Forwards = maps:get(forwards, Config, []), + Queue = open_replayq(Config), + State = init_opts(Config), + Topics = [iolist_to_binary(T) || T <- Forwards], + Subs = check_subscriptions(Subscriptions), + ConnectCfg = get_conn_cfg(Config), + self() ! idle, + {ok, idle, State#{connect_module => ConnectModule, + connect_cfg => ConnectCfg, + forwards => Topics, + subscriptions => Subs, + replayq => Queue + }}. + +init_opts(Config) -> + IfRecordMetrics = maps:get(if_record_metrics, Config, true), + ReconnDelayMs = maps:get(reconnect_delay_ms, Config, ?DEFAULT_RECONNECT_DELAY_MS), + StartType = maps:get(start_type, Config, manual), + BridgeHandler = maps:get(bridge_handler, Config, ?NO_BRIDGE_HANDLER), + Mountpoint = maps:get(forward_mountpoint, Config, undefined), + ReceiveMountpoint = maps:get(receive_mountpoint, Config, undefined), + MaxInflightSize = maps:get(max_inflight, Config, ?DEFAULT_BATCH_SIZE), + BatchSize = maps:get(batch_size, Config, ?DEFAULT_BATCH_SIZE), + Name = maps:get(name, Config, undefined), + #{start_type => StartType, + reconnect_delay_ms => ReconnDelayMs, + batch_size => BatchSize, + mountpoint => format_mountpoint(Mountpoint), + receive_mountpoint => ReceiveMountpoint, + inflight => [], + max_inflight => MaxInflightSize, + connection => undefined, + bridge_handler => BridgeHandler, + if_record_metrics => IfRecordMetrics, + name => Name}. + +open_replayq(Config) -> + QCfg = maps:get(queue, Config, #{}), + Dir = maps:get(replayq_dir, QCfg, undefined), + SegBytes = maps:get(replayq_seg_bytes, QCfg, ?DEFAULT_SEG_BYTES), + MaxTotalSize = maps:get(max_total_size, QCfg, ?DEFAULT_MAX_TOTAL_SIZE), + QueueConfig = case Dir =:= undefined orelse Dir =:= "" of + true -> #{mem_only => true}; + false -> #{dir => Dir, seg_bytes => SegBytes, max_total_size => MaxTotalSize} + end, + replayq:open(QueueConfig#{sizer => fun emqx_bridge_msg:estimate_size/1, + marshaller => fun ?MODULE:msg_marshaller/1}). + +check_subscriptions(Subscriptions) -> + lists:map(fun({Topic, QoS}) -> + Topic1 = iolist_to_binary(Topic), + true = emqx_topic:validate({filter, Topic1}), + {Topic1, QoS} + end, Subscriptions). + +get_conn_cfg(Config) -> + maps:without([connect_module, + queue, + reconnect_delay_ms, + forwards, + mountpoint, + name + ], Config). + +code_change(_Vsn, State, Data, _Extra) -> + {ok, State, Data}. + +terminate(_Reason, _StateName, #{replayq := Q} = State) -> + _ = disconnect(State), + _ = replayq:close(Q), + ok. + +%% ensure_started will be deprecated in the future +idle({call, From}, ensure_started, State) -> + case do_connect(State) of + {ok, State1} -> + {next_state, connected, State1, [{reply, From, ok}, {state_timeout, 0, connected}]}; + {error, Reason} -> + {keep_state_and_data, [{reply, From, {error, Reason}}]} + end; +%% @doc Standing by for manual start. +idle(info, idle, #{start_type := manual}) -> + keep_state_and_data; +%% @doc Standing by for auto start. +idle(info, idle, #{start_type := auto} = State) -> + connecting(State); +idle(state_timeout, reconnect, State) -> + connecting(State); + +idle(info, {batch_ack, Ref}, State) -> + case do_ack(State, Ref) of + {ok, NewState} -> + {keep_state, NewState}; + _ -> + keep_state_and_data + end; + +idle(Type, Content, State) -> + common(idle, Type, Content, State). + +connecting(#{reconnect_delay_ms := ReconnectDelayMs} = State) -> + case do_connect(State) of + {ok, State1} -> + {next_state, connected, State1, {state_timeout, 0, connected}}; + _ -> + {keep_state_and_data, {state_timeout, ReconnectDelayMs, reconnect}} + end. + +connected(state_timeout, connected, #{inflight := Inflight} = State) -> + case retry_inflight(State, Inflight) of + {ok, NewState} -> + {keep_state, NewState, {next_event, internal, maybe_send}}; + {error, NewState} -> + {keep_state, NewState} + end; +connected(internal, maybe_send, State) -> + {_, NewState} = pop_and_send(State), + {keep_state, NewState}; + +connected(info, {disconnected, Conn, Reason}, + #{connection := Connection, name := Name, reconnect_delay_ms := ReconnectDelayMs} = State) -> + case Conn =:= maps:get(client_pid, Connection, undefined) of + true -> + ?LOG(info, "Bridge ~p diconnected~nreason=~p", [Name, Reason]), + {next_state, idle, State#{connection => undefined}, {state_timeout, ReconnectDelayMs, reconnect}}; + false -> + keep_state_and_data + end; +connected(info, {batch_ack, Ref}, State) -> + case do_ack(State, Ref) of + {ok, NewState} -> + {keep_state, NewState, {next_event, internal, maybe_send}}; + _ -> + keep_state_and_data + end; +connected(Type, Content, State) -> + common(connected, Type, Content, State). + +%% Common handlers +common(StateName, {call, From}, status, _State) -> + {keep_state_and_data, [{reply, From, StateName}]}; +common(_StateName, {call, From}, ensure_started, _State) -> + {keep_state_and_data, [{reply, From, connected}]}; +common(_StateName, {call, From}, ensure_stopped, _State) -> + {stop_and_reply, {shutdown, manual}, [{reply, From, ok}]}; +common(_StateName, {call, From}, get_forwards, #{forwards := Forwards}) -> + {keep_state_and_data, [{reply, From, Forwards}]}; +common(_StateName, {call, From}, get_subscriptions, #{subscriptions := Subs}) -> + {keep_state_and_data, [{reply, From, Subs}]}; +common(_StateName, {call, From}, {ensure_present, What, Topic}, State) -> + {Result, NewState} = ensure_present(What, Topic, State), + {keep_state, NewState, [{reply, From, Result}]}; +common(_StateName, {call, From}, {ensure_absent, What, Topic}, State) -> + {Result, NewState} = ensure_absent(What, Topic, State), + {keep_state, NewState, [{reply, From, Result}]}; +common(_StateName, info, {deliver, _, Msg}, #{replayq := Q, if_record_metrics := IfRecordMetric} = State) -> + Msgs = collect([Msg]), + bridges_metrics_inc(IfRecordMetric, 'bridge.mqtt.message_received', length(Msgs)), + NewQ = replayq:append(Q, Msgs), + {keep_state, State#{replayq => NewQ}, {next_event, internal, maybe_send}}; +common(_StateName, info, {'EXIT', _, _}, State) -> + {keep_state, State}; +common(StateName, Type, Content, #{name := Name} = State) -> + ?LOG(notice, "Bridge ~p discarded ~p type event at state ~p:~p", + [Name, Type, StateName, Content]), + {keep_state, State}. + +eval_bridge_handler(State = #{bridge_handler := ?NO_BRIDGE_HANDLER}, _Msg) -> + State; +eval_bridge_handler(State = #{bridge_handler := Handler}, Msg) -> + Handler(Msg), + State. + +ensure_present(Key, Topic, State) -> + Topics = maps:get(Key, State), + case is_topic_present(Topic, Topics) of + true -> + {ok, State}; + false -> + R = do_ensure_present(Key, Topic, State), + {R, State#{Key := lists:usort([Topic | Topics])}} + end. + +ensure_absent(Key, Topic, State) -> + Topics = maps:get(Key, State), + case is_topic_present(Topic, Topics) of + true -> + R = do_ensure_absent(Key, Topic, State), + {R, State#{Key := ensure_topic_absent(Topic, Topics)}}; + false -> + {ok, State} + end. + +ensure_topic_absent(_Topic, []) -> []; +ensure_topic_absent(Topic, [{_, _} | _] = L) -> lists:keydelete(Topic, 1, L); +ensure_topic_absent(Topic, L) -> lists:delete(Topic, L). + +is_topic_present({Topic, _QoS}, Topics) -> + is_topic_present(Topic, Topics); +is_topic_present(Topic, Topics) -> + lists:member(Topic, Topics) orelse false =/= lists:keyfind(Topic, 1, Topics). + +do_connect(#{forwards := Forwards, + subscriptions := Subs, + connect_module := ConnectModule, + connect_cfg := ConnectCfg, + name := Name} = State) -> + ok = subscribe_local_topics(Forwards, Name), + case emqx_bridge_connect:start(ConnectModule, ConnectCfg#{subscriptions => Subs}) of + {ok, Conn} -> + ?LOG(info, "Bridge ~p is connecting......", [Name]), + {ok, eval_bridge_handler(State#{connection => Conn}, connected)}; + {error, Reason} -> + {error, Reason, State} + end. + +do_ensure_present(forwards, Topic, #{name := Name}) -> + subscribe_local_topic(Topic, Name); +do_ensure_present(subscriptions, _Topic, #{connection := undefined}) -> + {error, no_connection}; +do_ensure_present(subscriptions, _Topic, #{connect_module := emqx_bridge_rpc}) -> + {error, no_remote_subscription_support}; +do_ensure_present(subscriptions, {Topic, QoS}, #{connect_module := ConnectModule, + connection := Conn}) -> + ConnectModule:ensure_subscribed(Conn, Topic, QoS). + +do_ensure_absent(forwards, Topic, _) -> + do_unsubscribe(Topic); +do_ensure_absent(subscriptions, _Topic, #{connection := undefined}) -> + {error, no_connection}; +do_ensure_absent(subscriptions, _Topic, #{connect_module := emqx_bridge_rpc}) -> + {error, no_remote_subscription_support}; +do_ensure_absent(subscriptions, Topic, #{connect_module := ConnectModule, + connection := Conn}) -> + ConnectModule:ensure_unsubscribed(Conn, Topic). + +collect(Acc) -> + receive + {deliver, _, Msg} -> + collect([Msg | Acc]) + after + 0 -> + lists:reverse(Acc) + end. + +%% Retry all inflight (previously sent but not acked) batches. +retry_inflight(State, []) -> {ok, State}; +retry_inflight(State, [#{q_ack_ref := QAckRef, batch := Batch} | Inflight]) -> + case do_send(State#{inflight := Inflight}, QAckRef, Batch) of + {ok, State1} -> retry_inflight(State1, Inflight); + {error, State1} -> {error, State1} + end. + +pop_and_send(#{inflight := Inflight, max_inflight := Max } = State) when length(Inflight) >= Max -> + {ok, State}; +pop_and_send(#{replayq := Q, connect_module := Module} = State) -> + case replayq:is_empty(Q) of + true -> + {ok, State}; + false -> + BatchSize = case Module of + emqx_bridge_rpc -> maps:get(batch_size, State); + _ -> 1 + end, + Opts = #{count_limit => BatchSize, bytes_limit => 999999999}, + {Q1, QAckRef, Batch} = replayq:pop(Q, Opts), + do_send(State#{replayq := Q1}, QAckRef, Batch) + end. + +%% Assert non-empty batch because we have a is_empty check earlier. +do_send(#{inflight := Inflight, + connect_module := Module, + connection := Connection, + mountpoint := Mountpoint, + if_record_metrics := IfRecordMetrics} = State, QAckRef, Batch) -> + ExportMsg = fun(Message) -> + bridges_metrics_inc(IfRecordMetrics, 'bridge.mqtt.message_sent'), + emqx_bridge_msg:to_export(Module, Mountpoint, Message) + end, + case Module:send(Connection, [ExportMsg(M) || M <- Batch]) of + {ok, Ref} -> + {ok, State#{inflight := Inflight ++ [#{q_ack_ref => QAckRef, + send_ack_ref => Ref, + batch => Batch}]}}; + {error, Reason} -> + ?LOG(info, "Batch produce failed~p", [Reason]), + {error, State} + end. + + +do_ack(#{inflight := []} = State, Ref) -> + ?LOG(error, "Can't be found from the inflight:~p", [Ref]), + {ok, State}; + +do_ack(#{inflight := [#{send_ack_ref := Ref, + q_ack_ref := QAckRef}| Rest], replayq := Q} = State, Ref) -> + ok = replayq:ack(Q, QAckRef), + {ok, State#{inflight => Rest}}; + +do_ack(#{inflight := [#{q_ack_ref := QAckRef, + batch := Batch}| Rest], replayq := Q} = State, Ref) -> + ok = replayq:ack(Q, QAckRef), + NewQ = replayq:append(Q, Batch), + do_ack(State#{replayq => NewQ, inflight => Rest}, Ref). + +subscribe_local_topics(Topics, Name) -> + lists:foreach(fun(Topic) -> subscribe_local_topic(Topic, Name) end, Topics). + +subscribe_local_topic(Topic, Name) -> + do_subscribe(Topic, Name). + +topic(T) -> iolist_to_binary(T). + +validate(RawTopic) -> + Topic = topic(RawTopic), + try emqx_topic:validate(Topic) of + _Success -> Topic + catch + error:Reason -> + error({bad_topic, Topic, Reason}) + end. + +do_subscribe(RawTopic, Name) -> + TopicFilter = validate(RawTopic), + {Topic, SubOpts} = emqx_topic:parse(TopicFilter, #{qos => ?QOS_1}), + emqx_broker:subscribe(Topic, Name, SubOpts). + +do_unsubscribe(RawTopic) -> + TopicFilter = validate(RawTopic), + {Topic, _SubOpts} = emqx_topic:parse(TopicFilter), + emqx_broker:unsubscribe(Topic). + +disconnect(#{connection := Conn, + connect_module := Module + } = State) when Conn =/= undefined -> + Module:stop(Conn), + State0 = State#{connection => undefined}, + eval_bridge_handler(State0, disconnected); +disconnect(State) -> + eval_bridge_handler(State, disconnected). + +%% Called only when replayq needs to dump it to disk. +msg_marshaller(Bin) when is_binary(Bin) -> emqx_bridge_msg:from_binary(Bin); +msg_marshaller(Msg) -> emqx_bridge_msg:to_binary(Msg). + +format_mountpoint(undefined) -> + undefined; +format_mountpoint(Prefix) -> + binary:replace(iolist_to_binary(Prefix), <<"${node}">>, atom_to_binary(node(), utf8)). + +name(Id) -> list_to_atom(lists:concat([?MODULE, "_", Id])). + +id(Pid) when is_pid(Pid) -> Pid; +id(Name) -> name(Name). + +register_metrics() -> + lists:foreach(fun emqx_metrics:ensure/1, + ['bridge.mqtt.message_sent', + 'bridge.mqtt.message_received' + ]). + +bridges_metrics_inc(true, Metric) -> + emqx_metrics:inc(Metric); +bridges_metrics_inc(_IsRecordMetric, _Metric) -> + ok. + +bridges_metrics_inc(true, Metric, Value) -> + emqx_metrics:inc(Metric, Value); +bridges_metrics_inc(_IsRecordMetric, _Metric, _Value) -> + ok. diff --git a/apps/emqx_bridge_mqtt/test/emqx_bridge_mqtt_tests.erl b/apps/emqx_bridge_mqtt/test/emqx_bridge_mqtt_tests.erl new file mode 100644 index 000000000..392fa8e17 --- /dev/null +++ b/apps/emqx_bridge_mqtt/test/emqx_bridge_mqtt_tests.erl @@ -0,0 +1,47 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_mqtt_tests). + +-include_lib("eunit/include/eunit.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). + +send_and_ack_test() -> + %% delegate from gen_rpc to rpc for unit test + meck:new(emqtt, [passthrough, no_history]), + meck:expect(emqtt, start_link, 1, + fun(_) -> + {ok, spawn_link(fun() -> ok end)} + end), + meck:expect(emqtt, connect, 1, {ok, dummy}), + meck:expect(emqtt, stop, 1, + fun(Pid) -> Pid ! stop end), + meck:expect(emqtt, publish, 2, + fun(Client, Msg) -> + Client ! {publish, Msg}, + {ok, Msg} %% as packet id + end), + try + Max = 1, + Batch = lists:seq(1, Max), + {ok, Conn} = emqx_bridge_mqtt:start(#{address => "127.0.0.1:1883"}), + % %% return last packet id as batch reference + {ok, _AckRef} = emqx_bridge_mqtt:send(Conn, Batch), + + ok = emqx_bridge_mqtt:stop(Conn) + after + meck:unload(emqtt) + end. \ No newline at end of file diff --git a/apps/emqx_bridge_mqtt/test/emqx_bridge_rpc_tests.erl b/apps/emqx_bridge_mqtt/test/emqx_bridge_rpc_tests.erl new file mode 100644 index 000000000..f79d12dfb --- /dev/null +++ b/apps/emqx_bridge_mqtt/test/emqx_bridge_rpc_tests.erl @@ -0,0 +1,42 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_rpc_tests). +-include_lib("eunit/include/eunit.hrl"). + +send_and_ack_test() -> + %% delegate from emqx_rpc to rpc for unit test + meck:new(emqx_rpc, [passthrough, no_history]), + meck:expect(emqx_rpc, call, 4, + fun(Node, Module, Fun, Args) -> + rpc:call(Node, Module, Fun, Args) + end), + meck:expect(emqx_rpc, cast, 4, + fun(Node, Module, Fun, Args) -> + rpc:cast(Node, Module, Fun, Args) + end), + meck:new(emqx_bridge_worker, [passthrough, no_history]), + try + {ok, #{client_pid := Pid, address := Node}} = emqx_bridge_rpc:start(#{address => node()}), + {ok, Ref} = emqx_bridge_rpc:send(#{address => Node}, []), + receive + {batch_ack, Ref} -> + ok + end, + ok = emqx_bridge_rpc:stop( #{client_pid => Pid}) + after + meck:unload(emqx_rpc) + end. diff --git a/apps/emqx_bridge_mqtt/test/emqx_bridge_worker_SUITE.erl b/apps/emqx_bridge_mqtt/test/emqx_bridge_worker_SUITE.erl new file mode 100644 index 000000000..7cbf0987c --- /dev/null +++ b/apps/emqx_bridge_mqtt/test/emqx_bridge_worker_SUITE.erl @@ -0,0 +1,176 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_worker_SUITE). + +-export([ all/0 + , init_per_suite/1 + , end_per_suite/1]). +-export([ t_rpc/1 + , t_mqtt/1 + , t_mngr/1]). + +-include_lib("eunit/include/eunit.hrl"). +-include_lib("common_test/include/ct.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). +-include_lib("emqx/include/emqx.hrl"). + +-define(wait(For, Timeout), emqx_ct_helpers:wait_for(?FUNCTION_NAME, ?LINE, fun() -> For end, Timeout)). + +receive_messages(Count) -> + receive_messages(Count, []). + +receive_messages(0, Msgs) -> + Msgs; +receive_messages(Count, Msgs) -> + receive + {publish, Msg} -> + receive_messages(Count-1, [Msg|Msgs]); + _Other -> + receive_messages(Count, Msgs) + after 1000 -> + Msgs + end. + +all() -> [ t_rpc + , t_mqtt + , t_mngr + ]. + +init_per_suite(Config) -> + case node() of + nonode@nohost -> net_kernel:start(['emqx@127.0.0.1', longnames]); + _ -> ok + end, + ok = application:set_env(gen_rpc, tcp_client_num, 1), + emqx_ct_helpers:start_apps([emqx_bridge_mqtt]), + emqx_logger:set_log_level(error), + [{log_level, error} | Config]. + +end_per_suite(_Config) -> + emqx_ct_helpers:stop_apps([emqx_bridge_mqtt]). + +t_mngr(Config) when is_list(Config) -> + Subs = [{<<"a">>, 1}, {<<"b">>, 2}], + Cfg = #{address => node(), + forwards => [<<"mngr">>], + connect_module => emqx_bridge_rpc, + mountpoint => <<"forwarded">>, + subscriptions => Subs, + start_type => auto}, + Name = ?FUNCTION_NAME, + {ok, Pid} = emqx_bridge_worker:start_link(Name, Cfg), + try + ?assertEqual([<<"mngr">>], emqx_bridge_worker:get_forwards(Name)), + ?assertEqual(ok, emqx_bridge_worker:ensure_forward_present(Name, "mngr")), + ?assertEqual(ok, emqx_bridge_worker:ensure_forward_present(Name, "mngr2")), + ?assertEqual([<<"mngr">>, <<"mngr2">>], emqx_bridge_worker:get_forwards(Pid)), + ?assertEqual(ok, emqx_bridge_worker:ensure_forward_absent(Name, "mngr2")), + ?assertEqual(ok, emqx_bridge_worker:ensure_forward_absent(Name, "mngr3")), + ?assertEqual([<<"mngr">>], emqx_bridge_worker:get_forwards(Pid)), + ?assertEqual({error, no_remote_subscription_support}, + emqx_bridge_worker:ensure_subscription_present(Pid, <<"t">>, 0)), + ?assertEqual({error, no_remote_subscription_support}, + emqx_bridge_worker:ensure_subscription_absent(Pid, <<"t">>)), + ?assertEqual(Subs, emqx_bridge_worker:get_subscriptions(Pid)) + after + ok = emqx_bridge_worker:stop(Pid) + end. + +%% A loopback RPC to local node +t_rpc(Config) when is_list(Config) -> + Cfg = #{address => node(), + forwards => [<<"t_rpc/#">>], + connect_module => emqx_bridge_rpc, + forward_mountpoint => <<"forwarded">>, + start_type => auto}, + {ok, Pid} = emqx_bridge_worker:start_link(?FUNCTION_NAME, Cfg), + ClientId = <<"ClientId">>, + try + {ok, ConnPid} = emqtt:start_link([{clientid, ClientId}]), + {ok, _Props} = emqtt:connect(ConnPid), + {ok, _Props, [1]} = emqtt:subscribe(ConnPid, {<<"forwarded/t_rpc/one">>, ?QOS_1}), + timer:sleep(100), + {ok, _PacketId} = emqtt:publish(ConnPid, <<"t_rpc/one">>, <<"hello">>, ?QOS_1), + timer:sleep(100), + ?assertEqual(1, length(receive_messages(1))), + emqtt:disconnect(ConnPid) + after + ok = emqx_bridge_worker:stop(Pid) + end. + +%% Full data loopback flow explained: +%% mqtt-client ----> local-broker ---(local-subscription)---> +%% bridge(export) --- (mqtt-connection)--> local-broker ---(remote-subscription) --> +%% bridge(import) --> mqtt-client +t_mqtt(Config) when is_list(Config) -> + SendToTopic = <<"t_mqtt/one">>, + SendToTopic2 = <<"t_mqtt/two">>, + SendToTopic3 = <<"t_mqtt/three">>, + Mountpoint = <<"forwarded/${node}/">>, + Cfg = #{address => "127.0.0.1:1883", + forwards => [SendToTopic], + connect_module => emqx_bridge_mqtt, + forward_mountpoint => Mountpoint, + username => "user", + clean_start => true, + clientid => "bridge_aws", + keepalive => 60000, + password => "passwd", + proto_ver => mqttv4, + queue => #{replayq_dir => "data/t_mqtt/", + replayq_seg_bytes => 10000, + batch_bytes_limit => 1000, + batch_count_limit => 10 + }, + reconnect_delay_ms => 1000, + ssl => false, + %% Consume back to forwarded message for verification + %% NOTE: this is a indefenite loopback without mocking emqx_bridge_worker:import_batch/1 + subscriptions => [{SendToTopic2, _QoS = 1}], + receive_mountpoint => <<"receive/aws/">>, + start_type => auto}, + {ok, Pid} = emqx_bridge_worker:start_link(?FUNCTION_NAME, Cfg), + ClientId = <<"client-1">>, + try + ?assertEqual([{SendToTopic2, 1}], emqx_bridge_worker:get_subscriptions(Pid)), + ok = emqx_bridge_worker:ensure_subscription_present(Pid, SendToTopic3, _QoS = 1), + ?assertEqual([{SendToTopic3, 1},{SendToTopic2, 1}], + emqx_bridge_worker:get_subscriptions(Pid)), + {ok, ConnPid} = emqtt:start_link([{clientid, ClientId}]), + {ok, _Props} = emqtt:connect(ConnPid), + emqtt:subscribe(ConnPid, <<"forwarded/+/t_mqtt/one">>, 1), + %% message from a different client, to avoid getting terminated by no-local + Max = 10, + Msgs = lists:seq(1, Max), + lists:foreach(fun(I) -> + {ok, _PacketId} = emqtt:publish(ConnPid, SendToTopic, integer_to_binary(I), ?QOS_1) + end, Msgs), + ?assertEqual(10, length(receive_messages(200))), + + emqtt:subscribe(ConnPid, <<"receive/aws/t_mqtt/two">>, 1), + %% message from a different client, to avoid getting terminated by no-local + Max = 10, + Msgs = lists:seq(1, Max), + lists:foreach(fun(I) -> + {ok, _PacketId} = emqtt:publish(ConnPid, SendToTopic2, integer_to_binary(I), ?QOS_1) + end, Msgs), + ?assertEqual(10, length(receive_messages(200))), + + emqtt:disconnect(ConnPid) + after + ok = emqx_bridge_worker:stop(Pid) + end. diff --git a/apps/emqx_bridge_mqtt/test/emqx_bridge_worker_tests.erl b/apps/emqx_bridge_mqtt/test/emqx_bridge_worker_tests.erl new file mode 100644 index 000000000..1d2ed1b82 --- /dev/null +++ b/apps/emqx_bridge_mqtt/test/emqx_bridge_worker_tests.erl @@ -0,0 +1,172 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_bridge_worker_tests). +-behaviour(emqx_bridge_connect). + +-include_lib("eunit/include/eunit.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). + +-define(BRIDGE_NAME, test). +-define(BRIDGE_REG_NAME, emqx_bridge_worker_test). +-define(WAIT(PATTERN, TIMEOUT), + receive + PATTERN -> + ok + after + TIMEOUT -> + error(timeout) + end). + +%% stub callbacks +-export([start/1, send/2, stop/1]). + +start(#{connect_result := Result, test_pid := Pid, test_ref := Ref}) -> + case is_pid(Pid) of + true -> Pid ! {connection_start_attempt, Ref}; + false -> ok + end, + Result. + +send(SendFun, Batch) when is_function(SendFun, 2) -> + SendFun(Batch). + +stop(_Pid) -> ok. + +%% bridge worker should retry connecting remote node indefinitely +% reconnect_test() -> +% emqx_metrics:start_link(), +% emqx_bridge_worker:register_metrics(), +% Ref = make_ref(), +% Config = make_config(Ref, self(), {error, test}), +% {ok, Pid} = emqx_bridge_worker:start_link(?BRIDGE_NAME, Config), +% %% assert name registered +% ?assertEqual(Pid, whereis(?BRIDGE_REG_NAME)), +% ?WAIT({connection_start_attempt, Ref}, 1000), +% %% expect same message again +% ?WAIT({connection_start_attempt, Ref}, 1000), +% ok = emqx_bridge_worker:stop(?BRIDGE_REG_NAME), +% emqx_metrics:stop(), +% ok. + +%% connect first, disconnect, then connect again +disturbance_test() -> + emqx_metrics:start_link(), + emqx_bridge_worker:register_metrics(), + Ref = make_ref(), + TestPid = self(), + Config = make_config(Ref, TestPid, {ok, #{client_pid => TestPid}}), + {ok, Pid} = emqx_bridge_worker:start_link(?BRIDGE_NAME, Config), + ?assertEqual(Pid, whereis(?BRIDGE_REG_NAME)), + ?WAIT({connection_start_attempt, Ref}, 1000), + Pid ! {disconnected, TestPid, test}, + ?WAIT({connection_start_attempt, Ref}, 1000), + emqx_metrics:stop(), + ok = emqx_bridge_worker:stop(?BRIDGE_REG_NAME). + +% % %% buffer should continue taking in messages when disconnected +% buffer_when_disconnected_test_() -> +% {timeout, 10000, fun test_buffer_when_disconnected/0}. + +% test_buffer_when_disconnected() -> +% Ref = make_ref(), +% Nums = lists:seq(1, 100), +% Sender = spawn_link(fun() -> receive {bridge, Pid} -> sender_loop(Pid, Nums, _Interval = 5) end end), +% SenderMref = monitor(process, Sender), +% Receiver = spawn_link(fun() -> receive {bridge, Pid} -> receiver_loop(Pid, Nums, _Interval = 1) end end), +% ReceiverMref = monitor(process, Receiver), +% SendFun = fun(Batch) -> +% BatchRef = make_ref(), +% Receiver ! {batch, BatchRef, Batch}, +% {ok, BatchRef} +% end, +% Config0 = make_config(Ref, false, {ok, #{client_pid => undefined}}), +% Config = Config0#{reconnect_delay_ms => 100}, +% emqx_metrics:start_link(), +% emqx_bridge_worker:register_metrics(), +% {ok, Pid} = emqx_bridge_worker:start_link(?BRIDGE_NAME, Config), +% Sender ! {bridge, Pid}, +% Receiver ! {bridge, Pid}, +% ?assertEqual(Pid, whereis(?BRIDGE_REG_NAME)), +% Pid ! {disconnected, Ref, test}, +% ?WAIT({'DOWN', SenderMref, process, Sender, normal}, 5000), +% ?WAIT({'DOWN', ReceiverMref, process, Receiver, normal}, 1000), +% ok = emqx_bridge_worker:stop(?BRIDGE_REG_NAME), +% emqx_metrics:stop(). + +manual_start_stop_test() -> + emqx_metrics:start_link(), + emqx_bridge_worker:register_metrics(), + Ref = make_ref(), + TestPid = self(), + Config0 = make_config(Ref, TestPid, {ok, #{client_pid => TestPid}}), + Config = Config0#{start_type := manual}, + {ok, Pid} = emqx_bridge_worker:start_link(?BRIDGE_NAME, Config), + %% call ensure_started again should yeld the same result + ok = emqx_bridge_worker:ensure_started(?BRIDGE_NAME), + ?assertEqual(Pid, whereis(?BRIDGE_REG_NAME)), + emqx_bridge_worker:ensure_stopped(unknown), + emqx_bridge_worker:ensure_stopped(Pid), + emqx_bridge_worker:ensure_stopped(?BRIDGE_REG_NAME), + emqx_metrics:stop(). + +%% Feed messages to bridge +sender_loop(_Pid, [], _) -> exit(normal); +sender_loop(Pid, [Num | Rest], Interval) -> + random_sleep(Interval), + Pid ! {deliver, dummy, make_msg(Num)}, + sender_loop(Pid, Rest, Interval). + +%% Feed acknowledgments to bridge +receiver_loop(_Pid, [], _) -> ok; +receiver_loop(Pid, Nums, Interval) -> + receive + {batch, BatchRef, Batch} -> + Rest = match_nums(Batch, Nums), + random_sleep(Interval), + emqx_bridge_worker:handle_ack(Pid, BatchRef), + receiver_loop(Pid, Rest, Interval) + end. + +random_sleep(MaxInterval) -> + case rand:uniform(MaxInterval) - 1 of + 0 -> ok; + T -> timer:sleep(T) + end. + +match_nums([], Rest) -> Rest; +match_nums([#message{payload = P} | Rest], Nums) -> + I = binary_to_integer(P), + case Nums of + [I | NumsLeft] -> match_nums(Rest, NumsLeft); + [J | _] when J > I -> match_nums(Rest, Nums); %% allow retry + _ -> error([{received, I}, {expecting, Nums}]) + end. + +make_config(Ref, TestPid, Result) -> + #{test_pid => TestPid, + test_ref => Ref, + connect_module => ?MODULE, + reconnect_delay_ms => 50, + connect_result => Result, + start_type => auto + }. + +make_msg(I) -> + Payload = integer_to_binary(I), + emqx_message:make(<<"test/topic">>, Payload). + diff --git a/apps/emqx_coap/.github/workflows/run_test_cases.yaml b/apps/emqx_coap/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..b8e722570 --- /dev/null +++ b/apps/emqx_coap/.github/workflows/run_test_cases.yaml @@ -0,0 +1,29 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + container: + image: erlang:22.1 + + steps: + - uses: actions/checkout@v1 + - name: run test cases + run: | + make xref + make eunit + make ct + make cover + - uses: actions/upload-artifact@v1 + if: always() + with: + name: logs + path: _build/test/logs + - uses: actions/upload-artifact@v1 + with: + name: cover + path: _build/test/cover + diff --git a/apps/emqx_coap/.gitignore b/apps/emqx_coap/.gitignore new file mode 100644 index 000000000..67eaa0145 --- /dev/null +++ b/apps/emqx_coap/.gitignore @@ -0,0 +1,25 @@ +deps/ +ebin/ +_rel/ +.erlang.mk/ +*.d +*.o +*.exe +data/ +*.iml +.idea/ +logs/ +*.beam +emqx_coap.d +intergration_test/emqx-rel/ +intergration_test/libcoap/ +intergration_test/case*.txt +.DS_Store +_build/ +rebar.lock +rebar3.crashdump +*.swp +erlang.mk +.rebar3/ +etc/emqx_coap.conf.rendered +.tags* diff --git a/apps/emqx_coap/LICENSE b/apps/emqx_coap/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/apps/emqx_coap/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/emqx_coap/Makefile b/apps/emqx_coap/Makefile new file mode 100644 index 000000000..621b51d07 --- /dev/null +++ b/apps/emqx_coap/Makefile @@ -0,0 +1,37 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: compile + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + +CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish + +$(CUTTLEFISH_SCRIPT): + @${REBAR} get-deps + @if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi + +app.config: $(CUTTLEFISH_SCRIPT) etc/emqx_coap.conf + $(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/emqx_coap.conf -i priv/emqx_coap.schema -d data diff --git a/apps/emqx_coap/README.md b/apps/emqx_coap/README.md new file mode 100644 index 000000000..2da7b9fca --- /dev/null +++ b/apps/emqx_coap/README.md @@ -0,0 +1,254 @@ + +# emqx-coap + +emqx-coap is a CoAP Gateway for EMQ X Broker. It translates CoAP messages into MQTT messages and make it possible to communiate between CoAP clients and MQTT clients. + +### Client Usage Example +libcoap is an excellent coap library which has a simple client tool. It is recommended to use libcoap as a coap client. + +To compile libcoap, do following steps: + +``` +git clone http://github.com/obgm/libcoap +cd libcoap +./autogen.sh +./configure --enable-documentation=no --enable-tests=no +make +``` + +### Publish example: +``` +libcoap/examples/coap-client -m put -e 1234 "coap://127.0.0.1/mqtt/topic1?c=client1&u=tom&p=secret" +``` +- topic name is "topic1", NOT "/topic1" +- client id is client1 +- username is tom +- password is secret +- payload is a text string "1234" + +A mqtt message with topic="topic1", payload="1234" has been published. Any mqtt client or coap client, who has subscribed this topic could receive this message immediately. + +### Subscribe example: + +``` +libcoap/examples/coap-client -m get -s 10 "coap://127.0.0.1/mqtt/topic1?c=client1&u=tom&p=secret" +``` +- topic name is "topic1", NOT "/topic1" +- client id is client1 +- username is tom +- password is secret +- subscribe time is 10 seconds + +And you will get following result if any mqtt client or coap client sent message with text "1234567" to "topic1": + +``` +v:1 t:CON c:GET i:31ae {} [ ] +1234567v:1 t:CON c:GET i:31af {} [ Observe:1, Uri-Path:mqtt, Uri-Path:topic1, Uri-Query:c=client1, Uri-Query:u=tom, Uri-Query:p=secret ] +``` +The output message is not well formatted which hide "1234567" at the head of the 2nd line. + +### Configure + +#### Common + +File: etc/emqx_coap.conf + +```properties + +## The UDP port that CoAP is listening on. +## +## Value: Port +coap.port = 5683 + +## Interval for keepalive, specified in seconds. +## +## Value: Duration +## -s: seconds +## -m: minutes +## -h: hours +coap.keepalive = 120s + +## Whether to enable statistics for CoAP clients. +## +## Value: on | off +coap.enable_stats = off + +``` + +#### DTLS + +emqx_coap enable one-way authentication by default. + +If you want to disable it, comment these lines. + +File: etc/emqx_coap.conf + +```properties + +## The DTLS port that CoAP is listening on. +## +## Value: Port +coap.dtls.port = 5684 + +## Private key file for DTLS +## +## Value: File +coap.dtls.keyfile = {{ platform_etc_dir }}/certs/key.pem + +## Server certificate for DTLS. +## +## Value: File +coap.dtls.certfile = {{ platform_etc_dir }}/certs/cert.pem + +``` + +##### Enable two-way autentication + +For two-way autentication: + +```properties + +## A server only does x509-path validation in mode verify_peer, +## as it then sends a certificate request to the client (this +## message is not sent if the verify option is verify_none). +## You can then also want to specify option fail_if_no_peer_cert. +## More information at: http://erlang.org/doc/man/ssl.html +## +## Value: verify_peer | verify_none +## coap.dtls.verify = verify_peer + +## PEM-encoded CA certificates for DTLS +## +## Value: File +## coap.dtls.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem + +## Used together with {verify, verify_peer} by an SSL server. If set to true, +## the server fails if the client does not have a certificate to send, that is, +## sends an empty certificate. +## +## Value: true | false +## coap.dtls.fail_if_no_peer_cert = false + +``` + +### Load emqx-coap + +```bash +./bin/emqx_ctl plugins load emqx_coap +``` + +CoAP Client Observe Operation (subscribe topic) +----------------------------------------------- +To subscribe any topic, issue following command: + +``` + GET coap://localhost/mqtt/{topicname}?c={clientid}&u={username}&p={password} with OBSERVE=0 +``` + +- "mqtt" in the path is mandatory. +- replace {topicname}, {clientid}, {username} and {password} with your true values. +- {topicname} and {clientid} is mandatory. +- if clientid is absent, a "bad_request" will be returned. +- {topicname} in URI should be percent-encoded to prevent special characters, such as + and #. +- {username} and {password} are optional. +- if {username} and {password} are not correct, an uauthorized error will be returned. +- topic is subscribed with qos1. + +CoAP Client Unobserve Operation (unsubscribe topic) +--------------------------------------------------- +To cancel observation, issue following command: + +``` + GET coap://localhost/mqtt/{topicname}?c={clientid}&u={username}&p={password} with OBSERVE=1 +``` + +- "mqtt" in the path is mandatory. +- replace {topicname}, {clientid}, {username} and {password} with your true values. +- {topicname} and {clientid} is mandatory. +- if clientid is absent, a "bad_request" will be returned. +- {topicname} in URI should be percent-encoded to prevent special characters, such as + and #. +- {username} and {password} are optional. +- if {username} and {password} are not correct, an uauthorized error will be returned. + +CoAP Client Notification Operation (subscribed Message) +------------------------------------------------------- +Server will issue an observe-notification as a subscribed message. + +- Its payload is exactly the mqtt payload. +- payload data type is "application/octet-stream". + +CoAP Client Publish Operation +----------------------------- +Issue a coap put command to do publishment. For example: + +``` + PUT coap://localhost/mqtt/{topicname}?c={clientid}&u={username}&p={password} +``` + +- "mqtt" in the path is mandatory. +- replace {topicname}, {clientid}, {username} and {password} with your true values. +- {topicname} and {clientid} is mandatory. +- if clientid is absent, a "bad_request" will be returned. +- {topicname} in URI should be percent-encoded to prevent special characters, such as + and #. +- {username} and {password} are optional. +- if {username} and {password} are not correct, an uauthorized error will be returned. +- payload could be any binary data. +- payload data type is "application/octet-stream". +- publish message will be sent with qos0. + +CoAP Client Keep Alive +---------------------- +Device should issue a get command periodically, serve as a ping to keep mqtt session online. + +``` + GET coap://localhost/mqtt/{any_topicname}?c={clientid}&u={username}&p={password} +``` + +- "mqtt" in the path is mandatory. +- replace {any_topicname}, {clientid}, {username} and {password} with your true values. +- {any_topicname} is optional, and should be percent-encoded to prevent special characters. +- {clientid} is mandatory. If clientid is absent, a "bad_request" will be returned. +- {username} and {password} are optional. +- if {username} and {password} are not correct, an uauthorized error will be returned. +- coap client should do keepalive work periodically to keep mqtt session online, especially those devices in a NAT network. + + +CoAP Client NOTES +----------------- +emqx-coap gateway does not accept POST and DELETE requests. + +Topics in URI should be percent-encoded, but corresponding uri_path option has percent-encoding converted. Please refer to RFC 7252 section 6.4, "Decomposing URIs into Options": + +> Note that these rules completely resolve any percent-encoding. + +That implies coap client is responsible to convert any percert-encoding into true character while assembling coap packet. + + +ClientId, Username, Password and Topic +-------------------------------------- +ClientId/username/password/topic in the coap URI are the concepts in mqtt. That is to say, emqx-coap is trying to fit coap message into mqtt system, by borrowing the client/username/password/topic from mqtt. + +The Auth/ACL/Hook features in mqtt also applies on coap stuff. For example: +- If username/password is not authorized, coap client will get an uauthorized error. +- If username or clientid is not allowed to published specific topic, coap message will be dropped in fact, although coap client will get an acknoledgement from emqx-coap. +- If a coap message is published, a 'message.publish' hook is able to capture this message as well. + +well-known locations +-------------------- +Discovery always return "," + +For example +``` +libcoap/examples/coap-client -m get "coap://127.0.0.1/.well-known/core" +``` + +License +------- + +Apache License Version 2.0 + +Author +------ + +EMQ X Team. + diff --git a/apps/emqx_coap/TODO b/apps/emqx_coap/TODO new file mode 100644 index 000000000..2af129d6c --- /dev/null +++ b/apps/emqx_coap/TODO @@ -0,0 +1,13 @@ +1. Remove the test/test_mqtt_broker and use emqx-ct-helpers -> Done! + - Enhance all test case + +2. Remove the mqtt adaptor +3. Remove the emqx_coap_ps_topics.erl + + +### Problems + +1. The coap-client of libcoap does not support Fragment DTLS handshake frame + * So, the connection will be established failed, if the 'Server Hello' frame is too big + * Why is the 'Server Hello' too big when enable the 'coap.dtls.cacertfile' option? +2. diff --git a/apps/emqx_coap/docs/rfc7049.pdf b/apps/emqx_coap/docs/rfc7049.pdf new file mode 100644 index 000000000..a16db36ef Binary files /dev/null and b/apps/emqx_coap/docs/rfc7049.pdf differ diff --git a/apps/emqx_coap/docs/rfc7228.pdf b/apps/emqx_coap/docs/rfc7228.pdf new file mode 100644 index 000000000..c9dc1b59f Binary files /dev/null and b/apps/emqx_coap/docs/rfc7228.pdf differ diff --git a/apps/emqx_coap/docs/rfc7252.pdf b/apps/emqx_coap/docs/rfc7252.pdf new file mode 100644 index 000000000..6876fad3e Binary files /dev/null and b/apps/emqx_coap/docs/rfc7252.pdf differ diff --git a/apps/emqx_coap/etc/emqx_coap.conf b/apps/emqx_coap/etc/emqx_coap.conf new file mode 100644 index 000000000..0590a348e --- /dev/null +++ b/apps/emqx_coap/etc/emqx_coap.conf @@ -0,0 +1,82 @@ +##-------------------------------------------------------------------- +## CoAP Gateway +##-------------------------------------------------------------------- + +## The IP and UDP port that CoAP bind with. +## +## Default: 0.0.0.0:5683 +## +## Examples: +## coap.bind.udp.x = 0.0.0.0:5683 | :::5683 | 127.0.0.1:5683 | ::1:5683 +## +coap.bind.udp.1 = 0.0.0.0:5683 +##coap.bind.udp.2 = 0.0.0.0:6683 + +## Whether to enable statistics for CoAP clients. +## +## Value: on | off +coap.enable_stats = off + + +##------------------------------------------------------------------------------ +## DTLS options + +## The DTLS port that CoAP is listening on. +## +## Default: 0.0.0.0:5684 +## +## Examples: +## coap.bind.dtls.x = 0.0.0.0:5684 | :::5684 | 127.0.0.1:5684 | ::1:5684 +## +coap.bind.dtls.1 = 0.0.0.0:5684 +##coap.bind.dtls.2 = 0.0.0.0:6684 + +## A server only does x509-path validation in mode verify_peer, +## as it then sends a certificate request to the client (this +## message is not sent if the verify option is verify_none). +## You can then also want to specify option fail_if_no_peer_cert. +## More information at: http://erlang.org/doc/man/ssl.html +## +## Value: verify_peer | verify_none +## coap.dtls.verify = verify_peer + +## Private key file for DTLS +## +## Value: File +coap.dtls.keyfile = {{ platform_etc_dir }}/certs/key.pem + +## Server certificate for DTLS. +## +## Value: File +coap.dtls.certfile = {{ platform_etc_dir }}/certs/cert.pem + +## PEM-encoded CA certificates for DTLS +## +## Value: File +## coap.dtls.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem + +## Used together with {verify, verify_peer} by an SSL server. If set to true, +## the server fails if the client does not have a certificate to send, that is, +## sends an empty certificate. +## +## Value: true | false +## coap.dtls.fail_if_no_peer_cert = false + +## This is the single most important configuration option of an Erlang SSL +## application. Ciphers (and their ordering) define the way the client and +## server encrypt information over the wire, from the initial Diffie-Helman +## key exchange, the session key encryption ## algorithm and the message +## digest algorithm. Selecting a good cipher suite is critical for the +## application’s data security, confidentiality and performance. +## +## The cipher list above offers: +## +## A good balance between compatibility with older browsers. +## It can get stricter for Machine-To-Machine scenarios. +## Perfect Forward Secrecy. +## No old/insecure encryption and HMAC algorithms +## +## Most of it was copied from Mozilla’s Server Side TLS article +## +## Value: Ciphers +coap.dtls.ciphers = ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-AES256-SHA384,ECDHE-RSA-AES256-SHA384,ECDHE-ECDSA-DES-CBC3-SHA,ECDH-ECDSA-AES256-GCM-SHA384,ECDH-RSA-AES256-GCM-SHA384,ECDH-ECDSA-AES256-SHA384,ECDH-RSA-AES256-SHA384,DHE-DSS-AES256-GCM-SHA384,DHE-DSS-AES256-SHA256,AES256-GCM-SHA384,AES256-SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES128-SHA256,ECDHE-RSA-AES128-SHA256,ECDH-ECDSA-AES128-GCM-SHA256,ECDH-RSA-AES128-GCM-SHA256,ECDH-ECDSA-AES128-SHA256,ECDH-RSA-AES128-SHA256,DHE-DSS-AES128-GCM-SHA256,DHE-DSS-AES128-SHA256,AES128-GCM-SHA256,AES128-SHA256,ECDHE-ECDSA-AES256-SHA,ECDHE-RSA-AES256-SHA,DHE-DSS-AES256-SHA,ECDH-ECDSA-AES256-SHA,ECDH-RSA-AES256-SHA,AES256-SHA,ECDHE-ECDSA-AES128-SHA,ECDHE-RSA-AES128-SHA,DHE-DSS-AES128-SHA,ECDH-ECDSA-AES128-SHA,ECDH-RSA-AES128-SHA,AES128-SHA diff --git a/apps/emqx_coap/include/emqx_coap.hrl b/apps/emqx_coap/include/emqx_coap.hrl new file mode 100644 index 000000000..8204dc98c --- /dev/null +++ b/apps/emqx_coap/include/emqx_coap.hrl @@ -0,0 +1,20 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-define(APP, emqx_coap). + +-record(coap_mqtt_auth, {clientid, username, password}). + diff --git a/apps/emqx_coap/intergration_test/Makefile b/apps/emqx_coap/intergration_test/Makefile new file mode 100644 index 000000000..12a2081dd --- /dev/null +++ b/apps/emqx_coap/intergration_test/Makefile @@ -0,0 +1,129 @@ +.PHONY: clean, clean_result, start_broker stop_broker case1 case2 case3 + +RELX_CONF = emqx-rel/relx.config +LIBCOAP_GIT = libcoap/README.md + +all: clean_result $(RELX_CONF) $(LIBCOAP_GIT) start_broker clean_result case1 case2 case3 case4 stop_broker + @echo " " + @echo " test complete" + @echo " " + +clean_result: + -rm -f case*.txt + + +start_broker: + -rm -f emqx-rel/_rel/emqx/log/* + -emqx-rel/_rel/emqx/bin/emqx stop + sleep 1 + emqx-rel/_rel/emqx/bin/emqx start + sleep 1 + emqx-rel/_rel/emqx/bin/emqx_ctl plugins load emqx_coap + +stop_broker: + -emqx-rel/_rel/emqx/bin/emqx stop + +case1: + libcoap/examples/coap-client -m get -s 5 "coap://127.0.0.1/mqtt/topic1?c=client1&u=tom&p=secret" > case1_output.txt & + sleep 1 + libcoap/examples/coap-client -m put -e w123G45 "coap://127.0.0.1/mqtt/topic1?c=client2&u=mike&p=pw12" + sleep 6 + python check_result.py case1 case1_output.txt==w123G45 + +case2: + # subscribe to topic="x/y" + libcoap/examples/coap-client -m get -s 5 "coap://127.0.0.1/mqtt/x%2Fy?c=client3&u=tom&p=secret" > case2_output1.txt & + # subscribe to topic="+/z" + libcoap/examples/coap-client -m get -s 5 "coap://127.0.0.1/mqtt/%2B%2Fz?c=client4&u=mike&p=pw12" > case2_output2.txt & + sleep 1 + # publish to topic="x/y" + libcoap/examples/coap-client -m put -e big9wolf "coap://127.0.0.1/mqtt/x%2Fy?c=client5&u=sun&p=pw3" + # publish to topic="p/z" + libcoap/examples/coap-client -m put -e black2ant "coap://127.0.0.1/mqtt/p%2Fz?c=client5&u=sun&p=pw3" + sleep 6 + python check_result.py case2 case2_output1.txt==big9wolf case2_output1.txt!=black2ant case2_output2.txt!=big9wolf case2_output2.txt==black2ant + +case3: + libcoap/examples/coap-client -m get -T tk12 -s 5 "coap://127.0.0.1/mqtt/a%2Fb?c=client3&u=tom&p=secret" > case3_output1.txt & + libcoap/examples/coap-client -m get -T tk34 -s 5 "coap://127.0.0.1/mqtt/c%2Fd?c=client3&u=tom&p=secret" > case3_output2.txt & + sleep 1 + libcoap/examples/coap-client -m put -e big9wolf "coap://127.0.0.1/mqtt/c%2Fd?c=client5&u=sun&p=pw3" + libcoap/examples/coap-client -m put -e black2ant "coap://127.0.0.1/mqtt/a%2Fb?c=client5&u=sun&p=pw3" + sleep 6 + python check_result.py case3 case3_output1.txt==black2ant case3_output2.txt==big9wolf case3_output2.txt!=black2ant + + + +case4: + # reload emqx_coap, does it work as expected? + sleep 1 + emqx-rel/_rel/emqx/bin/emqx_ctl plugins unload emqx_coap + sleep 1 + emqx-rel/_rel/emqx/bin/emqx_ctl plugins load emqx_coap + sleep 1 + libcoap/examples/coap-client -m get -s 5 "coap://127.0.0.1/mqtt/topic1?c=client1&u=tom&p=secret" > case4_output.txt & + sleep 1 + libcoap/examples/coap-client -m put -e w6J3G45 "coap://127.0.0.1/mqtt/topic1?c=client2&u=mike&p=pw12" + sleep 6 + python check_result.py case4 case4_output.txt==w6J3G45 + + + + +$(RELX_CONF): + git clone https://github.com/emqx/emqx-rel.git + git clone https://github.com/emqx/emq-coap.git + @echo "update emq-coap with this development code" + mv emq-coap emqx_coap + -rm -rf emqx_coap/etc + -rm -rf emqx_coap/include + -rm -rf emqx_coap/priv + -rm -rf emqx_coap/src + -rm -rf emqx_coap/Makefile + cp -rf ../etc emqx_coap/ + cp -rf ../include emqx_coap/ + cp -rf ../priv emqx_coap/ + cp -rf ../src emqx_coap/ + cp -rf ../Makefile emqx_coap/Makefile + -mkdir emqx-rel/deps + mv emqx_coap emqx-rel/deps/ + @echo "start building ..." + make -C emqx-rel -f Makefile + + +coap: $(LIBCOAP_GIT) + @echo "make coap" + +$(LIBCOAP_GIT): + git clone -b v4.1.2 http://github.com/obgm/libcoap + cd libcoap && ./autogen.sh && ./configure --enable-documentation=no --enable-tests=no + make -C libcoap -f Makefile + +r: rebuild_emq + # r short for rebuild_emq + @echo " rebuild complete " + +rebuild_emq: + -emqx-rel/_rel/emqx/bin/emqx stop + -rm -rf emqx-rel/deps/emqx_coap/etc + -rm -rf emqx-rel/deps/emqx_coap/include + -rm -rf emqx-rel/deps/emqx_coap/priv + -rm -rf emqx-rel/deps/emqx_coap/src + -rm -rf emqx-rel/deps/emqx_coap/Makefile + cp -rf ../etc emqx-rel/deps/emqx_coap/ + cp -rf ../include emqx-rel/deps/emqx_coap/ + cp -rf ../priv emqx-rel/deps/emqx_coap/ + cp -rf ../src emqx-rel/deps/emqx_coap/ + cp -rf ../Makefile emqx-rel/deps/emqx_coap/Makefile + make -C emqx-rel -f Makefile + +clean: clean_result + -rm -f client/*.exe + -rm -f client/*.o + -rm -rf emqx-rel + -rm -rf libcoap + +lazy: clean_result start_broker case2 stop_broker + # custom your command here + @echo "you are so lazy" + diff --git a/apps/emqx_coap/intergration_test/README.md b/apps/emqx_coap/intergration_test/README.md new file mode 100644 index 000000000..eb3507923 --- /dev/null +++ b/apps/emqx_coap/intergration_test/README.md @@ -0,0 +1,8 @@ +Integration test for emq-coap +====== + +execute following command +``` +make +``` + diff --git a/apps/emqx_coap/intergration_test/check_result.py b/apps/emqx_coap/intergration_test/check_result.py new file mode 100644 index 000000000..f9baaefae --- /dev/null +++ b/apps/emqx_coap/intergration_test/check_result.py @@ -0,0 +1,52 @@ +import sys + + +def have_string(filename, text): + data = open(filename, "rb").read() + if data.find(text) > 0: + return True + else: + return False + + +def mark(case_number, result, description): + if result: + f = open(case_number+"_PASS.txt", "wb") + f.close() + print("\n\n"+case_number+" PASS\n\n") + else: + f = open(case_number+"_FAIL.txt", "wb") + f.write(description) + f.close() + print("\n\n"+case_number+" FAIL\n\n") + +def parse_condition(condition): + if condition.find("==") > 0: + r = condition.split("==") + return r[0], r[1], True + elif condition.find("!=") > 0: + r = condition.split("!=") + return r[0], r[1], False + else: + print("\ncondition syntax error\n\n\n") + sys.exit("condition syntax error") + + +def main(): + case_number = sys.argv[1] + description = "" + conclustion = True + for condition in sys.argv[2:]: + filename, text, result = parse_condition(condition) + if have_string(filename, text) == result: + pass + else: + conclustion = False + description = description + "\n" + condition + " failed\n" + + mark(case_number, conclustion, description) + + +if __name__ == "__main__": + main() + diff --git a/apps/emqx_coap/priv/emqx_coap.schema b/apps/emqx_coap/priv/emqx_coap.schema new file mode 100644 index 000000000..465979964 --- /dev/null +++ b/apps/emqx_coap/priv/emqx_coap.schema @@ -0,0 +1,93 @@ +%%-*- mode: erlang -*- +%% emqx_coap config mapping +{mapping, "coap.bind.udp.$number", "emqx_coap.bind_udp", [ + {datatype, ip}, + {default, "0.0.0.0:5683"} +]}. + +{mapping, "coap.enable_stats", "emqx_coap.enable_stats", [ + {datatype, flag} +]}. + +{mapping, "coap.bind.dtls.$number", "emqx_coap.bind_dtls", [ + {datatype, ip}, + {default, "0.0.0.0:5684"} +]}. + +{mapping, "coap.dtls.keyfile", "emqx_coap.dtls_opts", [ + {datatype, string} +]}. + +{mapping, "coap.dtls.certfile", "emqx_coap.dtls_opts", [ + {datatype, string} +]}. + +{mapping, "coap.dtls.verify", "emqx_coap.dtls_opts", [ + {default, verify_none}, + {datatype, {enum, [verify_none, verify_peer]}} +]}. + +{mapping, "coap.dtls.cacertfile", "emqx_coap.dtls_opts", [ + {datatype, string} +]}. + +{mapping, "coap.dtls.fail_if_no_peer_cert", "emqx_coap.dtls_opts", [ + {datatype, {enum, [true, false]}} +]}. + +{mapping, "coap.dtls.ciphers", "emqx_coap.dtls_opts", [ + {datatype, string} +]}. + +{translation, "emqx_coap.bind_udp", fun(Conf) -> + Options = cuttlefish_variable:filter_by_prefix("coap.bind.udp", Conf), + lists:map(fun({_, Bind}) -> + {Ip, Port} = cuttlefish_datatypes:from_string(Bind, ip), + Opts = case inet:parse_address(Ip) of + {ok, {_,_,_,_} = Address} -> + [inet, {ip, Address}]; + {ok, {_,_,_,_,_,_,_,_} = Address} -> + [inet6, {ip, Address}] + end, + {Port, Opts} + end, Options) +end}. + +{translation, "emqx_coap.bind_dtls", fun(Conf) -> + Options = cuttlefish_variable:filter_by_prefix("coap.bind.dtls", Conf), + lists:map(fun({_, Bind}) -> + {Ip, Port} = cuttlefish_datatypes:from_string(Bind, ip), + Opts = case inet:parse_address(Ip) of + {ok, {_,_,_,_} = Address} -> + [inet, {ip, Address}]; + {ok, {_,_,_,_,_,_,_,_} = Address} -> + [inet6, {ip, Address}] + end, + {Port, Opts} + end, Options) +end}. + +{translation, "emqx_coap.dtls_opts", fun(Conf) -> + Filter = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end, + + %% Ciphers + SplitFun = fun(undefined) -> undefined; (S) -> string:tokens(S, ",") end, + Ciphers = + case cuttlefish:conf_get("coap.dtls.ciphers", Conf, undefined) of + undefined -> + lists:foldl( + fun(TlsVer, Ciphers) -> + Ciphers ++ ssl:cipher_suites(all, TlsVer) + end, [], ['dtlsv1', 'dtlsv1.2']); + C -> + SplitFun(C) + end, + + Filter([{verify, cuttlefish:conf_get("coap.dtls.verify", Conf, undefined)}, + {keyfile, cuttlefish:conf_get("coap.dtls.keyfile", Conf, undefined)}, + {certfile, cuttlefish:conf_get("coap.dtls.certfile", Conf, undefined)}, + {cacertfile, cuttlefish:conf_get("coap.dtls.cacertfile", Conf, undefined)}, + {fail_if_no_peer_cert, cuttlefish:conf_get("coap.dtls.fail_if_no_peer_cert", Conf, undefined)}, + {ciphers, Ciphers}]) +end}. + diff --git a/apps/emqx_coap/rebar.config b/apps/emqx_coap/rebar.config new file mode 100644 index 000000000..dd1ad613e --- /dev/null +++ b/apps/emqx_coap/rebar.config @@ -0,0 +1,28 @@ +{deps, + [ + {gen_coap, {git, "https://github.com/emqx/gen_coap", {tag, "v0.3.0"}}} + ]}. + +{edoc_opts, [{preprocess, true}]}. +{erl_opts, [warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_obsolete_guard, + debug_info, + {parse_transform}]}. + +{xref_checks, [undefined_function_calls, undefined_functions, + locals_not_used, deprecated_function_calls, + warnings_as_errors, deprecated_functions]}. +{cover_enabled, true}. +{cover_opts, [verbose]}. +{cover_export_enabled, true}. + +{profiles, + [{test, + [{deps, + [{er_coap_client, {git, "https://github.com/emqx/er_coap_client", {tag, "v1.0"}}}, + {emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}} + ]} + ]} + ]}. diff --git a/apps/emqx_coap/rebar.config.script b/apps/emqx_coap/rebar.config.script new file mode 100644 index 000000000..e0a704a55 --- /dev/null +++ b/apps/emqx_coap/rebar.config.script @@ -0,0 +1,54 @@ +%%-*- mode: erlang -*- + +DEPS = case lists:keyfind(deps, 1, CONFIG) of + {_, Deps} -> Deps; + _ -> [] + end, + +ComparingFun = fun + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_list(C2); + is_integer(C1), is_integer(C2) -> C1 < C2 orelse _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_integer(C1), is_list(C2) -> _Fun(R1, R2); + _Fun([C1|R1], [C2|R2]) when is_list(C1), is_integer(C2) -> true; + _Fun(_, _) -> false + end, + +SortFun = fun(T1, T2) -> + C = fun(T) -> + [case catch list_to_integer(E) of + I when is_integer(I) -> I; + _ -> E + end || E <- re:split(string:sub_string(T, 2), "[.-]", [{return, list}])] + end, + ComparingFun(C(T1), C(T2)) + end, + +VTags = string:tokens(os:cmd("git tag -l \"v*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"), + +Tags = case VTags of + [] -> string:tokens(os:cmd("git tag -l \"e*\" --points-at $(git rev-parse $(git describe --abbrev=0 --tags))"), "\n"); + _ -> VTags + end, + +LatestTag = lists:last(lists:sort(SortFun, Tags)), + +Branch = case os:getenv("GITHUB_RUN_ID") of + false -> os:cmd("git branch | grep -e '^*' | cut -d' ' -f 2") -- "\n"; + _ -> re:replace(os:getenv("GITHUB_REF"), "^refs/heads/|^refs/tags/", "", [global, {return ,list}]) + end, + +GitDescribe = case re:run(Branch, "master|^dev/|^hotfix/", [{capture, none}]) of + match -> {branch, Branch}; + _ -> {tag, LatestTag} + end, + +UrlPrefix = "https://github.com/emqx/", + +EMQX_DEP = {emqx, {git, UrlPrefix ++ "emqx", GitDescribe}}, +EMQX_MGMT_DEP = {emqx_management, {git, UrlPrefix ++ "emqx-management", GitDescribe}}, + +NewDeps = [EMQX_DEP, EMQX_MGMT_DEP | DEPS], + +CONFIG1 = lists:keystore(deps, 1, CONFIG, {deps, NewDeps}), + +CONFIG1. diff --git a/apps/emqx_coap/src/emqx_coap.app.src b/apps/emqx_coap/src/emqx_coap.app.src new file mode 100644 index 000000000..edbd3223c --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap.app.src @@ -0,0 +1,14 @@ +{application, emqx_coap, + [{description, "EMQ X CoAP Gateway"}, + {vsn, "git"}, + {modules, []}, + {registered, []}, + {applications, [kernel,stdlib,gen_coap]}, + {mod, {emqx_coap_app, []}}, + {env, []}, + {licenses, ["Apache-2.0"]}, + {maintainers, ["EMQ X Team "]}, + {links, [{"Homepage", "https://emqx.io/"}, + {"Github", "https://github.com/emqx/emqx-coap"} + ]} + ]}. diff --git a/apps/emqx_coap/src/emqx_coap.app.src.script b/apps/emqx_coap/src/emqx_coap.app.src.script new file mode 100644 index 000000000..0e14ff23f --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap.app.src.script @@ -0,0 +1,24 @@ +%%-*- mode: erlang -*- +%% .app.src.script + +RemoveLeadingV = + fun(Tag) -> + case re:run(Tag, "^[v|e]?[0-9]\.[0-9]\.([0-9]|(rc|beta|alpha)\.[0-9])", [{capture, none}]) of + nomatch -> + re:replace(Tag, "/", "-", [{return ,list}]); + _ -> + %% if it is a version number prefixed by 'v' or 'e', then remove it + re:replace(Tag, "[v|e]", "", [{return ,list}]) + end + end, + +case os:getenv("EMQX_DEPS_DEFAULT_VSN") of + false -> CONFIG; % env var not defined + [] -> CONFIG; % env var set to empty string + Tag -> + [begin + AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}), + {application, App, AppConf0} + end || Conf = {application, App, AppConf} <- CONFIG] +end. + diff --git a/apps/emqx_coap/src/emqx_coap_app.erl b/apps/emqx_coap/src/emqx_coap_app.erl new file mode 100644 index 000000000..eaabd356b --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_app.erl @@ -0,0 +1,40 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_app). + +-behaviour(application). + +-emqx_plugin(protocol). + +-include("emqx_coap.hrl"). + +-export([ start/2 + , stop/1 + ]). + +start(_Type, _Args) -> + {ok, Sup} = emqx_coap_sup:start_link(), + coap_server_registry:add_handler([<<"mqtt">>], emqx_coap_resource, undefined), + coap_server_registry:add_handler([<<"ps">>], emqx_coap_ps_resource, undefined), + emqx_coap_ps_topics:start_link(), + emqx_coap_server:start(application:get_all_env(?APP)), + {ok,Sup}. + +stop(_State) -> + coap_server_registry:remove_handler([<<"mqtt">>], emqx_coap_resource, undefined), + coap_server_registry:remove_handler([<<"ps">>], emqx_coap_ps_resource, undefined), + emqx_coap_server:stop(application:get_all_env(?APP)). diff --git a/apps/emqx_coap/src/emqx_coap_mqtt_adapter.erl b/apps/emqx_coap/src/emqx_coap_mqtt_adapter.erl new file mode 100644 index 000000000..4c508c272 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_mqtt_adapter.erl @@ -0,0 +1,357 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_mqtt_adapter). + +-behaviour(gen_server). + +-include("emqx_coap.hrl"). + +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). + +-logger_header("[CoAP-Adpter]"). + +%% API. +-export([ subscribe/2 + , unsubscribe/2 + , publish/3 + ]). + +-export([ client_pid/4 + , stop/1 + ]). + +-export([call/2]). + +%% gen_server. +-export([ init/1 + , handle_call/3 + , handle_cast/2 + , handle_info/2 + , terminate/2 + , code_change/3 + ]). + +-record(state, {peername, clientid, username, password, sub_topics = [], connected_at}). + +-define(ALIVE_INTERVAL, 20000). + +-define(CONN_STATS, [recv_pkt, recv_msg, send_pkt, send_msg]). + +-define(SUBOPTS, #{rh => 0, rap => 0, nl => 0, qos => ?QOS_0, is_new => false}). + +%%-------------------------------------------------------------------- +%% API +%%-------------------------------------------------------------------- + +client_pid(undefined, _Username, _Password, _Channel) -> + {error, bad_request}; +client_pid(ClientId, Username, Password, Channel) -> + % check authority + case start(ClientId, Username, Password, Channel) of + {ok, Pid1} -> {ok, Pid1}; + {error, {already_started, Pid2}} -> {ok, Pid2}; + {error, auth_failure} -> {error, auth_failure}; + Other -> {error, Other} + end. + +start(ClientId, Username, Password, Channel) -> + % DO NOT use start_link, since multiple coap_reponsder may have relation with one mqtt adapter, + % one coap_responder crashes should not make mqtt adapter crash too + % And coap_responder is not a system process, it is dangerous to link mqtt adapter to coap_responder + gen_server:start({via, emqx_coap_registry, {ClientId, Username, Password}}, ?MODULE, {ClientId, Username, Password, Channel}, []). + +stop(Pid) -> + gen_server:stop(Pid). + +subscribe(Pid, Topic) -> + gen_server:call(Pid, {subscribe, Topic, self()}). + +unsubscribe(Pid, Topic) -> + gen_server:call(Pid, {unsubscribe, Topic, self()}). + +publish(Pid, Topic, Payload) -> + gen_server:call(Pid, {publish, Topic, Payload}). + +%% For emqx_management plugin +call(Pid, Msg) -> + Pid ! Msg, ok. + +%%-------------------------------------------------------------------- +%% gen_server Callbacks +%%-------------------------------------------------------------------- + +init({ClientId, Username, Password, Channel}) -> + ?LOG(debug, "try to start adapter ClientId=~p, Username=~p, Password=~p, Channel=~p", + [ClientId, Username, Password, Channel]), + State0 = #state{peername = Channel, + clientid = ClientId, + username = Username, + password = Password}, + _ = run_hooks('client.connect', [conninfo(State0)], undefined), + case emqx_access_control:authenticate(clientinfo(State0)) of + {ok, _AuthResult} -> + _ = run_hooks('client.connack', [conninfo(State0), success], undefined), + + State = State0#state{connected_at = erlang:system_time(millisecond)}, + + %% TODO: Evict same clientid on other node?? + + run_hooks('client.connected', [clientinfo(State), conninfo(State)]), + + erlang:send_after(?ALIVE_INTERVAL, self(), check_alive), + emqx_cm:register_channel(ClientId, info(State), stats(State)), + {ok, State}; + {error, Reason} -> + ?LOG(debug, "authentication faild: ~p", [Reason]), + _ = run_hooks('client.connack', [conninfo(State0), not_authorized], undefined), + {stop, {shutdown, Reason}} + end. + +handle_call({subscribe, Topic, CoapPid}, _From, State=#state{sub_topics = TopicList}) -> + NewTopics = proplists:delete(Topic, TopicList), + IsWild = emqx_topic:wildcard(Topic), + chann_subscribe(Topic, State), + {reply, ok, State#state{sub_topics = [{Topic, {IsWild, CoapPid}}|NewTopics]}, hibernate}; + +handle_call({unsubscribe, Topic, _CoapPid}, _From, State=#state{sub_topics = TopicList}) -> + NewTopics = proplists:delete(Topic, TopicList), + chann_unsubscribe(Topic, State), + {reply, ok, State#state{sub_topics = NewTopics}, hibernate}; + +handle_call({publish, Topic, Payload}, _From, State) -> + chann_publish(Topic, Payload, State), + {reply, ok, State}; + +handle_call(info, _From, State) -> + {reply, info(State), State}; + +handle_call(stats, _From, State) -> + {reply, stats(State), State, hibernate}; + +handle_call(kick, _From, State) -> + {stop, {shutdown, kick}, ok, State}; + +handle_call({set_rate_limit, _Rl}, _From, State) -> + ?LOG(error, "set_rate_limit is not support", []), + {reply, ok, State}; + +handle_call(get_rate_limit, _From, State) -> + ?LOG(error, "get_rate_limit is not support", []), + {reply, ok, State}; + +handle_call(Request, _From, State) -> + ?LOG(error, "adapter unexpected call ~p", [Request]), + {reply, ignored, State, hibernate}. + +handle_cast(Msg, State) -> + ?LOG(error, "broker_api unexpected cast ~p", [Msg]), + {noreply, State, hibernate}. + +handle_info({deliver, _Topic, #message{topic = Topic, payload = Payload}}, State = #state{sub_topics = Subscribers}) -> + deliver([{Topic, Payload}], Subscribers), + {noreply, State, hibernate}; + +handle_info(check_alive, State = #state{sub_topics = []}) -> + {stop, {shutdown, check_alive}, State}; +handle_info(check_alive, State) -> + erlang:send_after(?ALIVE_INTERVAL, self(), check_alive), + {noreply, State, hibernate}; + +handle_info({shutdown, Error}, State) -> + {stop, {shutdown, Error}, State}; + +handle_info({shutdown, conflict, {ClientId, NewPid}}, State) -> + ?LOG(warning, "clientid '~s' conflict with ~p", [ClientId, NewPid]), + {stop, {shutdown, conflict}, State}; + +handle_info(kick, State) -> + ?LOG(info, "Kicked", []), + {stop, {shutdown, kick}, State}; + +handle_info(Info, State) -> + ?LOG(error, "adapter unexpected info ~p", [Info]), + {noreply, State, hibernate}. + +terminate(Reason, State = #state{clientid = ClientId, sub_topics = SubTopics}) -> + ?LOG(debug, "unsubscribe ~p while exiting for ~p", [SubTopics, Reason]), + [chann_unsubscribe(Topic, State) || {Topic, _} <- SubTopics], + emqx_cm:unregister_channel(ClientId), + + ConnInfo0 = conninfo(State), + ConnInfo = ConnInfo0#{disconnected_at => erlang:system_time(millisecond)}, + run_hooks('client.disconnected', [clientinfo(State), Reason, ConnInfo]). + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%%-------------------------------------------------------------------- +%% Channel adapter functions + +chann_subscribe(Topic, State = #state{clientid = ClientId}) -> + ?LOG(debug, "subscribe Topic=~p", [Topic]), + emqx_broker:subscribe(Topic, ClientId, ?SUBOPTS), + emqx_hooks:run('session.subscribed', [clientinfo(State), Topic, ?SUBOPTS]). + +chann_unsubscribe(Topic, State) -> + ?LOG(debug, "unsubscribe Topic=~p", [Topic]), + Opts = #{rh => 0, rap => 0, nl => 0, qos => 0}, + emqx_broker:unsubscribe(Topic), + emqx_hooks:run('session.unsubscribed', [clientinfo(State), Topic, Opts]). + +chann_publish(Topic, Payload, #state{clientid = ClientId}) -> + ?LOG(debug, "publish Topic=~p, Payload=~p", [Topic, Payload]), + emqx_broker:publish( + emqx_message:set_flag(retain, false, + emqx_message:make(ClientId, ?QOS_0, Topic, Payload))). + +%%-------------------------------------------------------------------- +%% Deliver + +deliver([], _) -> ok; +deliver([Pub | More], Subscribers) -> + ok = do_deliver(Pub, Subscribers), + deliver(More, Subscribers). + +do_deliver({Topic, Payload}, Subscribers) -> + %% handle PUBLISH packet from broker + ?LOG(debug, "deliver message from broker Topic=~p, Payload=~p", [Topic, Payload]), + deliver_to_coap(Topic, Payload, Subscribers), + ok; + +do_deliver(Pkt, _Subscribers) -> + ?LOG(warning, "unknown packet type to deliver, pkt=~p,", [Pkt]), + ok. + +deliver_to_coap(_TopicName, _Payload, []) -> + ok; +deliver_to_coap(TopicName, Payload, [{TopicFilter, {IsWild, CoapPid}}|T]) -> + Matched = case IsWild of + true -> emqx_topic:match(TopicName, TopicFilter); + false -> TopicName =:= TopicFilter + end, + %?LOG(debug, "deliver_to_coap Matched=~p, CoapPid=~p, TopicName=~p, Payload=~p, T=~p", [Matched, CoapPid, TopicName, Payload, T]), + Matched andalso (CoapPid ! {dispatch, TopicName, Payload}), + deliver_to_coap(TopicName, Payload, T). + +%%-------------------------------------------------------------------- +%% Helper funcs + +-compile({inline, [run_hooks/2, run_hooks/3]}). +run_hooks(Name, Args) -> + ok = emqx_metrics:inc(Name), emqx_hooks:run(Name, Args). + +run_hooks(Name, Args, Acc) -> + ok = emqx_metrics:inc(Name), emqx_hooks:run_fold(Name, Args, Acc). + +%%-------------------------------------------------------------------- +%% Info & Stats + +info(State) -> + ChannInfo = chann_info(State), + ChannInfo#{sockinfo => sockinfo(State)}. + +%% copies from emqx_connection:info/1 +sockinfo(#state{peername = Peername}) -> + #{socktype => udp, + peername => Peername, + sockname => {{127,0,0,1}, 5683}, %% FIXME: Sock? + sockstate => running, + active_n => 1 + }. + +%% copies from emqx_channel:info/1 +chann_info(State) -> + #{conninfo => conninfo(State), + conn_state => connected, + clientinfo => clientinfo(State), + session => maps:from_list(session_info(State)), + will_msg => undefined + }. + +conninfo(#state{peername = Peername, + clientid = ClientId, + connected_at = ConnectedAt}) -> + #{socktype => udp, + sockname => {{127,0,0,1}, 5683}, + peername => Peername, + peercert => nossl, %% TODO: dtls + conn_mod => ?MODULE, + proto_name => <<"CoAP">>, + proto_ver => 1, + clean_start => true, + clientid => ClientId, + username => undefined, + conn_props => undefined, + connected => true, + connected_at => ConnectedAt, + keepalive => 0, + receive_maximum => 0, + expiry_interval => 0 + }. + +%% copies from emqx_session:info/1 +session_info(#state{sub_topics = SubTopics, connected_at = ConnectedAt}) -> + Subs = lists:foldl( + fun({Topic, _}, Acc) -> + Acc#{Topic => ?SUBOPTS} + end, #{}, SubTopics), + [{subscriptions, Subs}, + {upgrade_qos, false}, + {retry_interval, 0}, + {await_rel_timeout, 0}, + {created_at, ConnectedAt} + ]. + +%% The stats keys copied from emqx_connection:stats/1 +stats(#state{sub_topics = SubTopics}) -> + SockStats = [{recv_oct,0}, {recv_cnt,0}, {send_oct,0}, {send_cnt,0}, {send_pend,0}], + ConnStats = emqx_pd:get_counters(?CONN_STATS), + ChanStats = [{subscriptions_cnt, length(SubTopics)}, + {subscriptions_max, length(SubTopics)}, + {inflight_cnt, 0}, + {inflight_max, 0}, + {mqueue_len, 0}, + {mqueue_max, 0}, + {mqueue_dropped, 0}, + {next_pkt_id, 0}, + {awaiting_rel_cnt, 0}, + {awaiting_rel_max, 0} + ], + ProcStats = emqx_misc:proc_stats(), + lists:append([SockStats, ConnStats, ChanStats, ProcStats]). + +clientinfo(#state{peername = {PeerHost, _}, + clientid = ClientId, + username = Username, + password = Password}) -> + #{zone => undefined, + protocol => coap, + peerhost => PeerHost, + sockport => 5683, %% FIXME: + clientid => ClientId, + username => Username, + password => Password, + peercert => nossl, + is_bridge => false, + is_superuser => false, + mountpoint => undefined, + ws_cookie => undefined + }. + diff --git a/apps/emqx_coap/src/emqx_coap_ps_resource.erl b/apps/emqx_coap/src/emqx_coap_ps_resource.erl new file mode 100644 index 000000000..09d291bf5 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_ps_resource.erl @@ -0,0 +1,318 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_ps_resource). + +-behaviour(coap_resource). + +-include("emqx_coap.hrl"). +-include_lib("gen_coap/include/coap.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[CoAP-PS-RES]"). + +-export([ coap_discover/2 + , coap_get/5 + , coap_post/4 + , coap_put/4 + , coap_delete/3 + , coap_observe/5 + , coap_unobserve/1 + , handle_info/2 + , coap_ack/2 + ]). + +-ifdef(TEST). +-export([topic/1]). +-endif. + +-define(PS_PREFIX, [<<"ps">>]). + +%%-------------------------------------------------------------------- +%% Resource Callbacks +%%-------------------------------------------------------------------- +coap_discover(_Prefix, _Args) -> + [{absolute, [<<"ps">>], []}]. + +coap_get(ChId, ?PS_PREFIX, TopicPath, Query, Content=#coap_content{format = Format}) when TopicPath =/= [] -> + Topic = topic(TopicPath), + ?LOG(debug, "coap_get() Topic=~p, Query=~p~n", [Topic, Query]), + #coap_mqtt_auth{clientid = Clientid, username = Usr, password = Passwd} = get_auth(Query), + case emqx_coap_mqtt_adapter:client_pid(Clientid, Usr, Passwd, ChId) of + {ok, Pid} -> + put(mqtt_client_pid, Pid), + case Format of + <<"application/link-format">> -> + Content; + _Other -> + %% READ the topic info + read_last_publish_message(emqx_topic:wildcard(Topic), Topic, Content) + end; + {error, auth_failure} -> + put(mqtt_client_pid, undefined), + {error, uauthorized}; + {error, bad_request} -> + put(mqtt_client_pid, undefined), + {error, bad_request}; + {error, _Other} -> + put(mqtt_client_pid, undefined), + {error, internal_server_error} + end; +coap_get(ChId, Prefix, TopicPath, Query, _Content) -> + ?LOG(error, "ignore bad get request ChId=~p, Prefix=~p, TopicPath=~p, Query=~p", [ChId, Prefix, TopicPath, Query]), + {error, bad_request}. + +coap_post(_ChId, ?PS_PREFIX, TopicPath, #coap_content{format = Format, payload = Payload, max_age = MaxAge}) when TopicPath =/= [] -> + Topic = topic(TopicPath), + ?LOG(debug, "coap_post() Topic=~p, MaxAge=~p, Format=~p~n", [Topic, MaxAge, Format]), + case Format of + %% We treat ct of "application/link-format" as CREATE message + <<"application/link-format">> -> + handle_received_create(Topic, MaxAge, Payload); + %% We treat ct of other values as PUBLISH message + Other -> + ?LOG(debug, "coap_post() receive payload format=~p, will process as PUBLISH~n", [Format]), + handle_received_publish(Topic, MaxAge, Other, Payload) + end; + +coap_post(_ChId, _Prefix, _TopicPath, _Content) -> + {error, method_not_allowed}. + +coap_put(_ChId, ?PS_PREFIX, TopicPath, #coap_content{max_age = MaxAge, format = Format, payload = Payload}) when TopicPath =/= [] -> + Topic = topic(TopicPath), + ?LOG(debug, "put message, Topic=~p, Payload=~p~n", [Topic, Payload]), + handle_received_publish(Topic, MaxAge, Format, Payload); + +coap_put(_ChId, Prefix, TopicPath, Content) -> + ?LOG(error, "put has error, Prefix=~p, TopicPath=~p, Content=~p", [Prefix, TopicPath, Content]), + {error, bad_request}. + +coap_delete(_ChId, ?PS_PREFIX, TopicPath) -> + delete_topic_info(topic(TopicPath)); + +coap_delete(_ChId, _Prefix, _TopicPath) -> + {error, method_not_allowed}. + +coap_observe(ChId, ?PS_PREFIX, TopicPath, Ack, Content) when TopicPath =/= [] -> + Topic = topic(TopicPath), + ?LOG(debug, "observe Topic=~p, Ack=~p,Content=~p", [Topic, Ack, Content]), + Pid = get(mqtt_client_pid), + emqx_coap_mqtt_adapter:subscribe(Pid, Topic), + Code = case emqx_coap_ps_topics:is_topic_timeout(Topic) of + true -> + nocontent; + false-> + content + end, + {ok, {state, ChId, ?PS_PREFIX, [Topic]}, Code, Content}; + +coap_observe(ChId, Prefix, TopicPath, Ack, _Content) -> + ?LOG(error, "unknown observe request ChId=~p, Prefix=~p, TopicPath=~p, Ack=~p", [ChId, Prefix, TopicPath, Ack]), + {error, bad_request}. + +coap_unobserve({state, _ChId, ?PS_PREFIX, TopicPath}) when TopicPath =/= [] -> + Topic = topic(TopicPath), + ?LOG(debug, "unobserve ~p", [Topic]), + Pid = get(mqtt_client_pid), + emqx_coap_mqtt_adapter:unsubscribe(Pid, Topic), + ok; +coap_unobserve({state, ChId, Prefix, TopicPath}) -> + ?LOG(error, "ignore unknown unobserve request ChId=~p, Prefix=~p, TopicPath=~p", [ChId, Prefix, TopicPath]), + ok. + +handle_info({dispatch, Topic, Payload}, State) -> + ?LOG(debug, "dispatch Topic=~p, Payload=~p", [Topic, Payload]), + {ok, Ret} = emqx_coap_ps_topics:reset_topic_info(Topic, Payload), + ?LOG(debug, "Updated publish info of topic=~p, the Ret is ~p", [Topic, Ret]), + {notify, [], #coap_content{format = <<"application/octet-stream">>, payload = Payload}, State}; +handle_info(Message, State) -> + ?LOG(error, "Unknown Message ~p", [Message]), + {noreply, State}. + +coap_ack(_Ref, State) -> {ok, State}. + + +%%-------------------------------------------------------------------- +%% Internal Functions +%%-------------------------------------------------------------------- +get_auth(Query) -> + get_auth(Query, #coap_mqtt_auth{}). + +get_auth([], Auth=#coap_mqtt_auth{}) -> + Auth; +get_auth([<<$c, $=, Rest/binary>>|T], Auth=#coap_mqtt_auth{}) -> + get_auth(T, Auth#coap_mqtt_auth{clientid = Rest}); +get_auth([<<$u, $=, Rest/binary>>|T], Auth=#coap_mqtt_auth{}) -> + get_auth(T, Auth#coap_mqtt_auth{username = Rest}); +get_auth([<<$p, $=, Rest/binary>>|T], Auth=#coap_mqtt_auth{}) -> + get_auth(T, Auth#coap_mqtt_auth{password = Rest}); +get_auth([Param|T], Auth=#coap_mqtt_auth{}) -> + ?LOG(error, "ignore unknown parameter ~p", [Param]), + get_auth(T, Auth). + +add_topic_info(publish, Topic, MaxAge, Format, Payload) when is_binary(Topic), Topic =/= <<>> -> + case emqx_coap_ps_topics:lookup_topic_info(Topic) of + [{_, StoredMaxAge, StoredCT, _, _}] -> + ?LOG(debug, "publish topic=~p already exists, need reset the topic info", [Topic]), + %% check whether the ct value stored matches the ct option in this POST message + case Format =:= StoredCT of + true -> + {ok, Ret} = + case StoredMaxAge =:= MaxAge of + true -> + emqx_coap_ps_topics:reset_topic_info(Topic, Payload); + false -> + emqx_coap_ps_topics:reset_topic_info(Topic, MaxAge, Payload) + end, + {changed, Ret}; + false -> + ?LOG(debug, "ct values of topic=~p do not match, stored ct=~p, new ct=~p, ignore the PUBLISH", [Topic, StoredCT, Format]), + {changed, false} + end; + [] -> + ?LOG(debug, "publish topic=~p will be created", [Topic]), + {ok, Ret} = emqx_coap_ps_topics:add_topic_info(Topic, MaxAge, Format, Payload), + {created, Ret} + end; + +add_topic_info(create, Topic, MaxAge, Format, _Payload) when is_binary(Topic), Topic =/= <<>> -> + case emqx_coap_ps_topics:is_topic_existed(Topic) of + true -> + %% Whether we should support CREATE to an existed topic is TBD!! + ?LOG(debug, "create topic=~p already exists, need reset the topic info", [Topic]), + {ok, Ret} = emqx_coap_ps_topics:reset_topic_info(Topic, MaxAge, Format, <<>>); + false -> + ?LOG(debug, "create topic=~p will be created", [Topic]), + {ok, Ret} = emqx_coap_ps_topics:add_topic_info(Topic, MaxAge, Format, <<>>) + end, + {created, Ret}; + +add_topic_info(_, Topic, _MaxAge, _Format, _Payload) -> + ?LOG(debug, "create topic=~p info failed", [Topic]), + {badarg, false}. + +concatenate_location_path(List = [TopicPart1, TopicPart2, TopicPart3]) when is_binary(TopicPart1), is_binary(TopicPart2), is_binary(TopicPart3) -> + list_to_binary(lists:foldl( fun (Element, AccIn) when Element =/= <<>> -> + AccIn ++ "/" ++ binary_to_list(Element); + (_Element, AccIn) -> + AccIn + end, [], List)). + +format_string_to_int(<<"application/octet-stream">>) -> + <<"42">>; +format_string_to_int(<<"application/exi">>) -> + <<"47">>; +format_string_to_int(<<"application/json">>) -> + <<"50">>. + +handle_received_publish(Topic, MaxAge, Format, Payload) -> + case add_topic_info(publish, Topic, MaxAge, format_string_to_int(Format), Payload) of + {Ret ,true} -> + Pid = get(mqtt_client_pid), + emqx_coap_mqtt_adapter:publish(Pid, topic(Topic), Payload), + Content = case Ret of + changed -> + #coap_content{}; + created -> + LocPath = concatenate_location_path([<<"ps">>, Topic, <<>>]), + #coap_content{location_path = [LocPath]} + end, + {ok, Ret, Content}; + {_, false} -> + ?LOG(debug, "add_topic_info failed, will return bad_request", []), + {error, bad_request} + end. + +handle_received_create(TopicPrefix, MaxAge, Payload) -> + case core_link:decode(Payload) of + [{rootless, [Topic], [{ct, CT}]}] when is_binary(Topic), Topic =/= <<>> -> + TrueTopic = http_uri:decode(Topic), + ?LOG(debug, "decoded link-format payload, the Topic=~p, CT=~p~n", [TrueTopic, CT]), + LocPath = concatenate_location_path([<<"ps">>, TopicPrefix, TrueTopic]), + FullTopic = binary:part(LocPath, 4, byte_size(LocPath)-4), + ?LOG(debug, "the location path is ~p, the full topic is ~p~n", [LocPath, FullTopic]), + case add_topic_info(create, FullTopic, MaxAge, CT, <<>>) of + {_, true} -> + ?LOG(debug, "create topic info successfully, will return LocPath=~p", [LocPath]), + {ok, created, #coap_content{location_path = [LocPath]}}; + {_, false} -> + ?LOG(debug, "create topic info failed, will return bad_request", []), + {error, bad_request} + end; + Other -> + ?LOG(debug, "post with bad payload of link-format ~p, will return bad_request", [Other]), + {error, bad_request} + end. + +%% When topic is timeout, server should return nocontent here, +%% but gen_coap only receive return value of #coap_content from coap_get, so temporarily we can't give the Code 2.07 {ok, nocontent} out.TBC!!! +return_resource(Topic, Payload, MaxAge, TimeStamp, Content) -> + TimeElapsed = trunc((erlang:system_time(millisecond) - TimeStamp) / 1000), + case TimeElapsed < MaxAge of + true -> + LeftTime = (MaxAge - TimeElapsed), + ?LOG(debug, "topic=~p has max age left time is ~p", [Topic, LeftTime]), + Content#coap_content{max_age = LeftTime, payload = Payload}; + false -> + ?LOG(debug, "topic=~p has been timeout, will return empty content", [Topic]), + #coap_content{} + end. + +read_last_publish_message(false, Topic, Content=#coap_content{format = QueryFormat}) when is_binary(QueryFormat)-> + ?LOG(debug, "the QueryFormat=~p", [QueryFormat]), + case emqx_coap_ps_topics:lookup_topic_info(Topic) of + [] -> + {error, not_found}; + [{_, MaxAge, CT, Payload, TimeStamp}] -> + case CT =:= format_string_to_int(QueryFormat) of + true -> + return_resource(Topic, Payload, MaxAge, TimeStamp, Content); + false -> + ?LOG(debug, "format value does not match, the queried format=~p, the stored format=~p", [QueryFormat, CT]), + {error, bad_request} + end + end; + +read_last_publish_message(false, Topic, Content) -> + case emqx_coap_ps_topics:lookup_topic_info(Topic) of + [] -> + {error, not_found}; + [{_, MaxAge, _, Payload, TimeStamp}] -> + return_resource(Topic, Payload, MaxAge, TimeStamp, Content) + end; + +read_last_publish_message(true, Topic, _Content) -> + ?LOG(debug, "the topic=~p is illegal wildcard topic", [Topic]), + {error, bad_request}. + +delete_topic_info(Topic) -> + case emqx_coap_ps_topics:lookup_topic_info(Topic) of + [] -> + {error, not_found}; + [{_, _, _, _, _}] -> + emqx_coap_ps_topics:delete_sub_topics(Topic) + end. + +topic(Topic) when is_binary(Topic) -> Topic; +topic([]) -> <<>>; +topic([Path | TopicPath]) -> + case topic(TopicPath) of + <<>> -> Path; + RemTopic -> + <> + end. diff --git a/apps/emqx_coap/src/emqx_coap_ps_topics.erl b/apps/emqx_coap/src/emqx_coap_ps_topics.erl new file mode 100644 index 000000000..30e9d2623 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_ps_topics.erl @@ -0,0 +1,185 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_ps_topics). + +-behaviour(gen_server). + +-include("emqx_coap.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[CoAP-PS-TOPICS]"). + +-export([ start_link/0 + , stop/1 + ]). + +-export([ add_topic_info/4 + , delete_topic_info/1 + , delete_sub_topics/1 + , is_topic_existed/1 + , is_topic_timeout/1 + , reset_topic_info/2 + , reset_topic_info/3 + , reset_topic_info/4 + , lookup_topic_info/1 + , lookup_topic_payload/1 + ]). + +%% gen_server. +-export([ init/1 + , handle_call/3 + , handle_cast/2 + , handle_info/2 + , terminate/2 + , code_change/3 + ]). + +-record(state, {}). + +-define(COAP_TOPIC_TABLE, coap_topic). + +%%-------------------------------------------------------------------- +%% API +%%-------------------------------------------------------------------- + +start_link() -> + gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). + +stop(Pid) -> + gen_server:stop(Pid). + +add_topic_info(Topic, MaxAge, CT, Payload) when is_binary(Topic), is_integer(MaxAge), is_binary(CT), is_binary(Payload) -> + gen_server:call(?MODULE, {add_topic, {Topic, MaxAge, CT, Payload}}). + +delete_topic_info(Topic) when is_binary(Topic) -> + gen_server:call(?MODULE, {remove_topic, Topic}). + +delete_sub_topics(Topic) when is_binary(Topic) -> + gen_server:cast(?MODULE, {remove_sub_topics, Topic}). + +reset_topic_info(Topic, Payload) -> + gen_server:call(?MODULE, {reset_topic, {Topic, Payload}}). + +reset_topic_info(Topic, MaxAge, Payload) -> + gen_server:call(?MODULE, {reset_topic, {Topic, MaxAge, Payload}}). + +reset_topic_info(Topic, MaxAge, CT, Payload) -> + gen_server:call(?MODULE, {reset_topic, {Topic, MaxAge, CT, Payload}}). + +is_topic_existed(Topic) -> + ets:member(?COAP_TOPIC_TABLE, Topic). + +is_topic_timeout(Topic) when is_binary(Topic) -> + [{Topic, MaxAge, _, _, TimeStamp}] = ets:lookup(?COAP_TOPIC_TABLE, Topic), + %% MaxAge: x seconds + MaxAge < ((erlang:system_time(millisecond) - TimeStamp) / 1000). + +lookup_topic_info(Topic) -> + ets:lookup(?COAP_TOPIC_TABLE, Topic). + +lookup_topic_payload(Topic) -> + try ets:lookup_element(?COAP_TOPIC_TABLE, Topic, 4) + catch + error:badarg -> undefined + end. + +%%-------------------------------------------------------------------- +%% gen_server callbacks +%%-------------------------------------------------------------------- + +init([]) -> + ets:new(?COAP_TOPIC_TABLE, [set, named_table, protected]), + ?LOG(debug, "Create the coap_topic table", []), + {ok, #state{}}. + +handle_call({add_topic, {Topic, MaxAge, CT, Payload}}, _From, State) -> + Ret = create_table_element(Topic, MaxAge, CT, Payload), + {reply, {ok, Ret}, State, hibernate}; + +handle_call({reset_topic, {Topic, Payload}}, _From, State) -> + Ret = update_table_element(Topic, Payload), + {reply, {ok, Ret}, State, hibernate}; + +handle_call({reset_topic, {Topic, MaxAge, Payload}}, _From, State) -> + Ret = update_table_element(Topic, MaxAge, Payload), + {reply, {ok, Ret}, State, hibernate}; + +handle_call({reset_topic, {Topic, MaxAge, CT, Payload}}, _From, State) -> + Ret = update_table_element(Topic, MaxAge, CT, Payload), + {reply, {ok, Ret}, State, hibernate}; + +handle_call({remove_topic, {Topic, _Content}}, _From, State) -> + ets:delete(?COAP_TOPIC_TABLE, Topic), + ?LOG(debug, "Remove topic ~p in the coap_topic table", [Topic]), + {reply, ok, State, hibernate}; + +handle_call(Request, _From, State) -> + ?LOG(error, "adapter unexpected call ~p", [Request]), + {reply, ignored, State, hibernate}. + +handle_cast({remove_sub_topics, TopicPrefix}, State) -> + DeletedTopicNum = ets:foldl(fun ({Topic, _, _, _, _}, AccIn) -> + case binary:match(Topic, TopicPrefix) =/= nomatch of + true -> + ?LOG(debug, "Remove topic ~p in the coap_topic table", [Topic]), + ets:delete(?COAP_TOPIC_TABLE, Topic), + AccIn + 1; + false -> + AccIn + end + end, 0, ?COAP_TOPIC_TABLE), + ?LOG(debug, "Remove number of ~p topics with prefix=~p in the coap_topic table", [DeletedTopicNum, TopicPrefix]), + {noreply, State, hibernate}; + +handle_cast(Msg, State) -> + ?LOG(error, "broker_api unexpected cast ~p", [Msg]), + {noreply, State, hibernate}. + +handle_info(Info, State) -> + ?LOG(error, "adapter unexpected info ~p", [Info]), + {noreply, State, hibernate}. + +terminate(Reason, #state{}) -> + ets:delete(?COAP_TOPIC_TABLE), + ?LOG(error, "the ~p terminate for reason ~p", [?MODULE, Reason]), + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + + +%%-------------------------------------------------------------------- +%% Internal Functions +%%-------------------------------------------------------------------- +create_table_element(Topic, MaxAge, CT, Payload) -> + TopicInfo = {Topic, MaxAge, CT, Payload, erlang:system_time(millisecond)}, + ?LOG(debug, "Insert ~p in the coap_topic table", [TopicInfo]), + ets:insert_new(?COAP_TOPIC_TABLE, TopicInfo). + +update_table_element(Topic, Payload) -> + ?LOG(debug, "Update the topic=~p only with Payload", [Topic]), + ets:update_element(?COAP_TOPIC_TABLE, Topic, [{4, Payload}, {5, erlang:system_time(millisecond)}]). + +update_table_element(Topic, MaxAge, Payload) -> + ?LOG(debug, "Update the topic=~p info of MaxAge=~p and Payload", [Topic, MaxAge]), + ets:update_element(?COAP_TOPIC_TABLE, Topic, [{2, MaxAge}, {4, Payload}, {5, erlang:system_time(millisecond)}]). + +update_table_element(Topic, MaxAge, CT, <<>>) -> + ?LOG(debug, "Update the topic=~p info of MaxAge=~p, CT=~p, payload=<<>>", [Topic, MaxAge, CT]), + ets:update_element(?COAP_TOPIC_TABLE, Topic, [{2, MaxAge}, {3, CT}, {5, erlang:system_time(millisecond)}]). diff --git a/apps/emqx_coap/src/emqx_coap_registry.erl b/apps/emqx_coap/src/emqx_coap_registry.erl new file mode 100644 index 000000000..369bf2787 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_registry.erl @@ -0,0 +1,154 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_registry). + +-author("Feng Lee "). + +-include("emqx_coap.hrl"). +-include_lib("emqx/include/logger.hrl"). + +-logger_header("[CoAP-Registry]"). + +-behaviour(gen_server). + +%% API. +-export([ start_link/0 + , register_name/2 + , unregister_name/1 + , whereis_name/1 + , send/2 + , stop/0 + ]). + +%% gen_server. +-export([ init/1 + , handle_call/3 + , handle_cast/2 + , handle_info/2 + , terminate/2 + , code_change/3 + ]). + +-record(state, {}). + +-define(RESPONSE_TAB, coap_response_process). +-define(RESPONSE_REF_TAB, coap_response_process_ref). + +%% ------------------------------------------------------------------ +%% API Function Definitions +%% ------------------------------------------------------------------ + + +start_link() -> + gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). + +register_name(Name, Pid) -> + gen_server:call(?MODULE, {register_name, Name, Pid}). + +unregister_name(Name) -> + gen_server:call(?MODULE, {unregister_name, Name}). + +whereis_name(Name) -> + case ets:lookup(?RESPONSE_TAB, Name) of + [] -> undefined; + [{Name, Pid, _MRef}] -> Pid + end. + +send(Name, Msg) -> + case whereis_name(Name) of + undefined -> + exit({badarg, {Name, Msg}}); + Pid when is_pid(Pid) -> + Pid ! Msg, + Pid + end. + +stop() -> + gen_server:stop(?MODULE). + + +%% ------------------------------------------------------------------ +%% gen_server Function Definitions +%% ------------------------------------------------------------------ + +init([]) -> + ets:new(?RESPONSE_TAB, [set, named_table, protected]), + ets:new(?RESPONSE_REF_TAB, [set, named_table, protected]), + {ok, #state{}}. + +handle_call({register_name, Name, Pid}, _From, State) -> + case ets:member(?RESPONSE_TAB, Name) of + false -> + MRef = monitor_client(Pid), + ets:insert(?RESPONSE_TAB, {Name, Pid, MRef}), + ets:insert(?RESPONSE_REF_TAB, {MRef, Name, Pid}), + {reply, yes, State}; + true -> {reply, no, State} + end; + +handle_call({unregister_name, Name}, _From, State) -> + case ets:lookup(?RESPONSE_TAB, Name) of + [] -> + ok; + [{Name, _Pid, MRef}] -> + erase_monitor(MRef), + ets:delete(?RESPONSE_TAB, Name), + ets:delete(?RESPONSE_REF_TAB, MRef) + end, + {reply, ok, State}; + +handle_call(_Request, _From, State) -> + {reply, ignored, State}. + +handle_cast(_Msg, State) -> + {noreply, State}. + + +handle_info({'DOWN', MRef, process, DownPid, _Reason}, State) -> + case ets:lookup(?RESPONSE_REF_TAB, MRef) of + [{MRef, Name, _Pid}] -> + ets:delete(?RESPONSE_TAB, Name), + ets:delete(?RESPONSE_REF_TAB, MRef), + erase_monitor(MRef); + [] -> + ?LOG(error, "MRef of client ~p not found", [DownPid]) + end, + {noreply, State}; + + +handle_info(_Info, State) -> + {noreply, State}. + +terminate(_Reason, _State) -> + ets:delete(?RESPONSE_TAB), + ets:delete(?RESPONSE_REF_TAB), + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + + + +%%-------------------------------------------------------------------- +%% Internal functions +%%-------------------------------------------------------------------- + +monitor_client(Pid) -> + erlang:monitor(process, Pid). + +erase_monitor(MRef) -> + catch erlang:demonitor(MRef, [flush]). diff --git a/apps/emqx_coap/src/emqx_coap_resource.erl b/apps/emqx_coap/src/emqx_coap_resource.erl new file mode 100644 index 000000000..e11788a04 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_resource.erl @@ -0,0 +1,136 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_resource). + +-behaviour(coap_resource). + +-include("emqx_coap.hrl"). +-include_lib("emqx/include/emqx.hrl"). +-include_lib("emqx/include/logger.hrl"). +-include_lib("emqx/include/emqx_mqtt.hrl"). +-include_lib("gen_coap/include/coap.hrl"). + +-logger_header("[CoAP-RES]"). + +-export([ coap_discover/2 + , coap_get/5 + , coap_post/4 + , coap_put/4 + , coap_delete/3 + , coap_observe/5 + , coap_unobserve/1 + , handle_info/2 + , coap_ack/2 + ]). + +-ifdef(TEST). +-export([topic/1]). +-endif. + +-define(MQTT_PREFIX, [<<"mqtt">>]). + +% resource operations +coap_discover(_Prefix, _Args) -> + [{absolute, [<<"mqtt">>], []}]. + +coap_get(ChId, ?MQTT_PREFIX, Path, Query, _Content) -> + ?LOG(debug, "coap_get() Path=~p, Query=~p~n", [Path, Query]), + #coap_mqtt_auth{clientid = Clientid, username = Usr, password = Passwd} = get_auth(Query), + case emqx_coap_mqtt_adapter:client_pid(Clientid, Usr, Passwd, ChId) of + {ok, Pid} -> + put(mqtt_client_pid, Pid), + #coap_content{}; + {error, auth_failure} -> + put(mqtt_client_pid, undefined), + {error, unauthorized}; + {error, bad_request} -> + put(mqtt_client_pid, undefined), + {error, bad_request}; + {error, _Other} -> + put(mqtt_client_pid, undefined), + {error, internal_server_error} + end; +coap_get(ChId, Prefix, Path, Query, _Content) -> + ?LOG(error, "ignore bad get request ChId=~p, Prefix=~p, Path=~p, Query=~p", [ChId, Prefix, Path, Query]), + {error, bad_request}. + +coap_post(_ChId, _Prefix, _Topic, _Content) -> + {error, method_not_allowed}. + +coap_put(_ChId, ?MQTT_PREFIX, Topic, #coap_content{payload = Payload}) when Topic =/= [] -> + ?LOG(debug, "put message, Topic=~p, Payload=~p~n", [Topic, Payload]), + Pid = get(mqtt_client_pid), + emqx_coap_mqtt_adapter:publish(Pid, topic(Topic), Payload), + ok; +coap_put(_ChId, Prefix, Topic, Content) -> + ?LOG(error, "put has error, Prefix=~p, Topic=~p, Content=~p", [Prefix, Topic, Content]), + {error, bad_request}. + +coap_delete(_ChId, _Prefix, _Topic) -> + {error, method_not_allowed}. + +coap_observe(ChId, ?MQTT_PREFIX, Topic, Ack, Content) when Topic =/= [] -> + TrueTopic = topic(Topic), + ?LOG(debug, "observe Topic=~p, Ack=~p", [TrueTopic, Ack]), + Pid = get(mqtt_client_pid), + emqx_coap_mqtt_adapter:subscribe(Pid, TrueTopic), + {ok, {state, ChId, ?MQTT_PREFIX, [TrueTopic]}, content, Content}; +coap_observe(ChId, Prefix, Topic, Ack, _Content) -> + ?LOG(error, "unknown observe request ChId=~p, Prefix=~p, Topic=~p, Ack=~p", [ChId, Prefix, Topic, Ack]), + {error, bad_request}. + +coap_unobserve({state, _ChId, ?MQTT_PREFIX, Topic}) when Topic =/= [] -> + ?LOG(debug, "unobserve ~p", [Topic]), + Pid = get(mqtt_client_pid), + emqx_coap_mqtt_adapter:unsubscribe(Pid, topic(Topic)), + ok; +coap_unobserve({state, ChId, Prefix, Topic}) -> + ?LOG(error, "ignore unknown unobserve request ChId=~p, Prefix=~p, Topic=~p", [ChId, Prefix, Topic]), + ok. + +handle_info({dispatch, Topic, Payload}, State) -> + ?LOG(debug, "dispatch Topic=~p, Payload=~p", [Topic, Payload]), + {notify, [], #coap_content{format = <<"application/octet-stream">>, payload = Payload}, State}; +handle_info(Message, State) -> + emqx_coap_mqtt_adapter:handle_info(Message, State). + +coap_ack(_Ref, State) -> {ok, State}. + +get_auth(Query) -> + get_auth(Query, #coap_mqtt_auth{}). + +get_auth([], Auth=#coap_mqtt_auth{}) -> + Auth; +get_auth([<<$c, $=, Rest/binary>>|T], Auth=#coap_mqtt_auth{}) -> + get_auth(T, Auth#coap_mqtt_auth{clientid = Rest}); +get_auth([<<$u, $=, Rest/binary>>|T], Auth=#coap_mqtt_auth{}) -> + get_auth(T, Auth#coap_mqtt_auth{username = Rest}); +get_auth([<<$p, $=, Rest/binary>>|T], Auth=#coap_mqtt_auth{}) -> + get_auth(T, Auth#coap_mqtt_auth{password = Rest}); +get_auth([Param|T], Auth=#coap_mqtt_auth{}) -> + ?LOG(error, "ignore unknown parameter ~p", [Param]), + get_auth(T, Auth). + +topic(Topic) when is_binary(Topic) -> Topic; +topic([]) -> <<>>; +topic([Path | TopicPath]) -> + case topic(TopicPath) of + <<>> -> Path; + RemTopic -> + <> + end. + diff --git a/apps/emqx_coap/src/emqx_coap_server.erl b/apps/emqx_coap/src/emqx_coap_server.erl new file mode 100644 index 000000000..0d571fac3 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_server.erl @@ -0,0 +1,106 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_server). + +-include("emqx_coap.hrl"). + +-export([ start/1 + , stop/1 + ]). + +-export([ start_listener/1 + , start_listener/3 + , stop_listener/1 + , stop_listener/2 + ]). + +%%-------------------------------------------------------------------- +%% APIs +%%-------------------------------------------------------------------- + +start(Envs) -> + {ok, _} = application:ensure_all_started(gen_coap), + start_listeners(Envs). + +stop(Envs) -> + stop_listeners(Envs). + +%%-------------------------------------------------------------------- +%% Internal funcs +%%-------------------------------------------------------------------- + +start_listeners(Envs) -> + lists:foreach(fun start_listener/1, listeners_confs(Envs)). + +stop_listeners(Envs) -> + lists:foreach(fun stop_listener/1, listeners_confs(Envs)). + +start_listener({Proto, ListenOn, Opts}) -> + case start_listener(Proto, ListenOn, Opts) of + {ok, _Pid} -> + io:format("Start coap:~s listener on ~s successfully.~n", + [Proto, format(ListenOn)]); + {error, Reason} -> + io:format(standard_error, "Failed to start coap:~s listener on ~s - ~0p~n!", + [Proto, format(ListenOn), Reason]), + error(Reason) + end. + +start_listener(udp, ListenOn, Opts) -> + coap_server:start_udp('coap:udp', ListenOn, Opts); +start_listener(dtls, ListenOn, Opts) -> + coap_server:start_dtls('coap:dtls', ListenOn, Opts). + +stop_listener({Proto, ListenOn, _Opts}) -> + Ret = stop_listener(Proto, ListenOn), + case Ret of + ok -> io:format("Stop coap:~s listener on ~s successfully.~n", + [Proto, format(ListenOn)]); + {error, Reason} -> + io:format(standard_error, "Failed to stop coap:~s listener on ~s - ~p~n.", + [Proto, format(ListenOn), Reason]) + end, + Ret. + +stop_listener(udp, ListenOn) -> + coap_server:stop_udp('coap:udp', ListenOn); +stop_listener(dtls, ListenOn) -> + coap_server:stop_dtls('coap:dtls', ListenOn). + +%% XXX: It is a temporary func to convert conf format for esockd +listeners_confs(Envs) -> + listeners_confs(udp, Envs) ++ listeners_confs(dtls, Envs). + +listeners_confs(udp, Envs) -> + Udps = proplists:get_value(bind_udp, Envs, []), + [{udp, Port, [{udp_options, InetOpts}]} || {Port, InetOpts} <- Udps]; + +listeners_confs(dtls, Envs) -> + case proplists:get_value(dtls_opts, Envs, []) of + [] -> []; + DtlsOpts -> + BindDtls = proplists:get_value(bind_dtls, Envs, []), + [{dtls, Port, [{dtls_options, InetOpts ++ DtlsOpts}]} || {Port, InetOpts} <- BindDtls] + end. + +format(Port) when is_integer(Port) -> + io_lib:format("0.0.0.0:~w", [Port]); +format({Addr, Port}) when is_list(Addr) -> + io_lib:format("~s:~w", [Addr, Port]); +format({Addr, Port}) when is_tuple(Addr) -> + io_lib:format("~s:~w", [inet:ntoa(Addr), Port]). + diff --git a/apps/emqx_coap/src/emqx_coap_sup.erl b/apps/emqx_coap/src/emqx_coap_sup.erl new file mode 100644 index 000000000..a3a0fdc53 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_sup.erl @@ -0,0 +1,42 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_sup). + +-behaviour(supervisor). + +-export([ start_link/0 + , init/1 + ]). + +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +init(_Args) -> + Registry = #{id => emqx_coap_registry, + start => {emqx_coap_registry, start_link, []}, + restart => permanent, + shutdown => 5000, + type => worker, + modules => [emqx_coap_registry]}, + PsTopics = #{id => emqx_coap_ps_topics, + start => {emqx_coap_ps_topics, start_link, []}, + restart => permanent, + shutdown => 5000, + type => worker, + modules => [emqx_coap_ps_topics]}, + {ok, {{one_for_all, 10, 3600}, [Registry, PsTopics]}}. + diff --git a/apps/emqx_coap/src/emqx_coap_timer.erl b/apps/emqx_coap/src/emqx_coap_timer.erl new file mode 100644 index 000000000..3924ba239 --- /dev/null +++ b/apps/emqx_coap/src/emqx_coap_timer.erl @@ -0,0 +1,59 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_timer). + +-include("emqx_coap.hrl"). + +-export([ cancel_timer/1 + , start_timer/2 + , restart_timer/1 + , kick_timer/1 + , is_timeout/1 + , get_timer_length/1 + ]). + +-record(timer_state, {interval, kickme, tref, message}). + +-define(LOG(Level, Format, Args), + emqx_logger:Level("CoAP-Timer: " ++ Format, Args)). + +cancel_timer(#timer_state{tref = TRef}) when is_reference(TRef) -> + catch erlang:cancel_timer(TRef), + ok; +cancel_timer(_) -> + ok. + +kick_timer(State=#timer_state{kickme = false}) -> + State#timer_state{kickme = true}; +kick_timer(State=#timer_state{kickme = true}) -> + State. + +start_timer(Sec, Msg) -> + ?LOG(debug, "emqx_coap_timer:start_timer ~p", [Sec]), + TRef = erlang:send_after(timer:seconds(Sec), self(), Msg), + #timer_state{interval = Sec, kickme = false, tref = TRef, message = Msg}. + +restart_timer(State=#timer_state{interval = Sec, message = Msg}) -> + ?LOG(debug, "emqx_coap_timer:restart_timer ~p", [Sec]), + TRef = erlang:send_after(timer:seconds(Sec), self(), Msg), + State#timer_state{kickme = false, tref = TRef}. + +is_timeout(#timer_state{kickme = Bool}) -> + not Bool. + +get_timer_length(#timer_state{interval = Interval}) -> + Interval. diff --git a/apps/emqx_coap/test/emqx_coap_SUITE.erl b/apps/emqx_coap/test/emqx_coap_SUITE.erl new file mode 100644 index 000000000..866e2e203 --- /dev/null +++ b/apps/emqx_coap/test/emqx_coap_SUITE.erl @@ -0,0 +1,240 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-include_lib("gen_coap/include/coap.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("emqx/include/emqx.hrl"). + +-define(LOGT(Format, Args), ct:pal(Format, Args)). + +all() -> emqx_ct:all(?MODULE). + +init_per_suite(Config) -> + emqx_ct_helpers:start_apps([emqx_coap], fun set_sepecial_cfg/1), + Config. + +set_sepecial_cfg(emqx_coap) -> + Opts = application:get_env(emqx_coap, dtls_opts,[]), + Opts2 = [{keyfile, emqx_ct_helpers:deps_path(emqx, "etc/certs/key.pem")}, + {certfile, emqx_ct_helpers:deps_path(emqx, "etc/certs/cert.pem")}], + application:set_env(emqx_coap, dtls_opts, emqx_misc:merge_opts(Opts, Opts2)), + application:set_env(emqx_coap, enable_stats, true); +set_sepecial_cfg(_) -> + ok. + +end_per_suite(Config) -> + emqx_ct_helpers:stop_apps([emqx_coap]), + Config. + +%%-------------------------------------------------------------------- +%% Test Cases +%%-------------------------------------------------------------------- + +t_publish(_Config) -> + Topic = <<"abc">>, Payload = <<"123">>, + TopicStr = binary_to_list(Topic), + URI = "coap://127.0.0.1/mqtt/"++TopicStr++"?c=client1&u=tom&p=secret", + + %% Sub topic first + emqx:subscribe(Topic), + + Reply = er_coap_client:request(put, URI, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + {ok, changed, _} = Reply, + + receive + {deliver, Topic, Msg} -> + ?assertEqual(Topic, Msg#message.topic), + ?assertEqual(Payload, Msg#message.payload) + after + 500 -> + ?assert(false) + end. + +t_observe(_Config) -> + Topic = <<"abc">>, TopicStr = binary_to_list(Topic), + Payload = <<"123">>, + Uri = "coap://127.0.0.1/mqtt/"++TopicStr++"?c=client1&u=tom&p=secret", + {ok, Pid, N, Code, Content} = er_coap_observer:observe(Uri), + ?LOGT("observer Pid=~p, N=~p, Code=~p, Content=~p", [Pid, N, Code, Content]), + + [SubPid] = emqx:subscribers(Topic), + ?assert(is_pid(SubPid)), + + %% Publish a message + emqx:publish(emqx_message:make(Topic, Payload)), + + Notif = receive_notification(), + ?LOGT("observer get Notif=~p", [Notif]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv}} = Notif, + ?_assertEqual(Payload, PayloadRecv), + + er_coap_observer:stop(Pid), + timer:sleep(100), + + [] = emqx:subscribers(Topic). + +t_observe_wildcard(_Config) -> + Topic = <<"+/b">>, TopicStr = http_uri:encode(binary_to_list(Topic)), + Payload = <<"123">>, + Uri = "coap://127.0.0.1/mqtt/"++TopicStr++"?c=client1&u=tom&p=secret", + {ok, Pid, N, Code, Content} = er_coap_observer:observe(Uri), + ?LOGT("observer Uri=~p, Pid=~p, N=~p, Code=~p, Content=~p", [Uri, Pid, N, Code, Content]), + + [SubPid] = emqx:subscribers(Topic), + ?assert(is_pid(SubPid)), + + %% Publish a message + emqx:publish(emqx_message:make(Topic, Payload)), + + Notif = receive_notification(), + ?LOGT("observer get Notif=~p", [Notif]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv}} = Notif, + ?_assertEqual(Payload, PayloadRecv), + + er_coap_observer:stop(Pid), + timer:sleep(100), + + [] = emqx:subscribers(Topic). + +t_observe_pub(_Config) -> + Topic = <<"+/b">>, TopicStr = http_uri:encode(binary_to_list(Topic)), + Uri = "coap://127.0.0.1/mqtt/"++TopicStr++"?c=client1&u=tom&p=secret", + {ok, Pid, N, Code, Content} = er_coap_observer:observe(Uri), + ?LOGT("observer Pid=~p, N=~p, Code=~p, Content=~p", [Pid, N, Code, Content]), + + [SubPid] = emqx:subscribers(Topic), + ?assert(is_pid(SubPid)), + + Topic2 = <<"a/b">>, Payload2 = <<"UFO">>, + TopicStr2 = http_uri:encode(binary_to_list(Topic2)), + URI2 = "coap://127.0.0.1/mqtt/"++TopicStr2++"?c=client1&u=tom&p=secret", + + Reply2 = er_coap_client:request(put, URI2, #coap_content{format = <<"application/octet-stream">>, payload = Payload2}), + {ok,changed, _} = Reply2, + + Notif2 = receive_notification(), + ?LOGT("observer get Notif2=~p", [Notif2]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv2}} = Notif2, + ?_assertEqual(Payload2, PayloadRecv2), + + Topic3 = <<"j/b">>, Payload3 = <<"ET629">>, + TopicStr3 = http_uri:encode(binary_to_list(Topic3)), + URI3 = "coap://127.0.0.1/mqtt/"++TopicStr3++"?c=client2&u=mike&p=guess", + Reply3 = er_coap_client:request(put, URI3, #coap_content{format = <<"application/octet-stream">>, payload = Payload3}), + {ok,changed, _} = Reply3, + + Notif3 = receive_notification(), + ?LOGT("observer get Notif3=~p", [Notif3]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv3}} = Notif3, + ?_assertEqual(Payload3, PayloadRecv3), + + er_coap_observer:stop(Pid). + +t_one_clientid_sub_2_topics(_Config) -> + Topic1 = <<"abc">>, TopicStr1 = binary_to_list(Topic1), + Payload1 = <<"123">>, + Uri1 = "coap://127.0.0.1/mqtt/"++TopicStr1++"?c=client1&u=tom&p=secret", + {ok, Pid1, N1, Code1, Content1} = er_coap_observer:observe(Uri1), + ?LOGT("observer 1 Pid=~p, N=~p, Code=~p, Content=~p", [Pid1, N1, Code1, Content1]), + + [SubPid] = emqx:subscribers(Topic1), + ?assert(is_pid(SubPid)), + + Topic2 = <<"x/y">>, TopicStr2 = http_uri:encode(binary_to_list(Topic2)), + Payload2 = <<"456">>, + Uri2 = "coap://127.0.0.1/mqtt/"++TopicStr2++"?c=client1&u=tom&p=secret", + {ok, Pid2, N2, Code2, Content2} = er_coap_observer:observe(Uri2), + ?LOGT("observer 2 Pid=~p, N=~p, Code=~p, Content=~p", [Pid2, N2, Code2, Content2]), + + [SubPid] = emqx:subscribers(Topic2), + ?assert(is_pid(SubPid)), + + emqx:publish(emqx_message:make(Topic1, Payload1)), + + Notif1 = receive_notification(), + ?LOGT("observer 1 get Notif=~p", [Notif1]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv1}} = Notif1, + ?_assertEqual(Payload1, PayloadRecv1), + + emqx:publish(emqx_message:make(Topic2, Payload2)), + + Notif2 = receive_notification(), + ?LOGT("observer 2 get Notif=~p", [Notif2]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv2}} = Notif2, + ?_assertEqual(Payload2, PayloadRecv2), + + er_coap_observer:stop(Pid1), + er_coap_observer:stop(Pid2). + +t_invalid_parameter(_Config) -> + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% "cid=client2" is invaid + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Topic3 = <<"a/b">>, Payload3 = <<"ET629">>, + TopicStr3 = http_uri:encode(binary_to_list(Topic3)), + URI3 = "coap://127.0.0.1/mqtt/"++TopicStr3++"?cid=client2&u=tom&p=simple", + Reply3 = er_coap_client:request(put, URI3, #coap_content{format = <<"application/octet-stream">>, payload = Payload3}), + ?assertMatch({error,bad_request}, Reply3), + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% "what=hello" is invaid + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + URI4 = "coap://127.0.0.1/mqtt/"++TopicStr3++"?what=hello", + Reply4 = er_coap_client:request(put, URI4, #coap_content{format = <<"application/octet-stream">>, payload = Payload3}), + ?assertMatch({error, bad_request}, Reply4). + +t_invalid_topic(_Config) -> + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% "a/b" is a valid topic string + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Topic3 = <<"a/b">>, Payload3 = <<"ET629">>, + TopicStr3 = binary_to_list(Topic3), + URI3 = "coap://127.0.0.1/mqtt/"++TopicStr3++"?c=client2&u=tom&p=simple", + Reply3 = er_coap_client:request(put, URI3, #coap_content{format = <<"application/octet-stream">>, payload = Payload3}), + ?assertMatch({ok,changed,_Content}, Reply3), + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% "+?#" is invaid topic string + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + URI4 = "coap://127.0.0.1/mqtt/"++"+?#"++"?what=hello", + Reply4 = er_coap_client:request(put, URI4, #coap_content{format = <<"application/octet-stream">>, payload = Payload3}), + ?assertMatch({error,bad_request}, Reply4). + +t_stats(_) -> + ok. + +t_auth_failure(_) -> + ok. + +t_qos_supprot(_) -> + ok. + +%%-------------------------------------------------------------------- +%% Helpers + +receive_notification() -> + receive + {coap_notify, Pid, N2, Code2, Content2} -> + {coap_notify, Pid, N2, Code2, Content2} + after 2000 -> + receive_notification_timeout + end. + diff --git a/apps/emqx_coap/test/emqx_coap_ps_SUITE.erl b/apps/emqx_coap/test/emqx_coap_ps_SUITE.erl new file mode 100644 index 000000000..0a1cc3860 --- /dev/null +++ b/apps/emqx_coap/test/emqx_coap_ps_SUITE.erl @@ -0,0 +1,677 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-module(emqx_coap_ps_SUITE). + +-compile(export_all). +-compile(nowarn_export_all). + +-include_lib("gen_coap/include/coap.hrl"). +-include_lib("eunit/include/eunit.hrl"). +-include_lib("emqx/include/emqx.hrl"). + +-define(LOGT(Format, Args), ct:pal(Format, Args)). + +all() -> emqx_ct:all(?MODULE). + +init_per_suite(Config) -> + emqx_ct_helpers:start_apps([emqx_coap], fun set_sepecial_cfg/1), + Config. + +set_sepecial_cfg(emqx_coap) -> + application:set_env(emqx_coap, enable_stats, true); +set_sepecial_cfg(_) -> + ok. + +end_per_suite(Config) -> + emqx_ct_helpers:stop_apps([emqx_coap]), + Config. + +%%-------------------------------------------------------------------- +%% Test Cases +%%-------------------------------------------------------------------- + +t_update_max_age(_Config) -> + TopicInPayload = <<"topic1">>, + Payload = <<";ct=42">>, + Payload1 = <<";ct=50">>, + URI = "coap://127.0.0.1/ps/"++"?c=client1&u=tom&p=secret", + URI2 = "coap://127.0.0.1/ps/topic1"++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + TopicInfo = [{TopicInPayload, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(TopicInPayload), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + timer:sleep(50), + + %% post to create the same topic but with different max age and ct value in payload + Reply1 = er_coap_client:request(post, URI, #coap_content{max_age = 70, format = <<"application/link-format">>, payload = Payload1}), + {ok,created, #coap_content{location_path = LocPath}} = Reply1, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{TopicInPayload, MaxAge2, CT2, _ResPayload, _TimeStamp1}] = emqx_coap_ps_topics:lookup_topic_info(TopicInPayload), + ?assertEqual(70, MaxAge2), + ?assertEqual(<<"50">>, CT2), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI2). + +t_create_subtopic(_Config) -> + TopicInPayload = <<"topic1">>, + TopicInPayloadStr = "topic1", + Payload = <<";ct=42">>, + URI = "coap://127.0.0.1/ps/"++"?c=client1&u=tom&p=secret", + RealURI = "coap://127.0.0.1/ps/topic1"++"?c=client1&u=tom&p=secret", + + Reply = er_coap_client:request(post, URI, #coap_content{format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + TopicInfo = [{TopicInPayload, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(TopicInPayload), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + timer:sleep(50), + + %% post to create the a sub topic + SubPayload = <<";ct=42">>, + SubTopicInPayloadStr = "subtopic", + SubURI = "coap://127.0.0.1/ps/"++TopicInPayloadStr++"?c=client1&u=tom&p=secret", + SubRealURI = "coap://127.0.0.1/ps/"++TopicInPayloadStr++"/"++SubTopicInPayloadStr++"?c=client1&u=tom&p=secret", + FullTopic = list_to_binary(TopicInPayloadStr++"/"++SubTopicInPayloadStr), + Reply1 = er_coap_client:request(post, SubURI, #coap_content{format = <<"application/link-format">>, payload = SubPayload}), + ?LOGT("Reply =~p", [Reply1]), + {ok,created, #coap_content{location_path = LocPath1}} = Reply1, + ?assertEqual([<<"/ps/topic1/subtopic">>] ,LocPath1), + [{FullTopic, MaxAge2, CT2, _ResPayload, _}] = emqx_coap_ps_topics:lookup_topic_info(FullTopic), + ?assertEqual(60, MaxAge2), + ?assertEqual(<<"42">>, CT2), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, SubRealURI), + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, RealURI). + +t_over_max_age(_Config) -> + TopicInPayload = <<"topic1">>, + Payload = <<";ct=42">>, + URI = "coap://127.0.0.1/ps/"++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{max_age = 2, format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + TopicInfo = [{TopicInPayload, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(TopicInPayload), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(2, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + timer:sleep(3000), + ?assertEqual(true, emqx_coap_ps_topics:is_topic_timeout(TopicInPayload)). + +t_refreash_max_age(_Config) -> + TopicInPayload = <<"topic1">>, + Payload = <<";ct=42">>, + Payload1 = <<";ct=50">>, + URI = "coap://127.0.0.1/ps/"++"?c=client1&u=tom&p=secret", + RealURI = "coap://127.0.0.1/ps/topic1"++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{max_age = 5, format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + TopicInfo = [{TopicInPayload, MaxAge1, CT1, _ResPayload, TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(TopicInPayload), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?LOGT("TimeStamp=~p", [TimeStamp]), + ?assertEqual(5, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + timer:sleep(3000), + + %% post to create the same topic, the max age timer will be restarted with the new max age value + Reply1 = er_coap_client:request(post, URI, #coap_content{max_age = 5, format = <<"application/link-format">>, payload = Payload1}), + {ok,created, #coap_content{location_path = LocPath}} = Reply1, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{TopicInPayload, MaxAge2, CT2, _ResPayload, TimeStamp1}] = emqx_coap_ps_topics:lookup_topic_info(TopicInPayload), + ?LOGT("TimeStamp1=~p", [TimeStamp1]), + ?assertEqual(5, MaxAge2), + ?assertEqual(<<"50">>, CT2), + + timer:sleep(3000), + ?assertEqual(false, emqx_coap_ps_topics:is_topic_timeout(TopicInPayload)), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, RealURI). + +t_case01_publish_post(_Config) -> + timer:sleep(100), + MainTopic = <<"maintopic">>, + TopicInPayload = <<"topic1">>, + Payload = <<";ct=42">>, + MainTopicStr = binary_to_list(MainTopic), + + %% post to create topic maintopic/topic1 + URI1 = "coap://127.0.0.1/ps/"++MainTopicStr++"?c=client1&u=tom&p=secret", + FullTopic = list_to_binary(MainTopicStr++"/"++binary_to_list(TopicInPayload)), + Reply1 = er_coap_client:request(post, URI1, #coap_content{format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply1]), + {ok,created, #coap_content{location_path = LocPath1}} = Reply1, + ?assertEqual([<<"/ps/maintopic/topic1">>] ,LocPath1), + [{FullTopic, MaxAge, CT2, <<>>, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(FullTopic), + ?assertEqual(60, MaxAge), + ?assertEqual(<<"42">>, CT2), + + %% post to publish message to topic maintopic/topic1 + FullTopicStr = http_uri:encode(binary_to_list(FullTopic)), + URI2 = "coap://127.0.0.1/ps/"++FullTopicStr++"?c=client1&u=tom&p=secret", + PubPayload = <<"PUBLISH">>, + + %% Sub topic first + emqx:subscribe(FullTopic), + + Reply2 = er_coap_client:request(post, URI2, #coap_content{format = <<"application/octet-stream">>, payload = PubPayload}), + ?LOGT("Reply =~p", [Reply2]), + {ok,changed, _} = Reply2, + TopicInfo = [{FullTopic, MaxAge, CT2, PubPayload, _TimeStamp1}] = emqx_coap_ps_topics:lookup_topic_info(FullTopic), + ?LOGT("the topic info =~p", [TopicInfo]), + + assert_recv(FullTopic, PubPayload), + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI2). + +t_case02_publish_post(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"payload">>, + + %% Sub topic first + emqx:subscribe(Topic), + + %% post to publish a new topic "topic1", and the topic is created + URI = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(60, MaxAge), + ?assertEqual(<<"42">>, CT), + + assert_recv(Topic, Payload), + + %% post to publish a new message to the same topic "topic1" with different payload + NewPayload = <<"newpayload">>, + Reply1 = er_coap_client:request(post, URI, #coap_content{format = <<"application/octet-stream">>, payload = NewPayload}), + ?LOGT("Reply =~p", [Reply1]), + {ok,changed, _} = Reply1, + [{Topic, MaxAge, CT, NewPayload, _TimeStamp1}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + + assert_recv(Topic, NewPayload), + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case03_publish_post(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"payload">>, + + %% Sub topic first + emqx:subscribe(Topic), + + %% post to publish a new topic "topic1", and the topic is created + URI = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(60, MaxAge), + ?assertEqual(<<"42">>, CT), + + assert_recv(Topic, Payload), + + %% post to publish a new message to the same topic "topic1", but the ct is not same as created + NewPayload = <<"newpayload">>, + Reply1 = er_coap_client:request(post, URI, #coap_content{format = <<"application/exi">>, payload = NewPayload}), + ?LOGT("Reply =~p", [Reply1]), + ?assertEqual({error,bad_request}, Reply1), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case04_publish_post(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"payload">>, + + %% post to publish a new topic "topic1", and the topic is created + URI = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{max_age = 5, format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(5, MaxAge), + ?assertEqual(<<"42">>, CT), + + %% after max age timeout, the topic still exists but the status is timeout + timer:sleep(6000), + ?assertEqual(true, emqx_coap_ps_topics:is_topic_timeout(Topic)), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case01_publish_put(_Config) -> + MainTopic = <<"maintopic">>, + TopicInPayload = <<"topic1">>, + Payload = <<";ct=42">>, + MainTopicStr = binary_to_list(MainTopic), + + %% post to create topic maintopic/topic1 + URI1 = "coap://127.0.0.1/ps/"++MainTopicStr++"?c=client1&u=tom&p=secret", + FullTopic = list_to_binary(MainTopicStr++"/"++binary_to_list(TopicInPayload)), + Reply1 = er_coap_client:request(post, URI1, #coap_content{format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply1]), + {ok,created, #coap_content{location_path = LocPath1}} = Reply1, + ?assertEqual([<<"/ps/maintopic/topic1">>] ,LocPath1), + [{FullTopic, MaxAge, CT2, <<>>, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(FullTopic), + ?assertEqual(60, MaxAge), + ?assertEqual(<<"42">>, CT2), + + %% put to publish message to topic maintopic/topic1 + FullTopicStr = http_uri:encode(binary_to_list(FullTopic)), + URI2 = "coap://127.0.0.1/ps/"++FullTopicStr++"?c=client1&u=tom&p=secret", + PubPayload = <<"PUBLISH">>, + + %% Sub topic first + emqx:subscribe(FullTopic), + + Reply2 = er_coap_client:request(put, URI2, #coap_content{format = <<"application/octet-stream">>, payload = PubPayload}), + ?LOGT("Reply =~p", [Reply2]), + {ok,changed, _} = Reply2, + [{FullTopic, MaxAge, CT2, PubPayload, _TimeStamp1}] = emqx_coap_ps_topics:lookup_topic_info(FullTopic), + + assert_recv(FullTopic, PubPayload), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI2). + +t_case02_publish_put(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"payload">>, + + %% Sub topic first + emqx:subscribe(Topic), + + %% put to publish a new topic "topic1", and the topic is created + URI = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(put, URI, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(60, MaxAge), + ?assertEqual(<<"42">>, CT), + + assert_recv(Topic, Payload), + + %% put to publish a new message to the same topic "topic1" with different payload + NewPayload = <<"newpayload">>, + Reply1 = er_coap_client:request(put, URI, #coap_content{format = <<"application/octet-stream">>, payload = NewPayload}), + ?LOGT("Reply =~p", [Reply1]), + {ok,changed, _} = Reply1, + [{Topic, MaxAge, CT, NewPayload, _TimeStamp1}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + + assert_recv(Topic, NewPayload), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case03_publish_put(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"payload">>, + + %% Sub topic first + emqx:subscribe(Topic), + + %% put to publish a new topic "topic1", and the topic is created + URI = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(put, URI, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(60, MaxAge), + ?assertEqual(<<"42">>, CT), + + assert_recv(Topic, Payload), + + %% put to publish a new message to the same topic "topic1", but the ct is not same as created + NewPayload = <<"newpayload">>, + Reply1 = er_coap_client:request(put, URI, #coap_content{format = <<"application/exi">>, payload = NewPayload}), + ?LOGT("Reply =~p", [Reply1]), + ?assertEqual({error,bad_request}, Reply1), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case04_publish_put(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"payload">>, + + %% put to publish a new topic "topic1", and the topic is created + URI = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(put, URI, #coap_content{max_age = 5, format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/topic1">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(5, MaxAge), + ?assertEqual(<<"42">>, CT), + + %% after max age timeout, no publish message to the same topic, the topic info will be deleted + %%%%%%%%%%%%%%%%%%%%%%%%%% + % but there is one thing to do is we don't count in the publish message received from emqx(from other node).TBD!!!!!!!!!!!!! + %%%%%%%%%%%%%%%%%%%%%%%%%% + timer:sleep(6000), + ?assertEqual(true, emqx_coap_ps_topics:is_topic_timeout(Topic)), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case01_subscribe(_Config) -> + Topic = <<"topic1">>, + Payload1 = <<";ct=42">>, + timer:sleep(100), + + %% First post to create a topic "topic1" + Uri = "coap://127.0.0.1/ps/"++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, Uri, #coap_content{format = <<"application/link-format">>, payload = Payload1}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = [LocPath]}} = Reply, + ?assertEqual(<<"/ps/topic1">> ,LocPath), + TopicInfo = [{Topic, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + %% Subscribe the topic + Uri1 = "coap://127.0.0.1"++binary_to_list(LocPath)++"?c=client1&u=tom&p=secret", + {ok, Pid, N, Code, Content} = er_coap_observer:observe(Uri1), + ?LOGT("observer Pid=~p, N=~p, Code=~p, Content=~p", [Pid, N, Code, Content]), + + [SubPid] = emqx:subscribers(Topic), + ?assert(is_pid(SubPid)), + + %% Publish a message + Payload = <<"123">>, + emqx:publish(emqx_message:make(Topic, Payload)), + + Notif = receive_notification(), + ?LOGT("observer get Notif=~p", [Notif]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = PayloadRecv}} = Notif, + + ?_assertEqual(Payload, PayloadRecv), + + %% GET to read the publish message of the topic + Reply1 = er_coap_client:request(get, Uri1), + ?LOGT("Reply=~p", [Reply1]), + {ok,content, #coap_content{max_age = MaxAgeLeft,payload = <<"123">>}} = Reply1, + ?_assertEqual(true, MaxAgeLeft<60), + + er_coap_observer:stop(Pid), + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, Uri1). + +t_case02_subscribe(_Config) -> + Topic = <<"a/b">>, + TopicStr = binary_to_list(Topic), + PercentEncodedTopic = http_uri:encode(TopicStr), + Payload = <<"payload">>, + + %% post to publish a new topic "a/b", and the topic is created + URI = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{max_age = 5, format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/a/b">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(5, MaxAge), + ?assertEqual(<<"42">>, CT), + + %% Wait for the max age of the timer expires + timer:sleep(6000), + ?assertEqual(true, emqx_coap_ps_topics:is_topic_timeout(Topic)), + + %% Subscribe to the timeout topic "a/b", still successfully,got {ok, nocontent} Method + Uri = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + Reply1 = {ok, Pid, _N, nocontent, _} = er_coap_observer:observe(Uri), + ?LOGT("Subscribe Reply=~p", [Reply1]), + + [SubPid] = emqx:subscribers(Topic), + ?assert(is_pid(SubPid)), + + %% put to publish to topic "a/b" + Reply2 = er_coap_client:request(put, URI, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + {ok,changed, #coap_content{}} = Reply2, + [{Topic, MaxAge1, CT, Payload, TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT), + ?assertEqual(false, TimeStamp =:= timeout), + + %% Publish a message + emqx:publish(emqx_message:make(Topic, Payload)), + + Notif = receive_notification(), + ?LOGT("observer get Notif=~p", [Notif]), + {coap_notify, _, _, {ok,content}, #coap_content{payload = Payload}} = Notif, + + er_coap_observer:stop(Pid), + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case03_subscribe(_Config) -> + %% Subscribe to the unexisted topic "a/b", got not_found + Topic = <<"a/b">>, + TopicStr = binary_to_list(Topic), + PercentEncodedTopic = http_uri:encode(TopicStr), + Uri = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + {error, not_found} = er_coap_observer:observe(Uri), + + [] = emqx:subscribers(Topic). + +t_case04_subscribe(_Config) -> + %% Subscribe to the wildcad topic "+/b", got bad_request + Topic = <<"+/b">>, + TopicStr = binary_to_list(Topic), + PercentEncodedTopic = http_uri:encode(TopicStr), + Uri = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + {error, bad_request} = er_coap_observer:observe(Uri), + + [] = emqx:subscribers(Topic). + +t_case01_read(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"PubPayload">>, + timer:sleep(100), + + %% First post to create a topic "topic1" + Uri = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, Uri, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = [LocPath]}} = Reply, + ?assertEqual(<<"/ps/topic1">> ,LocPath), + TopicInfo = [{Topic, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + %% GET to read the publish message of the topic + Reply1 = er_coap_client:request(get, Uri), + ?LOGT("Reply=~p", [Reply1]), + {ok,content, #coap_content{max_age = MaxAgeLeft,payload = Payload}} = Reply1, + ?_assertEqual(true, MaxAgeLeft<60), + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, Uri). + +t_case02_read(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"PubPayload">>, + timer:sleep(100), + + %% First post to publish a topic "topic1" + Uri = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, Uri, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = [LocPath]}} = Reply, + ?assertEqual(<<"/ps/topic1">> ,LocPath), + TopicInfo = [{Topic, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + %% GET to read the publish message of unmatched format, got bad_request + Reply1 = er_coap_client:request(get, Uri, #coap_content{format = <<"application/json">>}), + ?LOGT("Reply=~p", [Reply1]), + {error, bad_request} = Reply1, + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, Uri). + +t_case03_read(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Uri = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + timer:sleep(100), + + %% GET to read the nexisted topic "topic1", got not_found + Reply = er_coap_client:request(get, Uri), + ?LOGT("Reply=~p", [Reply]), + {error, not_found} = Reply. + +t_case04_read(_Config) -> + Topic = <<"topic1">>, + TopicStr = binary_to_list(Topic), + Payload = <<"PubPayload">>, + timer:sleep(100), + + %% First post to publish a topic "topic1" + Uri = "coap://127.0.0.1/ps/"++TopicStr++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, Uri, #coap_content{format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = [LocPath]}} = Reply, + ?assertEqual(<<"/ps/topic1">> ,LocPath), + TopicInfo = [{Topic, MaxAge1, CT1, _ResPayload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?LOGT("lookup topic info=~p", [TopicInfo]), + ?assertEqual(60, MaxAge1), + ?assertEqual(<<"42">>, CT1), + + %% GET to read the publish message of wildcard topic, got bad_request + WildTopic = binary_to_list(<<"+/topic1">>), + Uri1 = "coap://127.0.0.1/ps/"++WildTopic++"?c=client1&u=tom&p=secret", + Reply1 = er_coap_client:request(get, Uri1, #coap_content{format = <<"application/json">>}), + ?LOGT("Reply=~p", [Reply1]), + {error, bad_request} = Reply1, + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, Uri). + +t_case05_read(_Config) -> + Topic = <<"a/b">>, + TopicStr = binary_to_list(Topic), + PercentEncodedTopic = http_uri:encode(TopicStr), + Payload = <<"payload">>, + + %% post to publish a new topic "a/b", and the topic is created + URI = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + Reply = er_coap_client:request(post, URI, #coap_content{max_age = 5, format = <<"application/octet-stream">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/a/b">>] ,LocPath), + [{Topic, MaxAge, CT, Payload, _TimeStamp}] = emqx_coap_ps_topics:lookup_topic_info(Topic), + ?assertEqual(5, MaxAge), + ?assertEqual(<<"42">>, CT), + + %% Wait for the max age of the timer expires + timer:sleep(6000), + ?assertEqual(true, emqx_coap_ps_topics:is_topic_timeout(Topic)), + + %% GET to read the expired publish message, supposed to get {ok, nocontent}, but now got {ok, content} + Reply1 = er_coap_client:request(get, URI), + ?LOGT("Reply=~p", [Reply1]), + {ok, content, #coap_content{payload = <<>>}}= Reply1, + + {ok, deleted, #coap_content{}} = er_coap_client:request(delete, URI). + +t_case01_delete(_Config) -> + TopicInPayload = <<"a/b">>, + TopicStr = binary_to_list(TopicInPayload), + PercentEncodedTopic = http_uri:encode(TopicStr), + Payload = list_to_binary("<"++PercentEncodedTopic++">;ct=42"), + URI = "coap://127.0.0.1/ps/"++"?c=client1&u=tom&p=secret", + + %% Client post to CREATE topic "a/b" + Reply = er_coap_client:request(post, URI, #coap_content{format = <<"application/link-format">>, payload = Payload}), + ?LOGT("Reply =~p", [Reply]), + {ok,created, #coap_content{location_path = LocPath}} = Reply, + ?assertEqual([<<"/ps/a/b">>] ,LocPath), + + %% Client post to CREATE topic "a/b/c" + TopicInPayload1 = <<"a/b/c">>, + PercentEncodedTopic1 = http_uri:encode(binary_to_list(TopicInPayload1)), + Payload1 = list_to_binary("<"++PercentEncodedTopic1++">;ct=42"), + Reply1 = er_coap_client:request(post, URI, #coap_content{format = <<"application/link-format">>, payload = Payload1}), + ?LOGT("Reply =~p", [Reply1]), + {ok,created, #coap_content{location_path = LocPath1}} = Reply1, + ?assertEqual([<<"/ps/a/b/c">>] ,LocPath1), + + timer:sleep(50), + + %% DELETE the topic "a/b" + UriD = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + ReplyD = er_coap_client:request(delete, UriD), + ?LOGT("Reply=~p", [Reply1]), + {ok, deleted, #coap_content{}}= ReplyD, + + ?assertEqual(false, emqx_coap_ps_topics:is_topic_existed(TopicInPayload)), + ?assertEqual(false, emqx_coap_ps_topics:is_topic_existed(TopicInPayload1)). + +t_case02_delete(_Config) -> + TopicInPayload = <<"a/b">>, + TopicStr = binary_to_list(TopicInPayload), + PercentEncodedTopic = http_uri:encode(TopicStr), + + %% DELETE the unexisted topic "a/b" + Uri1 = "coap://127.0.0.1/ps/"++PercentEncodedTopic++"?c=client1&u=tom&p=secret", + Reply1 = er_coap_client:request(delete, Uri1), + ?LOGT("Reply=~p", [Reply1]), + {error, not_found} = Reply1. + +t_case13_emit_stats_test(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% Internal functions + +receive_notification() -> + receive + {coap_notify, Pid, N2, Code2, Content2} -> + {coap_notify, Pid, N2, Code2, Content2} + after 2000 -> + receive_notification_timeout + end. + +assert_recv(Topic, Payload) -> + receive + {deliver, _, Msg} -> + ?assertEqual(Topic, Msg#message.topic), + ?assertEqual(Payload, Msg#message.payload) + after + 500 -> + ?assert(false) + end. + diff --git a/apps/emqx_enterprise_dashboard/.github/workflows/run_test_cases.yaml b/apps/emqx_enterprise_dashboard/.github/workflows/run_test_cases.yaml new file mode 100644 index 000000000..3b4fa29ec --- /dev/null +++ b/apps/emqx_enterprise_dashboard/.github/workflows/run_test_cases.yaml @@ -0,0 +1,28 @@ +name: Run test cases + +on: [push, pull_request] + +jobs: + run_test_cases: + runs-on: ubuntu-latest + + container: + image: erlang:22.1 + + steps: + - uses: actions/checkout@v1 + - name: run test cases + run: | + make eunit + make ct + make cover + - uses: actions/upload-artifact@v1 + if: always() + with: + name: logs + path: _build/test/logs + - uses: actions/upload-artifact@v1 + with: + name: cover + path: _build/test/cover + diff --git a/apps/emqx_enterprise_dashboard/.gitignore b/apps/emqx_enterprise_dashboard/.gitignore new file mode 100644 index 000000000..7e3592c39 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/.gitignore @@ -0,0 +1,26 @@ +.eunit +deps +*.o +*.beam +*.plt +erl_crash.dump +ebin +rel/example_project +.concrete/DEV_MODE +.rebar +.erlang.mk/ +ct.coverdata +logs/ +test/ct.cover.spec +data/ +.DS_Store +emqx_dashboard.d +cover/ +eunit.coverdata +.DS_Store +erlang.mk +rebar.lock +_build/ +*.conf.rendered +.rebar3/* + diff --git a/apps/emqx_enterprise_dashboard/.travis.yml b/apps/emqx_enterprise_dashboard/.travis.yml new file mode 100644 index 000000000..42422b9ce --- /dev/null +++ b/apps/emqx_enterprise_dashboard/.travis.yml @@ -0,0 +1,15 @@ +language: erlang + +otp_release: + - 21.3 + +before_install: + - git clone https://github.com/erlang/rebar3.git; cd rebar3; ./bootstrap; sudo mv rebar3 /usr/local/bin/; cd .. + +script: + - make xref + - make eunit + - make ct + +sudo: false + diff --git a/apps/emqx_enterprise_dashboard/LICENSE b/apps/emqx_enterprise_dashboard/LICENSE new file mode 100644 index 000000000..3fc84396f --- /dev/null +++ b/apps/emqx_enterprise_dashboard/LICENSE @@ -0,0 +1 @@ +Copyright (c) 2019 EMQ Technologies Co., Ltd. All Rights Reserved. \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/Makefile b/apps/emqx_enterprise_dashboard/Makefile new file mode 100644 index 000000000..e95664406 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/Makefile @@ -0,0 +1,29 @@ +## shallow clone for speed + +REBAR_GIT_CLONE_OPTIONS += --depth 1 +export REBAR_GIT_CLONE_OPTIONS + +REBAR = rebar3 +all: compile + +compile: + $(REBAR) compile + +clean: distclean + +ct: compile + $(REBAR) as test ct -v + +eunit: compile + $(REBAR) as test eunit + +xref: + $(REBAR) xref + +cover: + $(REBAR) cover + +distclean: + @rm -rf _build + @rm -f data/app.*.config data/vm.*.args rebar.lock + diff --git a/apps/emqx_enterprise_dashboard/README.md b/apps/emqx_enterprise_dashboard/README.md new file mode 100644 index 000000000..a0e720d5d --- /dev/null +++ b/apps/emqx_enterprise_dashboard/README.md @@ -0,0 +1,89 @@ + +emqx-dashboard +============== + +Dashboard for the EMQ X Broker. + +REST API +-------- + +The prefix of REST API is '/api/v2/'. + +Method | Path | Description +-------|---------------------------------------|------------------------------------ +GET | /nodes/ | A list of nodes in the cluster +GET | /nodes/:node | Lookup a node in the cluster +GET | /brokers/ | A list of brokers in the cluster +GET | /brokers/:node | Get broker info of a node +GET | /metrics/ | A list of metrics of all nodes in the cluster +GET | /nodes/:node/metrics/ | A list of metrics of a node +GET | /stats/ | A list of stats of all nodes in the cluster +GET | /nodes/:node/stats/ | A list of stats of a node +GET | /nodes/:node/clients/ | A list of clients on a node +GET | /listeners/ | A list of listeners in the cluster +GET | /nodes/:node/listeners | A list of listeners on the node +GET | /nodes/:node/sessions/ | A list of sessions on a node +GET | /subscriptions/:clientid | A list of subscriptions of a client +GET | /nodes/:node/subscriptions/:clientid | A list of subscriptions of a client on the node +GET | /nodes/:node/subscriptions/ | A list of subscriptions on a node +PUT | /clients/:clientid/clean_acl_cache | Clean ACL cache of a client +GET | /configs/ | Get all configs +GET | /nodes/:node/configs/ | Get all configs of a node +GET | /nodes/:node/plugin_configs/:plugin | Get configurations of a plugin on the node +DELETE | /clients/:clientid | Kick out a client +GET | /alarms/:node | List alarms of a node +GET | /alarms/ | List all alarms +GET | /plugins/ | List all plugins in the cluster +GET | /nodes/:node/plugins/ | List all plugins on a node +GET | /routes/ | List routes +POST | /nodes/:node/plugins/:plugin/load | Load a plugin +GET | /clients/:clientid | Lookup a client in the cluster +GET | nodes/:node/clients/:clientid | Lookup a client on node +GET | nodes/:node/sessions/:clientid | Lookup a session in the cluster +GET | nodes/:node/sessions/:clientid | Lookup a session on the node +POST | /mqtt/publish | Publish a MQTT message +POST | /mqtt/subscribe | Subscribe a topic +POST | /nodes/:node/plugins/:plugin/unload | Unload a plugin +POST | /mqtt/unsubscribe | Unsubscribe a topic +PUT | /configs/:app | Update config of an application in the cluster +PUT | /nodes/:node/configs/:app | Update config of an application on a node +PUT | /nodes/:node/plugin_configs/:plugin | Update configurations of a plugin on the node + +Build +----- + +make && make ct + +Configurtion +------------ + +``` +dashboard.listener = 18083 + +dashboard.listener.acceptors = 2 + +dashboard.listener.max_clients = 512 +``` + +Load Plugin +----------- + +``` +./bin/emqx_ctl plugins load emqx_dashboard +``` + +Login +----- + +URL: http://host:18083 + +Username: admin + +Password: public + +License +------- + +Apache License Version 2.0 + + diff --git a/apps/emqx_enterprise_dashboard/etc/emqx_dashboard.conf b/apps/emqx_enterprise_dashboard/etc/emqx_dashboard.conf new file mode 100644 index 000000000..e580bd46f --- /dev/null +++ b/apps/emqx_enterprise_dashboard/etc/emqx_dashboard.conf @@ -0,0 +1,117 @@ +##-------------------------------------------------------------------- +## EMQ X Dashboard +##-------------------------------------------------------------------- + +## Default user's login name. +## +## Value: String +dashboard.default_user.login = admin + +## Default user's password. +## +## Value: String +dashboard.default_user.password = public + +## Default metrics.expire interval. +## +## d - day +## h - hour +## m - minute +## s - second +dashboard.metrics.expire_interval = 7d + +##-------------------------------------------------------------------- +## HTTP Listener + +## The port that the Dashboard HTTP listener will bind. +## +## Value: Port +## +## Examples: 18083 +dashboard.listener.http = 18083 + +## The acceptor pool for external Dashboard HTTP listener. +## +## Value: Number +dashboard.listener.http.acceptors = 4 + +## Maximum number of concurrent Dashboard HTTP connections. +## +## Value: Number +dashboard.listener.http.max_clients = 512 +##-------------------------------------------------------------------- +## HTTPS Listener + +## The port that the Dashboard HTTPS listener will bind. +## +## Value: Port +## +## Examples: 18084 +## dashboard.listener.https = 18084 + +## The acceptor pool for external Dashboard HTTPS listener. +## +## Value: Number +## dashboard.listener.https.acceptors = 2 + +## Maximum number of concurrent Dashboard HTTPS connections. +## +## Value: Number +## dashboard.listener.https.max_clients = 512 + +## Path to the file containing the user's private PEM-encoded key. +## +## Value: File +## dashboard.listener.https.keyfile = etc/certs/key.pem + +## Path to a file containing the user certificate. +## +## Value: File +## dashboard.listener.https.certfile = etc/certs/cert.pem + +## Path to the file containing PEM-encoded CA certificates. +## +## Value: File +## dashboard.listener.https.cacertfile = etc/certs/cacert.pem + +## See: 'listener.ssl..dhfile' in emq.conf +## +## Value: File +## dashboard.listener.https.dhfile = {{ platform_etc_dir }}/certs/dh-params.pem + +## See: 'listener.ssl..vefify' in emq.conf +## +## Value: vefify_peer | verify_none +## dashboard.listener.https.verify = verify_peer + +## See: 'listener.ssl..fail_if_no_peer_cert' in emq.conf +## +## Value: false | true +## dashboard.listener.https.fail_if_no_peer_cert = true + +## TLS versions only to protect from POODLE attack. +## +## Value: String, seperated by ',' +## dashboard.listener.https.tls_versions = tlsv1.2,tlsv1.1,tlsv1 + +## See: 'listener.ssl..ciphers' in emq.conf +## +## Value: Ciphers +## dashboard.listener.https.ciphers = ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-AES256-SHA384,ECDHE-RSA-AES256-SHA384,ECDHE-ECDSA-DES-CBC3-SHA,ECDH-ECDSA-AES256-GCM-SHA384,ECDH-RSA-AES256-GCM-SHA384,ECDH-ECDSA-AES256-SHA384,ECDH-RSA-AES256-SHA384,DHE-DSS-AES256-GCM-SHA384,DHE-DSS-AES256-SHA256,AES256-GCM-SHA384,AES256-SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES128-SHA256,ECDHE-RSA-AES128-SHA256,ECDH-ECDSA-AES128-GCM-SHA256,ECDH-RSA-AES128-GCM-SHA256,ECDH-ECDSA-AES128-SHA256,ECDH-RSA-AES128-SHA256,DHE-DSS-AES128-GCM-SHA256,DHE-DSS-AES128-SHA256,AES128-GCM-SHA256,AES128-SHA256,ECDHE-ECDSA-AES256-SHA,ECDHE-RSA-AES256-SHA,DHE-DSS-AES256-SHA,ECDH-ECDSA-AES256-SHA,ECDH-RSA-AES256-SHA,AES256-SHA,ECDHE-ECDSA-AES128-SHA,ECDHE-RSA-AES128-SHA,DHE-DSS-AES128-SHA,ECDH-ECDSA-AES128-SHA,ECDH-RSA-AES128-SHA,AES128-SHA + +## See: 'listener.ssl..secure_renegotiate' in emq.conf +## +## Value: on | off +## dashboard.listener.https.secure_renegotiate = off + +## See: 'listener.ssl..reuse_sessions' in emq.conf +## +## Value: on | off +## dashboard.listener.https.reuse_sessions = on + +## See: 'listener.ssl..honor_cipher_order' in emq.conf +## +## Value: on | off +## dashboard.listener.https.honor_cipher_order = on + + diff --git a/apps/emqx_enterprise_dashboard/include/emqx_dashboard.hrl b/apps/emqx_enterprise_dashboard/include/emqx_dashboard.hrl new file mode 100644 index 000000000..769d9f503 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/include/emqx_dashboard.hrl @@ -0,0 +1,23 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2015-2017 EMQ Enterprise, Inc. (http://emqtt.io). +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + +-record(mqtt_admin, {username, password, tags}). + +-type(mqtt_admin() :: #mqtt_admin{}). + +-define(EMPTY_KEY(Key), ((Key == undefined) orelse (Key == <<>>))). + +-record(mqtt_collect, {timestamp, collect}). \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/emqx_dashboard.schema b/apps/emqx_enterprise_dashboard/priv/emqx_dashboard.schema new file mode 100644 index 000000000..4207defc4 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/emqx_dashboard.schema @@ -0,0 +1,134 @@ +%%-*- mode: erlang -*- +%% emqx_dashboard config mapping + +{mapping, "dashboard.default_user.login", "emqx_dashboard.default_user_username", [ + {datatype, string} +]}. + +{mapping, "dashboard.default_user.password", "emqx_dashboard.default_user_passwd", [ + {datatype, string} +]}. + +{mapping, "dashboard.metrics.expire_interval", "emqx_dashboard.expire_interval", [ + {datatype, {duration, ms}} +]}. + +{mapping, "dashboard.listener.http", "emqx_dashboard.listeners", [ + {datatype, integer} +]}. + +{mapping, "dashboard.listener.http.acceptors", "emqx_dashboard.listeners", [ + {default, 4}, + {datatype, integer} +]}. + +{mapping, "dashboard.listener.http.max_clients", "emqx_dashboard.listeners", [ + {default, 512}, + {datatype, integer} +]}. + +{mapping, "dashboard.listener.http.access.$id", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https", "emqx_dashboard.listeners", [ + {datatype, integer} +]}. + +{mapping, "dashboard.listener.https.acceptors", "emqx_dashboard.listeners", [ + {default, 8}, + {datatype, integer} +]}. + +{mapping, "dashboard.listener.https.max_clients", "emqx_dashboard.listeners", [ + {default, 64}, + {datatype, integer} +]}. + +{mapping, "dashboard.listener.https.tls_versions", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.dhfile", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.keyfile", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.certfile", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.cacertfile", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.verify", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.fail_if_no_peer_cert", "emqx_dashboard.listeners", [ + {datatype, {enum, [true, false]}} +]}. + +{mapping, "dashboard.listener.https.ciphers", "emqx_dashboard.listeners", [ + {datatype, string} +]}. + +{mapping, "dashboard.listener.https.secure_renegotiate", "emqx_dashboard.listeners", [ + {datatype, flag} +]}. + +{mapping, "dashboard.listener.https.reuse_sessions", "emqx_dashboard.listeners", [ + {default, on}, + {datatype, flag} +]}. + +{mapping, "dashboard.listener.https.honor_cipher_order", "emqx_dashboard.listeners", [ + {datatype, flag} +]}. + +{translation, "emqx_dashboard.listeners", fun(Conf) -> + Filter = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end, + LisOpts = fun(Prefix) -> + Filter([{num_acceptors, cuttlefish:conf_get(Prefix ++ ".acceptors", Conf)}, + {max_connections, cuttlefish:conf_get(Prefix ++ ".max_clients", Conf)}]) + end, + + SplitFun = fun(undefined) -> undefined; (S) -> string:tokens(S, ",") end, + + SslOpts = fun(Prefix) -> + Versions = case SplitFun(cuttlefish:conf_get(Prefix ++ ".tls_versions", Conf, undefined)) of + undefined -> undefined; + L -> [list_to_atom(V) || V <- L] + end, + Filter([{versions, Versions}, + {ciphers, SplitFun(cuttlefish:conf_get(Prefix ++ ".ciphers", Conf, undefined))}, + {dhfile, cuttlefish:conf_get(Prefix ++ ".dhfile", Conf, undefined)}, + {keyfile, cuttlefish:conf_get(Prefix ++ ".keyfile", Conf, undefined)}, + {certfile, cuttlefish:conf_get(Prefix ++ ".certfile", Conf, undefined)}, + {cacertfile, cuttlefish:conf_get(Prefix ++ ".cacertfile", Conf, undefined)}, + {verify, cuttlefish:conf_get(Prefix ++ ".verify", Conf, undefined)}, + {fail_if_no_peer_cert, cuttlefish:conf_get(Prefix ++ ".fail_if_no_peer_cert", Conf, undefined)}, + {secure_renegotiate, cuttlefish:conf_get(Prefix ++ ".secure_renegotiate", Conf, undefined)}, + {reuse_sessions, cuttlefish:conf_get(Prefix ++ ".reuse_sessions", Conf, undefined)}, + {honor_cipher_order, cuttlefish:conf_get(Prefix ++ ".honor_cipher_order", Conf, undefined)}]) + end, + lists:append( + lists:map( + fun(Proto) -> + Prefix = "dashboard.listener." ++ atom_to_list(Proto), + case cuttlefish:conf_get(Prefix, Conf, undefined) of + undefined -> []; + Port -> + [{Proto, Port, case Proto of + http -> LisOpts(Prefix); + https -> LisOpts(Prefix) ++ SslOpts(Prefix) + end}] + end + end, [http, https])) +end}. + + diff --git a/apps/emqx_enterprise_dashboard/priv/www/index.html b/apps/emqx_enterprise_dashboard/priv/www/index.html new file mode 100644 index 000000000..169af29b7 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/index.html @@ -0,0 +1 @@ +EMQ X Dashboard
\ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/app.0607679a.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/app.0607679a.css new file mode 100644 index 000000000..2c4b82683 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/app.0607679a.css @@ -0,0 +1 @@ +.left-bar{min-height:calc(100vh - 80px);background-color:#2f333e;-webkit-transition:all .3s;transition:all .3s}.left-bar .menu-wrapper{margin-top:54px}.left-bar .ant-menu{border-right-color:transparent}.left-bar .ant-menu.ant-menu-inline{border-right-color:#fff;border-right:0}.left-bar .ant-menu-dark,.left-bar .ant-menu-sub{background-color:#2f333e}.left-bar .ant-menu-inline.ant-menu-sub{background:rgba(0,0,0,.46)}.left-bar .ant-menu-item .anticon,.left-bar .ant-menu-submenu-title .anticon{margin-right:12px;font-size:18px}.left-bar .logo{text-align:center;width:200px;height:60px;line-height:60px;overflow:hidden;position:fixed;top:0;left:0;z-index:100;-webkit-transition:all .3s;transition:all .3s;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 20px;background:#2f333e}.left-bar .logo .logo-img{width:72px;height:auto;position:relative;left:-3px}.left-bar .logo .line{margin-top:12px;width:120px}.left-bar .el-scrollbar{height:100vh}.ant-menu-dark .ant-menu-sub{background-color:rgba(0,0,0,.81)}.breadcrumb{width:100%;margin:0 0 3px 5px}.nav-header[data-v-72830772]{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:50px;padding:0 20px 0 8px;background-color:#fff;-webkit-box-shadow:0 1px 4px rgba(0,21,41,.08);box-shadow:0 1px 4px rgba(0,21,41,.08);position:fixed;top:0;right:0;left:201px;z-index:100;-webkit-transition:all .3s;transition:all .3s}.nav-header[data-v-72830772],.pull-right[data-v-72830772]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.pull-right[data-v-72830772]{color:rgba(0,0,0,.65);font-size:14px}.func-item[data-v-72830772]{height:50px;line-height:53px;padding:0 12px;-webkit-transition:all .3s;transition:all .3s;cursor:pointer}.func-item[data-v-72830772]:hover{background-color:rgba(0,0,0,.024)}.func-item .iconfont[data-v-72830772]{font-size:18px;padding:4px}.el-badge[data-v-72830772]{line-height:20px}.el-dropdown-menu[data-v-72830772]{width:130px;text-align:center}.nav-tabs{position:fixed;width:auto;padding:0 24px;top:50px;right:0;left:200px;height:30px;line-height:28px;background:#fcfcfc;-webkit-box-shadow:0 1px 4px rgba(0,21,41,.1);box-shadow:0 1px 4px rgba(0,21,41,.1);z-index:100}.nav-tabs,.nav-tabs .el-button{-webkit-transition:all .3s;transition:all .3s}.nav-tabs .el-button{min-width:50px}.nav-tabs .el-button.active,.nav-tabs .el-button.active:focus,.nav-tabs .el-button.active:hover{border-color:#34c388;color:#fff;background:#34c388}.nav-tabs .el-button.active .btn-close,.nav-tabs .el-button.active:focus .btn-close,.nav-tabs .el-button.active:hover .btn-close{color:#fff}.nav-tabs .el-button .btn-close{color:#606266;-webkit-transition:all .3s;transition:all .3s;border-radius:50%;display:inline-block;width:12px;height:12px;text-align:center}.nav-tabs .el-button .btn-close i{-webkit-transform:scale(.6);transform:scale(.6);position:relative}.nav-tabs .el-button .btn-close:hover{background:#afafaf;color:#fff}.nav-tabs .scroll-container{white-space:nowrap;position:relative;overflow:hidden;width:100%}.nav-tabs .scroll-container .el-scrollbar__bar.is-horizontal{display:none}.nav-tabs .scroll-container .el-scrollbar:active>.el-scrollbar__bar,.nav-tabs .scroll-container .el-scrollbar:focus>.el-scrollbar__bar,.nav-tabs .scroll-container .el-scrollbar:hover>.el-scrollbar__bar{opacity:0}.fade-transform-enter-active[data-v-24e2d574],.fade-transform-leave-active[data-v-24e2d574]{-webkit-transition:all .3s;transition:all .3s}.fade-transform-enter[data-v-24e2d574]{opacity:0;-webkit-transform:translateX(30px);transform:translateX(30px)}.fade-transform-leave-to[data-v-24e2d574]{opacity:0;-webkit-transform:translateX(-30px);transform:translateX(-30px)}.el-aside[data-v-24e2d574]{background-color:#2f333e;-webkit-transition:all .3s;transition:all .3s;position:fixed;top:0;left:0;bottom:0;z-index:100}.el-main[data-v-24e2d574]{-webkit-transition:margin-left .3s;transition:margin-left .3s}.el-select-dropdown .custom-option .value{float:right;font-size:12px;color:#888;margin-left:30px}.page-header{width:auto;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;margin:24px 24px 0 24px}.page-header .page-header-top-start{position:absolute;right:24px;top:16px}.page-header .page-header-top-start.btn{top:12px}.page-header .page-header-content{width:100%;height:100%;min-height:100%;-webkit-transition:.3s;transition:.3s;padding:16px 24px}.page-header .page-header-content p{margin-bottom:0}.page-header .page-header-title-view .title{display:inline-block;padding-right:12px;color:rgba(0,0,0,.85);font-weight:700;font-size:16px;line-height:1.4}.page-header .page-header-title-view .title span{margin-right:8px}.page-header .page-header-title-view+.page-header-content-view{margin-top:16px}.page-header .link-item{margin-right:12px}.page-header .link-item .icon{width:24px;height:24px;line-height:16px;border-radius:50%;border:1px solid #34c388;padding:4px;text-align:center;margin-right:8px}.page-header .description{max-width:500px}.trans-up{-webkit-transition:all .15s cubic-bezier(.645,.045,.355,1);transition:all .15s cubic-bezier(.645,.045,.355,1)}.trans-up:hover{-webkit-box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);-webkit-transform:translateY(-1px);transform:translateY(-1px)}@font-face{font-family:element-icons;src:url(../../static/fonts/element-icons.535877f5.woff) format("woff"),url(../../static/fonts/element-icons.732389de.ttf) format("truetype");font-weight:400;font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-ice-cream-round:before{content:"\E6A0"}.el-icon-ice-cream-square:before{content:"\E6A3"}.el-icon-lollipop:before{content:"\E6A4"}.el-icon-potato-strips:before{content:"\E6A5"}.el-icon-milk-tea:before{content:"\E6A6"}.el-icon-ice-drink:before{content:"\E6A7"}.el-icon-ice-tea:before{content:"\E6A9"}.el-icon-coffee:before{content:"\E6AA"}.el-icon-orange:before{content:"\E6AB"}.el-icon-pear:before{content:"\E6AC"}.el-icon-apple:before{content:"\E6AD"}.el-icon-cherry:before{content:"\E6AE"}.el-icon-watermelon:before{content:"\E6AF"}.el-icon-grape:before{content:"\E6B0"}.el-icon-refrigerator:before{content:"\E6B1"}.el-icon-goblet-square-full:before{content:"\E6B2"}.el-icon-goblet-square:before{content:"\E6B3"}.el-icon-goblet-full:before{content:"\E6B4"}.el-icon-goblet:before{content:"\E6B5"}.el-icon-cold-drink:before{content:"\E6B6"}.el-icon-coffee-cup:before{content:"\E6B8"}.el-icon-water-cup:before{content:"\E6B9"}.el-icon-hot-water:before{content:"\E6BA"}.el-icon-ice-cream:before{content:"\E6BB"}.el-icon-dessert:before{content:"\E6BC"}.el-icon-sugar:before{content:"\E6BD"}.el-icon-tableware:before{content:"\E6BE"}.el-icon-burger:before{content:"\E6BF"}.el-icon-knife-fork:before{content:"\E6C1"}.el-icon-fork-spoon:before{content:"\E6C2"}.el-icon-chicken:before{content:"\E6C3"}.el-icon-food:before{content:"\E6C4"}.el-icon-dish-1:before{content:"\E6C5"}.el-icon-dish:before{content:"\E6C6"}.el-icon-moon-night:before{content:"\E6EE"}.el-icon-moon:before{content:"\E6F0"}.el-icon-cloudy-and-sunny:before{content:"\E6F1"}.el-icon-partly-cloudy:before{content:"\E6F2"}.el-icon-cloudy:before{content:"\E6F3"}.el-icon-sunny:before{content:"\E6F6"}.el-icon-sunset:before{content:"\E6F7"}.el-icon-sunrise-1:before{content:"\E6F8"}.el-icon-sunrise:before{content:"\E6F9"}.el-icon-heavy-rain:before{content:"\E6FA"}.el-icon-lightning:before{content:"\E6FB"}.el-icon-light-rain:before{content:"\E6FC"}.el-icon-wind-power:before{content:"\E6FD"}.el-icon-baseball:before{content:"\E712"}.el-icon-soccer:before{content:"\E713"}.el-icon-football:before{content:"\E715"}.el-icon-basketball:before{content:"\E716"}.el-icon-ship:before{content:"\E73F"}.el-icon-truck:before{content:"\E740"}.el-icon-bicycle:before{content:"\E741"}.el-icon-mobile-phone:before{content:"\E6D3"}.el-icon-service:before{content:"\E6D4"}.el-icon-key:before{content:"\E6E2"}.el-icon-unlock:before{content:"\E6E4"}.el-icon-lock:before{content:"\E6E5"}.el-icon-watch:before{content:"\E6FE"}.el-icon-watch-1:before{content:"\E6FF"}.el-icon-timer:before{content:"\E702"}.el-icon-alarm-clock:before{content:"\E703"}.el-icon-map-location:before{content:"\E704"}.el-icon-delete-location:before{content:"\E705"}.el-icon-add-location:before{content:"\E706"}.el-icon-location-information:before{content:"\E707"}.el-icon-location-outline:before{content:"\E708"}.el-icon-location:before{content:"\E79E"}.el-icon-place:before{content:"\E709"}.el-icon-discover:before{content:"\E70A"}.el-icon-first-aid-kit:before{content:"\E70B"}.el-icon-trophy-1:before{content:"\E70C"}.el-icon-trophy:before{content:"\E70D"}.el-icon-medal:before{content:"\E70E"}.el-icon-medal-1:before{content:"\E70F"}.el-icon-stopwatch:before{content:"\E710"}.el-icon-mic:before{content:"\E711"}.el-icon-copy-document:before{content:"\E718"}.el-icon-full-screen:before{content:"\E719"}.el-icon-switch-button:before{content:"\E71B"}.el-icon-aim:before{content:"\E71C"}.el-icon-crop:before{content:"\E71D"}.el-icon-odometer:before{content:"\E71E"}.el-icon-time:before{content:"\E71F"}.el-icon-bangzhu:before{content:"\E724"}.el-icon-close-notification:before{content:"\E726"}.el-icon-microphone:before{content:"\E727"}.el-icon-turn-off-microphone:before{content:"\E728"}.el-icon-position:before{content:"\E729"}.el-icon-postcard:before{content:"\E72A"}.el-icon-message:before{content:"\E72B"}.el-icon-chat-line-square:before{content:"\E72D"}.el-icon-chat-dot-square:before{content:"\E72E"}.el-icon-chat-dot-round:before{content:"\E72F"}.el-icon-chat-square:before{content:"\E730"}.el-icon-chat-line-round:before{content:"\E731"}.el-icon-chat-round:before{content:"\E732"}.el-icon-set-up:before{content:"\E733"}.el-icon-turn-off:before{content:"\E734"}.el-icon-open:before{content:"\E735"}.el-icon-connection:before{content:"\E736"}.el-icon-link:before{content:"\E737"}.el-icon-cpu:before{content:"\E738"}.el-icon-thumb:before{content:"\E739"}.el-icon-female:before{content:"\E73A"}.el-icon-male:before{content:"\E73B"}.el-icon-guide:before{content:"\E73C"}.el-icon-news:before{content:"\E73E"}.el-icon-price-tag:before{content:"\E744"}.el-icon-discount:before{content:"\E745"}.el-icon-wallet:before{content:"\E747"}.el-icon-coin:before{content:"\E748"}.el-icon-money:before{content:"\E749"}.el-icon-bank-card:before{content:"\E74A"}.el-icon-box:before{content:"\E74B"}.el-icon-present:before{content:"\E74C"}.el-icon-sell:before{content:"\E6D5"}.el-icon-sold-out:before{content:"\E6D6"}.el-icon-shopping-bag-2:before{content:"\E74D"}.el-icon-shopping-bag-1:before{content:"\E74E"}.el-icon-shopping-cart-2:before{content:"\E74F"}.el-icon-shopping-cart-1:before{content:"\E750"}.el-icon-shopping-cart-full:before{content:"\E751"}.el-icon-smoking:before{content:"\E752"}.el-icon-no-smoking:before{content:"\E753"}.el-icon-house:before{content:"\E754"}.el-icon-table-lamp:before{content:"\E755"}.el-icon-school:before{content:"\E756"}.el-icon-office-building:before{content:"\E757"}.el-icon-toilet-paper:before{content:"\E758"}.el-icon-notebook-2:before{content:"\E759"}.el-icon-notebook-1:before{content:"\E75A"}.el-icon-files:before{content:"\E75B"}.el-icon-collection:before{content:"\E75C"}.el-icon-receiving:before{content:"\E75D"}.el-icon-suitcase-1:before{content:"\E760"}.el-icon-suitcase:before{content:"\E761"}.el-icon-film:before{content:"\E763"}.el-icon-collection-tag:before{content:"\E765"}.el-icon-data-analysis:before{content:"\E766"}.el-icon-pie-chart:before{content:"\E767"}.el-icon-data-board:before{content:"\E768"}.el-icon-data-line:before{content:"\E76D"}.el-icon-reading:before{content:"\E769"}.el-icon-magic-stick:before{content:"\E76A"}.el-icon-coordinate:before{content:"\E76B"}.el-icon-mouse:before{content:"\E76C"}.el-icon-brush:before{content:"\E76E"}.el-icon-headset:before{content:"\E76F"}.el-icon-umbrella:before{content:"\E770"}.el-icon-scissors:before{content:"\E771"}.el-icon-mobile:before{content:"\E773"}.el-icon-attract:before{content:"\E774"}.el-icon-monitor:before{content:"\E775"}.el-icon-search:before{content:"\E778"}.el-icon-takeaway-box:before{content:"\E77A"}.el-icon-paperclip:before{content:"\E77D"}.el-icon-printer:before{content:"\E77E"}.el-icon-document-add:before{content:"\E782"}.el-icon-document:before{content:"\E785"}.el-icon-document-checked:before{content:"\E786"}.el-icon-document-copy:before{content:"\E787"}.el-icon-document-delete:before{content:"\E788"}.el-icon-document-remove:before{content:"\E789"}.el-icon-tickets:before{content:"\E78B"}.el-icon-folder-checked:before{content:"\E77F"}.el-icon-folder-delete:before{content:"\E780"}.el-icon-folder-remove:before{content:"\E781"}.el-icon-folder-add:before{content:"\E783"}.el-icon-folder-opened:before{content:"\E784"}.el-icon-folder:before{content:"\E78A"}.el-icon-edit-outline:before{content:"\E764"}.el-icon-edit:before{content:"\E78C"}.el-icon-date:before{content:"\E78E"}.el-icon-c-scale-to-original:before{content:"\E7C6"}.el-icon-view:before{content:"\E6CE"}.el-icon-loading:before{content:"\E6CF"}.el-icon-rank:before{content:"\E6D1"}.el-icon-sort-down:before{content:"\E7C4"}.el-icon-sort-up:before{content:"\E7C5"}.el-icon-sort:before{content:"\E6D2"}.el-icon-finished:before{content:"\E6CD"}.el-icon-refresh-left:before{content:"\E6C7"}.el-icon-refresh-right:before{content:"\E6C8"}.el-icon-refresh:before{content:"\E6D0"}.el-icon-video-play:before{content:"\E7C0"}.el-icon-video-pause:before{content:"\E7C1"}.el-icon-d-arrow-right:before{content:"\E6DC"}.el-icon-d-arrow-left:before{content:"\E6DD"}.el-icon-arrow-up:before{content:"\E6E1"}.el-icon-arrow-down:before{content:"\E6DF"}.el-icon-arrow-right:before{content:"\E6E0"}.el-icon-arrow-left:before{content:"\E6DE"}.el-icon-top-right:before{content:"\E6E7"}.el-icon-top-left:before{content:"\E6E8"}.el-icon-top:before{content:"\E6E6"}.el-icon-bottom:before{content:"\E6EB"}.el-icon-right:before{content:"\E6E9"}.el-icon-back:before{content:"\E6EA"}.el-icon-bottom-right:before{content:"\E6EC"}.el-icon-bottom-left:before{content:"\E6ED"}.el-icon-caret-top:before{content:"\E78F"}.el-icon-caret-bottom:before{content:"\E790"}.el-icon-caret-right:before{content:"\E791"}.el-icon-caret-left:before{content:"\E792"}.el-icon-d-caret:before{content:"\E79A"}.el-icon-share:before{content:"\E793"}.el-icon-menu:before{content:"\E798"}.el-icon-s-grid:before{content:"\E7A6"}.el-icon-s-check:before{content:"\E7A7"}.el-icon-s-data:before{content:"\E7A8"}.el-icon-s-opportunity:before{content:"\E7AA"}.el-icon-s-custom:before{content:"\E7AB"}.el-icon-s-claim:before{content:"\E7AD"}.el-icon-s-finance:before{content:"\E7AE"}.el-icon-s-comment:before{content:"\E7AF"}.el-icon-s-flag:before{content:"\E7B0"}.el-icon-s-marketing:before{content:"\E7B1"}.el-icon-s-shop:before{content:"\E7B4"}.el-icon-s-open:before{content:"\E7B5"}.el-icon-s-management:before{content:"\E7B6"}.el-icon-s-ticket:before{content:"\E7B7"}.el-icon-s-release:before{content:"\E7B8"}.el-icon-s-home:before{content:"\E7B9"}.el-icon-s-promotion:before{content:"\E7BA"}.el-icon-s-operation:before{content:"\E7BB"}.el-icon-s-unfold:before{content:"\E7BC"}.el-icon-s-fold:before{content:"\E7A9"}.el-icon-s-platform:before{content:"\E7BD"}.el-icon-s-order:before{content:"\E7BE"}.el-icon-s-cooperation:before{content:"\E7BF"}.el-icon-bell:before{content:"\E725"}.el-icon-message-solid:before{content:"\E799"}.el-icon-video-camera:before{content:"\E772"}.el-icon-video-camera-solid:before{content:"\E796"}.el-icon-camera:before{content:"\E779"}.el-icon-camera-solid:before{content:"\E79B"}.el-icon-download:before{content:"\E77C"}.el-icon-upload2:before{content:"\E77B"}.el-icon-upload:before{content:"\E7C3"}.el-icon-picture-outline-round:before{content:"\E75F"}.el-icon-picture-outline:before{content:"\E75E"}.el-icon-picture:before{content:"\E79F"}.el-icon-close:before{content:"\E6DB"}.el-icon-check:before{content:"\E6DA"}.el-icon-plus:before{content:"\E6D9"}.el-icon-minus:before{content:"\E6D8"}.el-icon-help:before{content:"\E73D"}.el-icon-s-help:before{content:"\E7B3"}.el-icon-circle-close:before{content:"\E78D"}.el-icon-circle-check:before{content:"\E720"}.el-icon-circle-plus-outline:before{content:"\E723"}.el-icon-remove-outline:before{content:"\E722"}.el-icon-zoom-out:before{content:"\E776"}.el-icon-zoom-in:before{content:"\E777"}.el-icon-error:before{content:"\E79D"}.el-icon-success:before{content:"\E79C"}.el-icon-circle-plus:before{content:"\E7A0"}.el-icon-remove:before{content:"\E7A2"}.el-icon-info:before{content:"\E7A1"}.el-icon-question:before{content:"\E7A4"}.el-icon-warning-outline:before{content:"\E6C9"}.el-icon-warning:before{content:"\E7A3"}.el-icon-goods:before{content:"\E7C2"}.el-icon-s-goods:before{content:"\E7B2"}.el-icon-star-off:before{content:"\E717"}.el-icon-star-on:before{content:"\E797"}.el-icon-more-outline:before{content:"\E6CC"}.el-icon-more:before{content:"\E794"}.el-icon-phone-outline:before{content:"\E6CB"}.el-icon-phone:before{content:"\E795"}.el-icon-user:before{content:"\E6E3"}.el-icon-user-solid:before{content:"\E7A5"}.el-icon-setting:before{content:"\E6CA"}.el-icon-s-tools:before{content:"\E7AC"}.el-icon-delete:before{content:"\E6D7"}.el-icon-delete-solid:before{content:"\E7C9"}.el-icon-eleme:before{content:"\E7C7"}.el-icon-platform-eleme:before{content:"\E7CA"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.el-pagination{white-space:nowrap;padding:2px 5px;color:#303133;font-weight:700}.el-pagination:after,.el-pagination:before{display:table;content:""}.el-pagination:after{clear:both}.el-pagination button,.el-pagination span:not([class*=suffix]){display:inline-block;font-size:13px;min-width:35.5px;height:28px;line-height:28px;vertical-align:top;-webkit-box-sizing:border-box;box-sizing:border-box}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield;line-height:normal}.el-pagination .el-input__suffix{right:0;-webkit-transform:scale(.8);transform:scale(.8)}.el-pagination .el-select .el-input{width:100px;margin:0 5px}.el-pagination .el-select .el-input .el-input__inner{padding-right:25px;border-radius:3px}.el-pagination button{border:none;padding:0 6px;background:transparent}.el-pagination button:focus{outline:none}.el-pagination button:hover{color:#34c388}.el-pagination button:disabled{color:#c0c4cc;background-color:#fff;cursor:not-allowed}.el-pagination .btn-next,.el-pagination .btn-prev{background:50% no-repeat;background-size:16px;background-color:#fff;cursor:pointer;margin:0;color:#303133}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700}.el-pagination .btn-prev{padding-right:12px}.el-pagination .btn-next{padding-left:12px}.el-pagination .el-pager li.disabled{color:#c0c4cc;cursor:not-allowed}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li,.el-pagination--small .el-pager li.btn-quicknext,.el-pagination--small .el-pager li.btn-quickprev,.el-pagination--small .el-pager li:last-child{border-color:transparent;font-size:12px;line-height:22px;height:22px;min-width:22px}.el-pagination--small .arrow.disabled{visibility:hidden}.el-pagination--small .more:before,.el-pagination--small li.more:before{line-height:24px}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){height:22px;line-height:22px}.el-pagination--small .el-pagination__editor,.el-pagination--small .el-pagination__editor.el-input .el-input__inner{height:22px}.el-pagination__sizes{margin:0 10px 0 0;font-weight:400;color:#606266}.el-pagination__sizes .el-input .el-input__inner{font-size:13px;padding-left:8px}.el-pagination__sizes .el-input .el-input__inner:hover{border-color:#34c388}.el-pagination__total{margin-right:10px;font-weight:400;color:#606266}.el-pagination__jump{margin-left:24px;font-weight:400;color:#606266}.el-pagination__jump .el-input__inner{padding:0 3px}.el-pagination__rightwrapper{float:right}.el-pagination__editor{line-height:18px;padding:0 2px;height:28px;text-align:center;margin:0 2px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:3px}.el-pagination__editor.el-input{width:50px}.el-pagination__editor.el-input .el-input__inner{height:28px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 5px;background-color:#f4f4f5;color:#606266;min-width:30px;border-radius:2px}.el-pagination.is-background .btn-next.disabled,.el-pagination.is-background .btn-prev.disabled,.el-pagination.is-background .el-pager li.disabled{color:#c0c4cc}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev{padding:0}.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev:disabled{color:#c0c4cc}.el-pagination.is-background .el-pager li:not(.disabled):hover{color:#34c388}.el-pagination.is-background .el-pager li:not(.disabled).active{background-color:#34c388;color:#fff}.el-pagination.is-background.el-pagination--small .btn-next,.el-pagination.is-background.el-pagination--small .btn-prev,.el-pagination.is-background.el-pagination--small .el-pager li{margin:0 3px;min-width:22px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;display:inline-block;vertical-align:top;font-size:0;padding:0;margin:0}.el-pager .more:before{line-height:30px}.el-pager li{padding:0 4px;background:#fff;vertical-align:top;display:inline-block;font-size:13px;min-width:35.5px;height:28px;line-height:28px;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;margin:0}.el-pager li.btn-quicknext,.el-pager li.btn-quickprev{line-height:28px;color:#303133}.el-pager li.btn-quicknext.disabled,.el-pager li.btn-quickprev.disabled{color:#c0c4cc}.el-pager li.btn-quicknext:hover,.el-pager li.btn-quickprev:hover{cursor:pointer}.el-pager li.active+li{border-left:0}.el-pager li:hover{color:#34c388}.el-pager li.active{color:#34c388;cursor:default}@-webkit-keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}.el-dialog{position:relative;margin:0 auto 50px;background:#fff;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.el-dialog.is-fullscreen{width:100%;margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog__header{padding:20px;padding-bottom:10px}.el-dialog__headerbtn{position:absolute;top:20px;right:20px;padding:0;background:transparent;border:none;outline:none;cursor:pointer;font-size:16px}.el-dialog__headerbtn .el-dialog__close{color:#909399}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:#34c388}.el-dialog__title{line-height:24px;font-size:18px;color:#303133}.el-dialog__body{padding:30px 20px;color:#606266;font-size:14px;word-break:break-all}.el-dialog__footer{padding:20px;padding-top:10px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px 25px 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.dialog-fade-enter-active{-webkit-animation:dialog-fade-in .3s;animation:dialog-fade-in .3s}.dialog-fade-leave-active{-webkit-animation:dialog-fade-out .3s;animation:dialog-fade-out .3s}@-webkit-keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete-suggestion{margin:5px 0;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:4px;border:1px solid #e8e8e8;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:#606266;font-size:14px;list-style:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li.highlighted,.el-autocomplete-suggestion li:hover{background-color:#fafafa}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid #000}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:#999}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:#fff}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-dropdown{display:inline-block;position:relative;color:#606266;font-size:14px}.el-dropdown .el-button-group{display:block}.el-dropdown .el-button-group .el-button{float:none}.el-dropdown .el-dropdown__caret-button{padding-left:5px;padding-right:5px;position:relative;border-left:none}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:5px;bottom:5px;left:0;background:hsla(0,0%,100%,.5)}.el-dropdown .el-dropdown__caret-button:hover:before{top:0;bottom:0}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{padding-left:0}.el-dropdown__icon{font-size:12px;margin:0 3px}.el-dropdown .el-dropdown-selfdefine:focus:active,.el-dropdown .el-dropdown-selfdefine:focus:not(.focusing){outline-width:0}.el-dropdown-menu{position:absolute;top:0;left:0;z-index:10;padding:10px 0;margin:5px 0;background-color:#fff;border:1px solid #ebeef5;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-dropdown-menu__item{list-style:none;line-height:36px;padding:0 20px;margin:0;font-size:14px;color:#606266;cursor:pointer;outline:none}.el-dropdown-menu__item:focus,.el-dropdown-menu__item:not(.is-disabled):hover{background-color:#ebf9f3;color:#5dcfa0}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{position:relative;margin-top:6px;border-top:1px solid #ebeef5}.el-dropdown-menu__item--divided:before{content:"";height:6px;display:block;margin:0 -20px;background-color:#fff}.el-dropdown-menu__item.is-disabled{cursor:default;color:#bbb;pointer-events:none}.el-dropdown-menu--medium{padding:6px 0}.el-dropdown-menu--medium .el-dropdown-menu__item{line-height:30px;padding:0 17px;font-size:14px}.el-dropdown-menu--medium .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:6px}.el-dropdown-menu--medium .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:6px;margin:0 -17px}.el-dropdown-menu--small{padding:6px 0}.el-dropdown-menu--small .el-dropdown-menu__item{line-height:27px;padding:0 15px;font-size:13px}.el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:4px}.el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:4px;margin:0 -15px}.el-dropdown-menu--mini{padding:3px 0}.el-dropdown-menu--mini .el-dropdown-menu__item{line-height:24px;padding:0 10px;font-size:12px}.el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:3px}.el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:3px;margin:0 -10px}.el-menu{border-right:1px solid #e6e6e6;list-style:none;position:relative;margin:0;padding-left:0;background-color:#fff}.el-menu:after,.el-menu:before{display:table;content:""}.el-menu:after{clear:both}.el-menu.el-menu--horizontal{border-bottom:1px solid #e6e6e6}.el-menu--horizontal{border-right:none}.el-menu--horizontal>.el-menu-item{float:left;height:60px;line-height:60px;margin:0;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-submenu{float:left}.el-menu--horizontal>.el-submenu:focus,.el-menu--horizontal>.el-submenu:hover{outline:none}.el-menu--horizontal>.el-submenu:focus .el-submenu__title,.el-menu--horizontal>.el-submenu:hover .el-submenu__title{color:#303133}.el-menu--horizontal>.el-submenu.is-active .el-submenu__title{border-bottom:2px solid #34c388;color:#303133}.el-menu--horizontal>.el-submenu .el-submenu__title{height:60px;line-height:60px;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-submenu .el-submenu__title:hover{background-color:#fff}.el-menu--horizontal>.el-submenu .el-submenu__icon-arrow{position:static;vertical-align:middle;margin-left:8px;margin-top:-3px}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-submenu__title{background-color:#fff;float:none;height:36px;line-height:36px;padding:0 10px;color:#909399}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-submenu.is-active>.el-submenu__title{color:#303133}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:none;color:#303133}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid #34c388;color:#303133}.el-menu--collapse{width:64px}.el-menu--collapse>.el-menu-item [class^=el-icon-],.el-menu--collapse>.el-submenu>.el-submenu__title [class^=el-icon-]{margin:0;vertical-align:middle;width:24px;text-align:center}.el-menu--collapse>.el-menu-item .el-submenu__icon-arrow,.el-menu--collapse>.el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item span,.el-menu--collapse>.el-submenu>.el-submenu__title span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-submenu{min-width:200px}.el-menu--collapse .el-submenu{position:relative}.el-menu--collapse .el-submenu .el-menu{position:absolute;margin-left:5px;top:0;left:100%;z-index:10;border:1px solid #e8e8e8;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--collapse .el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:none;transform:none}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--popup-bottom-start{margin-top:5px}.el-menu--popup-right-start{margin-left:5px;margin-right:5px}.el-menu-item{height:56px;line-height:56px;font-size:14px;color:#303133;padding:0 20px;list-style:none;cursor:pointer;position:relative;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:middle}.el-menu-item i{color:#909399}.el-menu-item:focus,.el-menu-item:hover{outline:none;background-color:#ebf9f3}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:none!important}.el-menu-item [class^=el-icon-]{margin-right:5px;width:24px;text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:#34c388}.el-menu-item.is-active i{color:inherit}.el-submenu{list-style:none;margin:0;padding-left:0}.el-submenu__title{height:56px;line-height:56px;font-size:14px;color:#303133;padding:0 20px;list-style:none;cursor:pointer;position:relative;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-submenu__title *{vertical-align:middle}.el-submenu__title i{color:#909399}.el-submenu__title:focus,.el-submenu__title:hover{outline:none;background-color:#ebf9f3}.el-submenu__title.is-disabled{opacity:.25;cursor:not-allowed;background:none!important}.el-submenu__title:hover{background-color:#ebf9f3}.el-submenu .el-menu{border:none}.el-submenu .el-menu-item{height:50px;line-height:50px;padding:0 45px;min-width:200px}.el-submenu__icon-arrow{position:absolute;top:50%;right:20px;margin-top:-7px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:12px}.el-submenu.is-active .el-submenu__title{border-bottom-color:#34c388}.el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.el-submenu.is-disabled .el-menu-item,.el-submenu.is-disabled .el-submenu__title{opacity:.25;cursor:not-allowed;background:none!important}.el-submenu [class^=el-icon-]{vertical-align:middle;margin-right:5px;width:24px;text-align:center;font-size:18px}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px 20px;line-height:normal;font-size:12px;color:#909399}.horizontal-collapse-transition .el-submenu__title .el-submenu__icon-arrow{-webkit-transition:.2s;transition:.2s;opacity:0}.el-radio-group{display:inline-block;line-height:1;vertical-align:middle;font-size:0}.el-radio-button,.el-radio-button__inner{position:relative;display:inline-block;outline:none}.el-radio-button__inner{line-height:1;white-space:nowrap;vertical-align:middle;background:#fff;border:1px solid #d9d9d9;font-weight:500;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-radio-button__inner.is-round{padding:12px 20px}.el-radio-button__inner:hover{color:#34c388}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:1px solid #d9d9d9;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-radio-button__orig-radio{opacity:0;outline:none;position:absolute;z-index:-1}.el-radio-button__orig-radio:checked+.el-radio-button__inner{color:#fff;background-color:#34c388;border-color:#34c388;-webkit-box-shadow:-1px 0 0 0 #34c388;box-shadow:-1px 0 0 0 #34c388}.el-radio-button__orig-radio:disabled+.el-radio-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5;-webkit-box-shadow:none;box-shadow:none}.el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner{background-color:#f2f6fc}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 4px 4px 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:4px}.el-radio-button--medium .el-radio-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-radio-button--medium .el-radio-button__inner.is-round{padding:10px 20px}.el-radio-button--small .el-radio-button__inner{padding:8px 15px;font-size:14px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button--mini .el-radio-button__inner{padding:4px 6px;font-size:12px;border-radius:0}.el-radio-button--mini .el-radio-button__inner.is-round{padding:4px 6px}.el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled){-webkit-box-shadow:0 0 2px 2px #34c388;box-shadow:0 0 2px 2px #34c388}.el-switch{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:14px;line-height:20px;height:20px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{-webkit-transition:.2s;transition:.2s;height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:#303133}.el-switch__label.is-active{color:#34c388}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__core{margin:0;display:inline-block;position:relative;width:40px;height:20px;border:1px solid #d9d9d9;outline:none;border-radius:10px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#d9d9d9;cursor:pointer;-webkit-transition:border-color .3s,background-color .3s;transition:border-color .3s,background-color .3s;vertical-align:middle}.el-switch__core:after{content:"";position:absolute;top:1px;left:1px;border-radius:100%;-webkit-transition:all .3s;transition:all .3s;width:16px;height:16px;background-color:#fff}.el-switch.is-checked .el-switch__core{border-color:#34c388;background-color:#34c388}.el-switch.is-checked .el-switch__core:after{left:100%;margin-left:-17px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter,.el-switch .label-fade-leave-active{opacity:0}.el-select-dropdown{position:absolute;z-index:1001;border:1px solid #e8e8e8;border-radius:4px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:#34c388;background-color:#fff}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:#fafafa}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{position:absolute;right:20px;font-family:element-icons;content:"\E6DA";font-size:12px;font-weight:700;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:#999;font-size:14px}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-select-dropdown__item{font-size:14px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#606266;height:34px;line-height:34px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-select-dropdown__item.is-disabled:hover{background-color:#fff}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:#fafafa}.el-select-dropdown__item.selected{color:#34c388;font-weight:700}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:#e8e8e8}.el-select-group__title{padding-left:20px;font-size:12px;color:#909399;line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select{display:inline-block;position:relative}.el-select .el-select__tags>span{display:contents}.el-select:hover .el-input__inner{border-color:#c0c4cc}.el-select .el-input__inner{cursor:pointer;padding-right:35px}.el-select .el-input__inner:focus{border-color:#34c388}.el-select .el-input .el-select__caret{color:#c0c4cc;font-size:14px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:rotate(180deg);transform:rotate(180deg);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:14px;text-align:center;-webkit-transform:rotate(180deg);transform:rotate(180deg);border-radius:100%;color:#c0c4cc;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-select .el-input .el-select__caret.is-show-close:hover{color:#909399}.el-select .el-input.is-disabled .el-input__inner{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__inner:hover{border-color:#e8e8e8}.el-select .el-input.is-focus .el-input__inner{border-color:#34c388}.el-select>.el-input{display:block}.el-select__input{border:none;outline:none;padding:0;margin-left:15px;color:#666;font-size:14px;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-mini{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:1000;right:25px;color:#c0c4cc;line-height:18px;font-size:14px}.el-select__close:hover{color:#909399}.el-select__tags{position:absolute;line-height:normal;white-space:normal;z-index:1;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-select .el-tag__close{margin-top:-2px}.el-select .el-tag{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:#f0f2f5}.el-select .el-tag__close.el-icon-close{background-color:#c0c4cc;right:-7px;top:0;color:#fff}.el-select .el-tag__close.el-icon-close:hover{background-color:#909399}.el-select .el-tag__close.el-icon-close:before{display:block;-webkit-transform:translateY(.5px);transform:translateY(.5px)}.el-table{position:relative;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex:1;flex:1;width:100%;max-width:100%;background-color:#fff;font-size:14px;color:#606266}.el-table__empty-block{min-height:60px;text-align:center;width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:#909399}.el-table__expand-column .cell{padding:0;text-align:center}.el-table__expand-icon{position:relative;cursor:pointer;color:#666;font-size:12px;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;height:20px}.el-table__expand-icon--expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-table__expand-icon>.el-icon{position:absolute;left:50%;top:50%;margin-left:-5px;margin-top:-5px}.el-table__expanded-cell{background-color:#fff}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit td.gutter,.el-table--fit th.gutter{border-right-width:1px}.el-table--scrollable-x .el-table__body-wrapper{overflow-x:auto}.el-table--scrollable-y .el-table__body-wrapper{overflow-y:auto}.el-table thead{color:#101010;font-weight:500}.el-table thead.is-group th{background:#fafafa}.el-table td,.el-table th{padding:12px 0;min-width:0;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left}.el-table td.is-center,.el-table th.is-center{text-align:center}.el-table td.is-right,.el-table th.is-right{text-align:right}.el-table td.gutter,.el-table th.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table td.is-hidden>*,.el-table th.is-hidden>*{visibility:hidden}.el-table--medium td,.el-table--medium th{padding:10px 0}.el-table--small{font-size:12px}.el-table--small td,.el-table--small th{padding:8px 0}.el-table--mini{font-size:12px}.el-table--mini td,.el-table--mini th{padding:6px 0}.el-table tr{background-color:#fff}.el-table tr input[type=checkbox]{margin:0}.el-table td,.el-table th.is-leaf{border-bottom:1px solid #ebeef5}.el-table th.is-sortable{cursor:pointer}.el-table th{white-space:nowrap;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#f7f7f7}.el-table th div{padding-left:10px;padding-right:10px;line-height:40px;overflow:hidden;white-space:nowrap}.el-table th>.cell,.el-table th div{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}.el-table th>.cell{position:relative;word-wrap:normal;vertical-align:middle;width:100%}.el-table th>.cell.highlight{color:#34c388}.el-table th.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td div{-webkit-box-sizing:border-box;box-sizing:border-box}.el-table td.gutter{width:0}.el-table .cell{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding-left:10px;padding-right:10px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--border,.el-table--group{border:1px solid #ebeef5}.el-table--border:after,.el-table--group:after,.el-table:before{content:"";position:absolute;background-color:#ebeef5;z-index:1}.el-table--border:after,.el-table--group:after{top:0;right:0;width:1px;height:100%}.el-table:before{left:0;bottom:0;width:100%;height:1px}.el-table--border{border-right:none;border-bottom:none}.el-table--border.el-loading-parent--relative{border-color:transparent}.el-table--border td,.el-table--border th{border-right:1px solid #ebeef5}.el-table--border td:first-child .cell,.el-table--border th:first-child .cell{padding-left:10px}.el-table--border th.gutter:last-of-type{border-bottom:1px solid #ebeef5;border-bottom-width:1px}.el-table--border th{border-bottom:1px solid #ebeef5}.el-table--hidden{visibility:hidden}.el-table__fixed,.el-table__fixed-right{position:absolute;top:0;left:0;overflow-x:hidden;overflow-y:hidden;-webkit-box-shadow:0 0 10px rgba(0,0,0,.12);box-shadow:0 0 10px rgba(0,0,0,.12)}.el-table__fixed-right:before,.el-table__fixed:before{content:"";position:absolute;left:0;bottom:0;width:100%;height:1px;background-color:#ebeef5;z-index:4}.el-table__fixed-right-patch{position:absolute;top:-1px;right:0;background-color:#fff;border-bottom:1px solid #ebeef5}.el-table__fixed-right{top:0;left:auto;right:0}.el-table__fixed-right .el-table__fixed-body-wrapper,.el-table__fixed-right .el-table__fixed-footer-wrapper,.el-table__fixed-right .el-table__fixed-header-wrapper{left:auto;right:0}.el-table__fixed-header-wrapper{position:absolute;left:0;top:0;z-index:3}.el-table__fixed-footer-wrapper{position:absolute;left:0;bottom:0;z-index:3}.el-table__fixed-footer-wrapper tbody td{border-top:1px solid #ebeef5;background-color:#fafafa;color:#606266}.el-table__fixed-body-wrapper{position:absolute;left:0;top:37px;overflow:hidden;z-index:3}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__footer-wrapper{margin-top:-1px}.el-table__footer-wrapper td{border-top:1px solid #ebeef5}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td,.el-table__header-wrapper tbody td{background-color:#fafafa;color:#606266}.el-table__body-wrapper{overflow:hidden;position:relative}.el-table__body-wrapper.is-scrolling-left~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right,.el-table__body-wrapper.is-scrolling-right~.el-table__fixed-right{-webkit-box-shadow:none;box-shadow:none}.el-table__body-wrapper .el-table--border.is-scrolling-right~.el-table__fixed-right{border-left:1px solid #ebeef5}.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:1px solid #ebeef5}.el-table .caret-wrapper{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:5px solid transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:#c0c4cc;top:5px}.el-table .sort-caret.descending{border-top-color:#c0c4cc;bottom:7px}.el-table .ascending .sort-caret.ascending{border-bottom-color:#34c388}.el-table .descending .sort-caret.descending{border-top-color:#34c388}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td{background:#fafafa}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td,.el-table__body tr.current-row>td,.el-table__body tr.hover-row.current-row>td,.el-table__body tr.hover-row.el-table__row--striped.current-row>td,.el-table__body tr.hover-row.el-table__row--striped>td,.el-table__body tr.hover-row>td{background-color:#ebf9f3}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:1px solid #ebeef5;z-index:10}.el-table__column-filter-trigger{display:inline-block;line-height:34px;cursor:pointer}.el-table__column-filter-trigger i{color:#909399;font-size:12px;-webkit-transform:scale(.75);transform:scale(.75)}.el-table--enable-row-transition .el-table__body td{-webkit-transition:background-color .25s ease;transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td{background-color:#fafafa}.el-table--fluid-height .el-table__fixed,.el-table--fluid-height .el-table__fixed-right{bottom:0;overflow:hidden}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:20px;line-height:20px;height:20px;text-align:center;margin-right:3px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:1px solid #ebeef5;border-radius:2px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:2px 0}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:14px}.el-table-filter__list-item:hover{background-color:#ebf9f3;color:#5dcfa0}.el-table-filter__list-item.is-active{background-color:#34c388;color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid #ebeef5;padding:8px}.el-table-filter__bottom button{background:transparent;border:none;color:#606266;cursor:pointer;font-size:13px;padding:0 3px}.el-table-filter__bottom button:hover{color:#34c388}.el-table-filter__bottom button:focus{outline:none}.el-table-filter__bottom button.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:block;margin-right:5px;margin-bottom:8px;margin-left:5px}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover div{background-color:#f2f6fc}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:#606266}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current div{background-color:#f2f6fc}.el-date-table td{width:32px;padding:4px 0;text-align:center;cursor:pointer;position:relative}.el-date-table td,.el-date-table td div{height:30px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-table td div{padding:3px 0}.el-date-table td span{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:#c0c4cc}.el-date-table td.today{position:relative}.el-date-table td.today span{color:#34c388;font-weight:700}.el-date-table td.today.end-date span,.el-date-table td.today.start-date span{color:#fff}.el-date-table td.available:hover{color:#34c388}.el-date-table td.in-range div,.el-date-table td.in-range div:hover{background-color:#f2f6fc}.el-date-table td.current:not(.disabled) span{color:#fff;background-color:#34c388}.el-date-table td.end-date div,.el-date-table td.start-date div{color:#fff}.el-date-table td.end-date span,.el-date-table td.start-date span{background-color:#34c388}.el-date-table td.start-date div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled div{background-color:#fafafa;opacity:1;cursor:not-allowed;color:#c0c4cc}.el-date-table td.selected div{margin-left:5px;margin-right:5px;background-color:#f2f6fc;border-radius:15px}.el-date-table td.selected div:hover{background-color:#f2f6fc}.el-date-table td.selected span{background-color:#34c388;color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:#606266}.el-date-table th{padding:5px;color:#606266;font-weight:400;border-bottom:1px solid #ebeef5}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-month-table td.today .cell{color:#34c388;font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:#fafafa;cursor:not-allowed;color:#c0c4cc}.el-month-table td.disabled .cell:hover{color:#c0c4cc}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:#606266;margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:#34c388}.el-month-table td.in-range div,.el-month-table td.in-range div:hover{background-color:#f2f6fc}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:#34c388}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:#34c388}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:#303133}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:#34c388;font-weight:700}.el-year-table td.disabled .cell{background-color:#fafafa;cursor:not-allowed;color:#c0c4cc}.el-year-table td.disabled .cell:hover{color:#c0c4cc}.el-year-table td .cell{width:48px;height:32px;display:block;line-height:32px;color:#606266;margin:0 auto}.el-year-table td .cell:hover,.el-year-table td.current:not(.disabled) .cell{color:#34c388}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid #e4e4e4}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{-webkit-box-sizing:border-box;box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:#303133}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:1px solid #ebeef5}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:#606266}.el-date-picker__header-label.active,.el-date-picker__header-label:hover{color:#34c388}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.selected:not(.disabled){color:#34c388;font-weight:700}.time-select-item.disabled{color:#e8e8e8;cursor:not-allowed}.time-select-item:hover{background-color:#fafafa;font-weight:700;cursor:pointer}.el-date-editor{position:relative;display:inline-block;text-align:left}.el-date-editor.el-input,.el-date-editor.el-input__inner{width:220px}.el-date-editor--monthrange.el-input,.el-date-editor--monthrange.el-input__inner{width:300px}.el-date-editor--daterange.el-input,.el-date-editor--daterange.el-input__inner,.el-date-editor--timerange.el-input,.el-date-editor--timerange.el-input__inner{width:350px}.el-date-editor--datetimerange.el-input,.el-date-editor--datetimerange.el-input__inner{width:400px}.el-date-editor--dates .el-input__inner{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .el-icon-circle-close{cursor:pointer}.el-date-editor .el-range__icon{font-size:14px;margin-left:-5px;color:#c0c4cc;float:left;line-height:32px}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:none;display:inline-block;height:100%;margin:0;padding:0;width:39%;text-align:center;font-size:14px;color:#606266}.el-date-editor .el-range-input::-webkit-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::-moz-placeholder{color:#c0c4cc}.el-date-editor .el-range-input:-ms-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::-ms-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::placeholder{color:#c0c4cc}.el-date-editor .el-range-separator{display:inline-block;height:100%;padding:0 5px;margin:0;text-align:center;line-height:32px;font-size:14px;width:5%;color:#303133}.el-date-editor .el-range__close-icon{font-size:14px;color:#c0c4cc;width:25px;display:inline-block;float:right;line-height:32px}.el-range-editor.el-input__inner{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px 10px}.el-range-editor .el-range-input{line-height:1}.el-range-editor.is-active,.el-range-editor.is-active:hover{border-color:#34c388}.el-range-editor--medium.el-input__inner{height:36px}.el-range-editor--medium .el-range-separator{line-height:28px;font-size:14px}.el-range-editor--medium .el-range-input{font-size:14px}.el-range-editor--medium .el-range__close-icon,.el-range-editor--medium .el-range__icon{line-height:28px}.el-range-editor--small.el-input__inner{height:32px}.el-range-editor--small .el-range-separator{line-height:24px;font-size:13px}.el-range-editor--small .el-range-input{font-size:13px}.el-range-editor--small .el-range__close-icon,.el-range-editor--small .el-range__icon{line-height:24px}.el-range-editor--mini.el-input__inner{height:28px}.el-range-editor--mini .el-range-separator{line-height:20px;font-size:12px}.el-range-editor--mini .el-range-input{font-size:12px}.el-range-editor--mini .el-range__close-icon,.el-range-editor--mini .el-range__icon{line-height:20px}.el-range-editor.is-disabled{background-color:#fafafa;border-color:#e8e8e8;color:#c0c4cc;cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:#e8e8e8}.el-range-editor.is-disabled input{background-color:#fafafa;color:#c0c4cc;cursor:not-allowed}.el-range-editor.is-disabled input::-webkit-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::-moz-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input:-ms-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::-ms-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::placeholder{color:#c0c4cc}.el-range-editor.is-disabled .el-range-separator{color:#c0c4cc}.el-picker-panel{color:#606266;border:1px solid #e8e8e8;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);background:#fff;border-radius:4px;line-height:30px;margin:5px 0}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid #e4e4e4;padding:4px;text-align:right;background-color:#fff;position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:#606266;padding-left:12px;text-align:left;outline:none;cursor:pointer}.el-picker-panel__shortcut:hover{color:#34c388}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:#34c388}.el-picker-panel__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:none;font-size:12px}.el-picker-panel__btn[disabled]{color:#ccc;cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:#303133;border:0;background:transparent;cursor:pointer;outline:none;margin-top:8px}.el-picker-panel__icon-btn:hover{color:#34c388}.el-picker-panel__icon-btn.is-disabled{color:#bbb}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid #e4e4e4;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;background-color:#fff;overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:190px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{-webkit-transform:translateY(-32px);transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.disabled):not(.active){background:#fff;cursor:default}.el-time-spinner__arrow{font-size:12px;color:#909399;position:absolute;left:0;width:100%;z-index:1;text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:#34c388}.el-time-spinner__arrow.el-icon-arrow-up{top:10px}.el-time-spinner__arrow.el-icon-arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner,.el-time-spinner__list{padding:0;text-align:center}.el-time-spinner__list{margin:0;list-style:none}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:#606266}.el-time-spinner__item:hover:not(.disabled):not(.active){background:#fafafa;cursor:pointer}.el-time-spinner__item.active:not(.disabled){color:#303133;font-weight:700}.el-time-spinner__item.disabled{color:#c0c4cc;cursor:not-allowed}.el-time-panel{margin:5px 0;border:1px solid #e8e8e8;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:2px;position:absolute;width:180px;left:0;z-index:1000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:content-box;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-15px;height:32px;z-index:-1;left:0;right:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;text-align:left;border-top:1px solid #e8e8e8;border-bottom:1px solid #e8e8e8}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%}.el-time-panel__content.has-seconds:after{left:66.66667%}.el-time-panel__content.has-seconds:before{padding-left:33.33333%}.el-time-panel__footer{border-top:1px solid #e4e4e4;padding:4px;height:36px;line-height:25px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:none;font-size:12px;color:#303133}.el-time-panel__btn.confirm{font-weight:800;color:#34c388}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px}.el-time-range-picker__cell{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid #e8e8e8}.el-popover{position:absolute;background:#fff;min-width:150px;border-radius:4px;border:1px solid #ebeef5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);word-break:break-all}.el-popover--plain{padding:18px 20px}.el-popover__title{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.el-popover:focus,.el-popover:focus:active,.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.v-modal-enter{-webkit-animation:v-modal-in .2s ease;animation:v-modal-in .2s ease}.v-modal-leave{-webkit-animation:v-modal-out .2s ease forwards;animation:v-modal-out .2s ease forwards}@keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000}.el-popup-parent--hidden{overflow:hidden}.el-message-box{display:inline-block;width:420px;padding-bottom:10px;vertical-align:middle;background-color:#fff;border-radius:4px;border:1px solid #ebeef5;font-size:18px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden}.el-message-box__wrapper{position:fixed;top:0;bottom:0;left:0;right:0;text-align:center}.el-message-box__wrapper:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box__header{position:relative;padding:15px;padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:18px;line-height:1;color:#303133}.el-message-box__headerbtn{position:absolute;top:15px;right:15px;padding:0;border:none;outline:none;background:transparent;font-size:16px;cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:#909399}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:#34c388}.el-message-box__content{position:relative;padding:10px 15px;color:#606266;font-size:14px}.el-message-box__input{padding-top:15px}.el-message-box__input input.invalid,.el-message-box__input input.invalid:focus{border-color:#f5222d}.el-message-box__status{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px}.el-message-box__status.el-icon-success{color:#52c41a}.el-message-box__status.el-icon-info{color:#909399}.el-message-box__status.el-icon-warning{color:#faad14}.el-message-box__status.el-icon-error{color:#f5222d}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:#f5222d;font-size:12px;min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;text-align:right}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.el-message-box--center{padding-bottom:30px}.el-message-box--center .el-message-box__header{padding-top:30px}.el-message-box--center .el-message-box__title{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns,.el-message-box--center .el-message-box__content{text-align:center}.el-message-box--center .el-message-box__content{padding-left:27px;padding-right:27px}.msgbox-fade-enter-active{-webkit-animation:msgbox-fade-in .3s;animation:msgbox-fade-in .3s}.msgbox-fade-leave-active{-webkit-animation:msgbox-fade-out .3s;animation:msgbox-fade-out .3s}@-webkit-keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:#c0c4cc}.el-breadcrumb__separator[class*=icon]{margin:0 6px;font-weight:400}.el-breadcrumb__item{float:left}.el-breadcrumb__inner{color:#606266}.el-breadcrumb__inner.is-link,.el-breadcrumb__inner a{font-weight:700;text-decoration:none;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1);color:#303133}.el-breadcrumb__inner.is-link:hover,.el-breadcrumb__inner a:hover{color:#34c388;cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover{font-weight:400;color:#606266;cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-form--label-left .el-form-item__label{text-align:left}.el-form--label-top .el-form-item__label{float:none;display:inline-block;text-align:left;padding:0 0 10px 0}.el-form--inline .el-form-item{display:inline-block;margin-right:10px;vertical-align:top}.el-form--inline .el-form-item__label{float:none;display:inline-block}.el-form--inline .el-form-item__content{display:inline-block;vertical-align:top}.el-form--inline.el-form--label-top .el-form-item__content{display:block}.el-form-item{margin-bottom:22px}.el-form-item:after,.el-form-item:before{display:table;content:""}.el-form-item:after{clear:both}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--medium .el-form-item__content,.el-form-item--medium .el-form-item__label{line-height:36px}.el-form-item--small .el-form-item__content,.el-form-item--small .el-form-item__label{line-height:32px}.el-form-item--small.el-form-item{margin-bottom:18px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item--mini .el-form-item__content,.el-form-item--mini .el-form-item__label{line-height:28px}.el-form-item--mini.el-form-item{margin-bottom:18px}.el-form-item--mini .el-form-item__error{padding-top:1px}.el-form-item__label-wrap{float:left}.el-form-item__label-wrap .el-form-item__label{display:inline-block;float:none}.el-form-item__label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#606266;line-height:40px;padding:0 12px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-form-item__content{line-height:40px;position:relative;font-size:14px}.el-form-item__content:after,.el-form-item__content:before{display:table;content:""}.el-form-item__content:after{clear:both}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:#f5222d;font-size:12px;line-height:1;padding-top:4px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{content:"*";color:#f5222d;margin-right:4px}.el-form-item.is-error .el-input__inner,.el-form-item.is-error .el-input__inner:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{border-color:#f5222d}.el-form-item.is-error .el-input-group__append .el-input__inner,.el-form-item.is-error .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-error .el-input__validateIcon{color:#f5222d}.el-form-item.is-success .el-input__inner,.el-form-item.is-success .el-input__inner:focus,.el-form-item.is-success .el-textarea__inner,.el-form-item.is-success .el-textarea__inner:focus{border-color:#52c41a}.el-form-item.is-success .el-input-group__append .el-input__inner,.el-form-item.is-success .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-success .el-input__validateIcon{color:#52c41a}.el-form-item--feedback .el-input__validateIcon{display:inline-block}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:#34c388;z-index:1;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);list-style:none}.el-tabs__new-tab{float:right;border:1px solid #d3dce6;height:18px;width:18px;line-height:18px;margin:12px 0 9px 10px;border-radius:3px;text-align:center;font-size:12px;color:#d3dce6;cursor:pointer;-webkit-transition:all .15s;transition:all .15s}.el-tabs__new-tab .el-icon-plus{-webkit-transform:scale(.8);transform:scale(.8)}.el-tabs__new-tab:hover{color:#34c388}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:#e8e8e8;z-index:1}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:#909399}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{white-space:nowrap;position:relative;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;float:left;z-index:2}.el-tabs__nav.is-stretch{min-width:100%;display:-webkit-box;display:-ms-flexbox;display:flex}.el-tabs__nav.is-stretch>*{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:40px;display:inline-block;list-style:none;font-size:14px;font-weight:500;color:#303133;position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:none}.el-tabs__item:focus.is-active.is-focus:not(:active){-webkit-box-shadow:0 0 2px 2px #34c388 inset;box-shadow:inset 0 0 2px 2px #34c388;border-radius:3px}.el-tabs__item .el-icon-close{border-radius:50%;text-align:center;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);margin-left:5px}.el-tabs__item .el-icon-close:before{-webkit-transform:scale(.9);transform:scale(.9);display:inline-block}.el-tabs__item .el-icon-close:hover{background-color:#c0c4cc;color:#fff}.el-tabs__item.is-active{color:#34c388}.el-tabs__item:hover{color:#34c388;cursor:pointer}.el-tabs__item.is-disabled{color:#c0c4cc;cursor:default}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid #e8e8e8}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid #e8e8e8;border-bottom:none;border-radius:4px 4px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close{position:relative;font-size:12px;width:0;height:14px;vertical-align:middle;line-height:15px;overflow:hidden;top:-1px;right:-2px;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid #e8e8e8;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .el-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:#fff}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .el-icon-close{width:14px}.el-tabs--border-card{background:#fff;border:1px solid #d9d9d9;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04);box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:#fafafa;border-bottom:1px solid #e8e8e8;margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);border:1px solid transparent;margin-top:-1px;color:#909399}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item,.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:#34c388;background-color:#fff;border-right-color:#d9d9d9;border-left-color:#d9d9d9}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:#34c388}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:#c0c4cc}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid #d9d9d9}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{float:none}.el-tabs--left .el-tabs__item.is-left,.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-right{display:block}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid #e8e8e8;border-bottom:none;border-top:1px solid #e8e8e8;text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid #e8e8e8;border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid #e8e8e8;border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid #e8e8e8;border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid #dfe4ed}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid #e8e8e8}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid #e8e8e8;border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid #e8e8e8;border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid #e8e8e8;border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid #dfe4ed}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter .3s;animation:slideInRight-enter .3s}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave .3s;animation:slideInRight-leave .3s}.slideInLeft-enter{-webkit-animation:slideInLeft-enter .3s;animation:slideInLeft-enter .3s}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave .3s;animation:slideInLeft-leave .3s}@-webkit-keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}.el-tree{position:relative;cursor:default;background:#fff;color:#606266}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#909399}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:#34c388}.el-tree-node{white-space:nowrap;outline:none}.el-tree-node:focus>.el-tree-node__content{background-color:#fafafa}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:#34c388;color:#fff}.el-tree-node__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px}.el-tree-node__content>.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:#fafafa}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:#c0c4cc;font-size:12px;-webkit-transform:rotate(0deg);transform:rotate(0deg);-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.el-tree-node__expand-icon.expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__label{font-size:14px}.el-tree-node__loading-icon{margin-right:8px;font-size:14px;color:#c0c4cc}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#effaf5}.el-alert{width:100%;padding:8px 16px;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;position:relative;background-color:#fff;overflow:hidden;opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:opacity .2s;transition:opacity .2s}.el-alert.is-light .el-alert__closebtn{color:#c0c4cc}.el-alert.is-dark .el-alert__closebtn,.el-alert.is-dark .el-alert__description{color:#fff}.el-alert.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-alert--success.is-light{background-color:#eef9e8;color:#52c41a}.el-alert--success.is-light .el-alert__description{color:#52c41a}.el-alert--success.is-dark{background-color:#52c41a;color:#fff}.el-alert--info.is-light{background-color:#f4f4f5;color:#909399}.el-alert--info.is-dark{background-color:#909399;color:#fff}.el-alert--info .el-alert__description{color:#909399}.el-alert--warning.is-light{background-color:#fff7e8;color:#faad14}.el-alert--warning.is-light .el-alert__description{color:#faad14}.el-alert--warning.is-dark{background-color:#faad14;color:#fff}.el-alert--error.is-light{background-color:#fee9ea;color:#f5222d}.el-alert--error.is-light .el-alert__description{color:#f5222d}.el-alert--error.is-dark{background-color:#f5222d;color:#fff}.el-alert__content{display:table-cell;padding:0 8px}.el-alert__icon{font-size:16px;width:16px}.el-alert__icon.is-big{font-size:28px;width:28px}.el-alert__title{font-size:13px;line-height:18px}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:12px;margin:5px 0 0 0}.el-alert__closebtn{font-size:12px;opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert__closebtn.is-customed{font-style:normal;font-size:13px;top:9px}.el-alert-fade-enter,.el-alert-fade-leave-active{opacity:0}.el-notification{display:-webkit-box;display:-ms-flexbox;display:flex;width:330px;padding:14px 26px 14px 13px;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #ebeef5;position:fixed;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;overflow:hidden}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:13px;margin-right:8px}.el-notification__title{font-weight:700;font-size:16px;color:#303133;margin:0}.el-notification__content{font-size:14px;line-height:21px;margin:6px 0 0 0;color:#606266;text-align:justify}.el-notification__content p{margin:0}.el-notification__icon{height:24px;width:24px;font-size:24px}.el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:#909399;font-size:16px}.el-notification__closeBtn:hover{color:#606266}.el-notification .el-icon-success{color:#52c41a}.el-notification .el-icon-error{color:#f5222d}.el-notification .el-icon-info{color:#909399}.el-notification .el-icon-warning{color:#faad14}.el-notification-fade-enter.right{right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.el-notification-fade-enter.left{left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.el-notification-fade-leave-active{opacity:0}.el-input-number{position:relative;display:inline-block;width:180px;line-height:38px}.el-input-number .el-input{display:block}.el-input-number .el-input__inner{-webkit-appearance:none;padding-left:50px;padding-right:50px;text-align:center}.el-input-number__decrease,.el-input-number__increase{position:absolute;z-index:1;top:1px;width:40px;height:auto;text-align:center;background:#fafafa;color:#606266;cursor:pointer;font-size:13px}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:#34c388}.el-input-number__decrease:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled),.el-input-number__increase:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled){border-color:#34c388}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 4px 4px 0;border-left:1px solid #d9d9d9}.el-input-number__decrease{left:1px;border-radius:4px 0 0 4px;border-right:1px solid #d9d9d9}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:#e8e8e8;color:#e8e8e8}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:#e8e8e8;cursor:not-allowed}.el-input-number--medium{width:200px;line-height:34px}.el-input-number--medium .el-input-number__decrease,.el-input-number--medium .el-input-number__increase{width:36px;font-size:14px}.el-input-number--medium .el-input__inner{padding-left:43px;padding-right:43px}.el-input-number--small{width:130px;line-height:30px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:32px;font-size:13px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.9);transform:scale(.9)}.el-input-number--small .el-input__inner{padding-left:39px;padding-right:39px}.el-input-number--mini{width:130px;line-height:26px}.el-input-number--mini .el-input-number__decrease,.el-input-number--mini .el-input-number__increase{width:28px;font-size:12px}.el-input-number--mini .el-input-number__decrease [class*=el-icon],.el-input-number--mini .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number--mini .el-input__inner{padding-left:35px;padding-right:35px}.el-input-number.is-without-controls .el-input__inner{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__inner{padding-left:15px;padding-right:50px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{height:auto;line-height:19px}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{border-radius:0 4px 0 0;border-bottom:1px solid #d9d9d9}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;bottom:1px;top:auto;left:auto;border-right:none;border-left:1px solid #d9d9d9;border-radius:0 0 4px 0}.el-input-number.is-controls-right[class*=medium] [class*=decrease],.el-input-number.is-controls-right[class*=medium] [class*=increase]{line-height:17px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{line-height:15px}.el-input-number.is-controls-right[class*=mini] [class*=decrease],.el-input-number.is-controls-right[class*=mini] [class*=increase]{line-height:13px}.el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing){outline-width:0}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2;min-width:10px;word-wrap:break-word}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow:after{content:" ";border-width:5px}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow:after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#fff}.el-tooltip__popper.is-light{background:#fff;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow:after{border-top-color:#fff}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow:after{border-bottom-color:#fff}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow:after{border-left-color:#fff}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow:after{border-right-color:#fff}.el-slider:after,.el-slider:before{display:table;content:""}.el-slider:after{clear:both}.el-slider__runway{width:100%;height:6px;margin:16px 0;background-color:#e8e8e8;border-radius:3px;position:relative;cursor:pointer;vertical-align:middle}.el-slider__runway.show-input{margin-right:160px;width:auto}.el-slider__runway.disabled{cursor:default}.el-slider__runway.disabled .el-slider__bar{background-color:#c0c4cc}.el-slider__runway.disabled .el-slider__button{border-color:#c0c4cc}.el-slider__runway.disabled .el-slider__button-wrapper.dragging,.el-slider__runway.disabled .el-slider__button-wrapper.hover,.el-slider__runway.disabled .el-slider__button-wrapper:hover{cursor:not-allowed}.el-slider__runway.disabled .el-slider__button.dragging,.el-slider__runway.disabled .el-slider__button.hover,.el-slider__runway.disabled .el-slider__button:hover{-webkit-transform:scale(1);transform:scale(1)}.el-slider__runway.disabled .el-slider__button.dragging,.el-slider__runway.disabled .el-slider__button.hover,.el-slider__runway.disabled .el-slider__button:hover{cursor:not-allowed}.el-slider__input{float:right;margin-top:3px;width:130px}.el-slider__input.el-input-number--mini{margin-top:5px}.el-slider__input.el-input-number--medium{margin-top:0}.el-slider__input.el-input-number--large{margin-top:-2px}.el-slider__bar{height:6px;background-color:#34c388;border-top-left-radius:3px;border-bottom-left-radius:3px;position:absolute}.el-slider__button-wrapper{height:36px;width:36px;position:absolute;z-index:1001;top:-15px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal}.el-slider__button-wrapper:after{content:"";height:100%}.el-slider__button-wrapper .el-tooltip,.el-slider__button-wrapper:after{display:inline-block;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{width:16px;height:16px;border:2px solid #34c388;background-color:#fff;border-radius:50%;-webkit-transition:.2s;transition:.2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:6px;width:6px;border-radius:100%;background-color:#fff;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#909399;margin-top:15px}.el-slider.is-vertical{position:relative}.el-slider.is-vertical .el-slider__runway{width:6px;height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:6px;height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:-15px}.el-slider.is-vertical .el-slider__button-wrapper,.el-slider.is-vertical .el-slider__stop{-webkit-transform:translateY(50%);transform:translateY(50%)}.el-slider.is-vertical.el-slider--with-input{padding-bottom:58px}.el-slider.is-vertical.el-slider--with-input .el-slider__input{overflow:visible;float:none;position:absolute;bottom:22px;width:36px;margin-top:15px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input__inner{text-align:center;padding-left:5px;padding-right:5px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{top:32px;margin-top:-1px;border:1px solid #d9d9d9;line-height:20px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease{width:18px;right:18px;border-bottom-left-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{width:19px;border-bottom-right-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase~.el-input .el-input__inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__increase{border-color:#c0c4cc}.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__increase{border-color:#34c388}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;-webkit-transform:translateY(50%);transform:translateY(50%)}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:hsla(0,0%,100%,.9);margin:0;top:0;right:0;bottom:0;left:0;-webkit-transition:opacity .3s;transition:opacity .3s}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:-25px}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:50px;width:50px}.el-loading-spinner{top:50%;margin-top:-21px;width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:#34c388;margin:3px 0;font-size:14px}.el-loading-spinner .circular{height:42px;width:42px;-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:#34c388;stroke-linecap:round}.el-loading-spinner i{color:#34c388}.el-loading-fade-enter,.el-loading-fade-leave-active{opacity:0}@-webkit-keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-row{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.el-row:after,.el-row:before{display:table;content:""}.el-row:after{clear:both}.el-row--flex{display:-webkit-box;display:-ms-flexbox;display:flex}.el-row--flex:after,.el-row--flex:before{display:none}.el-row--flex.is-justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-row--flex.is-justify-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.el-row--flex.is-justify-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-row--flex.is-justify-space-around{-ms-flex-pack:distribute;justify-content:space-around}.el-row--flex.is-align-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-row--flex.is-align-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}[class*=el-col-]{float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.el-col-0{display:none;width:0}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{width:4.16667%}.el-col-offset-1{margin-left:4.16667%}.el-col-pull-1{position:relative;right:4.16667%}.el-col-push-1{position:relative;left:4.16667%}.el-col-2{width:8.33333%}.el-col-offset-2{margin-left:8.33333%}.el-col-pull-2{position:relative;right:8.33333%}.el-col-push-2{position:relative;left:8.33333%}.el-col-3{width:12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{width:16.66667%}.el-col-offset-4{margin-left:16.66667%}.el-col-pull-4{position:relative;right:16.66667%}.el-col-push-4{position:relative;left:16.66667%}.el-col-5{width:20.83333%}.el-col-offset-5{margin-left:20.83333%}.el-col-pull-5{position:relative;right:20.83333%}.el-col-push-5{position:relative;left:20.83333%}.el-col-6{width:25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{width:29.16667%}.el-col-offset-7{margin-left:29.16667%}.el-col-pull-7{position:relative;right:29.16667%}.el-col-push-7{position:relative;left:29.16667%}.el-col-8{width:33.33333%}.el-col-offset-8{margin-left:33.33333%}.el-col-pull-8{position:relative;right:33.33333%}.el-col-push-8{position:relative;left:33.33333%}.el-col-9{width:37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{width:41.66667%}.el-col-offset-10{margin-left:41.66667%}.el-col-pull-10{position:relative;right:41.66667%}.el-col-push-10{position:relative;left:41.66667%}.el-col-11{width:45.83333%}.el-col-offset-11{margin-left:45.83333%}.el-col-pull-11{position:relative;right:45.83333%}.el-col-push-11{position:relative;left:45.83333%}.el-col-12{width:50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{width:54.16667%}.el-col-offset-13{margin-left:54.16667%}.el-col-pull-13{position:relative;right:54.16667%}.el-col-push-13{position:relative;left:54.16667%}.el-col-14{width:58.33333%}.el-col-offset-14{margin-left:58.33333%}.el-col-pull-14{position:relative;right:58.33333%}.el-col-push-14{position:relative;left:58.33333%}.el-col-15{width:62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{width:66.66667%}.el-col-offset-16{margin-left:66.66667%}.el-col-pull-16{position:relative;right:66.66667%}.el-col-push-16{position:relative;left:66.66667%}.el-col-17{width:70.83333%}.el-col-offset-17{margin-left:70.83333%}.el-col-pull-17{position:relative;right:70.83333%}.el-col-push-17{position:relative;left:70.83333%}.el-col-18{width:75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{width:79.16667%}.el-col-offset-19{margin-left:79.16667%}.el-col-pull-19{position:relative;right:79.16667%}.el-col-push-19{position:relative;left:79.16667%}.el-col-20{width:83.33333%}.el-col-offset-20{margin-left:83.33333%}.el-col-pull-20{position:relative;right:83.33333%}.el-col-push-20{position:relative;left:83.33333%}.el-col-21{width:87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{width:91.66667%}.el-col-offset-22{margin-left:91.66667%}.el-col-pull-22{position:relative;right:91.66667%}.el-col-push-22{position:relative;left:91.66667%}.el-col-23{width:95.83333%}.el-col-offset-23{margin-left:95.83333%}.el-col-pull-23{position:relative;right:95.83333%}.el-col-push-23{position:relative;left:95.83333%}.el-col-24{width:100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:767px){.el-col-xs-0{display:none;width:0}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{width:4.16667%}.el-col-xs-offset-1{margin-left:4.16667%}.el-col-xs-pull-1{position:relative;right:4.16667%}.el-col-xs-push-1{position:relative;left:4.16667%}.el-col-xs-2{width:8.33333%}.el-col-xs-offset-2{margin-left:8.33333%}.el-col-xs-pull-2{position:relative;right:8.33333%}.el-col-xs-push-2{position:relative;left:8.33333%}.el-col-xs-3{width:12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{width:16.66667%}.el-col-xs-offset-4{margin-left:16.66667%}.el-col-xs-pull-4{position:relative;right:16.66667%}.el-col-xs-push-4{position:relative;left:16.66667%}.el-col-xs-5{width:20.83333%}.el-col-xs-offset-5{margin-left:20.83333%}.el-col-xs-pull-5{position:relative;right:20.83333%}.el-col-xs-push-5{position:relative;left:20.83333%}.el-col-xs-6{width:25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{width:29.16667%}.el-col-xs-offset-7{margin-left:29.16667%}.el-col-xs-pull-7{position:relative;right:29.16667%}.el-col-xs-push-7{position:relative;left:29.16667%}.el-col-xs-8{width:33.33333%}.el-col-xs-offset-8{margin-left:33.33333%}.el-col-xs-pull-8{position:relative;right:33.33333%}.el-col-xs-push-8{position:relative;left:33.33333%}.el-col-xs-9{width:37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{width:41.66667%}.el-col-xs-offset-10{margin-left:41.66667%}.el-col-xs-pull-10{position:relative;right:41.66667%}.el-col-xs-push-10{position:relative;left:41.66667%}.el-col-xs-11{width:45.83333%}.el-col-xs-offset-11{margin-left:45.83333%}.el-col-xs-pull-11{position:relative;right:45.83333%}.el-col-xs-push-11{position:relative;left:45.83333%}.el-col-xs-12{width:50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{width:54.16667%}.el-col-xs-offset-13{margin-left:54.16667%}.el-col-xs-pull-13{position:relative;right:54.16667%}.el-col-xs-push-13{position:relative;left:54.16667%}.el-col-xs-14{width:58.33333%}.el-col-xs-offset-14{margin-left:58.33333%}.el-col-xs-pull-14{position:relative;right:58.33333%}.el-col-xs-push-14{position:relative;left:58.33333%}.el-col-xs-15{width:62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{width:66.66667%}.el-col-xs-offset-16{margin-left:66.66667%}.el-col-xs-pull-16{position:relative;right:66.66667%}.el-col-xs-push-16{position:relative;left:66.66667%}.el-col-xs-17{width:70.83333%}.el-col-xs-offset-17{margin-left:70.83333%}.el-col-xs-pull-17{position:relative;right:70.83333%}.el-col-xs-push-17{position:relative;left:70.83333%}.el-col-xs-18{width:75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{width:79.16667%}.el-col-xs-offset-19{margin-left:79.16667%}.el-col-xs-pull-19{position:relative;right:79.16667%}.el-col-xs-push-19{position:relative;left:79.16667%}.el-col-xs-20{width:83.33333%}.el-col-xs-offset-20{margin-left:83.33333%}.el-col-xs-pull-20{position:relative;right:83.33333%}.el-col-xs-push-20{position:relative;left:83.33333%}.el-col-xs-21{width:87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{width:91.66667%}.el-col-xs-offset-22{margin-left:91.66667%}.el-col-xs-pull-22{position:relative;right:91.66667%}.el-col-xs-push-22{position:relative;left:91.66667%}.el-col-xs-23{width:95.83333%}.el-col-xs-offset-23{margin-left:95.83333%}.el-col-xs-pull-23{position:relative;right:95.83333%}.el-col-xs-push-23{position:relative;left:95.83333%}.el-col-xs-24{width:100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0{display:none;width:0}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{width:4.16667%}.el-col-sm-offset-1{margin-left:4.16667%}.el-col-sm-pull-1{position:relative;right:4.16667%}.el-col-sm-push-1{position:relative;left:4.16667%}.el-col-sm-2{width:8.33333%}.el-col-sm-offset-2{margin-left:8.33333%}.el-col-sm-pull-2{position:relative;right:8.33333%}.el-col-sm-push-2{position:relative;left:8.33333%}.el-col-sm-3{width:12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{width:16.66667%}.el-col-sm-offset-4{margin-left:16.66667%}.el-col-sm-pull-4{position:relative;right:16.66667%}.el-col-sm-push-4{position:relative;left:16.66667%}.el-col-sm-5{width:20.83333%}.el-col-sm-offset-5{margin-left:20.83333%}.el-col-sm-pull-5{position:relative;right:20.83333%}.el-col-sm-push-5{position:relative;left:20.83333%}.el-col-sm-6{width:25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{width:29.16667%}.el-col-sm-offset-7{margin-left:29.16667%}.el-col-sm-pull-7{position:relative;right:29.16667%}.el-col-sm-push-7{position:relative;left:29.16667%}.el-col-sm-8{width:33.33333%}.el-col-sm-offset-8{margin-left:33.33333%}.el-col-sm-pull-8{position:relative;right:33.33333%}.el-col-sm-push-8{position:relative;left:33.33333%}.el-col-sm-9{width:37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{width:41.66667%}.el-col-sm-offset-10{margin-left:41.66667%}.el-col-sm-pull-10{position:relative;right:41.66667%}.el-col-sm-push-10{position:relative;left:41.66667%}.el-col-sm-11{width:45.83333%}.el-col-sm-offset-11{margin-left:45.83333%}.el-col-sm-pull-11{position:relative;right:45.83333%}.el-col-sm-push-11{position:relative;left:45.83333%}.el-col-sm-12{width:50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{width:54.16667%}.el-col-sm-offset-13{margin-left:54.16667%}.el-col-sm-pull-13{position:relative;right:54.16667%}.el-col-sm-push-13{position:relative;left:54.16667%}.el-col-sm-14{width:58.33333%}.el-col-sm-offset-14{margin-left:58.33333%}.el-col-sm-pull-14{position:relative;right:58.33333%}.el-col-sm-push-14{position:relative;left:58.33333%}.el-col-sm-15{width:62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{width:66.66667%}.el-col-sm-offset-16{margin-left:66.66667%}.el-col-sm-pull-16{position:relative;right:66.66667%}.el-col-sm-push-16{position:relative;left:66.66667%}.el-col-sm-17{width:70.83333%}.el-col-sm-offset-17{margin-left:70.83333%}.el-col-sm-pull-17{position:relative;right:70.83333%}.el-col-sm-push-17{position:relative;left:70.83333%}.el-col-sm-18{width:75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{width:79.16667%}.el-col-sm-offset-19{margin-left:79.16667%}.el-col-sm-pull-19{position:relative;right:79.16667%}.el-col-sm-push-19{position:relative;left:79.16667%}.el-col-sm-20{width:83.33333%}.el-col-sm-offset-20{margin-left:83.33333%}.el-col-sm-pull-20{position:relative;right:83.33333%}.el-col-sm-push-20{position:relative;left:83.33333%}.el-col-sm-21{width:87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{width:91.66667%}.el-col-sm-offset-22{margin-left:91.66667%}.el-col-sm-pull-22{position:relative;right:91.66667%}.el-col-sm-push-22{position:relative;left:91.66667%}.el-col-sm-23{width:95.83333%}.el-col-sm-offset-23{margin-left:95.83333%}.el-col-sm-pull-23{position:relative;right:95.83333%}.el-col-sm-push-23{position:relative;left:95.83333%}.el-col-sm-24{width:100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0{display:none;width:0}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{width:4.16667%}.el-col-md-offset-1{margin-left:4.16667%}.el-col-md-pull-1{position:relative;right:4.16667%}.el-col-md-push-1{position:relative;left:4.16667%}.el-col-md-2{width:8.33333%}.el-col-md-offset-2{margin-left:8.33333%}.el-col-md-pull-2{position:relative;right:8.33333%}.el-col-md-push-2{position:relative;left:8.33333%}.el-col-md-3{width:12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{width:16.66667%}.el-col-md-offset-4{margin-left:16.66667%}.el-col-md-pull-4{position:relative;right:16.66667%}.el-col-md-push-4{position:relative;left:16.66667%}.el-col-md-5{width:20.83333%}.el-col-md-offset-5{margin-left:20.83333%}.el-col-md-pull-5{position:relative;right:20.83333%}.el-col-md-push-5{position:relative;left:20.83333%}.el-col-md-6{width:25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{width:29.16667%}.el-col-md-offset-7{margin-left:29.16667%}.el-col-md-pull-7{position:relative;right:29.16667%}.el-col-md-push-7{position:relative;left:29.16667%}.el-col-md-8{width:33.33333%}.el-col-md-offset-8{margin-left:33.33333%}.el-col-md-pull-8{position:relative;right:33.33333%}.el-col-md-push-8{position:relative;left:33.33333%}.el-col-md-9{width:37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{width:41.66667%}.el-col-md-offset-10{margin-left:41.66667%}.el-col-md-pull-10{position:relative;right:41.66667%}.el-col-md-push-10{position:relative;left:41.66667%}.el-col-md-11{width:45.83333%}.el-col-md-offset-11{margin-left:45.83333%}.el-col-md-pull-11{position:relative;right:45.83333%}.el-col-md-push-11{position:relative;left:45.83333%}.el-col-md-12{width:50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{width:54.16667%}.el-col-md-offset-13{margin-left:54.16667%}.el-col-md-pull-13{position:relative;right:54.16667%}.el-col-md-push-13{position:relative;left:54.16667%}.el-col-md-14{width:58.33333%}.el-col-md-offset-14{margin-left:58.33333%}.el-col-md-pull-14{position:relative;right:58.33333%}.el-col-md-push-14{position:relative;left:58.33333%}.el-col-md-15{width:62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{width:66.66667%}.el-col-md-offset-16{margin-left:66.66667%}.el-col-md-pull-16{position:relative;right:66.66667%}.el-col-md-push-16{position:relative;left:66.66667%}.el-col-md-17{width:70.83333%}.el-col-md-offset-17{margin-left:70.83333%}.el-col-md-pull-17{position:relative;right:70.83333%}.el-col-md-push-17{position:relative;left:70.83333%}.el-col-md-18{width:75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{width:79.16667%}.el-col-md-offset-19{margin-left:79.16667%}.el-col-md-pull-19{position:relative;right:79.16667%}.el-col-md-push-19{position:relative;left:79.16667%}.el-col-md-20{width:83.33333%}.el-col-md-offset-20{margin-left:83.33333%}.el-col-md-pull-20{position:relative;right:83.33333%}.el-col-md-push-20{position:relative;left:83.33333%}.el-col-md-21{width:87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{width:91.66667%}.el-col-md-offset-22{margin-left:91.66667%}.el-col-md-pull-22{position:relative;right:91.66667%}.el-col-md-push-22{position:relative;left:91.66667%}.el-col-md-23{width:95.83333%}.el-col-md-offset-23{margin-left:95.83333%}.el-col-md-pull-23{position:relative;right:95.83333%}.el-col-md-push-23{position:relative;left:95.83333%}.el-col-md-24{width:100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1280px){.el-col-lg-0{display:none;width:0}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{width:4.16667%}.el-col-lg-offset-1{margin-left:4.16667%}.el-col-lg-pull-1{position:relative;right:4.16667%}.el-col-lg-push-1{position:relative;left:4.16667%}.el-col-lg-2{width:8.33333%}.el-col-lg-offset-2{margin-left:8.33333%}.el-col-lg-pull-2{position:relative;right:8.33333%}.el-col-lg-push-2{position:relative;left:8.33333%}.el-col-lg-3{width:12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{width:16.66667%}.el-col-lg-offset-4{margin-left:16.66667%}.el-col-lg-pull-4{position:relative;right:16.66667%}.el-col-lg-push-4{position:relative;left:16.66667%}.el-col-lg-5{width:20.83333%}.el-col-lg-offset-5{margin-left:20.83333%}.el-col-lg-pull-5{position:relative;right:20.83333%}.el-col-lg-push-5{position:relative;left:20.83333%}.el-col-lg-6{width:25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{width:29.16667%}.el-col-lg-offset-7{margin-left:29.16667%}.el-col-lg-pull-7{position:relative;right:29.16667%}.el-col-lg-push-7{position:relative;left:29.16667%}.el-col-lg-8{width:33.33333%}.el-col-lg-offset-8{margin-left:33.33333%}.el-col-lg-pull-8{position:relative;right:33.33333%}.el-col-lg-push-8{position:relative;left:33.33333%}.el-col-lg-9{width:37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{width:41.66667%}.el-col-lg-offset-10{margin-left:41.66667%}.el-col-lg-pull-10{position:relative;right:41.66667%}.el-col-lg-push-10{position:relative;left:41.66667%}.el-col-lg-11{width:45.83333%}.el-col-lg-offset-11{margin-left:45.83333%}.el-col-lg-pull-11{position:relative;right:45.83333%}.el-col-lg-push-11{position:relative;left:45.83333%}.el-col-lg-12{width:50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{width:54.16667%}.el-col-lg-offset-13{margin-left:54.16667%}.el-col-lg-pull-13{position:relative;right:54.16667%}.el-col-lg-push-13{position:relative;left:54.16667%}.el-col-lg-14{width:58.33333%}.el-col-lg-offset-14{margin-left:58.33333%}.el-col-lg-pull-14{position:relative;right:58.33333%}.el-col-lg-push-14{position:relative;left:58.33333%}.el-col-lg-15{width:62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{width:66.66667%}.el-col-lg-offset-16{margin-left:66.66667%}.el-col-lg-pull-16{position:relative;right:66.66667%}.el-col-lg-push-16{position:relative;left:66.66667%}.el-col-lg-17{width:70.83333%}.el-col-lg-offset-17{margin-left:70.83333%}.el-col-lg-pull-17{position:relative;right:70.83333%}.el-col-lg-push-17{position:relative;left:70.83333%}.el-col-lg-18{width:75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{width:79.16667%}.el-col-lg-offset-19{margin-left:79.16667%}.el-col-lg-pull-19{position:relative;right:79.16667%}.el-col-lg-push-19{position:relative;left:79.16667%}.el-col-lg-20{width:83.33333%}.el-col-lg-offset-20{margin-left:83.33333%}.el-col-lg-pull-20{position:relative;right:83.33333%}.el-col-lg-push-20{position:relative;left:83.33333%}.el-col-lg-21{width:87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{width:91.66667%}.el-col-lg-offset-22{margin-left:91.66667%}.el-col-lg-pull-22{position:relative;right:91.66667%}.el-col-lg-push-22{position:relative;left:91.66667%}.el-col-lg-23{width:95.83333%}.el-col-lg-offset-23{margin-left:95.83333%}.el-col-lg-pull-23{position:relative;right:95.83333%}.el-col-lg-push-23{position:relative;left:95.83333%}.el-col-lg-24{width:100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0{display:none;width:0}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{width:4.16667%}.el-col-xl-offset-1{margin-left:4.16667%}.el-col-xl-pull-1{position:relative;right:4.16667%}.el-col-xl-push-1{position:relative;left:4.16667%}.el-col-xl-2{width:8.33333%}.el-col-xl-offset-2{margin-left:8.33333%}.el-col-xl-pull-2{position:relative;right:8.33333%}.el-col-xl-push-2{position:relative;left:8.33333%}.el-col-xl-3{width:12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{width:16.66667%}.el-col-xl-offset-4{margin-left:16.66667%}.el-col-xl-pull-4{position:relative;right:16.66667%}.el-col-xl-push-4{position:relative;left:16.66667%}.el-col-xl-5{width:20.83333%}.el-col-xl-offset-5{margin-left:20.83333%}.el-col-xl-pull-5{position:relative;right:20.83333%}.el-col-xl-push-5{position:relative;left:20.83333%}.el-col-xl-6{width:25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{width:29.16667%}.el-col-xl-offset-7{margin-left:29.16667%}.el-col-xl-pull-7{position:relative;right:29.16667%}.el-col-xl-push-7{position:relative;left:29.16667%}.el-col-xl-8{width:33.33333%}.el-col-xl-offset-8{margin-left:33.33333%}.el-col-xl-pull-8{position:relative;right:33.33333%}.el-col-xl-push-8{position:relative;left:33.33333%}.el-col-xl-9{width:37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{width:41.66667%}.el-col-xl-offset-10{margin-left:41.66667%}.el-col-xl-pull-10{position:relative;right:41.66667%}.el-col-xl-push-10{position:relative;left:41.66667%}.el-col-xl-11{width:45.83333%}.el-col-xl-offset-11{margin-left:45.83333%}.el-col-xl-pull-11{position:relative;right:45.83333%}.el-col-xl-push-11{position:relative;left:45.83333%}.el-col-xl-12{width:50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{width:54.16667%}.el-col-xl-offset-13{margin-left:54.16667%}.el-col-xl-pull-13{position:relative;right:54.16667%}.el-col-xl-push-13{position:relative;left:54.16667%}.el-col-xl-14{width:58.33333%}.el-col-xl-offset-14{margin-left:58.33333%}.el-col-xl-pull-14{position:relative;right:58.33333%}.el-col-xl-push-14{position:relative;left:58.33333%}.el-col-xl-15{width:62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{width:66.66667%}.el-col-xl-offset-16{margin-left:66.66667%}.el-col-xl-pull-16{position:relative;right:66.66667%}.el-col-xl-push-16{position:relative;left:66.66667%}.el-col-xl-17{width:70.83333%}.el-col-xl-offset-17{margin-left:70.83333%}.el-col-xl-pull-17{position:relative;right:70.83333%}.el-col-xl-push-17{position:relative;left:70.83333%}.el-col-xl-18{width:75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{width:79.16667%}.el-col-xl-offset-19{margin-left:79.16667%}.el-col-xl-pull-19{position:relative;right:79.16667%}.el-col-xl-push-19{position:relative;left:79.16667%}.el-col-xl-20{width:83.33333%}.el-col-xl-offset-20{margin-left:83.33333%}.el-col-xl-pull-20{position:relative;right:83.33333%}.el-col-xl-push-20{position:relative;left:83.33333%}.el-col-xl-21{width:87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{width:91.66667%}.el-col-xl-offset-22{margin-left:91.66667%}.el-col-xl-pull-22{position:relative;right:91.66667%}.el-col-xl-push-22{position:relative;left:91.66667%}.el-col-xl-23{width:95.83333%}.el-col-xl-offset-23{margin-left:95.83333%}.el-col-xl-pull-23{position:relative;right:95.83333%}.el-col-xl-push-23{position:relative;left:95.83333%}.el-col-xl-24{width:100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}.el-upload{display:inline-block;text-align:center;cursor:pointer;outline:none}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:#606266;margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0;filter:alpha(opacity=0)}.el-upload--picture-card{background-color:#fbfdff;border:1px dashed #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;cursor:pointer;line-height:146px;vertical-align:top}.el-upload--picture-card i{font-size:28px;color:#8c939d}.el-upload--picture-card:hover,.el-upload:focus{border-color:#34c388;color:#34c388}.el-upload:focus .el-upload-dragger{border-color:#34c388}.el-upload-dragger{background-color:#fff;border:1px dashed #d9d9d9;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:360px;height:180px;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon-upload{font-size:67px;color:#c0c4cc;margin:40px 0 16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:1px solid #d9d9d9;margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:#606266;font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:#34c388;font-style:normal}.el-upload-dragger:hover{border-color:#34c388}.el-upload-dragger.is-dragover{background-color:rgba(32,159,255,.06);border:2px dashed #34c388}.el-upload-list{margin:0;padding:0;list-style:none}.el-upload-list__item{-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:#606266;line-height:1.8;margin-top:5px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item:first-child{margin-top:10px}.el-upload-list__item .el-icon-upload-success{color:#52c41a}.el-upload-list__item .el-icon-close{display:none;position:absolute;top:5px;right:5px;cursor:pointer;opacity:.75;color:#606266}.el-upload-list__item .el-icon-close:hover{opacity:1}.el-upload-list__item .el-icon-close-tip{display:none;position:absolute;top:5px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:#34c388}.el-upload-list__item:hover{background-color:#fafafa}.el-upload-list__item:hover .el-icon-close{display:inline-block}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:block}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:#34c388;cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon-close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon-close-tip,.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label,.el-upload-list__item.is-success:not(.focusing):focus .el-icon-close-tip{display:none}.el-upload-list.is-disabled .el-upload-list__item:hover .el-upload-list__item-status-label{display:block}.el-upload-list__item-name{color:#606266;display:block;margin-right:40px;overflow:hidden;padding-left:4px;text-overflow:ellipsis;-webkit-transition:color .3s;transition:color .3s;white-space:nowrap}.el-upload-list__item-name [class^=el-icon]{height:100%;margin-right:7px;color:#909399;line-height:inherit}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:#606266;display:none}.el-upload-list__item-delete:hover{color:#34c388}.el-upload-list--picture-card{margin:0;display:inline;vertical-align:top}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;margin:0 8px 8px 0;display:inline-block}.el-upload-list--picture-card .el-upload-list__item .el-icon-check,.el-upload-list--picture-card .el-upload-list__item .el-icon-circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon-close,.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%}.el-upload-list--picture-card .el-upload-list__item-status-label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;text-align:center;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s}.el-upload-list--picture-card .el-upload-list__item-actions:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:15px}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-block}.el-upload-list--picture-card .el-progress{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:10px;padding:10px 10px 10px 90px;height:92px}.el-upload-list--picture .el-upload-list__item .el-icon-check,.el-upload-list--picture .el-upload-list__item .el-icon-circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{background:transparent;-webkit-box-shadow:none;box-shadow:none;top:-2px;right:-12px}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name{line-height:70px;margin-top:0}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item-thumbnail{vertical-align:middle;display:inline-block;width:70px;height:70px;float:left;position:relative;z-index:1;margin-left:-80px;background-color:#fff}.el-upload-list--picture .el-upload-list__item-name{display:block;margin-top:20px}.el-upload-list--picture .el-upload-list__item-name i{font-size:70px;line-height:1;position:absolute;left:9px;top:10px}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 1px 1px #ccc;box-shadow:0 1px 1px #ccc}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-cover__label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.72);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{-webkit-transform:translateY(-13px);transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:#303133}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-progress{position:relative;line-height:1}.el-progress__text{font-size:14px;color:#606266;display:inline-block;vertical-align:middle;margin-left:10px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:#52c41a}.el-progress.is-success .el-progress__text{color:#52c41a}.el-progress.is-warning .el-progress-bar__inner{background-color:#faad14}.el-progress.is-warning .el-progress__text{color:#faad14}.el-progress.is-exception .el-progress-bar__inner{background-color:#f5222d}.el-progress.is-exception .el-progress__text{color:#f5222d}.el-progress-bar{padding-right:50px;display:inline-block;vertical-align:middle;width:100%;margin-right:-55px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:#ebeef5;overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:#34c388;text-align:right;border-radius:100px;line-height:1;white-space:nowrap;-webkit-transition:width .6s ease;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:#ececec;stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-message{min-width:380px;-webkit-box-sizing:border-box;box-sizing:border-box;border-width:1px;border-style:solid;border-color:#ebeef5;position:fixed;left:50%;top:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#edf2fc;-webkit-transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,transform .4s,top .4s;transition:opacity .3s,transform .4s,top .4s,-webkit-transform .4s;overflow:hidden;padding:15px 15px 15px 20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-message.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message.is-closable .el-message__content{padding-right:16px}.el-message p{margin:0}.el-message--info .el-message__content{color:#909399}.el-message--success{background-color:#eef9e8;border-color:#dcf3d1}.el-message--success .el-message__content{color:#52c41a}.el-message--warning{background-color:#fff7e8;border-color:#feefd0}.el-message--warning .el-message__content{color:#faad14}.el-message--error{background-color:#fee9ea;border-color:#fdd3d5}.el-message--error .el-message__content{color:#f5222d}.el-message__icon{margin-right:10px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message__closeBtn{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;color:#c0c4cc;font-size:16px}.el-message__closeBtn:focus{outline-width:0}.el-message__closeBtn:hover{color:#909399}.el-message .el-icon-success{color:#52c41a}.el-message .el-icon-error{color:#f5222d}.el-message .el-icon-info{color:#909399}.el-message .el-icon-warning{color:#faad14}.el-message-fade-enter,.el-message-fade-leave-active{opacity:0;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.el-badge{position:relative;vertical-align:middle;display:inline-block}.el-badge__content{background-color:#f5222d;border-radius:10px;color:#fff;display:inline-block;font-size:12px;height:18px;line-height:18px;padding:0 6px;text-align:center;white-space:nowrap;border:1px solid #fff}.el-badge__content.is-fixed{position:absolute;top:0;right:10px;-webkit-transform:translateY(-50%) translateX(100%);transform:translateY(-50%) translateX(100%)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:#34c388}.el-badge__content--success{background-color:#52c41a}.el-badge__content--warning{background-color:#faad14}.el-badge__content--info{background-color:#909399}.el-badge__content--danger{background-color:#f5222d}.el-card{border-radius:4px;border:1px solid #ebeef5;background-color:#fff;overflow:hidden;color:#303133;-webkit-transition:.3s;transition:.3s}.el-card.is-always-shadow,.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-card__header{padding:18px 20px;border-bottom:1px solid #ebeef5;-webkit-box-sizing:border-box;box-sizing:border-box}.el-card__body{padding:20px}.el-rate{height:20px;line-height:1}.el-rate:active,.el-rate:focus{outline-width:0}.el-rate__item{font-size:0;vertical-align:middle}.el-rate__icon,.el-rate__item{display:inline-block;position:relative}.el-rate__icon{font-size:18px;margin-right:6px;color:#c0c4cc;-webkit-transition:.3s;transition:.3s}.el-rate__icon.hover{-webkit-transform:scale(1.15);transform:scale(1.15)}.el-rate__decimal,.el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate__decimal{display:inline-block;overflow:hidden}.el-rate__text{font-size:14px;vertical-align:middle}.el-steps{display:-webkit-box;display:-ms-flexbox;display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:#fafafa}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}.el-step{position:relative;-ms-flex-negative:1;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{-ms-flex-preferred-size:auto!important;flex-basis:auto!important;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:#303133;border-color:#303133}.el-step__head.is-wait{color:#c0c4cc;border-color:#c0c4cc}.el-step__head.is-success{color:#52c41a;border-color:#52c41a}.el-step__head.is-error{color:#f5222d;border-color:#f5222d}.el-step__head.is-finish{color:#34c388;border-color:#34c388}.el-step__icon{position:relative;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:24px;height:24px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#fff;-webkit-transition:.15s ease-out;transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{-webkit-transform:translateY(1px);transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:#c0c4cc}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;-webkit-transition:.15s ease-out;transition:.15s ease-out;-webkit-box-sizing:border-box;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:#303133}.el-step__title.is-wait{color:#c0c4cc}.el-step__title.is-success{color:#52c41a}.el-step__title.is-error{color:#f5222d}.el-step__title.is-finish{color:#34c388}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:#303133}.el-step__description.is-wait{color:#c0c4cc}.el-step__description.is-success{color:#52c41a}.el-step__description.is-error{color:#f5222d}.el-step__description.is-finish{color:#34c388}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:-webkit-box;display:-ms-flexbox;display:flex}.el-step.is-vertical .el-step__head{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:transparent;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{-webkit-transform:scale(.8) translateY(1px);transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:#c0c4cc}.el-step.is-simple .el-step__arrow:before{-webkit-transform:rotate(-45deg) translateY(-4px);transform:rotate(-45deg) translateY(-4px);-webkit-transform-origin:0 0;transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{-webkit-transform:rotate(45deg) translateY(4px);transform:rotate(45deg) translateY(4px);-webkit-transform-origin:100% 100%;transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-carousel{position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:none;padding:0;margin:0;height:36px;width:36px;cursor:pointer;-webkit-transition:.3s;transition:.3s;border-radius:50%;background-color:rgba(31,45,61,.11);color:#fff;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);transform:translateY(-50%);text-align:center;font-size:12px}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:rgba(31,45,61,.23)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:2}.el-carousel__indicators--horizontal{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:26px;text-align:center;position:static;-webkit-transform:none;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:#c0c4cc;opacity:.24}.el-carousel__indicators--labels{left:0;right:0;-webkit-transform:none;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:12px 4px}.el-carousel__indicator--vertical{padding:4px 12px}.el-carousel__indicator--vertical .el-carousel__button{width:2px;height:15px}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:30px;height:2px;background-color:#fff;border:none;outline:none;padding:0;margin:0;cursor:pointer;-webkit-transition:.3s;transition:.3s}.carousel-arrow-left-enter,.carousel-arrow-left-leave-active{-webkit-transform:translateY(-50%) translateX(-10px);transform:translateY(-50%) translateX(-10px);opacity:0}.carousel-arrow-right-enter,.carousel-arrow-right-leave-active{-webkit-transform:translateY(-50%) translateX(10px);transform:translateY(-50%) translateX(10px);opacity:0}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:0}.el-carousel__item.is-active{z-index:2}.el-carousel__item--card,.el-carousel__item.is-animating{-webkit-transition:-webkit-transform .4s ease-in-out;transition:-webkit-transform .4s ease-in-out;transition:transform .4s ease-in-out;transition:transform .4s ease-in-out,-webkit-transform .4s ease-in-out}.el-carousel__item--card{width:50%}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:1}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:2}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:#fff;opacity:.24;-webkit-transition:.2s;transition:.2s}.fade-in-linear-enter-active,.fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.fade-in-linear-enter,.fade-in-linear-leave,.fade-in-linear-leave-active{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-linear-enter,.el-fade-in-linear-leave,.el-fade-in-linear-leave-active{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-fade-in-enter,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter,.el-zoom-in-center-leave-active{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center top;transform-origin:center top}.el-zoom-in-top-enter,.el-zoom-in-top-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center bottom;transform-origin:center bottom}.el-zoom-in-bottom-enter,.el-zoom-in-bottom-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:top left;transform-origin:top left}.el-zoom-in-left-enter,.el-zoom-in-left-leave-active{opacity:0;-webkit-transform:scale(.45);transform:scale(.45)}.collapse-transition{-webkit-transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out;transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out}.horizontal-collapse-transition{-webkit-transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out;transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out}.el-list-enter-active,.el-list-leave-active{-webkit-transition:all 1s;transition:all 1s}.el-list-enter,.el-list-leave-active{opacity:0;-webkit-transform:translateY(-30px);transform:translateY(-30px)}.el-opacity-transition{-webkit-transition:opacity .3s cubic-bezier(.55,0,.1,1);transition:opacity .3s cubic-bezier(.55,0,.1,1)}.el-collapse{border-top:1px solid #ebeef5;border-bottom:1px solid #ebeef5}.el-collapse-item.is-disabled .el-collapse-item__header{color:#bbb;cursor:not-allowed}.el-collapse-item__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:48px;line-height:48px;background-color:#fff;color:#303133;cursor:pointer;border-bottom:1px solid #ebeef5;font-size:13px;font-weight:500;-webkit-transition:border-bottom-color .3s;transition:border-bottom-color .3s;outline:none}.el-collapse-item__arrow{margin:0 8px 0 auto;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-weight:300}.el-collapse-item__arrow.is-active{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:#34c388}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:#fff;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #ebeef5}.el-collapse-item__content{padding-bottom:25px;font-size:13px;color:#303133;line-height:1.769230769230769}.el-collapse-item:last-child{margin-bottom:-1px}.el-popper .popper__arrow,.el-popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));filter:drop-shadow(0 2px 12px rgba(0,0,0,.03))}.el-popper .popper__arrow:after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#ebeef5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-6px;border-top-color:#fff;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#ebeef5}.el-popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#ebeef5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow:after{bottom:-6px;left:1px;border-right-color:#fff;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#ebeef5}.el-popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#fff}.el-tag{background-color:#ebf9f3;border-color:#d6f3e7;display:inline-block;height:32px;padding:0 10px;line-height:30px;font-size:12px;color:#34c388;border-width:1px;border-style:solid;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-tag.is-hit{border-color:#34c388}.el-tag .el-tag__close{color:#34c388}.el-tag .el-tag__close:hover{color:#fff;background-color:#34c388}.el-tag.el-tag--info{background-color:#f4f4f5;border-color:#e9e9eb;color:#909399}.el-tag.el-tag--info.is-hit{border-color:#909399}.el-tag.el-tag--info .el-tag__close{color:#909399}.el-tag.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag.el-tag--success{background-color:#eef9e8;border-color:#dcf3d1;color:#52c41a}.el-tag.el-tag--success.is-hit{border-color:#52c41a}.el-tag.el-tag--success .el-tag__close{color:#52c41a}.el-tag.el-tag--success .el-tag__close:hover{color:#fff;background-color:#52c41a}.el-tag.el-tag--warning{background-color:#fff7e8;border-color:#feefd0;color:#faad14}.el-tag.el-tag--warning.is-hit{border-color:#faad14}.el-tag.el-tag--warning .el-tag__close{color:#faad14}.el-tag.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#faad14}.el-tag.el-tag--danger{background-color:#fee9ea;border-color:#fdd3d5;color:#f5222d}.el-tag.el-tag--danger.is-hit{border-color:#f5222d}.el-tag.el-tag--danger .el-tag__close{color:#f5222d}.el-tag.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f5222d}.el-tag .el-icon-close{border-radius:50%;text-align:center;position:relative;cursor:pointer;font-size:12px;height:16px;width:16px;line-height:16px;vertical-align:middle;top:-1px;right:-5px}.el-tag .el-icon-close:before{display:block}.el-tag--dark{background-color:#34c388;color:#fff}.el-tag--dark,.el-tag--dark.is-hit{border-color:#34c388}.el-tag--dark .el-tag__close{color:#fff}.el-tag--dark .el-tag__close:hover{color:#fff;background-color:#5dcfa0}.el-tag--dark.el-tag--info{background-color:#909399;border-color:#909399;color:#fff}.el-tag--dark.el-tag--info.is-hit{border-color:#909399}.el-tag--dark.el-tag--info .el-tag__close{color:#fff}.el-tag--dark.el-tag--info .el-tag__close:hover{color:#fff;background-color:#a6a9ad}.el-tag--dark.el-tag--success{background-color:#52c41a;border-color:#52c41a;color:#fff}.el-tag--dark.el-tag--success.is-hit{border-color:#52c41a}.el-tag--dark.el-tag--success .el-tag__close{color:#fff}.el-tag--dark.el-tag--success .el-tag__close:hover{color:#fff;background-color:#75d048}.el-tag--dark.el-tag--warning{background-color:#faad14;border-color:#faad14;color:#fff}.el-tag--dark.el-tag--warning.is-hit{border-color:#faad14}.el-tag--dark.el-tag--warning .el-tag__close{color:#fff}.el-tag--dark.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#fbbd43}.el-tag--dark.el-tag--danger{background-color:#f5222d;border-color:#f5222d;color:#fff}.el-tag--dark.el-tag--danger.is-hit{border-color:#f5222d}.el-tag--dark.el-tag--danger .el-tag__close{color:#fff}.el-tag--dark.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f74e57}.el-tag--plain{background-color:#fff;border-color:#aee7cf;color:#34c388}.el-tag--plain.is-hit{border-color:#34c388}.el-tag--plain .el-tag__close{color:#34c388}.el-tag--plain .el-tag__close:hover{color:#fff;background-color:#34c388}.el-tag--plain.el-tag--info{background-color:#fff;border-color:#d3d4d6;color:#909399}.el-tag--plain.el-tag--info.is-hit{border-color:#909399}.el-tag--plain.el-tag--info .el-tag__close{color:#909399}.el-tag--plain.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag--plain.el-tag--success{background-color:#fff;border-color:#bae7a3;color:#52c41a}.el-tag--plain.el-tag--success.is-hit{border-color:#52c41a}.el-tag--plain.el-tag--success .el-tag__close{color:#52c41a}.el-tag--plain.el-tag--success .el-tag__close:hover{color:#fff;background-color:#52c41a}.el-tag--plain.el-tag--warning{background-color:#fff;border-color:#fddea1;color:#faad14}.el-tag--plain.el-tag--warning.is-hit{border-color:#faad14}.el-tag--plain.el-tag--warning .el-tag__close{color:#faad14}.el-tag--plain.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#faad14}.el-tag--plain.el-tag--danger{background-color:#fff;border-color:#fba7ab;color:#f5222d}.el-tag--plain.el-tag--danger.is-hit{border-color:#f5222d}.el-tag--plain.el-tag--danger .el-tag__close{color:#f5222d}.el-tag--plain.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f5222d}.el-tag--medium{height:28px;line-height:26px}.el-tag--medium .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--small{height:24px;padding:0 8px;line-height:22px}.el-tag--small .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--mini{height:20px;padding:0 5px;line-height:19px}.el-tag--mini .el-icon-close{margin-left:-3px;-webkit-transform:scale(.7);transform:scale(.7)}.el-cascader{display:inline-block;position:relative;font-size:14px;line-height:40px}.el-cascader:not(.is-disabled):hover .el-input__inner{cursor:pointer;border-color:#c0c4cc}.el-cascader .el-input{cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis}.el-cascader .el-input .el-input__inner:focus{border-color:#34c388}.el-cascader .el-input .el-icon-arrow-down{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:14px}.el-cascader .el-input .el-icon-arrow-down.is-reverse{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.el-cascader .el-input .el-icon-circle-close:hover{color:#909399}.el-cascader .el-input.is-focus .el-input__inner{border-color:#34c388}.el-cascader--medium{font-size:14px;line-height:36px}.el-cascader--small{font-size:13px;line-height:32px}.el-cascader--mini{font-size:12px;line-height:28px}.el-cascader.is-disabled .el-cascader__label{z-index:2;color:#c0c4cc}.el-cascader__dropdown{margin:5px 0;font-size:14px;background:#fff;border:1px solid #e8e8e8;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:normal;text-align:left;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader__tags .el-tag{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:#f0f2f5}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{-webkit-box-flex:0;-ms-flex:none;flex:none;background-color:#c0c4cc;color:#fff}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:#909399}.el-cascader__suggestion-panel{border-radius:4px}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:14px;color:#606266;text-align:center}.el-cascader__suggestion-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;padding:0 15px;text-align:left;outline:none;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:#fafafa}.el-cascader__suggestion-item.is-checked{color:#34c388;font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:#c0c4cc}.el-cascader__search-input{-webkit-box-flex:1;-ms-flex:1;flex:1;height:24px;min-width:60px;margin:2px 0 2px 15px;padding:0;color:#606266;border:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader__search-input::-webkit-input-placeholder{color:#c0c4cc}.el-cascader__search-input::-moz-placeholder{color:#c0c4cc}.el-cascader__search-input:-ms-input-placeholder{color:#c0c4cc}.el-cascader__search-input::-ms-input-placeholder{color:#c0c4cc}.el-cascader__search-input::placeholder{color:#c0c4cc}.el-color-predefine{font-size:12px;margin-top:8px;width:280px}.el-color-predefine,.el-color-predefine__colors{display:-webkit-box;display:-ms-flexbox;display:flex}.el-color-predefine__colors{-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{-webkit-box-shadow:0 0 3px 2px #34c388;box-shadow:0 0 3px 2px #34c388}.el-color-predefine__color-selector>div{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px}.el-color-hue-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.el-color-svpanel__black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(transparent));background:linear-gradient(0deg,#000,transparent)}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-alpha-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(#fff));background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,#fff);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),to(#fff));background:linear-gradient(180deg,hsla(0,0%,100%,0) 0,#fff)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:6px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-dropdown__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:none;font-size:12px}.el-color-dropdown__btn[disabled]{color:#ccc;cursor:not-allowed}.el-color-dropdown__btn:hover{color:#34c388;border-color:#34c388}.el-color-dropdown__link-btn{cursor:pointer;color:#34c388;text-decoration:none;padding:15px;font-size:12px}.el-color-dropdown__link-btn:hover{color:tint(#34c388,20%)}.el-color-picker{display:inline-block;position:relative;line-height:normal;height:40px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--medium{height:36px}.el-color-picker--medium .el-color-picker__trigger{height:36px;width:36px}.el-color-picker--medium .el-color-picker__mask{height:34px;width:34px}.el-color-picker--small{height:32px}.el-color-picker--small .el-color-picker__trigger{height:32px;width:32px}.el-color-picker--small .el-color-picker__mask{height:30px;width:30px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker--mini{height:28px}.el-color-picker--mini .el-color-picker__trigger{height:28px;width:28px}.el-color-picker--mini .el-color-picker__mask{height:26px;width:26px}.el-color-picker--mini .el-color-picker__empty,.el-color-picker--mini .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker__mask{height:38px;width:38px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:hsla(0,0%,100%,.7)}.el-color-picker__trigger{display:inline-block;height:40px;width:40px;padding:4px;border:1px solid #e6e6e6;border-radius:4px;font-size:0;cursor:pointer}.el-color-picker__color,.el-color-picker__trigger{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative}.el-color-picker__color{display:block;border:1px solid #999;border-radius:2px;width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-picker__color-inner{position:absolute;left:0;top:0;right:0;bottom:0}.el-color-picker__empty{color:#999}.el-color-picker__empty,.el-color-picker__icon{font-size:12px;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.el-color-picker__icon{display:inline-block;width:100%;color:#fff;text-align:center}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;-webkit-box-sizing:content-box;box-sizing:content-box;background-color:#fff;border:1px solid #ebeef5;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea__inner::-moz-placeholder{color:#c0c4cc}.el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea__inner:hover{border-color:#c0c4cc}.el-textarea__inner:focus{outline:none;border-color:#34c388}.el-textarea .el-input__count{color:#909399;background:#fff;position:absolute;font-size:12px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:#fafafa;border-color:#e8e8e8;color:#c0c4cc;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea.is-exceed .el-textarea__inner{border-color:#f5222d}.el-textarea.is-exceed .el-input__count{color:#f5222d}.el-input{position:relative;font-size:14px;display:inline-block;width:100%}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner,.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input .el-input__clear{color:#c0c4cc;font-size:14px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input .el-input__count{height:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#909399;font-size:12px}.el-input .el-input__count .el-input__count-inner{background:#fff;line-height:normal;display:inline-block;padding:0 5px}.el-input__inner{-webkit-appearance:none;background-color:#fff;background-image:none;border-radius:4px;border:1px solid #d9d9d9;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;display:inline-block;font-size:inherit;height:40px;line-height:40px;outline:none;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input__inner::-moz-placeholder{color:#c0c4cc}.el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input__inner::placeholder{color:#c0c4cc}.el-input__inner:hover{border-color:#c0c4cc}.el-input__inner:focus{outline:none;border-color:#34c388}.el-input__suffix{position:absolute;height:100%;right:5px;top:0;text-align:center;color:#c0c4cc;-webkit-transition:all .3s;transition:all .3s;pointer-events:none}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{position:absolute;left:5px;top:0;color:#c0c4cc}.el-input__icon,.el-input__prefix{height:100%;text-align:center;-webkit-transition:all .3s;transition:all .3s}.el-input__icon{width:25px;line-height:40px}.el-input__icon:after{content:"";height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__inner{outline:none;border-color:#34c388}.el-input.is-disabled .el-input__inner{background-color:#fafafa;border-color:#e8e8e8;color:#c0c4cc;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__inner{border-color:#f5222d}.el-input.is-exceed .el-input__suffix .el-input__count{color:#f5222d}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px;line-height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px;line-height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px;line-height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate;border-spacing:0}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#fafafa;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #d9d9d9;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:none}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-10px -20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append{border-left:0}.el-input-group--prepend .el-input__inner,.el-input-group__append{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input-group--append .el-input__inner{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input__inner::-ms-clear{display:none;width:0;height:0}.el-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #d9d9d9;border-color:#d9d9d9;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:500;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:12px 20px;font-size:14px;border-radius:4px}.el-button+.el-button{margin-left:10px}.el-button.is-round{padding:12px 20px}.el-button:focus,.el-button:hover{color:#34c388;border-color:#c2eddb;background-color:#ebf9f3}.el-button:active{color:#2fb07a;border-color:#2fb07a;outline:none}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon-]+span{margin-left:5px}.el-button.is-plain:focus,.el-button.is-plain:hover{background:#fff;border-color:#34c388;color:#34c388}.el-button.is-plain:active{background:#fff;outline:none}.el-button.is-active,.el-button.is-plain:active{border-color:#2fb07a;color:#2fb07a}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.el-button.is-disabled.el-button--text{background-color:transparent}.el-button.is-disabled.is-plain,.el-button.is-disabled.is-plain:focus,.el-button.is-disabled.is-plain:hover{background-color:#fff;border-color:#ebeef5;color:#c0c4cc}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:hsla(0,0%,100%,.35)}.el-button.is-round{border-radius:20px;padding:12px 23px}.el-button.is-circle{border-radius:50%;padding:12px}.el-button--primary{color:#fff;background-color:#34c388;border-color:#34c388}.el-button--primary:focus,.el-button--primary:hover{background:#5dcfa0;border-color:#5dcfa0;color:#fff}.el-button--primary:active{outline:none}.el-button--primary.is-active,.el-button--primary:active{background:#2fb07a;border-color:#2fb07a;color:#fff}.el-button--primary.is-disabled,.el-button--primary.is-disabled:active,.el-button--primary.is-disabled:focus,.el-button--primary.is-disabled:hover{color:#fff;background-color:#9ae1c4;border-color:#9ae1c4}.el-button--primary.is-plain{color:#34c388;background:#ebf9f3;border-color:#aee7cf}.el-button--primary.is-plain:focus,.el-button--primary.is-plain:hover{background:#34c388;border-color:#34c388;color:#fff}.el-button--primary.is-plain:active{background:#2fb07a;border-color:#2fb07a;color:#fff;outline:none}.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover{color:#85dbb8;background-color:#ebf9f3;border-color:#d6f3e7}.el-button--success{color:#fff;background-color:#52c41a;border-color:#52c41a}.el-button--success:focus,.el-button--success:hover{background:#75d048;border-color:#75d048;color:#fff}.el-button--success:active{outline:none}.el-button--success.is-active,.el-button--success:active{background:#4ab017;border-color:#4ab017;color:#fff}.el-button--success.is-disabled,.el-button--success.is-disabled:active,.el-button--success.is-disabled:focus,.el-button--success.is-disabled:hover{color:#fff;background-color:#a9e28d;border-color:#a9e28d}.el-button--success.is-plain{color:#52c41a;background:#eef9e8;border-color:#bae7a3}.el-button--success.is-plain:focus,.el-button--success.is-plain:hover{background:#52c41a;border-color:#52c41a;color:#fff}.el-button--success.is-plain:active{background:#4ab017;border-color:#4ab017;color:#fff;outline:none}.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover{color:#97dc76;background-color:#eef9e8;border-color:#dcf3d1}.el-button--warning{color:#fff;background-color:#faad14;border-color:#faad14}.el-button--warning:focus,.el-button--warning:hover{background:#fbbd43;border-color:#fbbd43;color:#fff}.el-button--warning:active{outline:none}.el-button--warning.is-active,.el-button--warning:active{background:#e19c12;border-color:#e19c12;color:#fff}.el-button--warning.is-disabled,.el-button--warning.is-disabled:active,.el-button--warning.is-disabled:focus,.el-button--warning.is-disabled:hover{color:#fff;background-color:#fdd68a;border-color:#fdd68a}.el-button--warning.is-plain{color:#faad14;background:#fff7e8;border-color:#fddea1}.el-button--warning.is-plain:focus,.el-button--warning.is-plain:hover{background:#faad14;border-color:#faad14;color:#fff}.el-button--warning.is-plain:active{background:#e19c12;border-color:#e19c12;color:#fff;outline:none}.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover{color:#fcce72;background-color:#fff7e8;border-color:#feefd0}.el-button--danger{color:#fff;background-color:#f5222d;border-color:#f5222d}.el-button--danger:focus,.el-button--danger:hover{background:#f74e57;border-color:#f74e57;color:#fff}.el-button--danger:active{outline:none}.el-button--danger.is-active,.el-button--danger:active{background:#dd1f29;border-color:#dd1f29;color:#fff}.el-button--danger.is-disabled,.el-button--danger.is-disabled:active,.el-button--danger.is-disabled:focus,.el-button--danger.is-disabled:hover{color:#fff;background-color:#fa9196;border-color:#fa9196}.el-button--danger.is-plain{color:#f5222d;background:#fee9ea;border-color:#fba7ab}.el-button--danger.is-plain:focus,.el-button--danger.is-plain:hover{background:#f5222d;border-color:#f5222d;color:#fff}.el-button--danger.is-plain:active{background:#dd1f29;border-color:#dd1f29;color:#fff;outline:none}.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover{color:#f97a81;background-color:#fee9ea;border-color:#fdd3d5}.el-button--info{color:#fff;background-color:#909399;border-color:#909399}.el-button--info:focus,.el-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.el-button--info:active{outline:none}.el-button--info.is-active,.el-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.el-button--info.is-disabled,.el-button--info.is-disabled:active,.el-button--info.is-disabled:focus,.el-button--info.is-disabled:hover{color:#fff;background-color:#c8c9cc;border-color:#c8c9cc}.el-button--info.is-plain{color:#909399;background:#f4f4f5;border-color:#d3d4d6}.el-button--info.is-plain:focus,.el-button--info.is-plain:hover{background:#909399;border-color:#909399;color:#fff}.el-button--info.is-plain:active{background:#82848a;border-color:#82848a;color:#fff;outline:none}.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover{color:#bcbec2;background-color:#f4f4f5;border-color:#e9e9eb}.el-button--medium{padding:10px 20px;font-size:14px;border-radius:4px}.el-button--medium.is-round{padding:10px 20px}.el-button--medium.is-circle{padding:10px}.el-button--small{padding:8px 15px;font-size:14px;border-radius:3px}.el-button--small.is-round{padding:8px 15px}.el-button--small.is-circle{padding:8px}.el-button--mini{padding:4px 6px;font-size:12px;border-radius:3px}.el-button--mini.is-round{padding:4px 6px}.el-button--mini.is-circle{padding:4px}.el-button--text{border-color:transparent;color:#34c388;background:transparent;padding-left:0;padding-right:0}.el-button--text:focus,.el-button--text:hover{color:#5dcfa0;border-color:transparent;background-color:transparent}.el-button--text:active{color:#2fb07a;background-color:transparent}.el-button--text.is-disabled,.el-button--text.is-disabled:focus,.el-button--text.is-disabled:hover,.el-button--text:active{border-color:transparent}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button.is-disabled{z-index:1}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px;border-top-left-radius:4px;border-bottom-left-radius:4px}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:20px}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button.is-active,.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-transfer{font-size:14px}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{display:block;margin:0 auto;padding:10px;border-radius:50%;color:#fff;background-color:#34c388;font-size:0}.el-transfer__button.is-with-texts{border-radius:4px}.el-transfer__button.is-disabled,.el-transfer__button.is-disabled:hover{border:1px solid #d9d9d9;background-color:#fafafa;color:#c0c4cc}.el-transfer__button:first-child{margin-bottom:10px}.el-transfer__button:nth-child(2){margin:0}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button [class*=el-icon-]+span{margin-left:0}.el-transfer-panel{border:1px solid #ebeef5;border-radius:4px;overflow:hidden;background:#fff;display:inline-block;vertical-align:middle;width:200px;max-height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:246px}.el-transfer-panel__body.is-with-footer{padding-bottom:40px}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:246px;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:194px;padding-top:0}.el-transfer-panel__item{height:30px;line-height:30px;padding-left:15px;display:block}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:#606266}.el-transfer-panel__item:hover{color:#34c388}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:24px;line-height:30px}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;margin:15px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:auto}.el-transfer-panel__filter .el-input__inner{height:32px;width:100%;font-size:12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:16px;padding-right:10px;padding-left:30px}.el-transfer-panel__filter .el-input__icon{margin-left:5px}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{height:40px;line-height:40px;background:#fafafa;margin:0;padding-left:15px;border-bottom:1px solid #ebeef5;-webkit-box-sizing:border-box;box-sizing:border-box;color:#000}.el-transfer-panel .el-transfer-panel__header .el-checkbox{display:block;line-height:40px}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:#303133;font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;color:#909399;font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:40px;background:#fff;margin:0;padding:0;border-top:1px solid #ebeef5;position:absolute;bottom:0;left:0;width:100%;z-index:1}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:#606266}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:30px;line-height:30px;padding:6px 15px 0;color:#909399;text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:0}.el-container.is-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.el-header{padding:0 20px}.el-aside,.el-header{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-aside{overflow:auto}.el-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;overflow:auto;padding:20px}.el-footer,.el-main{-webkit-box-sizing:border-box;box-sizing:border-box}.el-footer{padding:0 20px;-ms-flex-negative:0;flex-shrink:0}.el-timeline{margin:0;font-size:14px;list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid #e8e8e8}.el-timeline-item__icon{color:#fff;font-size:13px}.el-timeline-item__node{position:absolute;background-color:#e8e8e8;border-radius:50%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:12px;height:12px}.el-timeline-item__node--large{left:-2px;width:14px;height:14px}.el-timeline-item__node--primary{background-color:#34c388}.el-timeline-item__node--success{background-color:#52c41a}.el-timeline-item__node--warning{background-color:#faad14}.el-timeline-item__node--danger{background-color:#f5222d}.el-timeline-item__node--info{background-color:#909399}.el-timeline-item__dot{position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-timeline-item__content{color:#303133}.el-timeline-item__timestamp{color:#909399;line-height:1;font-size:13px}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-link{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:none;cursor:pointer;padding:0;font-size:14px;font-weight:500}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid #34c388}.el-link.is-disabled{cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default{color:#606266}.el-link.el-link--default:hover{color:#34c388}.el-link.el-link--default:after{border-color:#34c388}.el-link.el-link--default.is-disabled{color:#c0c4cc}.el-link.el-link--primary{color:#34c388}.el-link.el-link--primary:hover{color:#5dcfa0}.el-link.el-link--primary:after{border-color:#34c388}.el-link.el-link--primary.is-disabled{color:#9ae1c4}.el-link.el-link--primary.is-underline:hover:after{border-color:#34c388}.el-link.el-link--danger{color:#f5222d}.el-link.el-link--danger:hover{color:#f74e57}.el-link.el-link--danger:after{border-color:#f5222d}.el-link.el-link--danger.is-disabled{color:#fa9196}.el-link.el-link--danger.is-underline:hover:after{border-color:#f5222d}.el-link.el-link--success{color:#52c41a}.el-link.el-link--success:hover{color:#75d048}.el-link.el-link--success:after{border-color:#52c41a}.el-link.el-link--success.is-disabled{color:#a9e28d}.el-link.el-link--success.is-underline:hover:after{border-color:#52c41a}.el-link.el-link--warning{color:#faad14}.el-link.el-link--warning:hover{color:#fbbd43}.el-link.el-link--warning:after{border-color:#faad14}.el-link.el-link--warning.is-disabled{color:#fdd68a}.el-link.el-link--warning.is-underline:hover:after{border-color:#faad14}.el-link.el-link--info{color:#909399}.el-link.el-link--info:hover{color:#a6a9ad}.el-link.el-link--info:after{border-color:#909399}.el-link.el-link--info.is-disabled{color:#c8c9cc}.el-link.el-link--info.is-underline:hover:after{border-color:#909399}.el-divider{background-color:#d9d9d9;position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative}.el-divider__text{position:absolute;background-color:#fff;padding:0 20px;font-weight:500;color:#303133;font-size:14px}.el-divider__text.is-left{left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-divider__text.is-center{left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-image__error,.el-image__inner,.el-image__placeholder{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top}.el-image__inner--center{position:relative;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block}.el-image__error,.el-image__placeholder{background:#fafafa}.el-image__error{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:14px;color:#c0c4cc;vertical-align:middle}.el-calendar{background-color:#fff}.el-calendar__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:12px 20px;border-bottom:1px solid #ebeef5}.el-calendar__title{color:#000;-ms-flex-item-align:center;align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:#606266;font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:#c0c4cc}.el-calendar-table td{border-bottom:1px solid #ebeef5;border-right:1px solid #ebeef5;vertical-align:top;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.el-calendar-table td.is-selected{background-color:#f2f8fe}.el-calendar-table td.is-today{color:#34c388}.el-calendar-table tr:first-child td{border-top:1px solid #ebeef5}.el-calendar-table tr td:first-child{border-left:1px solid #ebeef5}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px;height:85px}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:#f2f8fe}.el-backtop{position:fixed;background-color:#fff;width:40px;height:40px;border-radius:50%;color:#34c388;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-size:20px;-webkit-box-shadow:0 0 6px rgba(0,0,0,.12);box-shadow:0 0 6px rgba(0,0,0,.12);cursor:pointer;z-index:5}.el-backtop:hover{background-color:#f2f6fc}.el-page-header{line-height:24px}.el-page-header,.el-page-header__left{display:-webkit-box;display:-ms-flexbox;display:flex}.el-page-header__left{cursor:pointer;margin-right:40px;position:relative}.el-page-header__left:after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:#d9d9d9}.el-page-header__left .el-icon-back{font-size:18px;margin-right:6px;-ms-flex-item-align:center;align-self:center}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:#303133}.el-checkbox{color:#606266;font-weight:500;font-size:14px;position:relative;cursor:pointer;display:inline-block;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px}.el-checkbox.is-bordered{padding:9px 20px 9px 10px;border-radius:4px;border:1px solid #d9d9d9;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:normal;height:40px}.el-checkbox.is-bordered.is-checked{border-color:#34c388}.el-checkbox.is-bordered.is-disabled{border-color:#ebeef5;cursor:not-allowed}.el-checkbox.is-bordered+.el-checkbox.is-bordered{margin-left:10px}.el-checkbox.is-bordered.el-checkbox--medium{padding:7px 20px 7px 10px;border-radius:4px;height:36px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label{line-height:17px;font-size:14px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:5px 15px 5px 10px;border-radius:3px;height:32px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{line-height:15px;font-size:14px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox.is-bordered.el-checkbox--mini{padding:3px 15px 3px 10px;border-radius:3px;height:28px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__label{line-height:12px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:none;display:inline-block;line-height:1;position:relative;vertical-align:middle}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:#edf2fc;border-color:#d9d9d9;cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:#c0c4cc}.el-checkbox__input.is-disabled .el-checkbox__inner+.el-checkbox__label{cursor:not-allowed}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:#f2f6fc;border-color:#d9d9d9}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:#c0c4cc}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:#f2f6fc;border-color:#d9d9d9}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:#c0c4cc;border-color:#c0c4cc}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:#c0c4cc;cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:#34c388;border-color:#34c388}.el-checkbox__input.is-checked .el-checkbox__inner:after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:#34c388}.el-checkbox__input.is-focus .el-checkbox__inner{border-color:#34c388}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:#34c388;border-color:#34c388}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:#fff;height:2px;-webkit-transform:scale(.5);transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:1px solid #d9d9d9;border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;-webkit-transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:#34c388}.el-checkbox__inner:after{-webkit-box-sizing:content-box;box-sizing:content-box;content:"";border:1px solid #fff;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;-webkit-transform:rotate(45deg) scaleY(0);transform:rotate(45deg) scaleY(0);width:3px;-webkit-transition:-webkit-transform .15s ease-in .05s;transition:-webkit-transform .15s ease-in .05s;transition:transform .15s ease-in .05s;transition:transform .15s ease-in .05s,-webkit-transform .15s ease-in .05s;-webkit-transform-origin:center;transform-origin:center}.el-checkbox__original{opacity:0;outline:none;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:10px;line-height:19px;font-size:14px}.el-checkbox:last-child{margin-right:0}.el-checkbox-button,.el-checkbox-button__inner{position:relative;display:inline-block}.el-checkbox-button__inner{line-height:1;font-weight:500;white-space:nowrap;vertical-align:middle;cursor:pointer;background:#fff;border:1px solid #d9d9d9;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;margin:0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:12px 20px;font-size:14px;border-radius:0}.el-checkbox-button__inner.is-round{padding:12px 20px}.el-checkbox-button__inner:hover{color:#34c388}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:none;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:#fff;background-color:#34c388;border-color:#34c388;-webkit-box-shadow:-1px 0 0 0 #85dbb8;box-shadow:-1px 0 0 0 #85dbb8}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:#34c388}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5;-webkit-box-shadow:none;box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:#ebeef5}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:1px solid #d9d9d9;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:#34c388}.el-checkbox-button:last-child .el-checkbox-button__inner{border-radius:0 4px 4px 0}.el-checkbox-button--medium .el-checkbox-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-checkbox-button--medium .el-checkbox-button__inner.is-round{padding:10px 20px}.el-checkbox-button--small .el-checkbox-button__inner{padding:8px 15px;font-size:14px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button--mini .el-checkbox-button__inner{padding:4px 6px;font-size:12px;border-radius:0}.el-checkbox-button--mini .el-checkbox-button__inner.is-round{padding:4px 6px}.el-checkbox-group{font-size:0}.el-radio{color:#606266;font-weight:500;line-height:1;position:relative;cursor:pointer;display:inline-block;white-space:nowrap;outline:none;font-size:14px;margin-right:30px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.el-radio.is-bordered{padding:12px 20px 0 10px;border-radius:4px;border:1px solid #d9d9d9;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px}.el-radio.is-bordered.is-checked{border-color:#34c388}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:#ebeef5}.el-radio.is-bordered+.el-radio.is-bordered{margin-left:10px}.el-radio--medium.is-bordered{padding:10px 20px 0 10px;border-radius:4px;height:36px}.el-radio--medium.is-bordered .el-radio__label{font-size:14px}.el-radio--medium.is-bordered .el-radio__inner{height:14px;width:14px}.el-radio--small.is-bordered{padding:8px 15px 0 10px;border-radius:3px;height:32px}.el-radio--small.is-bordered .el-radio__label{font-size:14px}.el-radio--small.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio--mini.is-bordered{padding:6px 15px 0 10px;border-radius:3px;height:28px}.el-radio--mini.is-bordered .el-radio__label{font-size:12px}.el-radio--mini.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:none;display:inline-block;line-height:1;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:#fafafa;border-color:#e8e8e8;cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:#fafafa}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:#fafafa;border-color:#e8e8e8}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:#c0c4cc}.el-radio__input.is-disabled+span.el-radio__label{color:#c0c4cc;cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:#34c388;background:#34c388}.el-radio__input.is-checked .el-radio__inner:after{-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:#34c388}.el-radio__input.is-focus .el-radio__inner{border-color:#34c388}.el-radio__inner{border:1px solid #d9d9d9;border-radius:100%;width:14px;height:14px;background-color:#fff;position:relative;cursor:pointer;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.el-radio__inner:hover{border-color:#34c388}.el-radio__inner:after{width:4px;height:4px;border-radius:100%;background-color:#fff;content:"";position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%) scale(0);transform:translate(-50%,-50%) scale(0);-webkit-transition:-webkit-transform .15s ease-in;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in,-webkit-transform .15s ease-in}.el-radio__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{-webkit-box-shadow:0 0 2px 2px #34c388;box-shadow:0 0 2px 2px #34c388}.el-radio__label{font-size:14px;padding-left:10px}.el-scrollbar{overflow:hidden;position:relative}.el-scrollbar:active>.el-scrollbar__bar,.el-scrollbar:focus>.el-scrollbar__bar,.el-scrollbar:hover>.el-scrollbar__bar{opacity:1;-webkit-transition:opacity .34s ease-out;transition:opacity .34s ease-out}.el-scrollbar__wrap{overflow:scroll;height:100%}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{width:0;height:0}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:rgba(144,147,153,.3);-webkit-transition:background-color .3s;transition:background-color .3s}.el-scrollbar__thumb:hover{background-color:rgba(144,147,153,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px;opacity:0;-webkit-transition:opacity .12s ease-out;transition:opacity .12s ease-out}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-cascader-panel{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:4px;font-size:14px}.el-cascader-panel.is-bordered{border:1px solid #e8e8e8;border-radius:4px}.el-cascader-menu{min-width:180px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;border-right:1px solid #e8e8e8}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;color:#c0c4cc}.el-cascader-node{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:none}.el-cascader-node.is-selectable.in-active-path{color:#606266}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:#34c388;font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:#fafafa}.el-cascader-node.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox,.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}body *,html *{-webkit-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto Light"),local("Roboto-Light"),url(../../static/fonts/Roboto-Light.ecce92d0.woff) format("woff"),url(../../static/fonts/Roboto-Light.634f53eb.ttf) format("truetype")}body{background-color:#f0f2f5;padding:0;margin:0;color:rgba(0,0,0,.65);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}#app{min-width:1200px;margin:0 auto}#nprogress .bar{background:#34c388}#nprogress .peg{-webkit-box-shadow:0 0 10px #34c388,0 0 5px #34c388;box-shadow:0 0 10px #34c388,0 0 5px #34c388}.app-wrapper{padding:24px!important}.line{height:1px;min-width:50px;background-color:#34c388;margin:0 auto}.ant-card-bordered{border:none}.emq-list-card.ant-card .ant-card-head{border-bottom:1px solid #eee}.emq-list-card.ant-card .ant-card-head .ant-card-head-title{color:#303133;text-align:center;font-weight:400;position:relative}.emq-list-card.ant-card .ant-card-head .ant-card-head-title .back-btn{position:absolute;left:0;cursor:pointer;font-size:14px}.emq-list-card.ant-card .ant-card-head .ant-card-head-title .back-btn:before{font-family:element-icons,serif!important;content:"\E6DE";font-weight:700}.emq-table-header{padding:0 0 24px 0}.emq-table-header,.emq-table-header .search-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.emq-table-header .search-wrapper{width:400px}.emq-table-header .search-wrapper .node-select{width:100%}.emq-table-header .search-wrapper .el-button{margin-left:12px}.emq-table-footer{margin-top:24px;text-align:center}.btn{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.raw:hover,.btn:not(.btn-default){color:#34c388}.emq-title{font-size:16px;color:#333;font-weight:bolder;margin-bottom:40px}.emq-title.h3,.emq-title[size=small]{font-size:14px}.emq-title .sub-title{font-weight:400;display:block;font-size:12px;color:#8f9297;margin-top:12px}.emq-title.required-title:before{content:"*";color:#f5222d;margin-right:4px}.emq-option-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.emq-option-item .option-value{font-size:13px;padding-left:10px}.state{position:relative;top:-1px;display:inline-block;width:6px;height:6px;vertical-align:middle;border-radius:50%}.emq-popover-content{font-size:12px}.field-info{margin:0;list-style:none;padding:3px 0;line-height:35px}.field-info .field-title{display:inline-block;font-style:normal;font-size:14px;color:#999;padding-right:16px}.field-info .field-value{font-size:14px;color:#101010}.ant-badge-status-success{background-color:#34c388}.ant-badge[type=success] .ant-badge-status-text{color:#34c388}.ant-badge[type=error] .ant-badge-status-text{color:#f5222d}.button-group{margin-top:24px}.button-group__center{text-align:center}.button-group__right{text-align:right}.monaco-container{border:1px solid #d9d9d9}input{line-height:normal!important}.el-button{-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);font-weight:400}.el-button.el-button--small{font-size:14px;padding:8px 15px}.el-button--dashed.danger:focus,.el-button--dashed.danger:hover{color:#f5222d;border-color:#f5222d}.el-button--dashed{color:rgba(0,0,0,.65);background-color:#fff;border-color:#d9d9d9;border-style:dashed}.el-button--dashed:focus,.el-button--dashed:hover{color:#34c388;border-color:#34c388;background-color:#fff}.el-button--danger{color:#f5222d;background-color:#f5f5f5;border-color:#d9d9d9}.el-button--danger:hover{background-color:#f5222d;color:#fff;border-color:#f5222d}.el-button--danger:focus{color:#f5222d;background-color:#fff;border-color:#f5222d}.el-input,.el-textarea{-webkit-transition:all .3s;transition:all .3s}.el-input__inner:focus,.el-textarea__inner:focus{-webkit-box-shadow:0 0 0 2px rgba(52,195,136,.2);box-shadow:0 0 0 2px rgba(52,195,136,.2)}.el-form.el-form--label-left .el-form-item.is-required .el-form-item__label{margin-left:-10px}.el-form-item.is-error .el-input__inner,.el-form-item.is-error .el-textarea__inner{-webkit-box-shadow:0 0 0 2px rgba(245,34,45,.2);box-shadow:0 0 0 2px rgba(245,34,45,.2)}.el-form-item.is-success .el-input__inner,.el-form-item.is-success .el-textarea__inner{border-color:#d9d9d9}.el-form--label-top .el-form-item__label{padding:0}.el-form-item .emq-select{width:100%}.code-editor__item.el-form-item .el-form-item__content{line-height:18px}.el-select-dropdown__item.hover{background-color:rgba(52,195,136,.08)}.el-message{padding:16px;border-radius:4px;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15);background:#fff;border:none}.el-message--success .el-icon-success,.el-message--success .el-message__content{color:#34c388}.el-table .el-table__header th{border-bottom-color:#f7f7f7}.el-table .el-table__header-wrapper{border-radius:4px}.el-table thead{border-bottom-color:#fff}.el-table .el-table__empty-block{min-height:180px}.el-table.data-list .cell .iconfont{font-size:18px}.el-table .align-table-column .cell{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-dialog{border-radius:4px}.el-dialog .dialog-align-footer{text-align:center}.dialog-primary-btn{margin-left:12px}.el-radio-group,.el-radio-group .el-radio-button__inner{font-weight:400}.el-radio-group[border] .el-radio-button__orig-radio:checked+.el-radio-button__inner{background-color:#fff;color:#34c388}.el-dropdown-menu__item.active{background-color:#ebf9f3;color:#5dcfa0}.el-tabs.el-tabs--card>.el-tabs__header{border-bottom:0;margin-bottom:0}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__nav{border:none}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__item{-webkit-transition:all .5s;transition:all .5s;background:#fafafa;border-radius:4px 4px 0 0;margin-right:3px;border:1px solid transparent;border-bottom:1px solid #fff;line-height:38px}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close{font-size:14px;line-height:14px;top:0;color:#909399}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close:hover{color:#fff}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__new-tab{color:#34c388;border-color:#34c388;line-height:17px}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__new-tab i{font-weight:600}.el-tabs.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{background:#fff;border:1px solid #fff}.el-tabs__item{color:#909399}.el-icon-question{cursor:pointer}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon,.ant-menu-inline-collapsed>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon{font-size:20px;margin-right:0}.ant-breadcrumb{font-size:16px}.details-page .details-form__view .el-input.is-disabled .el-input__inner{background:transparent;border:none;cursor:text;color:#303133}.details-page .details-form__view .el-select .el-input .el-select__caret{visibility:hidden}.details-page .details-form__view .el-form-item__label{color:#999} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-18aaaf52.a09c5d07.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-18aaaf52.a09c5d07.css new file mode 100644 index 000000000..300d509eb --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-18aaaf52.a09c5d07.css @@ -0,0 +1 @@ +.key-and-value-editor{font-size:12px!important}.key-and-value-editor .el-input{width:100%!important}.key-and-value-editor .el-input.key-input{width:120px!important}.key-and-value-editor .el-table__empty-block{min-height:40px}.array-editor{font-size:12px!important}.array-editor .my-header{color:#333}.array-editor .el-input{width:100%!important}.array-editor .el-input.key-input{width:120px!important}.array-editor .el-table__empty-block{min-height:40px}.array-editor .requiredclass>div.cell:before{content:"*";color:#f5222d;margin-right:4px}.file-editor .el-upload{width:100%;text-align:right}.file-editor .el-upload .file-icon{color:#34c388}.listeners .listener-item{padding:20px;margin-bottom:20px;background-color:#f2f2f2;border:1px dashed #f2f2f2;-webkit-transition:border .3s;transition:border .3s;position:relative;border-radius:4px}.listeners .listener-item .listener-item-head{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:12px}.listeners .listener-item .listener-item-head .listener-item-type{font-size:12px}.listeners .listener-item .listener-item-head .listener-item-type .title{color:#888;float:left}.listeners .listener-item .listener-item-head .listener-item-type .desc{float:left;margin-left:8px;color:#444;margin-right:20px}.listeners .listener-item .listener-item-head .listener-item-btn .btn{margin-right:5px}.listeners .listener-item .listener-item-head .listener-item-btn .btn:last-child{margin-right:0}.el-select-dropdown .custom-option .value{float:right;font-size:12px;color:#888;margin-left:30px}.module-detail .page-header-content{padding:16px 20px}.module-detail .module-title{margin-bottom:10px}.module-detail .listener-title{margin-bottom:20px}.module-detail .listener-title:before{content:"*";color:#f5222d;font-size:12px;vertical-align:text-bottom}.module-detail .el-form-item .el-input,.module-detail .el-form-item .el-select{width:100%}.module-detail .el-form-item .el-select:not(.reset-width){width:330px}.module-detail .el-form-item .el-form-item__label{font-size:14px;color:#606266}.module-detail .config-item-wrapper{min-height:100px}.module-detail .config-item-wrapper .params-loading-wrapper{padding:0 32px}.module-detail .button-group__center{margin-bottom:24px}.module-detail .listener-wrapper{margin-top:24px}.module-detail .delete-btn{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-19e46f15.16b26fc6.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-19e46f15.16b26fc6.css new file mode 100644 index 000000000..ac421990a --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-19e46f15.16b26fc6.css @@ -0,0 +1 @@ +.auth-clientid-table .data-list{clear:both}.auth-clientid-table .app-wrapper .add-form{display:block;width:100%}.auth-clientid-table .app-wrapper .add-form .el-select{width:100%}.auth-clientid-table .app-wrapper .add-form .col-oper .el-button{margin-left:12px}.auth-clientid-table .app-wrapper .add-form .el-col-8{margin-bottom:20px}.auth-username-table .data-list{clear:both}.auth-username-table .app-wrapper .add-form{display:block;width:100%}.auth-username-table .app-wrapper .add-form .el-select{width:100%}.auth-username-table .app-wrapper .add-form .col-oper .el-button{margin-left:12px}.auth-username-table .app-wrapper .add-form .el-col-8{margin-bottom:20px}.auth-mnesia-table .data-list{clear:both}.auth-mnesia-table .app-wrapper .emq-table-header{padding:5px 0 0 0}.auth-mnesia-table .app-wrapper .acl{margin-top:40px}.auth-mnesia-table .app-wrapper .add-form{display:block;width:100%}.auth-mnesia-table .app-wrapper .add-form .tutorial{position:absolute;right:20px;top:4px}.auth-mnesia-table .app-wrapper .add-form .el-autocomplete,.auth-mnesia-table .app-wrapper .add-form .el-select{width:100%}.auth-mnesia-table .app-wrapper .add-form .col-oper .el-button{margin-left:12px}.auth-mnesia-table .app-wrapper .add-form .el-col{position:relative;margin-bottom:20px}.generate-jwt .monaco-container{height:200px}.generate-jwt .el-date-editor.el-input,.generate-jwt .el-date-editor.el-input__inner,.generate-jwt .el-select{width:100%}.generate-jwt .el-table{margin-top:40px}.generate-jwt .jwt-payload-desc{font-size:14px;padding:12px;border-radius:4px;line-height:1.4;margin:16px 0;background:#f6f7fb} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-1aa6ec30.655540b6.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-1aa6ec30.655540b6.css new file mode 100644 index 000000000..cfbb23995 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-1aa6ec30.655540b6.css @@ -0,0 +1 @@ +.rule-metrics .metrics-item[data-v-0b7b7823]{margin-bottom:50px}.rule-metrics .metrics-item .metrics-item-title[data-v-0b7b7823]{font-size:14px;font-weight:700;color:#101010}.rule-metrics .metrics-item .oper-wrapper[data-v-0b7b7823]{margin:20px auto;text-align:center}.rule-metrics .field-info[data-v-0b7b7823]{margin-top:12px}.rule-metrics .field-info.rule-metrics .field-title[data-v-0b7b7823]{min-width:130px}.rule-metrics .field-info.action-metrics .field-info-item[data-v-0b7b7823]{padding-left:12px}.rule-metrics .field-info.action-metrics .field-title[data-v-0b7b7823]{min-width:40px}.rule-metrics .metrics-item-body .item-title[data-v-0b7b7823]{color:#101010} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-2095c2f3.62b43ba0.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-2095c2f3.62b43ba0.css new file mode 100644 index 000000000..bdea14c3f --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-2095c2f3.62b43ba0.css @@ -0,0 +1 @@ +.stretch-height{width:100%;height:10px;background:#e6e6e6;cursor:row-resize;text-align:center}.stretch-height .el-icon-more{position:relative;top:-4px}.rule-create .rule-wrapper .code,.rule-create .rule-wrapper .code-view,.rule-create .rule-wrapper .el-autocomplete,.rule-create .rule-wrapper .el-input,.rule-create .rule-wrapper .el-select,.rule-create .rule-wrapper .el-textarea{width:100%}.rule-create .rule-wrapper .code{font-size:13px;padding:4px;border:1px dashed #fff;-webkit-transition:all .3s;transition:all .3s;line-height:24px}.rule-create .rule-wrapper .code.code-border{border:1px dashed #fff}.rule-create .rule-wrapper .code.code-border:hover{border:1px dashed #d8d8d8}.rule-create .rule-wrapper .code code{word-break:break-word}.rule-create .rule-wrapper .icon,.rule-create .rule-wrapper .tips{margin-left:12px}.rule-create .rule-wrapper .tips{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:12px}.rule-create .rule-wrapper .line{width:95%;margin:30px auto 28px auto;background-color:#edeef2}.rule-create .detail-title-wrapper{margin:-28px -24px 24px;padding:10px 0}.rule-create .detail-title-wrapper .ant-card-body{padding:14px 32px}.rule-create .emq-list-card{margin-bottom:24px}.rule-create .metrics-wrapper{margin-top:-12px}.rule-create .metrics-card{color:#101010}.rule-create .metrics-card:not(.last-child){border-right:1px solid #d8d8d8}.rule-create .metrics-card .card-title{font-size:14px;height:36px;line-height:36px;font-weight:700}.rule-create .metrics-card .card-value{font-size:32px}.rule-create .metrics-card .card-unit{font-size:14px}.rule-create .metrics-card .card-desc{margin-top:8px;font-size:12px;color:#a2a2a2}.rule-create .available-fields{-webkit-transition:all .3s;transition:all .3s;border-bottom:1px dashed #d8d8d8;padding-bottom:3px;position:relative;margin-right:8px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;line-height:2.3}.rule-create .available-fields:hover{color:#34c388}.rule-create .rule-create-footer{height:60px;background-color:#fff;margin-top:24px;text-align:center}.rule-create .rule-create-footer .el-button{min-width:80px}.rule-create .required-title{position:relative}.rule-create .required-title:before{content:"*";color:#f5222d;font-size:12px;position:absolute;left:-10px;top:3px}.rule-create .tips-form .tips-item{margin-bottom:20px}.rule-create .tips-form .tips-item .notice{color:#f5222d}.rule-create .tips-form .tips-item .copy-success{color:#34c388;float:right}.rule-create .tips-wrapper{width:100%;word-break:break-word;margin-top:10px;background:#f6f7fb;border-radius:4px;color:#909399}.rule-create .tips-wrapper.code{border:none;padding:10px}.rule-create .payload.stretch-height .el-icon-more{top:-11px}.rule-create .payload-type{width:100%;padding:2px 12px;background:#f6f7fb;border:1px solid #d9d9d9;border-top:none;text-align:right}.rule-create .payload-type .el-radio__label{font-size:13px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-214e9a45.14ee6fe0.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-214e9a45.14ee6fe0.css new file mode 100644 index 000000000..1761354f1 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-214e9a45.14ee6fe0.css @@ -0,0 +1 @@ +.application .el-date-editor,.application .el-select{width:100%} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-2be77691.75bab761.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-2be77691.75bab761.css new file mode 100644 index 000000000..19c7d3ee2 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-2be77691.75bab761.css @@ -0,0 +1 @@ +.blacklist .description[data-v-170091b5]{max-width:500px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-3208fb9c.ba1dcff8.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-3208fb9c.ba1dcff8.css new file mode 100644 index 000000000..957e54fa5 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-3208fb9c.ba1dcff8.css @@ -0,0 +1 @@ +.el-select-dropdown .custom-option .value{float:right;font-size:12px;color:#888;margin-left:30px}.rule-actions .show-btn{border-bottom:1px dashed #d8d8d8}.rule-actions .action-item .action-item-btn .btn{margin-right:5px}.rule-actions .action-item .action-item-btn .btn:last-child{margin-right:0}.rule-actions .action-item .action-item-btn .fallbacks{position:absolute;bottom:5px;right:22px}.rule-actions .action-item .action-item-btn .fallbacks .el-button{font-size:12px}.rule-actions .action-item .action-item-btn .fallbacks .el-button [class*=el-icon-]+span{margin-left:0}.rule-actions .error-action .action-item-btn .fallbacks{position:absolute;bottom:-3px;right:5px;color:#909399}.rule-actions .metrics-detail{margin-top:16px;padding:4px 0;font-size:12px;color:#444}.rule-actions .metrics-detail .main-title{color:#101010;margin-bottom:8px}.rule-actions .metrics-detail .title{color:#888;padding-left:8px}.rule-actions .metrics-detail .value{margin-left:8px;margin-right:20px}.rule-actions .action-item{padding:20px;margin-bottom:20px;background-color:#f2f2f2;border:1px dashed #f2f2f2;-webkit-transition:border .3s;transition:border .3s;position:relative}.rule-actions .action-item.error-action{padding:0;margin-bottom:0}.rule-actions .action-item-head{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:12px}.rule-actions .action-item-head .action-item-type{font-size:12px}.rule-actions .action-item-head .action-item-type .title{color:#888;float:left}.rule-actions .action-item-head .action-item-type .desc{float:left;margin-left:8px;color:#444;margin-right:20px}.rule-actions .action-item-description{font-size:12px;color:#888;margin:4px 0 12px 0}.rule-actions .action-item-params{margin-top:12px;margin-bottom:20px;font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:80%;-ms-flex-wrap:wrap;flex-wrap:wrap}.rule-actions .action-item-params .action-item-field{margin-right:20px}.rule-actions .action-item-params .title{color:#888;float:left}.rule-actions .action-item-params .value{float:left;margin-left:8px;color:#444}.rule-actions .el-form .el-form-item .el-input{width:100%}.rule-actions .el-form .el-form-item .el-select:not(.reset-width){width:330px}.rule-actions .el-form .el-form-item .el-form-item__label{padding-bottom:0;font-size:12px}.rule-actions .action-description{margin-top:-10px;padding-bottom:8px;font-size:12px;margin-bottom:3px;border-bottom:1px solid #d8d8d8}.rule-actions .tips{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:12px;margin-left:12px}.rule-actions .line{background-color:#d8d8d8}.rule-actions .params-item-wrapper{margin-top:30px;min-height:100px}.rule-actions .params-item-wrapper .params-loading-wrapper{padding:0 32px}.rule-actions .params-item-wrapper .el-input,.rule-actions .params-item-wrapper .el-select{width:200px!important}.rule-actions .params-item-wrapper .el-textarea{width:330px}.rule-actions .params-item-wrapper .monaco-action__sql{height:200px}.create-guide{min-height:80px;margin:0 auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.create-guide,.custom-option{display:-webkit-box;display:-ms-flexbox;display:flex}.custom-option{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.custom-option .key{display:inline-block;max-width:350px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-32291c05.be47c5e9.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-32291c05.be47c5e9.css new file mode 100644 index 000000000..c54e0e364 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-32291c05.be47c5e9.css @@ -0,0 +1 @@ +.modules .header-box .content[data-v-839f236e],.modules .page-header-content-view .content[data-v-839f236e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-width:830px}.modules .header-box .content .modules-num[data-v-839f236e],.modules .page-header-content-view .content .modules-num[data-v-839f236e]{display:inline-block;min-width:38px;padding:2px 10px;text-align:center;color:#fff;font-size:13px;border-radius:15px;background-color:#2f333e;margin:0 12px}.modules .el-card[data-v-839f236e]{margin-bottom:20px}.modules .module-item[data-v-839f236e]{position:relative;cursor:pointer}.modules .module-item .item-error-tip[data-v-839f236e],.modules .module-item[data-v-839f236e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.modules .module-item .item-error-tip[data-v-839f236e]{position:absolute;top:0;left:0;width:100%;padding:5px 20px;background-color:#fff8e5;font-size:12px;border-left:5px solid #ffb900}.modules .module-item .item-error-tip .reconnect-btn[data-v-839f236e]{width:40px;height:18px;line-height:8px;color:#f56e28;border:1px solid #f56e28;background-color:#fff8e5}.modules .module-item .left-box[data-v-839f236e]{display:-webkit-box;display:-ms-flexbox;display:flex}.modules .module-item .item-img[data-v-839f236e]{width:85px;height:85px;-ms-flex-negative:0;flex-shrink:0}.modules .module-item .item-content[data-v-839f236e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-left:20px;margin-right:10px;-ms-flex-item-align:start;align-self:flex-start}.modules .module-item .item-content .item-title[data-v-839f236e]{color:#101010;font-size:16px;font-weight:700;word-break:break-word}.modules .module-item .item-content .item-des[data-v-839f236e]{max-width:240px;color:rgba(0,0,0,.65);font-size:12px}.modules .module-item .item-handle[data-v-839f236e]{height:85px;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.modules .module-item .item-handle .handle-icons[data-v-839f236e]{width:52px;height:28px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;font-size:20px;padding-right:2px}.modules .module-item .item-handle .handle-icons .open[data-v-839f236e]{width:20px;color:#23bd78;font-size:28px;position:relative}.modules .module-item .item-handle .handle-icons .el-icon-caret-right[data-v-839f236e]:before{position:absolute;left:-5px}.modules .module-item .item-handle .handle-icons .close[data-v-839f236e]{color:red;line-height:28px}.modules .module-item .item-handle .handle-icons .el-icon-edit-outline[data-v-839f236e]{line-height:28px}.modules .module-item .item-handle .start-btn[data-v-839f236e]{width:52px;color:#23bd78;border:1px solid #23bd78;font-size:14px;background-color:#f6fcf8;margin-left:0}.modules .module-item .item-handle .know-more[data-v-839f236e]{font-size:13px}.modules .search-input .el-icon-loading[data-v-839f236e],.modules .search-input .el-icon-search[data-v-839f236e]{position:relative;left:4px;top:7px}.modules .null-modules[data-v-839f236e]{min-height:130px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.modules .item-box[data-v-839f236e]{position:relative}.modules .item-box .delete-icon[data-v-839f236e]{visibility:hidden}.modules .item-box:hover .delete-icon[data-v-839f236e]{visibility:visible}.modules .delete-icon[data-v-839f236e]{position:absolute;width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABcElEQVRYR+2WMU7DMBSGn3MLrgCXYGNDYqAzTKgLU/KsZKFblEekDIiu7FRCSL1AL1EuwQ0iJUGOHCmq7NjPgNohXjLEz//n//2yLeDIQxxZH2aA03Ygz/PLNE13/5kTqwNFUayEEE8AsEHERQgEEb0DwFXXdfdSyg/TGlYAIloDwFIXsSG0+K2qF0JskyS55gKoYrWDYXhDjMV18QIRNywANZmI2BAc8d4dV285EFxxLwBfJ0LEvQFcEKHiLAAbhG5hn3ZX4NghNBUYMjGeZk27LWvOEDIg2OLsFgwwhp6rX97nxHhTbAcOxPd6sQv9ZUOwAA7Foyjq74i2bdWJGQThDWASj+P4SwGUZXkeCuEFMCU+9DMUwgngI/4biEkAjngoxNR74BkAYr3wXgVu6LnrAjO04wURH1knIRG9AcAdALDELU58IuINC0BNVs+ypmlesyz7du3a9L+qqrO6rh+klKs/PYpDYGaA2YGTdeAH4UfVIZWshvAAAAAASUVORK5CYII=) no-repeat;background-size:100% 100%;top:3px;right:3px;cursor:pointer}.modules-select[data-v-839f236e]{-webkit-transform:none;transform:none}.modules-select .header-box[data-v-839f236e]{width:100%;height:112px;position:fixed;top:80px;right:0;z-index:9}.modules-select .header-box .inner-box[data-v-839f236e]{background:#f0f2f5;padding:24px;-webkit-box-sizing:border-box;box-sizing:border-box}.modules-select .header-box .content[data-v-839f236e]{height:64px;padding:0 24px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.modules-select .header-box .content .content-left[data-v-839f236e]{display:-webkit-box;display:-ms-flexbox;display:flex}.modules-select .header-box .content span[data-v-839f236e]{-ms-flex-negative:0;flex-shrink:0}.modules-select .header-box .content .module-class[data-v-839f236e]{font-size:14px;color:rgba(0,0,0,.65);margin-right:20px;cursor:pointer;-ms-flex-negative:0;flex-shrink:0}.modules-select .header-box .content .active-nav[data-v-839f236e]{color:#34c388;position:relative}.modules-select .header-box .content .active-nav[data-v-839f236e]:before{content:"";position:absolute;width:100%;height:2px;background:#34c388;bottom:-15px;left:0}.modules-select .content-title[data-v-839f236e]{font-weight:700}.modules-select .class-title[data-v-839f236e]{display:block;margin-bottom:30px;color:#101010;font-weight:700}.modules-select .content-box[data-v-839f236e]{scroll-behavior:smooth;padding:16px 24px;margin:24px;margin-top:112px;background-color:#fff}.modules-select .module-item .item-handle[data-v-839f236e]{text-align:center;font-size:14px}.modules-select .module-item .item-handle .start-btn[data-v-839f236e]{width:60px}.modules-select .module-item .item-handle .select-btn[data-v-839f236e]{width:50px;font-size:13px;color:#999}.modules-select .module-item .item-handle .select-btn[data-v-839f236e]:hover{color:#23bd78}.modules-select .active-title[data-v-839f236e]{color:#34c388}.modules-select .link-content[data-v-839f236e]{padding-top:200px;margin-top:-200px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-3adcb268.c694417f.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-3adcb268.c694417f.css new file mode 100644 index 000000000..58795a9c2 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-3adcb268.c694417f.css @@ -0,0 +1 @@ +.monaco-editor .accessibilityHelpWidget{padding:10px;vertical-align:middle;overflow:scroll}.monaco-aria-container{position:absolute;left:-999em}.monaco-editor .bracket-match{-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-menu .monaco-action-bar.vertical .action-label.hover{background-color:#eee}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{-webkit-animation:fadeIn .15s ease-out;animation:fadeIn .15s ease-out}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{-webkit-animation:fadeOut .1s ease-out;animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:1px 4px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute}.monaco-editor .lightbulb-glyph{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:16px;width:20px;padding-left:2px}.monaco-editor .lightbulb-glyph:hover{cursor:pointer}.monaco-editor.vs .lightbulb-glyph{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS42NyA4LjY1OGMtLjMzOC4zMzQtLjU5OC43MDUtLjc4MSAxLjExNC0uMTc4LjQwNy0uMjY4Ljg1LS4yNjggMS4zMjl2MS42YTEuMzA0IDEuMzA0IDAgMCAxLS43OTQgMS4xOTdjLS4xNTkuMDY4LS4zMjkuMTAyLS41MDkuMTAySDcuNzEyYTEuMjg1IDEuMjg1IDAgMCAxLS45MjItLjM3OSAxLjMwMyAxLjMwMyAwIDAgMS0uMzgtLjkydi0xLjZjMC0uNDc5LS4wOTItLjkyMS0uMjc0LTEuMzI5YTMuNTU2IDMuNTU2IDAgMCAwLS43NzYtMS4xMTQgNC42ODkgNC42ODkgMCAwIDEtMS4wMDYtMS40MzdBNC4xODcgNC4xODcgMCAwIDEgNCA1LjVhNC40MzIgNC40MzIgMCAwIDEgLjYxNi0yLjI3Yy4xOTctLjMzNi40MzItLjY0LjcwNS0uOTE0LjI3NC0uMjcyLjU3OC0uNTA2LjkxMS0uNzAyLjMzOC0uMTk2LjctLjM0OCAxLjA4NC0uNDU0QzcuNyAxLjA1MyA4LjEgMSA4LjUxNiAxYTQuNDc2IDQuNDc2IDAgMCAxIDIuMjc2LjYxNCA0LjQ3NSA0LjQ3NSAwIDAgMSAxLjYyMiAxLjYxNiA0LjQzOCA0LjQzOCAwIDAgMSAuNjE2IDIuMjdjMCAuNjE3LS4xMTcgMS4xOTEtLjM1MyAxLjcyMWE0LjY5IDQuNjkgMCAwIDEtMS4wMDYgMS40Mzd6TTkuNjIzIDEwLjVINy40MDl2Mi4yMDFjMCAuMDgxLjAyOC4xNS4wOS4yMTIuMDYyLjA2MS4xMzEuMDkuMjEzLjA5aDEuNjA2YS4yODkuMjg5IDAgMCAwIC4yMTMtLjA5LjI4Ni4yODYgMCAwIDAgLjA5LS4yMTJWMTAuNXoiIGZpbGw9IiNGQzAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjY3IDguNjU4Yy0uMzM4LjMzNC0uNTk4LjcwNS0uNzgxIDEuMTE0LS4xNzguNDA3LS4yNjguODUtLjI2OCAxLjMyOXYxLjZhMS4zMDQgMS4zMDQgMCAwIDEtLjc5NCAxLjE5N2MtLjE1OS4wNjgtLjMyOS4xMDItLjUwOS4xMDJINy43MTJhMS4yODUgMS4yODUgMCAwIDEtLjkyMi0uMzc5IDEuMzAzIDEuMzAzIDAgMCAxLS4zOC0uOTJ2LTEuNmMwLS40NzktLjA5Mi0uOTIxLS4yNzQtMS4zMjlhMy41NTYgMy41NTYgMCAwIDAtLjc3Ni0xLjExNCA0LjY4OSA0LjY4OSAwIDAgMS0xLjAwNi0xLjQzN0E0LjE4NyA0LjE4NyAwIDAgMSA0IDUuNWE0LjQzMiA0LjQzMiAwIDAgMSAuNjE2LTIuMjdjLjE5Ny0uMzM2LjQzMi0uNjQuNzA1LS45MTQuMjc0LS4yNzIuNTc4LS41MDYuOTExLS43MDIuMzM4LS4xOTYuNy0uMzQ4IDEuMDg0LS40NTRDNy43IDEuMDUzIDguMSAxIDguNTE2IDFhNC40NzYgNC40NzYgMCAwIDEgMi4yNzYuNjE0IDQuNDc1IDQuNDc1IDAgMCAxIDEuNjIyIDEuNjE2IDQuNDM4IDQuNDM4IDAgMCAxIC42MTYgMi4yN2MwIC42MTctLjExNyAxLjE5MS0uMzUzIDEuNzIxYTQuNjkgNC42OSAwIDAgMS0xLjAwNiAxLjQzN3pNOS42MjMgMTAuNUg3LjQwOXYyLjIwMWMwIC4wODEuMDI4LjE1LjA5LjIxMi4wNjIuMDYxLjEzMS4wOS4yMTMuMDloMS42MDZhLjI4OS4yODkgMCAwIDAgLjIxMy0uMDkuMjg2LjI4NiAwIDAgMCAuMDktLjIxMlYxMC41eiIgZmlsbD0iI0REQjEwMCIvPjwvc3ZnPg==") 50% no-repeat}.monaco-editor.vs .lightbulb-glyph.autofixable{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiA5Yy0xLjY3IDAtMyAxLjMzLTMgM3MxLjMzIDMgMyAzIDMtMS4zMyAzLTMtMS4zMy0zLTMtM3ptLS43OTcgMy40NzFMMTAuNzA0IDE0IDEyIDEzLjAyNGwxLjMwNS45NzYtLjUwOC0xLjUyOUwxNCAxMS42NGgtMS40NjRMMTIgMTBsLS41MjcgMS42NEgxMGwxLjIwMy44MzF6IiBmaWxsPSIjMDA3QUNDIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS4xNyA4LjA4NUEzLjk3OSAzLjk3OSAwIDAgMCA4LjI4OCAxMC41SDYuNDA5djIuMjAxYzAgLjA4MS4wMjguMTUuMDkuMjEyLjA2Mi4wNjEuMTMxLjA5LjIxMy4wOWgxLjQxM2MuMDg5LjM0OC4yMjMuNjc4LjM5Ni45ODItLjA2Ni4wMS0uMTM0LjAxNS0uMjAzLjAxNUg2LjcxMmExLjI4NSAxLjI4NSAwIDAgMS0uOTIyLS4zNzkgMS4zMDMgMS4zMDMgMCAwIDEtLjM4LS45MnYtMS42YzAtLjQ3OS0uMDkyLS45MjEtLjI3NC0xLjMyOWEzLjU1NiAzLjU1NiAwIDAgMC0uNzc2LTEuMTE0IDQuNjg5IDQuNjg5IDAgMCAxLTEuMDA2LTEuNDM3QTQuMTg3IDQuMTg3IDAgMCAxIDMgNS41YTQuNDMyIDQuNDMyIDAgMCAxIC42MTYtMi4yN2MuMTk3LS4zMzYuNDMyLS42NC43MDUtLjkxNC4yNzQtLjI3Mi41NzgtLjUwNi45MTEtLjcwMi4zMzgtLjE5Ni43LS4zNDggMS4wODQtLjQ1NEM2LjcgMS4wNTMgNy4xIDEgNy41MTYgMWE0LjQ3NiA0LjQ3NiAwIDAgMSAyLjI3Ni42MTQgNC40NzUgNC40NzUgMCAwIDEgMS42MjIgMS42MTYgNC40MzggNC40MzggMCAwIDEgLjYxNiAyLjI3YzAgLjYxNy0uMTE3IDEuMTkxLS4zNTMgMS43MjFhNC41MzcgNC41MzcgMCAwIDEtLjUwNi44NjR6IiBmaWxsPSIjMDA3QUNDIi8+PC9zdmc+") 50% no-repeat}.monaco-editor.hc-black .lightbulb-glyph,.monaco-editor.vs-dark .lightbulb-glyph{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS42NyA4LjY1OGMtLjMzOC4zMzQtLjU5OC43MDUtLjc4MSAxLjExNC0uMTc4LjQwNy0uMjY4Ljg1LS4yNjggMS4zMjl2MS42YTEuMzA0IDEuMzA0IDAgMCAxLS43OTQgMS4xOTdjLS4xNTkuMDY4LS4zMjkuMTAyLS41MDkuMTAySDcuNzEyYTEuMjg1IDEuMjg1IDAgMCAxLS45MjItLjM3OSAxLjMwMyAxLjMwMyAwIDAgMS0uMzgtLjkydi0xLjZjMC0uNDc5LS4wOTItLjkyMS0uMjc0LTEuMzI5YTMuNTU2IDMuNTU2IDAgMCAwLS43NzYtMS4xMTQgNC42ODkgNC42ODkgMCAwIDEtMS4wMDYtMS40MzdBNC4xODcgNC4xODcgMCAwIDEgNCA1LjVhNC40MzIgNC40MzIgMCAwIDEgLjYxNi0yLjI3Yy4xOTctLjMzNi40MzItLjY0LjcwNS0uOTE0LjI3NC0uMjcyLjU3OC0uNTA2LjkxMS0uNzAyLjMzOC0uMTk2LjctLjM0OCAxLjA4NC0uNDU0QzcuNyAxLjA1MyA4LjEgMSA4LjUxNiAxYTQuNDc2IDQuNDc2IDAgMCAxIDIuMjc2LjYxNCA0LjQ3NSA0LjQ3NSAwIDAgMSAxLjYyMiAxLjYxNiA0LjQzOCA0LjQzOCAwIDAgMSAuNjE2IDIuMjdjMCAuNjE3LS4xMTcgMS4xOTEtLjM1MyAxLjcyMWE0LjY5IDQuNjkgMCAwIDEtMS4wMDYgMS40Mzd6TTkuNjIzIDEwLjVINy40MDl2Mi4yMDFjMCAuMDgxLjAyOC4xNS4wOS4yMTIuMDYyLjA2MS4xMzEuMDkuMjEzLjA5aDEuNjA2YS4yODkuMjg5IDAgMCAwIC4yMTMtLjA5LjI4Ni4yODYgMCAwIDAgLjA5LS4yMTJWMTAuNXoiIGZpbGw9IiNGQzAiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor.hc-black .lightbulb-glyph.autofixable,.monaco-editor.vs-dark .lightbulb-glyph.autofixable{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiA5Yy0xLjY3IDAtMyAxLjMzLTMgM3MxLjMzIDMgMyAzIDMtMS4zMyAzLTMtMS4zMy0zLTMtM3ptLS43OTcgMy40NzFMMTAuNzA0IDE0IDEyIDEzLjAyNGwxLjMwNS45NzYtLjUwOC0xLjUyOUwxNCAxMS42NGgtMS40NjRMMTIgMTBsLS41MjcgMS42NEgxMGwxLjIwMy44MzF6IiBmaWxsPSIjNzVCRUZGIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS4xNyA4LjA4NUEzLjk3OSAzLjk3OSAwIDAgMCA4LjI4OCAxMC41SDYuNDA5djIuMjAxYzAgLjA4MS4wMjguMTUuMDkuMjEyLjA2Mi4wNjEuMTMxLjA5LjIxMy4wOWgxLjQxM2MuMDg5LjM0OC4yMjMuNjc4LjM5Ni45ODItLjA2Ni4wMS0uMTM0LjAxNS0uMjAzLjAxNUg2LjcxMmExLjI4NSAxLjI4NSAwIDAgMS0uOTIyLS4zNzkgMS4zMDMgMS4zMDMgMCAwIDEtLjM4LS45MnYtMS42YzAtLjQ3OS0uMDkyLS45MjEtLjI3NC0xLjMyOWEzLjU1NiAzLjU1NiAwIDAgMC0uNzc2LTEuMTE0IDQuNjg5IDQuNjg5IDAgMCAxLTEuMDA2LTEuNDM3QTQuMTg3IDQuMTg3IDAgMCAxIDMgNS41YTQuNDMyIDQuNDMyIDAgMCAxIC42MTYtMi4yN2MuMTk3LS4zMzYuNDMyLS42NC43MDUtLjkxNC4yNzQtLjI3Mi41NzgtLjUwNi45MTEtLjcwMi4zMzgtLjE5Ni43LS4zNDggMS4wODQtLjQ1NEM2LjcgMS4wNTMgNy4xIDEgNy41MTYgMWE0LjQ3NiA0LjQ3NiAwIDAgMSAyLjI3Ni42MTQgNC40NzUgNC40NzUgMCAwIDEgMS42MjIgMS42MTYgNC40MzggNC40MzggMCAwIDEgLjYxNiAyLjI3YzAgLjYxNy0uMTE3IDEuMTkxLS4zNTMgMS43MjFhNC41MzcgNC41MzcgMCAwIDEtLjUwNi44NjR6IiBmaWxsPSIjNzVCRUZGIi8+PC9zdmc+") 50% no-repeat}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-block;text-overflow:ellipsis}.monaco-editor .codelens-decoration>a,.monaco-editor .codelens-decoration>span{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;vertical-align:sub}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{text-decoration:underline;cursor:pointer}.monaco-editor .codelens-decoration.invisible-cl{opacity:0}@-webkit-keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{-webkit-animation:fadein .1s linear;animation:fadein .1s linear}.monaco-action-bar{text-align:right;overflow:hidden;white-space:nowrap}.monaco-action-bar .actions-container{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0 auto;padding:0;width:100%;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar.reverse .actions-container{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.monaco-action-bar .action-item{cursor:pointer;display:inline-block;-webkit-transition:-webkit-transform 50ms ease;transition:-webkit-transform 50ms ease;transition:transform 50ms ease;transition:transform 50ms ease,-webkit-transform 50ms ease;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar.animated .action-item.active{-webkit-transform:scale(1.272019649);transform:scale(1.272019649)}.monaco-action-bar .action-item .icon{display:inline-block}.monaco-action-bar .action-label{font-size:11px;margin-right:4px}.monaco-action-bar .action-label.octicon{font-size:15px;line-height:35px;text-align:center}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:hover{opacity:.4}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar.animated.vertical .action-item.active{-webkit-transform:translate(5px);transform:translate(5px)}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;-webkit-box-flex:1;-ms-flex:1;flex:1;max-width:170px;min-width:60px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.monaco-editor.vs .dnd-target{border-right:2px dotted #000;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #aeafad;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines{cursor:default}.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines{cursor:copy}.monaco-custom-checkbox{margin-left:2px;float:left;cursor:pointer;overflow:hidden;opacity:.7;width:20px;height:20px;border:1px solid transparent;padding:1px;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none;user-select:none}.monaco-custom-checkbox.checked,.monaco-custom-checkbox:hover{opacity:1}.hc-black .monaco-custom-checkbox,.hc-black .monaco-custom-checkbox:hover{background:none}.monaco-custom-checkbox.monaco-simple-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-custom-checkbox.monaco-simple-checkbox.checked{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNSAzLjc2M2wtOS4xOTMgOC4xNzItLjcyMS0uMDQyTDEgNy4yOTZsLjc2My0uNjc4IDMuNzQ3IDQuMjE0TDE0LjMyMSAzbC42NzkuNzYzeiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==") 50% no-repeat;background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNSAzLjc2M2wtOS4xOTMgOC4xNzItLjcyMS0uMDQyTDEgNy4yOTZsLjc2My0uNjc4IDMuNzQ3IDQuMjE0TDE0LjMyMSAzbC42NzkuNzYzeiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") 50% no-repeat}.vs .monaco-custom-checkbox.monaco-case-sensitive{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ5NSA5LjA1MmwuODkxIDIuMzVoMS4wOTFMNi4yMzcgM2gtMS4wMkwyIDExLjQwMmgxLjA5NWwuODM4LTIuMzVoMy41NjJ6TTUuODExIDQuNDUzbC4wNDQuMTM1IDEuMzE4IDMuNTc0SDQuMjU1bDEuMzA3LTMuNTc0LjA0NC0uMTM1LjAzOC0uMTU2LjAzMi0uMTUyLjAyMS0uMTI2aC4wMjNsLjAyNC4xMjYuMDI5LjE1Mi4wMzguMTU2em03Ljk4NCA2LjAxMXYuOTM2aC45NlY3LjQ5OGMwLS43MTktLjE4LTEuMjcyLS41MzktMS42NjEtLjM1OS0uMzg5LS44ODktLjU4My0xLjU4OC0uNTgzLS4xOTkgMC0uNDAxLjAxOS0uNjA2LjA1NmE0Ljg3NSA0Ljg3NSAwIDAgMC0xLjA3OC4zMjYgMi4wODEgMi4wODEgMCAwIDAtLjM0My4xODh2Ljk4NGMuMjY2LS4yMy41NjYtLjQxMS45MDQtLjU0YTIuOTI3IDIuOTI3IDAgMCAxIDEuMDUyLS4xOTNjLjE4OCAwIC4zNTguMDI4LjUxMy4wODVhLjk4Ljk4IDAgMCAxIC4zOTYuMjY3Yy4xMDkuMTIxLjE5My4yNzkuMjUyLjQ3Mi4wNTkuMTkzLjA4OC40MjcuMDg4LjdsLTEuODExLjI1MmMtLjM0NC4wNDctLjY0LjEyNi0uODg4LjIzN2ExLjk0NyAxLjk0NyAwIDAgMC0uNjE1LjQxOSAxLjYgMS42IDAgMCAwLS4zNi41OCAyLjEzNCAyLjEzNCAwIDAgMC0uMTE3LjcyMWMwIC4yNDYuMDQyLjQ3NS4xMjQuNjg4LjA4Mi4yMTMuMjAzLjM5Ny4zNjMuNTUxLjE2LjE1NC4zNi4yNzYuNTk4LjM2Ni4yMzguMDkuNTEzLjEzNS44MjYuMTM1LjQwMiAwIC43Ni0uMDkyIDEuMDc1LS4yNzguMzE1LS4xODYuNTcyLS40NTQuNzcxLS44MDZoLjAyM3ptLTIuMTI4LTEuNzQzYy4xNzYtLjA2NC40MDEtLjExNC42NzQtLjE0OWwxLjQ2NS0uMjA1di42MDljMCAuMjQ2LS4wNDEuNDc1LS4xMjMuNjg4YTEuNzI3IDEuNzI3IDAgMCAxLS4zNDMuNTU3IDEuNTczIDEuNTczIDAgMCAxLS41MjQuMzcyIDEuNjMgMS42MyAwIDAgMS0uNjY4LjEzNWMtLjE4NyAwLS4zNTMtLjAyNS0uNDk1LS4wNzZhMS4wMyAxLjAzIDAgMCAxLS4zNTctLjIxMS44OTYuODk2IDAgMCAxLS4yMi0uMzE2QTEuMDA1IDEuMDA1IDAgMCAxIDExIDkuNzMyYTEuNiAxLjYgMCAwIDEgLjA1NS0uNDQuNzM5LjczOSAwIDAgMSAuMjAyLS4zMzQgMS4xNiAxLjE2IDAgMCAxIC40MS0uMjM3eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==") 50% no-repeat}.vs-dark .monaco-custom-checkbox.monaco-case-sensitive{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ5NSA5LjA1MmwuODkxIDIuMzVoMS4wOTFMNi4yMzcgM2gtMS4wMkwyIDExLjQwMmgxLjA5NWwuODM4LTIuMzVoMy41NjJ6TTUuODExIDQuNDUzbC4wNDQuMTM1IDEuMzE4IDMuNTc0SDQuMjU1bDEuMzA3LTMuNTc0LjA0NC0uMTM1LjAzOC0uMTU2LjAzMi0uMTUyLjAyMS0uMTI2aC4wMjNsLjAyNC4xMjYuMDI5LjE1Mi4wMzguMTU2em03Ljk4NCA2LjAxMXYuOTM2aC45NlY3LjQ5OGMwLS43MTktLjE4LTEuMjcyLS41MzktMS42NjEtLjM1OS0uMzg5LS44ODktLjU4My0xLjU4OC0uNTgzLS4xOTkgMC0uNDAxLjAxOS0uNjA2LjA1NmE0Ljg3NSA0Ljg3NSAwIDAgMC0xLjA3OC4zMjYgMi4wODEgMi4wODEgMCAwIDAtLjM0My4xODh2Ljk4NGMuMjY2LS4yMy41NjYtLjQxMS45MDQtLjU0YTIuOTI3IDIuOTI3IDAgMCAxIDEuMDUyLS4xOTNjLjE4OCAwIC4zNTguMDI4LjUxMy4wODVhLjk4Ljk4IDAgMCAxIC4zOTYuMjY3Yy4xMDkuMTIxLjE5My4yNzkuMjUyLjQ3Mi4wNTkuMTkzLjA4OC40MjcuMDg4LjdsLTEuODExLjI1MmMtLjM0NC4wNDctLjY0LjEyNi0uODg4LjIzN2ExLjk0NyAxLjk0NyAwIDAgMC0uNjE1LjQxOSAxLjYgMS42IDAgMCAwLS4zNi41OCAyLjEzNCAyLjEzNCAwIDAgMC0uMTE3LjcyMWMwIC4yNDYuMDQyLjQ3NS4xMjQuNjg4LjA4Mi4yMTMuMjAzLjM5Ny4zNjMuNTUxLjE2LjE1NC4zNi4yNzYuNTk4LjM2Ni4yMzguMDkuNTEzLjEzNS44MjYuMTM1LjQwMiAwIC43Ni0uMDkyIDEuMDc1LS4yNzguMzE1LS4xODYuNTcyLS40NTQuNzcxLS44MDZoLjAyM3ptLTIuMTI4LTEuNzQzYy4xNzYtLjA2NC40MDEtLjExNC42NzQtLjE0OWwxLjQ2NS0uMjA1di42MDljMCAuMjQ2LS4wNDEuNDc1LS4xMjMuNjg4YTEuNzI3IDEuNzI3IDAgMCAxLS4zNDMuNTU3IDEuNTczIDEuNTczIDAgMCAxLS41MjQuMzcyIDEuNjMgMS42MyAwIDAgMS0uNjY4LjEzNWMtLjE4NyAwLS4zNTMtLjAyNS0uNDk1LS4wNzZhMS4wMyAxLjAzIDAgMCAxLS4zNTctLjIxMS44OTYuODk2IDAgMCAxLS4yMi0uMzE2QTEuMDA1IDEuMDA1IDAgMCAxIDExIDkuNzMyYTEuNiAxLjYgMCAwIDEgLjA1NS0uNDQuNzM5LjczOSAwIDAgMSAuMjAyLS4zMzQgMS4xNiAxLjE2IDAgMCAxIC40MS0uMjM3eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-case-sensitive,.hc-black .monaco-custom-checkbox.monaco-case-sensitive:hover{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ5NSA5LjA1MmwuODkxIDIuMzVoMS4wOTFMNi4yMzcgM2gtMS4wMkwyIDExLjQwMmgxLjA5NWwuODM4LTIuMzVoMy41NjJ6TTUuODExIDQuNDUzbC4wNDQuMTM1IDEuMzE4IDMuNTc0SDQuMjU1bDEuMzA3LTMuNTc0LjA0NC0uMTM1LjAzOC0uMTU2LjAzMi0uMTUyLjAyMS0uMTI2aC4wMjNsLjAyNC4xMjYuMDI5LjE1Mi4wMzguMTU2em03Ljk4NCA2LjAxMXYuOTM2aC45NlY3LjQ5OGMwLS43MTktLjE4LTEuMjcyLS41MzktMS42NjEtLjM1OS0uMzg5LS44ODktLjU4My0xLjU4OC0uNTgzLS4xOTkgMC0uNDAxLjAxOS0uNjA2LjA1NmE0Ljg3NSA0Ljg3NSAwIDAgMC0xLjA3OC4zMjYgMi4wODEgMi4wODEgMCAwIDAtLjM0My4xODh2Ljk4NGMuMjY2LS4yMy41NjYtLjQxMS45MDQtLjU0YTIuOTI3IDIuOTI3IDAgMCAxIDEuMDUyLS4xOTNjLjE4OCAwIC4zNTguMDI4LjUxMy4wODVhLjk4Ljk4IDAgMCAxIC4zOTYuMjY3Yy4xMDkuMTIxLjE5My4yNzkuMjUyLjQ3Mi4wNTkuMTkzLjA4OC40MjcuMDg4LjdsLTEuODExLjI1MmMtLjM0NC4wNDctLjY0LjEyNi0uODg4LjIzN2ExLjk0NyAxLjk0NyAwIDAgMC0uNjE1LjQxOSAxLjYgMS42IDAgMCAwLS4zNi41OCAyLjEzNCAyLjEzNCAwIDAgMC0uMTE3LjcyMWMwIC4yNDYuMDQyLjQ3NS4xMjQuNjg4LjA4Mi4yMTMuMjAzLjM5Ny4zNjMuNTUxLjE2LjE1NC4zNi4yNzYuNTk4LjM2Ni4yMzguMDkuNTEzLjEzNS44MjYuMTM1LjQwMiAwIC43Ni0uMDkyIDEuMDc1LS4yNzguMzE1LS4xODYuNTcyLS40NTQuNzcxLS44MDZoLjAyM3ptLTIuMTI4LTEuNzQzYy4xNzYtLjA2NC40MDEtLjExNC42NzQtLjE0OWwxLjQ2NS0uMjA1di42MDljMCAuMjQ2LS4wNDEuNDc1LS4xMjMuNjg4YTEuNzI3IDEuNzI3IDAgMCAxLS4zNDMuNTU3IDEuNTczIDEuNTczIDAgMCAxLS41MjQuMzcyIDEuNjMgMS42MyAwIDAgMS0uNjY4LjEzNWMtLjE4NyAwLS4zNTMtLjAyNS0uNDk1LS4wNzZhMS4wMyAxLjAzIDAgMCAxLS4zNTctLjIxMS44OTYuODk2IDAgMCAxLS4yMi0uMzE2QTEuMDA1IDEuMDA1IDAgMCAxIDExIDkuNzMyYTEuNiAxLjYgMCAwIDEgLjA1NS0uNDQuNzM5LjczOSAwIDAgMSAuMjAyLS4zMzQgMS4xNiAxLjE2IDAgMCAxIC40MS0uMjM3eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") 50% no-repeat}.vs .monaco-custom-checkbox.monaco-preserve-case{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguNTM0IDEyLjQ2N0g3LjQzNmwtLjg5Ny0yLjM3M2gtMy41OWwtLjg0NSAyLjM3M0gxTDQuMjQ4IDRoMS4wMjdsMy4yNiA4LjQ2N3ptLTIuMzItMy4yNjVMNC44ODUgNS41OTRhMy40NTQgMy40NTQgMCAwIDEtLjEzLS41NjdoLS4wMjNjLS4wNC4yNC0uMDg1LjQzLS4xMzYuNTY3TDMuMjc5IDkuMjAyaDIuOTM1ek05Ljc4NiAxMi40NjdWNGgyLjQxYy43MzIgMCAxLjMxMi4xOCAxLjc0MS41MzcuNDMuMzU5LjY0NC44MjUuNjQ0IDEuNCAwIC40OC0uMTMuODk3LS4zOSAxLjI1Mi0uMjYuMzU0LS42MTguNjA2LTEuMDc1Ljc1NXYuMDI0Yy41NzEuMDY3IDEuMDI4LjI4MyAxLjM3LjY1LjM0My4zNjIuNTE0LjgzNC41MTQgMS40MTcgMCAuNzI0LS4yNiAxLjMxLS43OCAxLjc2LS41MTkuNDQ4LTEuMTc0LjY3Mi0xLjk2Ni42NzJIOS43ODZ6bS45OTItNy41N3YyLjczNGgxLjAxNmMuNTQzIDAgLjk3LS4xMyAxLjI4MS0uMzkuMzExLS4yNjMuNDY2LS42MzMuNDY2LTEuMTEgMC0uODIyLS41NC0xLjIzMy0xLjYyMy0xLjIzM2gtMS4xNHptMCAzLjYyNnYzLjA0N2gxLjM0NmMuNTgzIDAgMS4wMzQtLjEzOCAxLjM1My0uNDE0LjMyMi0uMjc1LjQ4NC0uNjUzLjQ4NC0xLjEzMyAwLTEtLjY4MS0xLjUtMi4wNDMtMS41aC0xLjE0eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==") 50% no-repeat}.vs-dark .monaco-custom-checkbox.monaco-preserve-case{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguNTM0IDEyLjQ2N0g3LjQzNmwtLjg5Ny0yLjM3M2gtMy41OWwtLjg0NSAyLjM3M0gxTDQuMjQ4IDRoMS4wMjdsMy4yNiA4LjQ2N3ptLTIuMzItMy4yNjVMNC44ODUgNS41OTRhMy40NTQgMy40NTQgMCAwIDEtLjEzLS41NjdoLS4wMjNjLS4wNC4yNC0uMDg1LjQzLS4xMzYuNTY3TDMuMjc5IDkuMjAyaDIuOTM1ek05Ljc4NiAxMi40NjdWNGgyLjQxYy43MzIgMCAxLjMxMi4xOCAxLjc0MS41MzcuNDMuMzU5LjY0NC44MjUuNjQ0IDEuNCAwIC40OC0uMTMuODk3LS4zOSAxLjI1Mi0uMjYuMzU0LS42MTguNjA2LTEuMDc1Ljc1NXYuMDI0Yy41NzEuMDY3IDEuMDI4LjI4MyAxLjM3LjY1LjM0My4zNjIuNTE0LjgzNC41MTQgMS40MTcgMCAuNzI0LS4yNiAxLjMxLS43OCAxLjc2LS41MTkuNDQ4LTEuMTc0LjY3Mi0xLjk2Ni42NzJIOS43ODZ6bS45OTItNy41N3YyLjczNGgxLjAxNmMuNTQzIDAgLjk3LS4xMyAxLjI4MS0uMzkuMzExLS4yNjMuNDY2LS42MzMuNDY2LTEuMTEgMC0uODIyLS41NC0xLjIzMy0xLjYyMy0xLjIzM2gtMS4xNHptMCAzLjYyNnYzLjA0N2gxLjM0NmMuNTgzIDAgMS4wMzQtLjEzOCAxLjM1My0uNDE0LjMyMi0uMjc1LjQ4NC0uNjUzLjQ4NC0xLjEzMyAwLTEtLjY4MS0xLjUtMi4wNDMtMS41aC0xLjE0eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-preserve-case,.hc-black .monaco-custom-checkbox.monaco-preserve-case:hover{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTguNTM0IDEyLjQ2N0g3LjQzNmwtLjg5Ny0yLjM3M2gtMy41OWwtLjg0NSAyLjM3M0gxTDQuMjQ4IDRoMS4wMjdsMy4yNiA4LjQ2N3ptLTIuMzItMy4yNjVMNC44ODUgNS41OTRhMy40NTQgMy40NTQgMCAwIDEtLjEzLS41NjdoLS4wMjNjLS4wNC4yNC0uMDg1LjQzLS4xMzYuNTY3TDMuMjc5IDkuMjAyaDIuOTM1ek05Ljc4NiAxMi40NjdWNGgyLjQxYy43MzIgMCAxLjMxMi4xOCAxLjc0MS41MzcuNDMuMzU5LjY0NC44MjUuNjQ0IDEuNCAwIC40OC0uMTMuODk3LS4zOSAxLjI1Mi0uMjYuMzU0LS42MTguNjA2LTEuMDc1Ljc1NXYuMDI0Yy41NzEuMDY3IDEuMDI4LjI4MyAxLjM3LjY1LjM0My4zNjIuNTE0LjgzNC41MTQgMS40MTcgMCAuNzI0LS4yNiAxLjMxLS43OCAxLjc2LS41MTkuNDQ4LTEuMTc0LjY3Mi0xLjk2Ni42NzJIOS43ODZ6bS45OTItNy41N3YyLjczNGgxLjAxNmMuNTQzIDAgLjk3LS4xMyAxLjI4MS0uMzkuMzExLS4yNjMuNDY2LS42MzMuNDY2LTEuMTEgMC0uODIyLS41NC0xLjIzMy0xLjYyMy0xLjIzM2gtMS4xNHptMCAzLjYyNnYzLjA0N2gxLjM0NmMuNTgzIDAgMS4wMzQtLjEzOCAxLjM1My0uNDE0LjMyMi0uMjc1LjQ4NC0uNjUzLjQ4NC0xLjEzMyAwLTEtLjY4MS0xLjUtMi4wNDMtMS41aC0xLjE0eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") 50% no-repeat}.vs .monaco-custom-checkbox.monaco-whole-word{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDJoMTR2MUgxVjJ6bTEzIDJoLTF2OGgxVjR6bS0yLjcyOCA0LjM4N2EyLjM1MyAyLjM1MyAwIDAgMC0uMzYtLjc4NiAxLjc0NiAxLjc0NiAwIDAgMC0uNjA5LS41MyAxLjgzMiAxLjgzMiAwIDAgMC0uODY2LS4xOTNjLS4xOTggMC0uMzguMDI0LS41NDcuMDczYTEuNzYgMS43NiAwIDAgMC0uNDUzLjIwNSAxLjcyNCAxLjcyNCAwIDAgMC0uMzY1LjMxOGwtLjE3OS4yNThWNC41NzhIN1YxMmguODkzdi0uNTc1bC4xMjYuMTc1Yy4wODcuMTAyLjE4OS4xOS4zMDQuMjY5LjExNy4wNzguMjQ5LjE0LjM5OC4xODYuMTQ5LjA0Ni4zMTQuMDY4LjQ5OC4wNjguMzUzIDAgLjY2Ni0uMDcxLjkzNy0uMjEyLjI3Mi0uMTQzLjQ5OS0uMzM4LjY4Mi0uNTg2LjE4My0uMjUuMzIxLS41NDMuNDE0LS44NzkuMDkzLS4zMzguMTQtLjcwMy4xNC0xLjA5N2EzLjc1NiAzLjc1NiAwIDAgMC0uMTItLjk2MnpNOS43OTMgNy43OGMuMTUxLjA3MS4yODIuMTc2LjM5LjMxNC4xMDkuMTQuMTk0LjMxMy4yNTUuNTE3LjA1MS4xNzQuMDgyLjM3MS4wODkuNTg3bC0uMDA3LjEyNWMwIC4zMjctLjAzMy42Mi0uMS44NjlhMS44ODYgMS44ODYgMCAwIDEtLjI3OC42MTRjLS4xMTcuMTYyLS4yNi4yODUtLjQyMS4zNjYtLjMyMi4xNjItLjc2LjE2Ni0xLjA2OS4wMTVhMS4yNjQgMS4yNjQgMCAwIDEtLjM5My0uMjk2IDEuMjczIDEuMjczIDAgMCAxLS4yMTgtLjM2N3MtLjE3OS0uNDQ3LS4xNzktLjk0N2MwLS41LjE3OS0xLjAwMi4xNzktMS4wMDIuMDYyLS4xNzcuMTM2LS4zMTguMjI0LS40My4xMTQtLjE0My4yNTYtLjI1OS40MjQtLjM0NS4xNjgtLjA4Ni4zNjUtLjEyOS41ODctLjEyOS4xOSAwIC4zNjQuMDM3LjUxNy4xMDl6TTE1IDEzSDF2MWgxNHYtMXpNMi44MTMgMTBsLS43MjggMi4wMzFIMWwuMDI1LS4wNzIgMi40NDEtNy4wODZoLjk0MWwyLjQ4NSA3LjE1OEg1LjgxTDUuMDMyIDEwSDIuODEzem0xLjEyMS0zLjU3OGgtLjAyMmwtLjkwNSAyLjc1M2gxLjg0MWwtLjkxNC0yLjc1M3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=") 50% no-repeat}.vs-dark .monaco-custom-checkbox.monaco-whole-word{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDJoMTR2MUgxVjJ6bTEzIDJoLTF2OGgxVjR6bS0yLjcyOCA0LjM4N2EyLjM1MyAyLjM1MyAwIDAgMC0uMzYtLjc4NiAxLjc0NiAxLjc0NiAwIDAgMC0uNjA5LS41MyAxLjgzMiAxLjgzMiAwIDAgMC0uODY2LS4xOTNjLS4xOTggMC0uMzguMDI0LS41NDcuMDczYTEuNzYgMS43NiAwIDAgMC0uNDUzLjIwNSAxLjcyNCAxLjcyNCAwIDAgMC0uMzY1LjMxOGwtLjE3OS4yNThWNC41NzhIN1YxMmguODkzdi0uNTc1bC4xMjYuMTc1Yy4wODcuMTAyLjE4OS4xOS4zMDQuMjY5LjExNy4wNzguMjQ5LjE0LjM5OC4xODYuMTQ5LjA0Ni4zMTQuMDY4LjQ5OC4wNjguMzUzIDAgLjY2Ni0uMDcxLjkzNy0uMjEyLjI3Mi0uMTQzLjQ5OS0uMzM4LjY4Mi0uNTg2LjE4My0uMjUuMzIxLS41NDMuNDE0LS44NzkuMDkzLS4zMzguMTQtLjcwMy4xNC0xLjA5N2EzLjc1NiAzLjc1NiAwIDAgMC0uMTItLjk2MnpNOS43OTMgNy43OGMuMTUxLjA3MS4yODIuMTc2LjM5LjMxNC4xMDkuMTQuMTk0LjMxMy4yNTUuNTE3LjA1MS4xNzQuMDgyLjM3MS4wODkuNTg3bC0uMDA3LjEyNWMwIC4zMjctLjAzMy42Mi0uMS44NjlhMS44ODYgMS44ODYgMCAwIDEtLjI3OC42MTRjLS4xMTcuMTYyLS4yNi4yODUtLjQyMS4zNjYtLjMyMi4xNjItLjc2LjE2Ni0xLjA2OS4wMTVhMS4yNjQgMS4yNjQgMCAwIDEtLjM5My0uMjk2IDEuMjczIDEuMjczIDAgMCAxLS4yMTgtLjM2N3MtLjE3OS0uNDQ3LS4xNzktLjk0N2MwLS41LjE3OS0xLjAwMi4xNzktMS4wMDIuMDYyLS4xNzcuMTM2LS4zMTguMjI0LS40My4xMTQtLjE0My4yNTYtLjI1OS40MjQtLjM0NS4xNjgtLjA4Ni4zNjUtLjEyOS41ODctLjEyOS4xOSAwIC4zNjQuMDM3LjUxNy4xMDl6TTE1IDEzSDF2MWgxNHYtMXpNMi44MTMgMTBsLS43MjggMi4wMzFIMWwuMDI1LS4wNzIgMi40NDEtNy4wODZoLjk0MWwyLjQ4NSA3LjE1OEg1LjgxTDUuMDMyIDEwSDIuODEzem0xLjEyMS0zLjU3OGgtLjAyMmwtLjkwNSAyLjc1M2gxLjg0MWwtLjkxNC0yLjc1M3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-whole-word,.hc-black .monaco-custom-checkbox.monaco-whole-word:hover{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDJoMTR2MUgxVjJ6bTEzIDJoLTF2OGgxVjR6bS0yLjcyOCA0LjM4N2EyLjM1MyAyLjM1MyAwIDAgMC0uMzYtLjc4NiAxLjc0NiAxLjc0NiAwIDAgMC0uNjA5LS41MyAxLjgzMiAxLjgzMiAwIDAgMC0uODY2LS4xOTNjLS4xOTggMC0uMzguMDI0LS41NDcuMDczYTEuNzYgMS43NiAwIDAgMC0uNDUzLjIwNSAxLjcyNCAxLjcyNCAwIDAgMC0uMzY1LjMxOGwtLjE3OS4yNThWNC41NzhIN1YxMmguODkzdi0uNTc1bC4xMjYuMTc1Yy4wODcuMTAyLjE4OS4xOS4zMDQuMjY5LjExNy4wNzguMjQ5LjE0LjM5OC4xODYuMTQ5LjA0Ni4zMTQuMDY4LjQ5OC4wNjguMzUzIDAgLjY2Ni0uMDcxLjkzNy0uMjEyLjI3Mi0uMTQzLjQ5OS0uMzM4LjY4Mi0uNTg2LjE4My0uMjUuMzIxLS41NDMuNDE0LS44NzkuMDkzLS4zMzguMTQtLjcwMy4xNC0xLjA5N2EzLjc1NiAzLjc1NiAwIDAgMC0uMTItLjk2MnpNOS43OTMgNy43OGMuMTUxLjA3MS4yODIuMTc2LjM5LjMxNC4xMDkuMTQuMTk0LjMxMy4yNTUuNTE3LjA1MS4xNzQuMDgyLjM3MS4wODkuNTg3bC0uMDA3LjEyNWMwIC4zMjctLjAzMy42Mi0uMS44NjlhMS44ODYgMS44ODYgMCAwIDEtLjI3OC42MTRjLS4xMTcuMTYyLS4yNi4yODUtLjQyMS4zNjYtLjMyMi4xNjItLjc2LjE2Ni0xLjA2OS4wMTVhMS4yNjQgMS4yNjQgMCAwIDEtLjM5My0uMjk2IDEuMjczIDEuMjczIDAgMCAxLS4yMTgtLjM2N3MtLjE3OS0uNDQ3LS4xNzktLjk0N2MwLS41LjE3OS0xLjAwMi4xNzktMS4wMDIuMDYyLS4xNzcuMTM2LS4zMTguMjI0LS40My4xMTQtLjE0My4yNTYtLjI1OS40MjQtLjM0NS4xNjgtLjA4Ni4zNjUtLjEyOS41ODctLjEyOS4xOSAwIC4zNjQuMDM3LjUxNy4xMDl6TTE1IDEzSDF2MWgxNHYtMXpNMi44MTMgMTBsLS43MjggMi4wMzFIMWwuMDI1LS4wNzIgMi40NDEtNy4wODZoLjk0MWwyLjQ4NSA3LjE1OEg1LjgxTDUuMDMyIDEwSDIuODEzem0xLjEyMS0zLjU3OGgtLjAyMmwtLjkwNSAyLjc1M2gxLjg0MWwtLjkxNC0yLjc1M3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=") 50% no-repeat}.vs .monaco-custom-checkbox.monaco-regex{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wMTIgMmguOTc2djMuMTEzbDIuNTYtMS41NTcuNDg2Ljg4NUwxMS40NyA2bDIuNTY0IDEuNTU5LS40ODUuODg1LTIuNTYxLTEuNTU3VjEwaC0uOTc2VjYuODg3bC0yLjU2IDEuNTU3LS40ODYtLjg4NUw5LjUzIDYgNi45NjYgNC40NDFsLjQ4NS0uODg1IDIuNTYxIDEuNTU3VjJ6TTIgMTBoNHY0SDJ2LTR6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+") 50% no-repeat}.vs-dark .monaco-custom-checkbox.monaco-regex{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wMTIgMmguOTc2djMuMTEzbDIuNTYtMS41NTcuNDg2Ljg4NUwxMS40NyA2bDIuNTY0IDEuNTU5LS40ODUuODg1LTIuNTYxLTEuNTU3VjEwaC0uOTc2VjYuODg3bC0yLjU2IDEuNTU3LS40ODYtLjg4NUw5LjUzIDYgNi45NjYgNC40NDFsLjQ4NS0uODg1IDIuNTYxIDEuNTU3VjJ6TTIgMTBoNHY0SDJ2LTR6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+") 50% no-repeat}.hc-black .monaco-custom-checkbox.monaco-regex,.hc-black .monaco-custom-checkbox.monaco-regex:hover{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wMTIgMmguOTc2djMuMTEzbDIuNTYtMS41NTcuNDg2Ljg4NUwxMS40NyA2bDIuNTY0IDEuNTU5LS40ODUuODg1LTIuNTYxLTEuNTU3VjEwaC0uOTc2VjYuODg3bC0yLjU2IDEuNTU3LS40ODYtLjg4NUw5LjUzIDYgNi45NjYgNC40NDFsLjQ4NS0uODg1IDIuNTYxIDEuNTU3VjJ6TTIgMTBoNHY0SDJ2LTR6IiBmaWxsPSIjZmZmIi8+PC9zdmc+") 50% no-repeat}.monaco-checkbox .label{width:12px;height:12px;border:1px solid #000;background-color:transparent;display:inline-block}.monaco-checkbox .checkbox{position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0}.monaco-checkbox .checkbox:checked+.label{background-color:#000}.monaco-editor .find-widget{position:absolute;z-index:10;top:-44px;height:33px;overflow:hidden;line-height:19px;-webkit-transition:top .2s linear;transition:top .2s linear;padding:0 4px;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled{top:-74px}.monaco-editor .find-widget.replaceToggled>.replace-part{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex}.monaco-editor .find-widget.replaceToggled.visible,.monaco-editor .find-widget.visible{top:0}.monaco-editor .find-widget.multipleline{top:unset;bottom:10px}.monaco-editor .find-widget.multipleline.replaceToggled.visible,.monaco-editor .find-widget.multipleline.visible{top:0;bottom:unset}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:4px 0 0 17px;font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.wrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.wrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.wrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.wrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.wrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button,.monaco-editor .find-widget .matchesCount{display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;-webkit-box-flex:initial;-ms-flex:initial;flex:initial}.monaco-editor .find-widget .button{min-width:20px;width:20px;height:20px;margin-left:3px;background-position:50%;background-repeat:no-repeat;cursor:pointer}.monaco-editor .find-widget .button:not(.disabled):hover{background-color:rgba(0,0,0,.1)}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:0;width:18px;height:100%;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .previous{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44NTQgNi4yOTNsLTUtNWgtLjcwOGwtNSA1TDMuODU0IDcgOCAyLjg1NFYxNS4wNmgxVjIuODU0TDEzLjE0NiA3bC43MDctLjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .find-widget .next{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjE0NiA5Ljc2OGw1IDVoLjcwOGw1LTUtLjcwOC0uNzA3TDkgMTMuMjA3VjFIOHYxMi4yMDdMMy44NTQgOS4wNjFsLS43MDguNzA3eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .disabled{opacity:.3;cursor:default}.monaco-editor .find-widget .monaco-checkbox{width:20px;height:20px;display:inline-block;vertical-align:middle;margin-left:3px}.monaco-editor .find-widget .monaco-checkbox .label{content:"";display:inline-block;background-repeat:no-repeat;background-position:50%;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMTJ2LTFoOXYxSDF6bTAtNWgxNHYxSDFWN3ptMTEtNHYxSDFWM2gxMXoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");width:20px;height:20px;border:none}.monaco-editor .find-widget .monaco-checkbox .checkbox:disabled+.label{opacity:.3;cursor:default}.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled)+.label{cursor:pointer}.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before+.label{background-color:#ddd}.monaco-editor .find-widget .monaco-checkbox .checkbox:checked+.label{background-color:hsla(0,0%,39.2%,.2)}.monaco-editor .find-widget .close-fw{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ3LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwOC0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDhMOCA4LjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .find-widget .expand{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .find-widget .collapse{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYyTDExIDguMzA4di0uNjE4TDYuMzMzIDMuMDI0bC0uNjE4LjYxOUwxMC4wNzIgOHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .find-widget .replace{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjIyMSAzLjczOWwyLjI2MSAyLjI2OUw3LjcgMy43ODRsLS43LS43LTEuMDEyIDEuMDA3LS4wMDgtMS42YS41MjMuNTIzIDAgMCAxIC41LS41MjZIOFYxSDYuNDhBMS40ODIgMS40ODIgMCAwIDAgNSAyLjQ4OVY0LjFMMy45MjcgMy4wMzNsLS43MDYuNzA2em02LjY3IDEuNzk0aC4wMWMuMTgzLjMxMS40NTEuNDY3LjgwNi40NjcuMzkzIDAgLjcwNi0uMTY4Ljk0LS41MDMuMjM2LS4zMzUuMzUzLS43OC4zNTMtMS4zMzMgMC0uNTExLS4xLS45MTMtLjMwMS0xLjIwNy0uMjAxLS4yOTUtLjQ4OC0uNDQyLS44Ni0uNDQyLS40MDUgMC0uNzE4LjE5NC0uOTM4LjU4MWgtLjAxVjFIOXY0LjkxOWguODl2LS4zODZ6bS0uMDE1LTEuMDYxdi0uMzRjMC0uMjQ4LjA1OC0uNDQ4LjE3NS0uNjAxYS41NC41NCAwIDAgMSAuNDQ1LS4yMy40OS40OSAwIDAgMSAuNDM2LjIzM2MuMTA0LjE1NC4xNTUuMzY4LjE1NS42NDMgMCAuMzMtLjA1Ni41ODctLjE2OS43NjhhLjUyNC41MjQgMCAwIDEtLjQ3LjI3LjQ5NS40OTUgMCAwIDEtLjQxMS0uMjExLjg1My44NTMgMCAwIDEtLjE2LS41MzJ6TTkgMTIuNzY5Yy0uMjU2LjE1NC0uNjI1LjIzMS0xLjEwOC4yMzEtLjU2MyAwLTEuMDItLjE3OC0xLjM2OS0uNTMzLS4zNDktLjM1NS0uNTIzLS44MTMtLjUyMy0xLjM3NCAwLS42NDguMTg2LTEuMTU4LjU2LTEuNTMuMzc0LS4zNzYuODc1LS41NjMgMS41LS41NjMuNDMzIDAgLjc0Ni4wNi45NC4xNzl2Ljk5OGExLjI2IDEuMjYgMCAwIDAtLjc5Mi0uMjc2Yy0uMzI1IDAtLjU4My4xLS43NzQuMjk4LS4xOS4xOTYtLjI4My40NjgtLjI4My44MTYgMCAuMzM4LjA5LjYwMy4yNzIuNzk3LjE4Mi4xOTEuNDMxLjI4Ny43NDkuMjg3LjI4MiAwIC41NTgtLjA5Mi44MjgtLjI3NnYuOTQ2ek00IDdMMyA4djZsMSAxaDdsMS0xVjhsLTEtMUg0em0wIDFoN3Y2SDRWOHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .find-widget .replace-all{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS42IDIuNjc3Yy4xNDctLjMxLjM1Ni0uNDY1LjYyNi0uNDY1LjI0OCAwIC40NC4xMTguNTczLjM1My4xMzQuMjM2LjIwMS41NTcuMjAxLjk2NiAwIC40NDMtLjA3OC43OTgtLjIzNSAxLjA2Ny0uMTU2LjI2OC0uMzY1LjQwMi0uNjI3LjQwMi0uMjM3IDAtLjQxNi0uMTI1LS41MzctLjM3NGgtLjAwOHYuMzFIMTFWMWguNTkzdjEuNjc3aC4wMDh6bS0uMDE2IDEuMWEuNzguNzggMCAwIDAgLjEwNy40MjZjLjA3MS4xMTMuMTYzLjE2OS4yNzQuMTY5LjEzNiAwIC4yNC0uMDcyLjMxNC0uMjE2LjA3NS0uMTQ1LjExMy0uMzUuMTEzLS42MTUgMC0uMjItLjAzNS0uMzktLjEwNC0uNTE0LS4wNjctLjEyNC0uMTY0LS4xODctLjI5LS4xODctLjEyIDAtLjIxOS4wNjItLjI5Ny4xODVhLjg4Ni44ODYgMCAwIDAtLjExNy40OHYuMjcyek00LjEyIDcuNjk1TDIgNS41NjhsLjY2Mi0uNjYyIDEuMDA2IDF2LTEuNTFBMS4zOSAxLjM5IDAgMCAxIDUuMDU1IDNINy40di45MDVINS4wNTVhLjQ5LjQ5IDAgMCAwLS40NjguNDkzbC4wMDcgMS41Ljk0OS0uOTQ0LjY1Ni42NTYtMi4wOCAyLjA4NXpNOS4zNTYgNC45M0gxMFYzLjIyQzEwIDIuNDA4IDkuNjg1IDIgOS4wNTYgMmMtLjEzNSAwLS4yODUuMDI0LS40NS4wNzNhMS40NDQgMS40NDQgMCAwIDAtLjM4OC4xNjd2LjY2NWMuMjM3LS4yMDMuNDg3LS4zMDQuNzUtLjMwNC4yNjEgMCAuMzkyLjE1Ni4zOTIuNDY5bC0uNi4xMDNjLS41MDYuMDg2LS43Ni40MDYtLjc2Ljk2MSAwIC4yNjMuMDYxLjQ3My4xODMuNjMxQS42MS42MSAwIDAgMCA4LjY5IDVjLjI5IDAgLjUwOS0uMTYuNjU3LS40OGguMDA5di40MXptLjAwNC0xLjM1NXYuMTkzYzAgLjE3NS0uMDQuMzItLjEyLjQzNmEuMzY4LjM2OCAwIDAgMS0uMzEzLjE3LjI3Ni4yNzYgMCAwIDEtLjIyLS4wOTUuMzguMzggMCAwIDEtLjA4LS4yNDhjMC0uMjIyLjExLS4zNTEuMzMyLS4zODlsLjQtLjA2N3pNNyAxMi45M2gtLjY0NHYtLjQxaC0uMDA5Yy0uMTQ4LjMyLS4zNjcuNDgtLjY1Ny40OGEuNjEuNjEgMCAwIDEtLjUwNy0uMjM1Yy0uMTIyLS4xNTgtLjE4My0uMzY4LS4xODMtLjYzIDAtLjU1Ni4yNTQtLjg3Ni43Ni0uOTYybC42LS4xMDNjMC0uMzEzLS4xMy0uNDctLjM5Mi0uNDctLjI2MyAwLS41MTMuMTAyLS43NS4zMDV2LS42NjVjLjA5NS0uMDYzLjIyNC0uMTE5LjM4OC0uMTY3LjE2NS0uMDQ5LjMxNS0uMDczLjQ1LS4wNzMuNjMgMCAuOTQ0LjQwNy45NDQgMS4yMnYxLjcxem0tLjY0LTEuMTYydi0uMTkzbC0uNC4wNjhjLS4yMjIuMDM3LS4zMzMuMTY2LS4zMzMuMzg4IDAgLjEuMDI3LjE4My4wOC4yNDhhLjI3Ni4yNzYgMCAwIDAgLjIyLjA5NS4zNjguMzY4IDAgMCAwIC4zMTItLjE3Yy4wOC0uMTE2LjEyLS4yNi4xMi0uNDM2ek05LjI2MiAxM2MuMzIxIDAgLjU2OC0uMDU4LjczOC0uMTczdi0uNzFhLjkuOSAwIDAgMS0uNTUyLjIwNy42MTkuNjE5IDAgMCAxLS41LS4yMTVjLS4xMi0uMTQ1LS4xODEtLjM0NS0uMTgxLS41OTggMC0uMjYuMDYzLS40NjQuMTg5LS42MTJhLjY0NC42NDQgMCAwIDEgLjUxNi0uMjIzYy4xOTQgMCAuMzcuMDY5LjUyOC4yMDd2LS43NDljLS4xMjktLjA5LS4zMzgtLjEzNC0uNjI2LS4xMzQtLjQxNyAwLS43NTEuMTQtMS4wMDEuNDIyLS4yNDkuMjgtLjM3My42NjItLjM3MyAxLjE0OCAwIC40Mi4xMTYuNzY0LjM0OSAxLjAzLjIzMi4yNjcuNTM3LjQuOTEzLjR6TTIgOWwxLTFoOWwxIDF2NWwtMSAxSDNsLTEtMVY5em0xIDB2NWg5VjlIM3ptMy0ybDEtMWg3bDEgMXY1bC0xIDFWN0g2eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;display:-webkit-flex;vertical-align:middle;-webkit-box-flex:1;-ms-flex:auto;flex:auto;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount,.monaco-editor .find-widget.reduced-find-widget .monaco-checkbox{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .findMatch{-webkit-animation-duration:0;-webkit-animation-name:inherit!important;-moz-animation-duration:0;-moz-animation-name:inherit!important;-ms-animation-duration:0;-ms-animation-name:inherit!important;animation-duration:0;animation-name:inherit!important}.monaco-editor .find-widget .monaco-sash{width:2px!important;margin-left:-4px}.monaco-editor.hc-black .find-widget .previous,.monaco-editor.vs-dark .find-widget .previous{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44NTQgNi4yOTNsLTUtNWgtLjcwOGwtNSA1TDMuODU0IDcgOCAyLjg1NFYxNS4wNmgxVjIuODU0TDEzLjE0NiA3bC43MDctLjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .find-widget .next,.monaco-editor.vs-dark .find-widget .next{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjE0NiA5Ljc2OGw1IDVoLjcwOGw1LTUtLjcwOC0uNzA3TDkgMTMuMjA3VjFIOHYxMi4yMDdMMy44NTQgOS4wNjFsLS43MDguNzA3eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .monaco-checkbox .label,.monaco-editor.vs-dark .find-widget .monaco-checkbox .label{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMTJ2LTFoOXYxSDF6bTAtNWgxNHYxSDFWN3ptMTEtNHYxSDFWM2gxMXoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.vs-dark .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before+.label{background-color:hsla(0,0%,100%,.1)}.monaco-editor.hc-black .find-widget .close-fw,.monaco-editor.vs-dark .find-widget .close-fw{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ3LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwOC0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDhMOCA4LjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .find-widget .replace,.monaco-editor.vs-dark .find-widget .replace{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjIyMSAzLjczOWwyLjI2MSAyLjI2OUw3LjcgMy43ODRsLS43LS43LTEuMDEyIDEuMDA3LS4wMDgtMS42YS41MjMuNTIzIDAgMCAxIC41LS41MjZIOFYxSDYuNDhBMS40ODIgMS40ODIgMCAwIDAgNSAyLjQ4OVY0LjFMMy45MjcgMy4wMzNsLS43MDYuNzA2em02LjY3IDEuNzk0aC4wMWMuMTgzLjMxMS40NTEuNDY3LjgwNi40NjcuMzkzIDAgLjcwNi0uMTY4Ljk0LS41MDMuMjM2LS4zMzUuMzUzLS43OC4zNTMtMS4zMzMgMC0uNTExLS4xLS45MTMtLjMwMS0xLjIwNy0uMjAxLS4yOTUtLjQ4OC0uNDQyLS44Ni0uNDQyLS40MDUgMC0uNzE4LjE5NC0uOTM4LjU4MWgtLjAxVjFIOXY0LjkxOWguODl2LS4zODZ6bS0uMDE1LTEuMDYxdi0uMzRjMC0uMjQ4LjA1OC0uNDQ4LjE3NS0uNjAxYS41NC41NCAwIDAgMSAuNDQ1LS4yMy40OS40OSAwIDAgMSAuNDM2LjIzM2MuMTA0LjE1NC4xNTUuMzY4LjE1NS42NDMgMCAuMzMtLjA1Ni41ODctLjE2OS43NjhhLjUyNC41MjQgMCAwIDEtLjQ3LjI3LjQ5NS40OTUgMCAwIDEtLjQxMS0uMjExLjg1My44NTMgMCAwIDEtLjE2LS41MzJ6TTkgMTIuNzY5Yy0uMjU2LjE1NC0uNjI1LjIzMS0xLjEwOC4yMzEtLjU2MyAwLTEuMDItLjE3OC0xLjM2OS0uNTMzLS4zNDktLjM1NS0uNTIzLS44MTMtLjUyMy0xLjM3NCAwLS42NDguMTg2LTEuMTU4LjU2LTEuNTMuMzc0LS4zNzYuODc1LS41NjMgMS41LS41NjMuNDMzIDAgLjc0Ni4wNi45NC4xNzl2Ljk5OGExLjI2IDEuMjYgMCAwIDAtLjc5Mi0uMjc2Yy0uMzI1IDAtLjU4My4xLS43NzQuMjk4LS4xOS4xOTYtLjI4My40NjgtLjI4My44MTYgMCAuMzM4LjA5LjYwMy4yNzIuNzk3LjE4Mi4xOTEuNDMxLjI4Ny43NDkuMjg3LjI4MiAwIC41NTgtLjA5Mi44MjgtLjI3NnYuOTQ2ek00IDdMMyA4djZsMSAxaDdsMS0xVjhsLTEtMUg0em0wIDFoN3Y2SDRWOHoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .find-widget .replace-all,.monaco-editor.vs-dark .find-widget .replace-all{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS42IDIuNjc3Yy4xNDctLjMxLjM1Ni0uNDY1LjYyNi0uNDY1LjI0OCAwIC40NC4xMTguNTczLjM1My4xMzQuMjM2LjIwMS41NTcuMjAxLjk2NiAwIC40NDMtLjA3OC43OTgtLjIzNSAxLjA2Ny0uMTU2LjI2OC0uMzY1LjQwMi0uNjI3LjQwMi0uMjM3IDAtLjQxNi0uMTI1LS41MzctLjM3NGgtLjAwOHYuMzFIMTFWMWguNTkzdjEuNjc3aC4wMDh6bS0uMDE2IDEuMWEuNzguNzggMCAwIDAgLjEwNy40MjZjLjA3MS4xMTMuMTYzLjE2OS4yNzQuMTY5LjEzNiAwIC4yNC0uMDcyLjMxNC0uMjE2LjA3NS0uMTQ1LjExMy0uMzUuMTEzLS42MTUgMC0uMjItLjAzNS0uMzktLjEwNC0uNTE0LS4wNjctLjEyNC0uMTY0LS4xODctLjI5LS4xODctLjEyIDAtLjIxOS4wNjItLjI5Ny4xODVhLjg4Ni44ODYgMCAwIDAtLjExNy40OHYuMjcyek00LjEyIDcuNjk1TDIgNS41NjhsLjY2Mi0uNjYyIDEuMDA2IDF2LTEuNTFBMS4zOSAxLjM5IDAgMCAxIDUuMDU1IDNINy40di45MDVINS4wNTVhLjQ5LjQ5IDAgMCAwLS40NjguNDkzbC4wMDcgMS41Ljk0OS0uOTQ0LjY1Ni42NTYtMi4wOCAyLjA4NXpNOS4zNTYgNC45M0gxMFYzLjIyQzEwIDIuNDA4IDkuNjg1IDIgOS4wNTYgMmMtLjEzNSAwLS4yODUuMDI0LS40NS4wNzNhMS40NDQgMS40NDQgMCAwIDAtLjM4OC4xNjd2LjY2NWMuMjM3LS4yMDMuNDg3LS4zMDQuNzUtLjMwNC4yNjEgMCAuMzkyLjE1Ni4zOTIuNDY5bC0uNi4xMDNjLS41MDYuMDg2LS43Ni40MDYtLjc2Ljk2MSAwIC4yNjMuMDYxLjQ3My4xODMuNjMxQS42MS42MSAwIDAgMCA4LjY5IDVjLjI5IDAgLjUwOS0uMTYuNjU3LS40OGguMDA5di40MXptLjAwNC0xLjM1NXYuMTkzYzAgLjE3NS0uMDQuMzItLjEyLjQzNmEuMzY4LjM2OCAwIDAgMS0uMzEzLjE3LjI3Ni4yNzYgMCAwIDEtLjIyLS4wOTUuMzguMzggMCAwIDEtLjA4LS4yNDhjMC0uMjIyLjExLS4zNTEuMzMyLS4zODlsLjQtLjA2N3pNNyAxMi45M2gtLjY0NHYtLjQxaC0uMDA5Yy0uMTQ4LjMyLS4zNjcuNDgtLjY1Ny40OGEuNjEuNjEgMCAwIDEtLjUwNy0uMjM1Yy0uMTIyLS4xNTgtLjE4My0uMzY4LS4xODMtLjYzIDAtLjU1Ni4yNTQtLjg3Ni43Ni0uOTYybC42LS4xMDNjMC0uMzEzLS4xMy0uNDctLjM5Mi0uNDctLjI2MyAwLS41MTMuMTAyLS43NS4zMDV2LS42NjVjLjA5NS0uMDYzLjIyNC0uMTE5LjM4OC0uMTY3LjE2NS0uMDQ5LjMxNS0uMDczLjQ1LS4wNzMuNjMgMCAuOTQ0LjQwNy45NDQgMS4yMnYxLjcxem0tLjY0LTEuMTYydi0uMTkzbC0uNC4wNjhjLS4yMjIuMDM3LS4zMzMuMTY2LS4zMzMuMzg4IDAgLjEuMDI3LjE4My4wOC4yNDhhLjI3Ni4yNzYgMCAwIDAgLjIyLjA5NS4zNjguMzY4IDAgMCAwIC4zMTItLjE3Yy4wOC0uMTE2LjEyLS4yNi4xMi0uNDM2ek05LjI2MiAxM2MuMzIxIDAgLjU2OC0uMDU4LjczOC0uMTczdi0uNzFhLjkuOSAwIDAgMS0uNTUyLjIwNy42MTkuNjE5IDAgMCAxLS41LS4yMTVjLS4xMi0uMTQ1LS4xODEtLjM0NS0uMTgxLS41OTggMC0uMjYuMDYzLS40NjQuMTg5LS42MTJhLjY0NC42NDQgMCAwIDEgLjUxNi0uMjIzYy4xOTQgMCAuMzcuMDY5LjUyOC4yMDd2LS43NDljLS4xMjktLjA5LS4zMzgtLjEzNC0uNjI2LS4xMzQtLjQxNyAwLS43NTEuMTQtMS4wMDEuNDIyLS4yNDkuMjgtLjM3My42NjItLjM3MyAxLjE0OCAwIC40Mi4xMTYuNzY0LjM0OSAxLjAzLjIzMi4yNjcuNTM3LjQuOTEzLjR6TTIgOWwxLTFoOWwxIDF2NWwtMSAxSDNsLTEtMVY5em0xIDB2NWg5VjlIM3ptMy0ybDEtMWg3bDEgMXY1bC0xIDFWN0g2eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .expand,.monaco-editor.vs-dark .find-widget .expand{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .find-widget .collapse,.monaco-editor.vs-dark .find-widget .collapse{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYyTDExIDguMzA4di0uNjE4TDYuMzMzIDMuMDI0bC0uNjE4LjYxOUwxMC4wNzIgOHoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .find-widget .button:not(.disabled):hover,.monaco-editor.vs-dark .find-widget .button:not(.disabled):hover{background-color:hsla(0,0%,100%,.1)}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor.hc-black .find-widget .monaco-checkbox .checkbox:checked+.label{background-color:hsla(0,0%,100%,.1)}.monaco-sash{position:absolute;z-index:35;-ms-touch-action:none;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.vertical{cursor:ew-resize;top:0;width:4px;height:100%}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:4px}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash:not(.disabled).orthogonal-end:after,.monaco-sash:not(.disabled).orthogonal-start:before{content:" ";height:8px;width:8px;z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.orthogonal-start.vertical:before{left:-2px;top:-4px}.monaco-sash.orthogonal-end.vertical:after{left:-2px;bottom:-4px}.monaco-sash.orthogonal-start.horizontal:before{top:-2px;left:-4px}.monaco-sash.orthogonal-end.horizontal:after{top:-2px;right:-4px}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.touch.vertical{width:20px}.monaco-sash.touch.horizontal{height:20px}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled).orthogonal-end:after,.monaco-sash.debug:not(.disabled).orthogonal-start:before{background:red}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls{-webkit-animation:monaco-findInput-highlight-0 .1s linear 0s;animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls{-webkit-animation:monaco-findInput-highlight-1 .1s linear 0s;animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{-webkit-animation:monaco-findInput-highlight-dark-0 .1s linear 0s;animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{-webkit-animation:monaco-findInput-highlight-dark-1 .1s linear 0s;animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@-webkit-keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@-webkit-keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@-webkit-keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:hsla(0,0%,100%,.44)}to{background:transparent}}@-webkit-keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:hsla(0,0%,100%,.44)}99%{background:transparent}}.monaco-inputbox{position:relative;display:block;padding:0;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;line-height:auto!important;font-size:inherit}.monaco-inputbox.idle{border:1px solid transparent}.monaco-inputbox>.wrapper>.input,.monaco-inputbox>.wrapper>.mirror{padding:4px}.monaco-inputbox>.wrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.wrapper>.input{display:inline-block;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.wrapper>input{text-overflow:ellipsis}.monaco-inputbox>.wrapper>textarea.input{display:block;-ms-overflow-style:none;overflow:-moz-scrollbars-none;scrollbar-width:none;outline:none}.monaco-inputbox>.wrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.wrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;min-height:34px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .icon{background-repeat:no-repeat;width:16px;height:16px}.monaco-scrollable-element>.scrollbar>.up-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkuNDggOC45NjFsMS4yNi0xLjI2LTUuMDQtNS4wNC01LjQ2IDUuMDQgMS4yNiAxLjI2IDQuMi0zLjc4IDMuNzggMy43OHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");cursor:pointer}.monaco-scrollable-element>.scrollbar>.down-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTEuNSAyLjY2MkwuMjQgMy45MjJsNS4wNCA1LjA0IDUuNDYtNS4wNC0xLjI2LTEuMjYtNC4yIDMuNzgtMy43OC0zLjc4eiIvPjwvc3ZnPg==");cursor:pointer}.monaco-scrollable-element>.scrollbar>.left-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTguNjQgMS40NDFMNy4zOC4xODFsLTUuMDQgNS4wNCA1LjA0IDUuNDYgMS4yNi0xLjI2LTMuNzgtNC4yIDMuNzgtMy43OHoiLz48L3N2Zz4=");cursor:pointer}.monaco-scrollable-element>.scrollbar>.right-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTIuNDY3IDkuNTQ4bDEuMjYgMS4yNiA1LjA0LTUuMDQtNS4wNC01LjQ2LTEuMjYgMS4yNiAzLjc4IDQuMi0zLjc4IDMuNzh6Ii8+PC9zdmc+");cursor:pointer}.hc-black .monaco-scrollable-element>.scrollbar>.up-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.up-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkuNDggOC45NjFsMS4yNi0xLjI2LTUuMDQtNS4wNC01LjQ2IDUuMDQgMS4yNiAxLjI2IDQuMi0zLjc4IDMuNzggMy43OHoiIGZpbGw9IiNFOEU4RTgiLz48L3N2Zz4=")}.hc-black .monaco-scrollable-element>.scrollbar>.down-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.down-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTEuNSAyLjY2MkwuMjQgMy45MjJsNS4wNCA1LjA0IDUuNDYtNS4wNC0xLjI2LTEuMjYtNC4yIDMuNzgtMy43OC0zLjc4eiIvPjwvc3ZnPg==")}.hc-black .monaco-scrollable-element>.scrollbar>.left-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.left-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTguNjQgMS40NDFMNy4zOC4xODFsLTUuMDQgNS4wNCA1LjA0IDUuNDYgMS4yNi0xLjI2LTMuNzgtNC4yIDMuNzgtMy43OHoiLz48L3N2Zz4=")}.hc-black .monaco-scrollable-element>.scrollbar>.right-arrow,.vs-dark .monaco-scrollable-element>.scrollbar>.right-arrow{background:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTIuNDY3IDkuNTQ4bDEuMjYgMS4yNiA1LjA0LTUuMDQtNS4wNC01LjQ2LTEuMjYgMS4yNiAzLjc4IDQuMi0zLjc4IDMuNzh6Ii8+PC9zdmc+")}.monaco-scrollable-element>.visible{opacity:1;background:transparent;-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{-webkit-transition:opacity .8s linear;transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;-webkit-box-shadow:#ddd 0 6px 6px -6px inset;box-shadow:inset 0 6px 6px -6px #ddd}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;-webkit-box-shadow:#ddd 6px 0 6px -6px inset;box-shadow:inset 6px 0 6px -6px #ddd}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{-webkit-box-shadow:#ddd 6px 6px 6px -6px inset;box-shadow:inset 6px 6px 6px -6px #ddd}.vs .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,39.2%,.4)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,47.5%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider{background:rgba(111,195,223,.6)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:hsla(0,0%,39.2%,.7)}.hc-black .monaco-scrollable-element>.scrollbar>.slider:hover{background:rgba(111,195,223,.8)}.monaco-scrollable-element>.scrollbar>.slider.active{background:rgba(0,0,0,.6)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active{background:hsla(0,0%,74.9%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider.active{background:#6fc3df}.vs-dark .monaco-scrollable-element .shadow.top{-webkit-box-shadow:none;box-shadow:none}.vs-dark .monaco-scrollable-element .shadow.left{-webkit-box-shadow:#000 6px 0 6px -6px inset;box-shadow:inset 6px 0 6px -6px #000}.vs-dark .monaco-scrollable-element .shadow.top.left{-webkit-box-shadow:#000 6px 6px 6px -6px inset;box-shadow:inset 6px 6px 6px -6px #000}.hc-black .monaco-scrollable-element .shadow.left,.hc-black .monaco-scrollable-element .shadow.top,.hc-black .monaco-scrollable-element .shadow.top.left{-webkit-box-shadow:none;box-shadow:none}.monaco-editor .margin-view-overlays .folding{cursor:pointer;background-repeat:no-repeat;background-origin:border-box;background-position:calc(50% + 2px) 50%;background-size:auto calc(100% - 3px);opacity:0;-webkit-transition:opacity .5s;transition:opacity .5s;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .margin-view-overlays .folding,.monaco-editor.vs-dark .margin-view-overlays .folding{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .margin-view-overlays .folding{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==")}.monaco-editor .margin-view-overlays .folding.alwaysShowFoldIcons,.monaco-editor .margin-view-overlays:hover .folding{opacity:1}.monaco-editor .margin-view-overlays .folding.collapsed{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+");opacity:1}.monaco-editor.vs-dark .margin-view-overlays .folding.collapsed{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .margin-view-overlays .folding.collapsed{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjZmZmIi8+PC9zdmc+")}.monaco-editor .inline-folded:after{color:grey;margin:.1em .2em 0 .2em;content:"\22EF";display:inline;line-height:1em;cursor:pointer}.monaco-editor .peekview-widget .head{-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex}.monaco-editor .peekview-widget .head .peekview-title{display:inline-block;font-size:13px;margin-left:20px;cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-actions{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar .action-item{margin-left:4px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar .action-label{width:16px;height:100%;margin:0;line-height:inherit;background-repeat:no-repeat;background-position:50%}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar .action-label.octicon{margin:0}.monaco-editor .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ2LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDdMOCA4LjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor.hc-black .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action,.monaco-editor.vs-dark .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ2LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDdMOCA4LjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor .peekview-widget .peekview-actions .icon.chevron-up{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44NTQgNi4yOTNsLTUtNWgtLjcwOGwtNSA1TDMuODU0IDcgOCAyLjg1NFYxNS4wNmgxVjIuODU0TDEzLjE0NiA3bC43MDctLjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=") 50% no-repeat}.hc-black .monaco-editor .peekview-widget .peekview-actions .icon.chevron-up,.vs-dark .monaco-editor .peekview-widget .peekview-actions .icon.chevron-up{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44NTQgNi4yOTNsLTUtNWgtLjcwOGwtNSA1TDMuODU0IDcgOCAyLjg1NFYxNS4wNmgxVjIuODU0TDEzLjE0NiA3bC43MDctLjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor .peekview-widget .peekview-actions .icon.chevron-down{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjE0NiA5Ljc2OGw1IDVoLjcwOGw1LTUtLjcwOC0uNzA3TDkgMTMuMjA3VjFIOHYxMi4yMDdMMy44NTQgOS4wNjFsLS43MDguNzA3eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==") 50% no-repeat}.hc-black .monaco-editor .peekview-widget .peekview-actions .icon.chevron-down,.vs-dark .monaco-editor .peekview-widget .peekview-actions .icon.chevron-down{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjE0NiA5Ljc2OGw1IDVoLjcwOGw1LTUtLjcwOC0uNzA3TDkgMTMuMjA3VjFIOHYxMi4yMDdMMy44NTQgOS4wNjFsLS43MDguNzA3eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") 50% no-repeat}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;-webkit-font-feature-settings:"liga" off,"calt" off;font-feature-settings:"liga" off,"calt" off}.monaco-editor.enable-ligatures{-webkit-font-feature-settings:"liga" on,"calt" on;font-feature-settings:"liga" on,"calt" on}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .vs-whitespace{display:inline-block}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent}.monaco-editor .inputarea.ime-input{z-index:10}.monaco-editor .margin-view-overlays .line-numbers{position:absolute;text-align:right;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:default;height:100%}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers{cursor:-webkit-image-set(url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIyNSI+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDAwIiBkPSJNMTQuNSAxLjJMMS45IDEzLjhIN2wtMy44IDcuNyAzLjEgMSAzLjgtNy42IDQuNCAzLjF6Ii8+PC9zdmc+") 1x,url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSI1MCI+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik0yOSAyLjRMMy44IDI3LjZIMTRMNi40IDQzbDYuMiAyIDcuNi0xNS4yTDI5IDM2eiIvPjwvc3ZnPg==") 2x) 30 0,default}.monaco-editor.mac .margin-view-overlays .line-numbers{cursor:-webkit-image-set(url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMyIgaGVpZ2h0PSIxOSI+PHBhdGggZD0iTTUuMyAxNi42bDEuNi00LjdIMi4xTDEyLjUgMS4ydjE0LjRMOS43IDEzbC0xLjYgNC42Yy0uMi41LS44LjgtMS4zLjZsLS44LS4zYy0uNi0uMi0uOS0uNy0uNy0xLjN6IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIvPjwvc3ZnPg==") 1x,url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNiIgaGVpZ2h0PSIzOCI+PHBhdGggZD0iTTEwLjYgMzMuMmwzLjItOS40SDQuMkwyNSAyLjR2MjguOEwxOS40IDI2bC0zLjIgOS4yYy0uNCAxLTEuNiAxLjYtMi42IDEuMmwtMS42LS42Yy0xLjItLjQtMS44LTEuNC0xLjQtMi42eiIgc3Ryb2tlPSIjZmZmIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiLz48L3N2Zz4=") 2x) 24 3,default}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .margin-view-overlays .current-line,.monaco-editor .view-overlays .current-line{display:block;position:absolute;left:0;top:0;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .lines-content .cigr,.monaco-editor .lines-content .cigra,.monaco-editor .margin-view-overlays .cgmr{position:absolute}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.monaco-editor .view-lines{cursor:text;white-space:nowrap}.monaco-editor.hc-black.mac .view-lines,.monaco-editor.vs-dark.mac .view-lines{cursor:-webkit-image-set(url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=) 1x,url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC) 2x) 5 8,text}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover .minimap-slider.active,.monaco-editor .minimap.slider-mouseover:hover .minimap-slider{opacity:1}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;cursor:text;overflow:hidden}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{-webkit-transition:80ms;transition:80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}@-webkit-keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@-webkit-keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@-webkit-keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}@keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}.cursor-smooth{-webkit-animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{-webkit-animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{-webkit-animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:100%;height:100%}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-icon-label{display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:0;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:inline-block;-webkit-font-smoothing:antialiased;vertical-align:top;-ms-flex-negative:0;flex-shrink:0}.monaco-icon-label>.monaco-icon-label-description-container{overflow:hidden;text-overflow:ellipsis}.monaco-icon-label>.monaco-icon-label-description-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.italic>.monaco-icon-label-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-description-container>.label-name{font-style:italic}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;padding:0 12px 0 5px;margin-left:auto;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after,.monaco-tree.focused .selected .monaco-icon-label,.monaco-tree.focused .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description,.monaco-tree-row.focused.selected .label-description,.monaco-tree-row.selected .label-description{opacity:.8}.monaco-count-badge{padding:3px 5px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;-o-user-select:none;user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;-o-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;-ms-touch-action:none;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute}.monaco-list-type-filter{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;border-radius:2px;padding:0 3px;max-width:calc(100% - 10px);text-overflow:ellipsis;overflow:hidden;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:all-scroll;font-size:13px;line-height:18px;height:20px;z-index:1;top:4px}.monaco-list-type-filter.dragging{-webkit-transition:top .2s,left .2s;transition:top .2s,left .2s}.monaco-list-type-filter.ne{right:4px}.monaco-list-type-filter.nw{left:4px}.monaco-list-type-filter>.controls{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .2s;transition:width .2s;width:0}.monaco-list-type-filter.dragging>.controls,.monaco-list-type-filter:hover>.controls{width:36px}.monaco-list-type-filter>.controls>*{-webkit-box-sizing:border-box;box-sizing:border-box;width:16px;height:16px;margin:0 0 0 2px;-ms-flex-negative:0;flex-shrink:0}.monaco-list-type-filter>.controls>.filter{-webkit-appearance:none;width:16px;height:16px;background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMTJ2LTFoOXYxSDF6bTAtNWgxNHYxSDFWN3ptMTEtNHYxSDFWM2gxMXoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");background-position:50% 50%;cursor:pointer}.monaco-list-type-filter>.controls>.filter:checked{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYgMTJ2LTFoNHYxSDZ6TTQgN2g4djFINFY3em0xMC00djFIMlYzaDEyeiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.vs-dark .monaco-list-type-filter>.controls>.filter{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMTJ2LTFoOXYxSDF6bTAtNWgxNHYxSDFWN3ptMTEtNHYxSDFWM2gxMXoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.vs-dark .monaco-list-type-filter>.controls>.filter:checked{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYgMTJ2LTFoNHYxSDZ6TTQgN2g4djFINFY3em0xMC00djFIMlYzaDEyeiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.hc-black .monaco-list-type-filter>.controls>.filter{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMTJ2LTFoOXYxSDF6bTAtNWgxNHYxSDFWN3ptMTEtNHYxSDFWM2gxMXoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.hc-black .monaco-list-type-filter>.controls>.filter:checked{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYgMTJ2LTFoNHYxSDZ6TTQgN2g4djFINFY3em0xMC00djFIMlYzaDEyeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==")}.monaco-list-type-filter>.controls>.clear{border:none;background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ3LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDhMOCA4LjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");cursor:pointer}.hc-black .monaco-list-type-filter>.controls>.clear,.vs-dark .monaco-list-type-filter>.controls>.clear{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ3LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDhMOCA4LjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-list-type-filter-message{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-list-type-filter{cursor:-webkit-grab;cursor:grab}.monaco-list-type-filter.dragging{cursor:-webkit-grabbing;cursor:grabbing}.monaco-tl-row{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative}.monaco-tl-indent{height:100%;position:absolute;top:0;left:18px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;border-left:1px solid transparent;-webkit-transition:border-color .1s linear;transition:border-color .1s linear}.monaco-tl-contents,.monaco-tl-twistie{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;margin-right:6px;-ms-flex-negative:0;flex-shrink:0;width:16px}.monaco-tl-contents{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.monaco-tl-twistie.collapsible{background-size:16px;background-position:3px 50%;background-repeat:no-repeat;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-tl-twistie.collapsible.collapsed:not(.loading){display:inline-block;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.vs-dark .monaco-tl-twistie.collapsible:not(.loading){background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.vs-dark .monaco-tl-twistie.collapsible.collapsed:not(.loading){background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.hc-black .monaco-tl-twistie.collapsible:not(.loading){background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjIuNjE4TDguMjg0IDExaC0uNjE4TDMgNi4zMzNsLjYxOS0uNjE4IDQuMzU3IDQuMzU3eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==")}.hc-black .monaco-tl-twistie.collapsible.collapsed:not(.loading){background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjZmZmIi8+PC9zdmc+")}.monaco-tl-twistie.loading{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvc3ZnPg==");background-position:0}.vs-dark .monaco-tl-twistie.loading{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48ZyBmaWxsPSJncmF5Ij48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvZz48L3N2Zz4=")}.hc-black .monaco-tl-twistie.loading{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48ZyBmaWxsPSIjZmZmIj48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvZz48L3N2Zz4=")}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:auto}.monaco-split-view2>.split-view-container{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:100%;white-space:nowrap}.monaco-split-view2.vertical>.split-view-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.monaco-split-view2.horizontal>.split-view-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.monaco-split-view2>.split-view-container>.split-view-view{white-space:normal;-webkit-box-flex:0;-ms-flex:none;flex:none;position:relative}.monaco-split-view2>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.split-view-container>.split-view-view{height:100%;display:inline-block}.monaco-split-view2.separator-border>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .code,.monaco-editor .marker-widget .descriptioncontainer .message .source{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer}.monaco-keybinding{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border:1px solid hsla(0,0%,80%,.4);border-bottom-color:hsla(0,0%,73.3%,.4);border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 hsla(0,0%,73.3%,.4);box-shadow:inset 0 -1px 0 hsla(0,0%,73.3%,.4);background-color:hsla(0,0%,86.7%,.4);vertical-align:middle;color:#555;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.hc-black .monaco-keybinding>.monaco-keybinding-key,.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:hsla(0,0%,50.2%,.17);color:#ccc;border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);-webkit-box-shadow:inset 0 -1px 0 rgba(68,68,68,.6);box-shadow:inset 0 -1px 0 rgba(68,68,68,.6)}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-quick-open-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight,.monaco-quick-open-widget .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight{color:#0066bf}.vs-dark .monaco-quick-open-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight,.vs-dark .monaco-quick-open-widget .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .monaco-quick-open-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight,.hc-black .monaco-quick-open-widget .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight{color:#f38518}.monaco-quick-open-widget{position:absolute;width:600px;z-index:2000;padding-bottom:6px;left:50%;margin-left:-300px}.monaco-quick-open-widget .monaco-progress-container{position:absolute;left:0;top:38px;z-index:1;height:2px}.monaco-quick-open-widget .monaco-progress-container .progress-bit{height:2px}.monaco-quick-open-widget .quick-open-input{width:588px;border:none;margin:6px}.monaco-quick-open-widget .quick-open-input .monaco-inputbox{width:100%;height:25px}.monaco-quick-open-widget .quick-open-result-count{position:absolute;left:-10000px}.monaco-quick-open-widget .quick-open-tree{line-height:22px}.monaco-quick-open-widget .quick-open-tree .monaco-tree-row>.content>.sub-content{overflow:hidden}.monaco-quick-open-widget.content-changing .quick-open-tree .monaco-scrollable-element .slider{display:none}.monaco-quick-open-widget .quick-open-tree .quick-open-entry{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.monaco-quick-open-widget .quick-open-tree .quick-open-entry>.quick-open-row{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon{overflow:hidden;width:16px;height:16px;margin-right:4px;display:inline-block;vertical-align:middle;-ms-flex-negative:0;flex-shrink:0}.monaco-quick-open-widget .quick-open-tree .monaco-icon-label,.monaco-quick-open-widget .quick-open-tree .monaco-icon-label .monaco-icon-label-description-container{-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .monaco-highlighted-label span{opacity:1}.monaco-quick-open-widget .quick-open-tree .quick-open-entry-meta{opacity:.7;line-height:normal}.monaco-quick-open-widget .quick-open-tree .content.has-group-label .quick-open-entry-keybinding{margin-right:8px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry-keybinding .monaco-keybinding-key{vertical-align:text-bottom}.monaco-quick-open-widget .quick-open-tree .results-group{margin-right:18px}.monaco-quick-open-widget .quick-open-tree .focused .monaco-tree-row.focused>.content.has-actions>.results-group,.monaco-quick-open-widget .quick-open-tree .monaco-tree-row.focused>.content.has-actions>.results-group,.monaco-quick-open-widget .quick-open-tree .monaco-tree-row:hover:not(.highlighted)>.content.has-actions>.results-group{margin-right:0}.monaco-quick-open-widget .quick-open-tree .results-group-separator{border-top-width:1px;border-top-style:solid;-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:-11px;padding-left:11px}.monaco-tree .monaco-tree-row>.content.actions{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.monaco-tree .monaco-tree-row>.content.actions>.sub-content{-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-tree .monaco-tree-row>.content.actions .action-item{margin:0}.monaco-tree .monaco-tree-row>.content.actions>.primary-action-bar{line-height:22px;display:none;padding:0 .8em 0 .4em}.monaco-tree .monaco-tree-row.focused>.content.has-actions>.primary-action-bar{width:0;display:block}.monaco-tree.focused .monaco-tree-row.focused>.content.has-actions>.primary-action-bar,.monaco-tree .monaco-tree-row:hover:not(.highlighted)>.content.has-actions>.primary-action-bar,.monaco-tree .monaco-tree-row>.content.has-actions.more>.primary-action-bar{width:inherit;display:block}.monaco-tree .monaco-tree-row>.content.actions>.primary-action-bar .action-label{margin-right:.4em;margin-top:4px;background-repeat:no-repeat;width:16px;height:16px}.monaco-quick-open-widget .quick-open-tree .monaco-highlighted-label .highlight{font-weight:700}.monaco-tree{height:100%;width:100%;white-space:nowrap;-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;-o-user-select:none;user-select:none;position:relative}.monaco-tree>.monaco-scrollable-element{height:100%}.monaco-tree>.monaco-scrollable-element>.monaco-tree-wrapper{height:100%;width:100%;position:relative}.monaco-tree .monaco-tree-rows{position:absolute;width:100%;height:100%}.monaco-tree .monaco-tree-rows>.monaco-tree-row{-o-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;overflow:hidden;width:100%;-ms-touch-action:none;touch-action:none}.monaco-tree .monaco-tree-rows>.monaco-tree-row>.content{position:relative;height:100%}.monaco-tree-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute}.monaco-tree .monaco-tree-rows>.monaco-tree-row.scrolling{display:none}.monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.has-children>.content:before{content:" ";position:absolute;display:block;background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+") 50% 50% no-repeat;width:16px;height:100%;top:0;left:-16px}.monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.expanded>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjE5LjYxOEw4LjI4NSAxMWgtLjYxOEwzIDYuMzMzbC42MTktLjYxOCA0LjM1NyA0LjM1N3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-tree .monaco-tree-rows>.monaco-tree-row.has-children.loading>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvc3ZnPg==")}.monaco-tree.highlighted .monaco-tree-rows>.monaco-tree-row:not(.highlighted){opacity:.3}.vs-dark .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.has-children>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.vs-dark .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.expanded>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjE5LjYxOEw4LjI4NSAxMWgtLjYxOEwzIDYuMzMzbC42MTktLjYxOCA0LjM1NyA0LjM1N3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.vs-dark .monaco-tree .monaco-tree-rows>.monaco-tree-row.has-children.loading>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48ZyBmaWxsPSJncmF5Ij48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvZz48L3N2Zz4=")}.hc-black .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.has-children>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNzIgOGwtNC4zNTcgNC4zNTcuNjE4LjYxOUwxMSA4LjMwOXYtLjYxOEw2LjMzMyAzLjAyNGwtLjYxOC42MTlMMTAuMDcyIDh6IiBmaWxsPSIjZmZmIi8+PC9zdmc+")}.hc-black .monaco-tree .monaco-tree-rows.show-twisties>.monaco-tree-row.expanded>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03Ljk3NiAxMC4wNzJsNC4zNTctNC4zNTcuNjE5LjYxOEw4LjI4NSAxMWgtLjYxOEwzIDYuMzMzbC42MTktLjYxOCA0LjM1NyA0LjM1N3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=")}.hc-black .monaco-tree .monaco-tree-rows>.monaco-tree-row.has-children.loading>.content:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHN0eWxlPmNpcmNsZXthbmltYXRpb246YmFsbCAuNnMgbGluZWFyIGluZmluaXRlfWNpcmNsZTpudGgtY2hpbGQoMil7YW5pbWF0aW9uLWRlbGF5Oi4wNzVzfWNpcmNsZTpudGgtY2hpbGQoMyl7YW5pbWF0aW9uLWRlbGF5Oi4xNXN9Y2lyY2xlOm50aC1jaGlsZCg0KXthbmltYXRpb24tZGVsYXk6LjIyNXN9Y2lyY2xlOm50aC1jaGlsZCg1KXthbmltYXRpb24tZGVsYXk6LjNzfWNpcmNsZTpudGgtY2hpbGQoNil7YW5pbWF0aW9uLWRlbGF5Oi4zNzVzfWNpcmNsZTpudGgtY2hpbGQoNyl7YW5pbWF0aW9uLWRlbGF5Oi40NXN9Y2lyY2xlOm50aC1jaGlsZCg4KXthbmltYXRpb24tZGVsYXk6LjUyNXN9PC9zdHlsZT48ZyBmaWxsPSIjZmZmIj48Y2lyY2xlIGN4PSI1IiBjeT0iMSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSI3LjgyOCIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjkiIGN5PSI1IiByPSIxIiBvcGFjaXR5PSIuMyIvPjxjaXJjbGUgY3g9IjcuODI4IiBjeT0iNy44MjgiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iNSIgY3k9IjkiIHI9IjEiIG9wYWNpdHk9Ii4zIi8+PGNpcmNsZSBjeD0iMi4xNzIiIGN5PSI3LjgyOCIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIxIiBjeT0iNSIgcj0iMSIgb3BhY2l0eT0iLjMiLz48Y2lyY2xlIGN4PSIyLjE3MiIgY3k9IjIuMTcyIiByPSIxIiBvcGFjaXR5PSIuMyIvPjwvZz48L3N2Zz4=")}.monaco-tree-action.collapse-all{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkgOUg0djFoNVY5eiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNSAzbDEtMWg3bDEgMXY3bC0xIDFoLTJ2MmwtMSAxSDNsLTEtMVY2bDEtMWgyVjN6bTEgMmg0bDEgMXY0aDJWM0g2djJ6bTQgMUgzdjdoN1Y2eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==") 50% no-repeat}.vs-dark .monaco-tree-action.collapse-all{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkgOUg0djFoNVY5eiIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNSAzbDEtMWg3bDEgMXY3bC0xIDFoLTJ2MmwtMSAxSDNsLTEtMVY2bDEtMWgyVjN6bTEgMmg0bDEgMXY0aDJWM0g2djJ6bTQgMUgzdjdoN1Y2eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") 50% no-repeat}.hc-black .monaco-tree-action.collapse-all{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkgOUg0djFoNVY5eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNSAzbDEtMWg3bDEgMXY3bC0xIDFoLTJ2MmwtMSAxSDNsLTEtMVY2bDEtMWgyVjN6bTEgMmg0bDEgMXY0aDJWM0g2djJ6bTQgMUgzdjdoN1Y2eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-progress-container{width:100%;height:5px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:5px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;-webkit-transition:width .1s linear;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;animation-timing-function:linear;-ms-animation-name:progress;-ms-animation-duration:4s;-ms-animation-iteration-count:infinite;-ms-animation-timing-function:linear;-webkit-animation-name:progress;-webkit-animation-duration:4s;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear;-moz-animation-name:progress;-moz-animation-duration:4s;-moz-animation-iteration-count:infinite;-moz-animation-timing-function:linear;will-change:transform}@keyframes progress{0%{-webkit-transform:translateX(0) scaleX(1);transform:translateX(0) scaleX(1)}50%{-webkit-transform:translateX(2500%) scaleX(3);transform:translateX(2500%) scaleX(3)}to{-webkit-transform:translateX(4950%) scaleX(1);transform:translateX(4950%) scaleX(1)}}@-webkit-keyframes progress{0%{-webkit-transform:translateX(0) scaleX(1);transform:translateX(0) scaleX(1)}50%{-webkit-transform:translateX(2500%) scaleX(3);transform:translateX(2500%) scaleX(3)}to{-webkit-transform:translateX(4950%) scaleX(1);transform:translateX(4950%) scaleX(1)}}.monaco-editor-hover{cursor:default;position:absolute;overflow:hidden;z-index:50;-webkit-user-select:text;-ms-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;-webkit-box-sizing:initial;box-sizing:initial;-webkit-animation:fadein .1s linear;animation:fadein .1s linear;line-height:1.5em}.monaco-editor-hover.hidden{display:none}.monaco-editor-hover .hover-contents{padding:4px 8px}.monaco-editor-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:500px;word-wrap:break-word}.monaco-editor-hover p,.monaco-editor-hover ul{margin:8px 0}.monaco-editor-hover hr{margin-top:4px;margin-bottom:-6px;margin-left:-10px;margin-right:-10px;height:1px}.monaco-editor-hover p:first-child,.monaco-editor-hover ul:first-child{margin-top:0}.monaco-editor-hover p:last-child,.monaco-editor-hover ul:last-child{margin-bottom:0}.monaco-editor-hover ul{padding-left:20px}.monaco-editor-hover li>p{margin-bottom:0}.monaco-editor-hover li>ul{margin-top:0}.monaco-editor-hover code{border-radius:3px;padding:0 .4em}.monaco-editor-hover .monaco-tokenized-source{white-space:pre-wrap;word-break:break-all}.monaco-editor-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-editor-hover .hover-row.status-bar .actions{display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 8px}.monaco-editor-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer}.monaco-editor-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.colorpicker-widget{height:190px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.monaco-editor .colorpicker-hover:focus{outline:none}.colorpicker-header{display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;position:relative;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=");background-size:9px 9px;-ms-interpolation-mode:nearest-neighbor;image-rendering:-webkit-optimize-contrast;image-rendering:-moz-crisp-edges;image-rendering:-o-pixelated;image-rendering:pixelated}.colorpicker-header .picked-color{width:216px;line-height:24px;cursor:pointer;color:#fff;-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.colorpicker-body{display:-webkit-box;display:-ms-flexbox;display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;-webkit-box-flex:1;-ms-flex:1;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid #fff;border-radius:100%;-webkit-box-shadow:0 0 2px rgba(0,0,0,.8);box-shadow:0 0 2px rgba(0,0,0,.8);position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .hue-strip{background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.colorpicker-body .hue-strip,.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:-webkit-grab;cursor:grab}.colorpicker-body .opacity-strip{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=");background-size:9px 9px;-ms-interpolation-mode:nearest-neighbor;image-rendering:-webkit-optimize-contrast;image-rendering:-moz-crisp-edges;image-rendering:-o-pixelated;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:-webkit-grabbing;cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid hsla(0,0%,100%,.71);-webkit-box-shadow:0 0 1px rgba(0,0,0,.85);box-shadow:0 0 1px rgba(0,0,0,.85)}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.monaco-editor .tokens-inspect-widget{z-index:50;-webkit-user-select:text;-ms-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;padding:10px}.tokens-inspect-separator{height:1px;border:0}.monaco-editor .tokens-inspect-widget .tm-token{font-family:monospace}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:monospace;text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:monospace}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OC4wMzYgNC4wMUg0LjAwOFYzMi4wM2g0NC4wMjhWNC4wMXpNNC4wMDguMDA4QTQuMDAzIDQuMDAzIDAgMCAwIC4wMDUgNC4wMVYzMi4wM2E0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMyA0LjAwMmg0NC4wMjhhNC4wMDMgNC4wMDMgMCAwIDAgNC4wMDMtNC4wMDJWNC4wMUE0LjAwMyA0LjAwMyAwIDAgMCA0OC4wMzYuMDA4SDQuMDA4ek04LjAxIDguMDEzaDQuMDAzdjQuMDAzSDguMDFWOC4wMTN6bTEyLjAwOCAwaC00LjAwMnY0LjAwM2g0LjAwMlY4LjAxM3ptNC4wMDMgMGg0LjAwMnY0LjAwM2gtNC4wMDJWOC4wMTN6bTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM1Y4LjAxM3ptNC4wMDIgMGg0LjAwM3Y0LjAwM0g0MC4wM1Y4LjAxM3ptLTI0LjAxNSA4LjAwNUg4LjAxdjQuMDAzaDguMDA2di00LjAwM3ptNC4wMDIgMGg0LjAwM3Y0LjAwM2gtNC4wMDN2LTQuMDAzem0xMi4wMDggMGgtNC4wMDN2NC4wMDNoNC4wMDN2LTQuMDAzem0xMi4wMDggMHY0LjAwM2gtOC4wMDV2LTQuMDAzaDguMDA1em0tMzIuMDIxIDguMDA1SDguMDF2NC4wMDNoNC4wMDN2LTQuMDAzem00LjAwMyAwaDIwLjAxM3Y0LjAwM0gxNi4wMTZ2LTQuMDAzem0yOC4wMTggMEg0MC4wM3Y0LjAwM2g0LjAwM3YtNC4wMDN6IiBmaWxsPSIjNDI0MjQyIi8+PC9nPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoNTN2MzZIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=") 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OC4wMzYgNC4wMUg0LjAwOFYzMi4wM2g0NC4wMjhWNC4wMXpNNC4wMDguMDA4QTQuMDAzIDQuMDAzIDAgMCAwIC4wMDUgNC4wMVYzMi4wM2E0LjAwMyA0LjAwMyAwIDAgMCA0LjAwMyA0LjAwMmg0NC4wMjhhNC4wMDMgNC4wMDMgMCAwIDAgNC4wMDMtNC4wMDJWNC4wMUE0LjAwMyA0LjAwMyAwIDAgMCA0OC4wMzYuMDA4SDQuMDA4ek04LjAxIDguMDEzaDQuMDAzdjQuMDAzSDguMDFWOC4wMTN6bTEyLjAwOCAwaC00LjAwMnY0LjAwM2g0LjAwMlY4LjAxM3ptNC4wMDMgMGg0LjAwMnY0LjAwM2gtNC4wMDJWOC4wMTN6bTEyLjAwOCAwaC00LjAwM3Y0LjAwM2g0LjAwM1Y4LjAxM3ptNC4wMDIgMGg0LjAwM3Y0LjAwM0g0MC4wM1Y4LjAxM3ptLTI0LjAxNSA4LjAwNUg4LjAxdjQuMDAzaDguMDA2di00LjAwM3ptNC4wMDIgMGg0LjAwM3Y0LjAwM2gtNC4wMDN2LTQuMDAzem0xMi4wMDggMGgtNC4wMDN2NC4wMDNoNC4wMDN2LTQuMDAzem0xMi4wMDggMHY0LjAwM2gtOC4wMDV2LTQuMDAzaDguMDA1em0tMzIuMDIxIDguMDA1SDguMDF2NC4wMDNoNC4wMDN2LTQuMDAzem00LjAwMyAwaDIwLjAxM3Y0LjAwM0gxNi4wMTZ2LTQuMDAzem0yOC4wMTggMEg0MC4wM3Y0LjAwM2g0LjAwM3YtNC4wMDN6IiBmaWxsPSIjQzVDNUM1Ii8+PC9nPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoNTN2MzZIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=") 50% no-repeat;border:4px solid #252526}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer}.monaco-editor .parameter-hints-widget{z-index:10;line-height:1.5em}.monaco-editor .parameter-hints-widget,.monaco-editor .parameter-hints-widget>.wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.monaco-editor .parameter-hints-widget>.wrapper{max-width:440px}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0 0 0 1.9em}.monaco-editor .parameter-hints-widget.visible{-webkit-transition:left .05s ease-in-out;transition:left .05s ease-in-out}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .body,.monaco-editor .parameter-hints-widget .monaco-scrollable-element{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:normal}.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs code{border-radius:3px;padding:0 .4em}.monaco-editor .parameter-hints-widget .buttons{position:absolute;display:none;bottom:0;left:0}.monaco-editor .parameter-hints-widget.multiple .buttons{display:block}.monaco-editor .parameter-hints-widget.multiple .button{position:absolute;left:2px;width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTEwLjggOS41bC45LS45TDguMSA1IDQuMiA4LjZsLjkuOSAzLTIuNyAyLjcgMi43eiIvPjwvc3ZnPg==")}.monaco-editor .parameter-hints-widget .button.next{bottom:0;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iIzQyNDI0MiIgZD0iTTUuMSA1bC0uOS45IDMuNiAzLjYgMy45LTMuNi0xLS45LTMgMi43TDUuMSA1eiIvPjwvc3ZnPg==")}.monaco-editor .parameter-hints-widget .overloads{position:absolute;display:none;text-align:center;bottom:14px;left:0;width:22px;height:12px;line-height:12px;opacity:.5}.monaco-editor .parameter-hints-widget.multiple .overloads{display:block}.monaco-editor .parameter-hints-widget .signature .parameter.active{font-weight:700;text-decoration:underline}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor.hc-black .parameter-hints-widget .button.previous,.monaco-editor.vs-dark .parameter-hints-widget .button.previous{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTEwLjggOS41bC45LS45TDguMSA1IDQuMiA4LjZsLjkuOSAzLTIuNyAyLjcgMi43eiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .parameter-hints-widget .button.next,.monaco-editor.vs-dark .parameter-hints-widget .button.next{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0iI0U4RThFOCIgZD0iTTUuMSA1bC0uOS45IDMuNiAzLjYgMy45LTMuNi0xLS45LTMgMi43TDUuMSA1eiIvPjwvc3ZnPg==")}.monaco-quick-open-widget{font-size:13px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNCAyNi44NThMNC40ODYgMjZsNS0zaDEuMDI4bDUgMyAuNDg2Ljg1OHY2bC0uNDg2Ljg1Ny01IDNIOS40ODZsLTUtM0w0IDMyLjg1N3YtNnptNS41IDguN2wtNC41LTIuN1YyNy43bDQuNSAyLjQ1NHY1LjQwM3ptMSAwbDQuNS0yLjdWMjcuN2wtNC41IDIuNDU0djUuNDAzem0tLjUtMTEuN2wtNC43NCAyLjg0NEwxMCAyOS4yODhsNC43NC0yLjU4NkwxMCAyMy44NTd6IiBmaWxsPSIjQjE4MEQ3Ii8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDYuODU3TDQuNDg2IDZsNS0zaDEuMDI4bDUgMyAuNDg2Ljg1N3Y2bC0uNDg2Ljg1OC01IDNIOS40ODZsLTUtM0w0IDEyLjg1OHYtNnptNS41IDguN2wtNC41LTIuN1Y3LjdsNC41IDIuNDU0djUuNDAzem0xIDBsNC41LTIuN1Y3LjdsLTQuNSAyLjQ1NHY1LjQwM3ptLS41LTExLjdMNS4yNiA2LjcwMiAxMCA5LjI4OGw0Ljc0LTIuNTg2TDEwIDMuODU3eiIgZmlsbD0iIzY1MkQ5MCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjMgMjguMzk0bC41NTMtLjg5NCA3LTMuNWguODk0bDUgMi41LjU1My44OTR2NC41bC0uNTUzLjg5NS03IDMuNWgtLjg5NGwtNS0yLjUtLjU1My0uODk1di00LjV6bTUuNSA2Ljc1bC00LjUtMi4yNXYtMy43MjNsNC41IDIuMDQ1djMuOTI4em0xIDBsNi41LTMuMjVWMjguMThsLTYuNSAzLjAzM3YzLjkzMXptMS41LTEwLjI1bC02LjY2MyAzLjMzMiA0LjY2IDIuMTE4IDYuNjc0LTMuMTE0TDMxIDI0Ljg5NHoiIGZpbGw9IiM3NUJFRkYiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIzIDguMzk0bC41NTMtLjg5NCA3LTMuNWguODk0bDUgMi41LjU1My44OTR2NC41bC0uNTUzLjg5NS03IDMuNWgtLjg5NGwtNS0yLjUtLjU1My0uODk1di00LjV6bTUuNSA2Ljc1bC00LjUtMi4yNVY5LjE3MWw0LjUgMi4wNDV2My45Mjh6bTEgMGw2LjUtMy4yNVY4LjE4bC02LjUgMy4wMzN2My45MzF6TTMxIDQuODk0bC02LjY2MyAzLjMzMiA0LjY2IDIuMTE4IDYuNjc0LTMuMTE0TDMxIDQuODk0eiIgZmlsbD0iIzAwN0FDQyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDUuMzU0IDI4LjY0NmwtMS4yOTMtMS4yOTMgMy4yOTMtMy4yOTIgMS4yOTMgMS4yOTMtMy4yOTMgMy4yOTJ6TTQ3IDIzbC00IDR2LjcwN2wyIDJoLjcwN2wxLjE0Ny0xLjE0NnY1Ljc5MmwuNS41aDQuNjU2di41MjFsMS4zMzMgMS4zMzNoLjcwN2wyLjY2Ny0yLjY2NnYtLjcwN0w1NS4zODMgMzJoLS43MDdsLTEuODUzIDEuODUzaC00Ljk3di0zLjk2aDQuMTU3di40ODFsMS4zMzMgMS4zMzNoLjcwN2wyLjY2Ny0yLjY2NnYtLjcwN0w1NS4zODMgMjdoLS43MDdsLTEuODEzIDEuODE0aC01LjAxVjI3LjU2bDEuODU0LTEuODU0VjI1bC0yLTJINDd6bTYuMDcgNy4wMmwuNjI3LjYyNyAxLjk2LTEuOTYtLjYyNy0uNjI2LTEuOTYgMS45NnptMCA1bC42MjcuNjI3IDEuOTYtMS45Ni0uNjI3LS42MjYtMS45NiAxLjk2eiIgZmlsbD0iI0VFOUQyOCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDUuMzU0IDguNjQ2TDQ0LjA2IDcuMzU0bDMuMjkzLTMuMjkzIDEuMjkzIDEuMjkzLTMuMjkzIDMuMjkyek00NyAzbC00IDR2LjcwN2wyIDJoLjcwN2wxLjE0Ny0xLjE0NnY1Ljc5M2wuNS41aDQuNjU2di41MmwxLjMzMyAxLjMzM2guNzA3bDIuNjY3LTIuNjY2di0uNzA3TDU1LjM4MyAxMmgtLjcwN2wtMS44NTMgMS44NTRoLTQuOTd2LTMuOTZoNC4xNTd2LjQ4bDEuMzMzIDEuMzMzaC43MDdsMi42NjctMi42NjZ2LS43MDdMNTUuMzgzIDdoLS43MDdsLTEuODEzIDEuODE0aC01LjAxVjcuNTZsMS44NTQtMS44NTRWNWwtMi0ySDQ3em02LjA3IDcuMDJsLjYyNy42MjcgMS45Ni0xLjk2LS42MjctLjYyNi0xLjk2IDEuOTZ6bTAgNWwuNjI3LjYyNyAxLjk2LTEuOTYtLjYyNy0uNjI2LTEuOTYgMS45NnoiIGZpbGw9IiNENjdFMDAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg4IDI0Ljk4NFYyNGgtLjA5Yy0uMzEzIDAtLjYxNi4wNjItLjkwOS4xODVhMi4zMyAyLjMzIDAgMCAwLS43NzUuNTMgMi4yMyAyLjIzIDAgMCAwLS40OTMuNzUzdi4wMDFhMy41NDIgMy41NDIgMCAwIDAtLjE5OC44M3YuMDAyYy0uMDI4LjI4LS4wMzYuNTY3LS4wMjQuODYzLjAxMi4yOS4wMTguNTguMDE4Ljg2OSAwIC4yMDMtLjA0LjM5My0uMTE3LjU3MnYuMDAxYTEuNTAzIDEuNTAzIDAgMCAxLS43NjUuNzg2IDEuMzc2IDEuMzc2IDAgMCAxLS41NTguMTE2SDg0di45ODRoLjA5Yy4xOTUgMCAuMzguMDQuNTU2LjEyMWwuMDAxLjAwMWMuMTc4LjA3OC4zMjkuMTg0LjQ1NS4zMThsLjAwMi4wMDJjLjEzLjEzLjIzMy4yODUuMzA3LjQ2NWwuMDAxLjAwMmMuMDc4LjE4LjExNy4zNjguMTE3LjU2NiAwIC4yOS0uMDA2LjU4LS4wMTguODY5YTYuMTkgNi4xOSAwIDAgMCAuMDI0Ljg3di4wMDFjLjAzMy4yODMuMDk5LjU1OC4xOTcuODI0di4wMDFjLjEwNi4yNzMuMjcxLjUyNC40OTQuNzUzLjIyMy4yMy40ODIuNDA3Ljc3NS41My4yOTMuMTIzLjU5Ni4xODUuOTEuMTg1SDg4di0uOTg0aC0uMDljLS4yIDAtLjM4Ni0uMDM4LS41NjItLjExNWExLjYxMiAxLjYxMiAwIDAgMS0uNDU3LS4zMiAxLjY1OSAxLjY1OSAwIDAgMS0uMzA5LS40NjdjLS4wNzQtLjE4LS4xMS0uMzctLjExLS41NzMgMC0uMjI4LjAwMy0uNDUyLjAxMS0uNjcyLjAwOC0uMjI4LjAwOC0uNDUgMC0uNjY1YTQuNjQxIDQuNjQxIDAgMCAwLS4wNTUtLjY0IDIuNjgyIDIuNjgyIDAgMCAwLS4xNjgtLjYwOSAyLjI4IDIuMjggMCAwIDAtLjczOC0uOTU1IDIuMjggMi4yOCAwIDAgMCAuNzM4LS45NTUgMi43IDIuNyAwIDAgMCAuMTY4LS42MDJjLjAzMy0uMjEuMDUxLS40MjMuMDU1LS42NC4wMDgtLjIyLjAwOC0uNDQyIDAtLjY2NmExOS4yNiAxOS4yNiAwIDAgMS0uMDEyLS42NzggMS40NyAxLjQ3IDAgMCAxIC40Mi0xLjAzNWMuMTMtLjEzNS4yODQtLjI0MS40NTctLjMxOWExLjMzIDEuMzMgMCAwIDEgLjU2My0uMTIxSDg4em00IDEwLjAzMlYzNmguMDljLjMxMyAwIC42MTYtLjA2Mi45MDktLjE4NS4yOTMtLjEyMy41NTItLjMuNzc1LS41My4yMjMtLjIzLjM4OC0uNDguNDkzLS43NTN2LS4wMDFjLjEtLjI2Ni4xNjUtLjU0My4xOTgtLjgzdi0uMDAyYy4wMjgtLjI4LjAzNi0uNTY3LjAyNC0uODYzLS4wMTItLjI5LS4wMTgtLjU4LS4wMTgtLjg2OSAwLS4yMDMuMDQtLjM5My4xMTctLjU3MnYtLjAwMWExLjUwMyAxLjUwMyAwIDAgMSAuNzY1LS43ODZjLjE3Ni0uMDc4LjM2Mi0uMTE2LjU1OC0uMTE2SDk2di0uOTg0aC0uMDljLS4xOTUgMC0uMzgtLjA0LS41NTYtLjEyMWwtLjAwMS0uMDAxYTEuMzc2IDEuMzc2IDAgMCAxLS40NTUtLjMxOGwtLjAwMi0uMDAyYTEuNDE0IDEuNDE0IDAgMCAxLS4zMDctLjQ2NWwtLjAwMS0uMDAyYTEuNDA1IDEuNDA1IDAgMCAxLS4xMTctLjU2NmMwLS4yOS4wMDYtLjU4LjAxOC0uODY5YTYuMTkgNi4xOSAwIDAgMC0uMDI0LS44N3YtLjAwMWEzLjU0MSAzLjU0MSAwIDAgMC0uMTk3LS44MjR2LS4wMDFhMi4yMyAyLjIzIDAgMCAwLS40OTQtLjc1MyAyLjMzIDIuMzMgMCAwIDAtLjc3NS0uNTMgMi4zMjUgMi4zMjUgMCAwIDAtLjkxLS4xODVIOTJ2Ljk4NGguMDljLjIgMCAuMzg2LjAzOC41NjIuMTE1LjE3NC4wODIuMzI2LjE4OC40NTcuMzIuMTI3LjEzNC4yMy4yOS4zMDkuNDY3LjA3NC4xOC4xMS4zNy4xMS41NzMgMCAuMjI4LS4wMDMuNDUzLS4wMTEuNjcyLS4wMDguMjI4LS4wMDguNDUgMCAuNjY1LjAwNC4yMjEuMDIyLjQzNS4wNTUuNjQuMDMzLjIxNC4wODkuNDE2LjE2OC42MDlhMi4yOCAyLjI4IDAgMCAwIC43MzguOTU1IDIuMjggMi4yOCAwIDAgMC0uNzM4Ljk1NSAyLjcgMi43IDAgMCAwLS4xNjguNjAyIDQuNzYgNC43NiAwIDAgMC0uMDU1LjY0Yy0uMDA4LjIyLS4wMDguNDQyIDAgLjY2NS4wMDguMjI1LjAxMi40NS4wMTIuNjc5YTEuNDcgMS40NyAwIDAgMS0uNDIgMS4wMzUgMS40NjYgMS40NjYgMCAwIDEtLjQ1Ny4zMTkgMS4zMyAxLjMzIDAgMCAxLS41NjMuMTIxSDkyeiIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODggNC45ODRWNGgtLjA5Yy0uMzEzIDAtLjYxNi4wNjItLjkwOS4xODVhMi4zMyAyLjMzIDAgMCAwLS43NzUuNTMgMi4yMyAyLjIzIDAgMCAwLS40OTMuNzUzdi4wMDFhMy41NDIgMy41NDIgMCAwIDAtLjE5OC44M3YuMDAyYy0uMDI4LjI4LS4wMzYuNTY3LS4wMjQuODYzLjAxMi4yOS4wMTguNTguMDE4Ljg2OSAwIC4yMDMtLjA0LjM5My0uMTE3LjU3MnYuMDAxYTEuNTA0IDEuNTA0IDAgMCAxLS43NjUuNzg3IDEuMzc1IDEuMzc1IDAgMCAxLS41NTguMTE1SDg0di45ODRoLjA5Yy4xOTUgMCAuMzguMDQuNTU2LjEyMWwuMDAxLjAwMWMuMTc4LjA3OC4zMjkuMTg0LjQ1NS4zMThsLjAwMi4wMDJjLjEzLjEzLjIzMy4yODUuMzA3LjQ2NWwuMDAxLjAwMmMuMDc4LjE4LjExNy4zNjguMTE3LjU2NiAwIC4yOS0uMDA2LjU4LS4wMTguODY5YTYuMTkgNi4xOSAwIDAgMCAuMDI0Ljg3di4wMDFjLjAzMy4yODMuMDk5LjU1OC4xOTcuODI0di4wMDFjLjEwNi4yNzMuMjcxLjUyNC40OTQuNzUzLjIyMy4yMy40ODIuNDA3Ljc3NS41My4yOTMuMTIzLjU5Ni4xODUuOTEuMTg1SDg4di0uOTg0aC0uMDljLS4yIDAtLjM4Ni0uMDM4LS41NjItLjExNWExLjYxMiAxLjYxMiAwIDAgMS0uNDU3LS4zMiAxLjY1OSAxLjY1OSAwIDAgMS0uMzA5LS40NjdjLS4wNzQtLjE4LS4xMS0uMzctLjExLS41NzMgMC0uMjI4LjAwMy0uNDUzLjAxMS0uNjcyLjAwOC0uMjI4LjAwOC0uNDUgMC0uNjY1YTQuNjQxIDQuNjQxIDAgMCAwLS4wNTUtLjY0IDIuNjgyIDIuNjgyIDAgMCAwLS4xNjgtLjYwOSAyLjI4IDIuMjggMCAwIDAtLjczOC0uOTU1IDIuMjgyIDIuMjgyIDAgMCAwIC43MzgtLjk1NSAyLjcgMi43IDAgMCAwIC4xNjgtLjYwMmMuMDMzLS4yMS4wNTEtLjQyMy4wNTUtLjY0LjAwOC0uMjIuMDA4LS40NDIgMC0uNjY2LS4wMDgtLjIyNC0uMDEyLS40NS0uMDEyLS42NzhhMS40NyAxLjQ3IDAgMCAxIC44NzctMS4zNTQgMS4zMyAxLjMzIDAgMCAxIC41NjMtLjEyMUg4OHptNCAxMC4wMzJWMTZoLjA5Yy4zMTMgMCAuNjE2LS4wNjIuOTA5LS4xODUuMjkzLS4xMjMuNTUyLS4zLjc3NS0uNTMuMjIzLS4yMy4zODgtLjQ4LjQ5My0uNzUzdi0uMDAxYy4xLS4yNjYuMTY1LS41NDMuMTk4LS44M3YtLjAwMmMuMDI4LS4yOC4wMzYtLjU2Ny4wMjQtLjg2My0uMDEyLS4yOS0uMDE4LS41OC0uMDE4LS44NjkgMC0uMjAzLjA0LS4zOTMuMTE3LS41NzJ2LS4wMDFhMS41MDMgMS41MDMgMCAwIDEgLjc2NS0uNzg3Yy4xNzYtLjA3Ni4zNjItLjExNS41NTgtLjExNUg5NnYtLjk4NGgtLjA5Yy0uMTk1IDAtLjM4LS4wNC0uNTU2LS4xMjFsLS4wMDEtLjAwMWExLjM3NiAxLjM3NiAwIDAgMS0uNDU1LS4zMThsLS4wMDItLjAwMmExLjQxNCAxLjQxNCAwIDAgMS0uMzA3LS40NjVsLS4wMDEtLjAwMmExLjQwNSAxLjQwNSAwIDAgMS0uMTE3LS41NjZjMC0uMjkuMDA2LS41OC4wMTgtLjg2OWE2LjE5IDYuMTkgMCAwIDAtLjAyNC0uODd2LS4wMDFhMy41NDIgMy41NDIgMCAwIDAtLjE5Ny0uODI0di0uMDAxYTIuMjMgMi4yMyAwIDAgMC0uNDk0LS43NTMgMi4zMyAyLjMzIDAgMCAwLS43NzUtLjUzIDIuMzI1IDIuMzI1IDAgMCAwLS45MS0uMTg1SDkydi45ODRoLjA5Yy4yIDAgLjM4Ni4wMzguNTYyLjExNS4xNzQuMDgyLjMyNi4xODguNDU3LjMyLjEyNy4xMzQuMjMuMjkuMzA5LjQ2Ny4wNzQuMTguMTEuMzcuMTEuNTczIDAgLjIyOC0uMDAzLjQ1Mi0uMDExLjY3Mi0uMDA4LjIyOC0uMDA4LjQ1IDAgLjY2NS4wMDQuMjIyLjAyMi40MzUuMDU1LjY0LjAzMy4yMTQuMDg5LjQxNi4xNjguNjA5YTIuMjgyIDIuMjgyIDAgMCAwIC43MzguOTU1IDIuMjggMi4yOCAwIDAgMC0uNzM4Ljk1NSAyLjcgMi43IDAgMCAwLS4xNjguNjAyIDQuNzYgNC43NiAwIDAgMC0uMDU1LjY0Yy0uMDA4LjIyLS4wMDguNDQyIDAgLjY2Ni4wMDguMjI0LjAxMi40NS4wMTIuNjc4YTEuNDcgMS40NyAwIDAgMS0uNDIgMS4wMzUgMS40NjYgMS40NjYgMCAwIDEtLjQ1Ny4zMTkgMS4zMyAxLjMzIDAgMCAxLS41NjMuMTIxSDkyeiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzMuNSAyN2EyLjUgMi41IDAgMSAwIDAgNSAyLjUgMi41IDAgMCAwIDAtNXptLTMuNDY1IDNhMy41MDEgMy41MDEgMCAxIDAgMC0xaC0zLjA5OGEyIDIgMCAxIDAgMCAxaDMuMDk4eiIgZmlsbD0iIzc1QkVGRiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzMuNSA3YTIuNSAyLjUgMCAxIDAgMCA1IDIuNSAyLjUgMCAwIDAgMC01em0tMy40NjUgM2EzLjUwMSAzLjUwMSAwIDEgMCAwLTFoLTMuMDk4YTIgMiAwIDEgMCAwIDFoMy4wOTh6IiBmaWxsPSIjMDA3QUNDIi8+PHBhdGggZD0iTTEwNC44MDcgMzYuOTc1YTEuNzUxIDEuNzUxIDAgMCAxLTEuMjU1LS41NTYgMS42ODIgMS42ODIgMCAwIDEtLjU0NC0xLjEgMS43MiAxLjcyIDAgMCAxIC4zNTMtMS4yMThjMS4yMDctMS4yNzIgMy41ODYtMy42NTIgNS4zMTctNS4zNDZhNC4yNiA0LjI2IDAgMCAxIC4wNDgtMy4wNzggNC4xMDEgNC4xMDEgMCAwIDEgMS42NjUtMS45NjkgNC4yNjEgNC4yNjEgMCAwIDEgNC4wNC0uMzZsLjYxNy4yNjgtMi44NjYgMi45NTEgMS4yNTUgMS4yNTkgMi45NDQtMi44NzcuMjY3LjYxOWE0LjI4OCA0LjI4OCAwIDAgMSAuMDM5IDMuMzExIDQuMjAyIDQuMjAyIDAgMCAxLS45MjIgMS4zOTJjLS4yMjYuMjItLjQ3NS40MTUtLjc0My41ODFhNC4yMTggNC4yMTggMCAwIDEtMy44MTIuNDQ2Yy0xLjA5OCAxLjExMy0zLjgzOSAzLjg3Mi01LjMxOSA1LjI1NGExLjYzIDEuNjMgMCAwIDEtMS4wODQuNDIzem03LjkzOC0xMy4wNDdhMy4zMjIgMy4zMjIgMCAwIDAtMS44NDkuNTU3IDMuMzcgMy4zNyAwIDAgMC0uNTkxLjQ1OCAzLjMxOSAzLjMxOSAwIDAgMC0uNjU3IDMuNzMzbC4xMzUuMjk3LS4yMzMuMjI3Yy0xLjczOCAxLjY5Ny00LjI2OSA0LjIyLTUuNDg1IDUuNTA1YS44MDMuODAzIDAgMCAwIC4xMzIgMS4wNDguOTEuOTEgMCAwIDAgLjI5OC4yMmMuMTAxLjA0NS4yMDkuMDcuMzE5LjA3MmEuNjk1LjY5NSAwIDAgMCAuNDUtLjE4YzEuNTczLTEuNDY5IDQuNjEyLTQuNTM5IDUuNTA0LTUuNDRsLjIyOS0uMjMyLjI5NS4xMzVhMy4yODkgMy4yODkgMCAwIDAgMy4yMjUtLjI1M2MuMjE0LS4xMzIuNDEzLS4yODguNTkyLS40NjVhMy4yODQgMy4yODQgMCAwIDAgLjk2My0yLjM1OGMwLS4yMTUtLjAyMi0uNDMtLjA2NC0uNjQybC0yLjU3NyAyLjUxNS0yLjU1Mi0yLjU0NyAyLjUxNS0yLjU5YTMuMjggMy4yOCAwIDAgMC0uNjQ5LS4wNnoiIGZpbGw9IiNDNUM1QzUiLz48cGF0aCBkPSJNMTA0LjgwNyAxNi45NzVhMS43NTEgMS43NTEgMCAwIDEtMS4yNTUtLjU1NiAxLjY4MiAxLjY4MiAwIDAgMS0uNTQ0LTEuMSAxLjcyIDEuNzIgMCAwIDEgLjM1My0xLjIxOGMxLjIwNy0xLjI3MiAzLjU4Ni0zLjY1MiA1LjMxNy01LjM0NmE0LjI2IDQuMjYgMCAwIDEgLjA0OC0zLjA3OCA0LjEwMSA0LjEwMSAwIDAgMSAxLjY2NS0xLjk2OSA0LjI2MSA0LjI2MSAwIDAgMSA0LjA0LS4zNmwuNjE3LjI2OC0yLjg2NiAyLjk1MSAxLjI1NSAxLjI1OSAyLjk0NC0yLjg3Ny4yNjcuNjE5YTQuMjg4IDQuMjg4IDAgMCAxIC4wMzkgMy4zMTEgNC4yMDMgNC4yMDMgMCAwIDEtLjkyMiAxLjM5MmMtLjIyNi4yMi0uNDc1LjQxNS0uNzQzLjU4MWE0LjIxOCA0LjIxOCAwIDAgMS0zLjgxMi40NDZjLTEuMDk4IDEuMTEzLTMuODM5IDMuODcyLTUuMzE5IDUuMjU0YTEuNjMgMS42MyAwIDAgMS0xLjA4NC40MjN6bTcuOTM4LTEzLjA0N2EzLjMyMSAzLjMyMSAwIDAgMC0xLjg0OS41NTdjLS4yMTMuMTMtLjQxMi4yODQtLjU5MS40NThhMy4zMTkgMy4zMTkgMCAwIDAtLjY1NyAzLjczM2wuMTM1LjI5Ny0uMjMzLjIyN2MtMS43MzggMS42OTctNC4yNjkgNC4yMi01LjQ4NSA1LjUwNWEuODAzLjgwMyAwIDAgMCAuMTMyIDEuMDQ4LjkxLjkxIDAgMCAwIC4yOTguMjJjLjEwMS4wNDUuMjA5LjA3LjMxOS4wNzJhLjY5NS42OTUgMCAwIDAgLjQ1LS4xOGMxLjU3My0xLjQ2OSA0LjYxMi00LjUzOSA1LjUwNC01LjQ0bC4yMjktLjIzMi4yOTUuMTM1YTMuMjg5IDMuMjg5IDAgMCAwIDMuMjI1LS4yNTNjLjIxNC0uMTMyLjQxMy0uMjg4LjU5Mi0uNDY1YTMuMjg0IDMuMjg0IDAgMCAwIC45NjMtMi4zNThjMC0uMjE1LS4wMjItLjQzLS4wNjQtLjY0MmwtMi41NzcgMi41MTUtMi41NTItMi41NDcgMi41MTUtMi41OWEzLjI4IDMuMjggMCAwIDAtLjY0OS0uMDZ6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNDkgMjVsMS0xaDZsMSAxdjVsLTEgMWgtNHYtMWg0di01aC02djNoLTF2LTN6bTEgNGwxIDF2NWwtMSAxaC02bC0xLTF2LTVsMS0xaDZ6bTAgMXY1aC02di01aDZ6bTEuNDE0LTFsLS40MTQtLjQxNFYyOGg0djFoLTMuNTg2ek0xNTEgMjZoNHYxaC00di0xem0tMiA2aC00djFoNHYtMXoiIGZpbGw9IiM3NUJFRkYiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE0OSA1bDEtMWg2bDEgMXY1bC0xIDFoLTR2LTFoNFY1aC02djNoLTFWNXptMSA0bDEgMXY1bC0xIDFoLTZsLTEtMXYtNWwxLTFoNnptMCAxdjVoLTZ2LTVoNnptMS40MTQtMUwxNTEgOC41ODZWOGg0djFoLTMuNTg2ek0xNTEgNmg0djFoLTRWNnptLTIgNmgtNHYxaDR2LTF6IiBmaWxsPSIjMDA3QUNDIi8+PHBhdGggZD0iTTE3NyA2aC01VjVoNXYxem0tMSAzaC0ydjFoMlY5em0tNCAwaC05djFoOVY5em0yIDZoLTExdjFoMTF2LTF6bS01LTNoLTZ2MWg2di0xem04IDBoLTV2MWg1di0xem0tNy04djNoLTdWNGg3em0tMSAxaC01djFoNVY1eiIgZmlsbD0iI0M1QzVDNSIvPjxwYXRoIGQ9Ik0xNzcgMjZoLTV2LTFoNXYxem0tMSAzaC0ydjFoMnYtMXptLTQgMGgtOXYxaDl2LTF6bTIgNmgtMTF2MWgxMXYtMXptLTUtM2gtNnYxaDZ2LTF6bTggMGgtNXYxaDV2LTF6bS03LTh2M2gtN3YtM2g3em0tMSAxaC01djFoNXYtMXoiIGZpbGw9IiM0MjQyNDIiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIwOS4yMjMgMzIuOTMzYy4zMjYuMTkyLjY5OS4yOSAxLjA3Ny4yODJhMi4xNTUgMi4xNTUgMCAwIDAgMS43NTQtLjg0MiAzLjI5NCAzLjI5NCAwIDAgMCAuNjU0LTIuMTEzIDIuODkgMi44OSAwIDAgMC0uNTc2LTEuODc3IDEuOTg3IDEuOTg3IDAgMCAwLTEuNjM0LS43MzMgMi4yOTIgMi4yOTIgMCAwIDAtMS41MjMuNTY3di0yLjc0MmgtLjk5MVYzMy4xaC45OTV2LS4zNDRjLjA3Ni4wNjYuMTU4LjEyNS4yNDQuMTc3em0uNjI3LTQuMjMzYy4xODYtLjA3OS4zODgtLjExMy41OS0uMWExLjA4IDEuMDggMCAwIDEgLjg5Ni40MjhjLjI1Ny4zNjMuMzgyLjgwMi4zNTcgMS4yNDVhMi40ODMgMi40ODMgMCAwIDEtLjQgMS40ODQgMS4xNDEgMS4xNDEgMCAwIDEtLjk2LjUwOCAxLjIyNSAxLjIyNSAwIDAgMS0uOTc2LS40MTcgMS41MjMgMS41MjMgMCAwIDEtLjM4Mi0xLjA0OHYtLjZhMS43MjMgMS43MjMgMCAwIDEgLjM5My0xLjE0NWMuMTMxLS4xNTQuMjk2LS4yNzYuNDgyLS4zNTV6bS00LjU2MS0xLjAyNWEzLjAyOCAzLjAyOCAwIDAgMC0uOTM3LjE2MiAyLjU4MyAyLjU4MyAwIDAgMC0uOC40bC0uMS4wNzd2MS4ybC40MjMtLjM1OWEyLjEgMi4xIDAgMCAxIDEuMzY2LS41NzIuNzU3Ljc1NyAwIDAgMSAuNjYxLjI4MmMuMTUuMjMyLjIzLjUwMy4yMzEuNzc5bC0xLjIzMy4xODFhMi41OTggMi41OTggMCAwIDAtMS4zNzguNTc1IDEuNjUgMS42NSAwIDAgMC0uMDIyIDIuMzM2IDEuNzQgMS43NCAwIDAgMCAxLjI1My40NTQgMS45NiAxLjk2IDAgMCAwIDEuMTA3LS4zMzIgMi4xOSAyLjE5IDAgMCAwIC4yODYtLjIyOXYuNDQ0aC45NDF2LTMuMzU4YTIuMTk2IDIuMTk2IDAgMCAwLS40NjktMS41IDEuNjkgMS42OSAwIDAgMC0xLjMyOS0uNTR6bS44NTcgMy4wNDFjLjAyLjQxOC0uMTIuODI5LS4zOTEgMS4xNDhhMS4yMiAxLjIyIDAgMCAxLS45NTUuNDIyLjgzLjgzIDAgMCAxLS42MDgtLjIuODM0LjgzNCAwIDAgMSAwLTEuMDkxYy4yODEtLjE3NC42LS4yNzcuOTMtLjNsMS4wMi0uMTQ4LjAwNC4xNjl6bTguMzEzIDIuMzE2Yy4zMDcuMTMyLjYzOS4xOTQuOTczLjE4My40OTUuMDEyLjk4My0uMTE0IDEuNDEtLjM2NWwuMTIzLS4wNzUuMDEzLS4wMDd2LTEuMTUzbC0uNDQ2LjMyYy0uMzE2LjIyNC0uNjk2LjM0LTEuMDg0LjMyOWExLjMwMyAxLjMwMyAwIDAgMS0xLjA0OC0uNDY0IDEuOTc4IDEuOTc4IDAgMCAxLS40LTEuMzEyYy0uMDI2LS41LjEzNS0uOTkzLjQ1My0xLjM4MWExLjQzNyAxLjQzNyAwIDAgMSAxLjE0Ny0uNTA3Yy4zNDQtLjAwMi42ODEuMDk1Ljk3MS4yNzlsLjQyOS4yNjVWMjcuOTdsLS4xNjktLjA3M2EyLjg5OSAyLjg5OSAwIDAgMC0xLjE3LS4yNDcgMi41MiAyLjUyIDAgMCAwLTEuOTI5LjgxNyAyLjkwMSAyLjkwMSAwIDAgMC0uNzQ3IDIuMDQ5Yy0uMDI4LjcwOC4yMTEgMS40LjY2OSAxLjkzOS4yMjMuMjQ5LjQ5OC40NDYuODA1LjU3OHoiIGZpbGw9IiNDNUM1QzUiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIwOS4yMjMgMTIuOTMzYy4zMjYuMTkyLjY5OS4yOSAxLjA3Ny4yODJhMi4xNTUgMi4xNTUgMCAwIDAgMS43NTQtLjg0MiAzLjI5NCAzLjI5NCAwIDAgMCAuNjU0LTIuMTEzIDIuODkgMi44OSAwIDAgMC0uNTc2LTEuODc3IDEuOTg3IDEuOTg3IDAgMCAwLTEuNjM0LS43MzMgMi4yOTMgMi4yOTMgMCAwIDAtMS41MjMuNTY3VjUuNDc1aC0uOTkxVjEzLjFoLjk5NXYtLjM0NGMuMDc2LjA2Ni4xNTguMTI1LjI0NC4xNzd6bS42MjctNC4yMzNjLjE4Ni0uMDc5LjM4OC0uMTEzLjU5LS4xYTEuMDggMS4wOCAwIDAgMSAuODk2LjQyOGMuMjU3LjM2My4zODIuODAyLjM1NyAxLjI0NWEyLjQ4MyAyLjQ4MyAwIDAgMS0uNCAxLjQ4NCAxLjE0MSAxLjE0MSAwIDAgMS0uOTYuNTA4IDEuMjI1IDEuMjI1IDAgMCAxLS45NzYtLjQxNyAxLjUyMyAxLjUyMyAwIDAgMS0uMzgyLTEuMDQ4di0uNmExLjcyMyAxLjcyMyAwIDAgMSAuMzkzLTEuMTQ1Yy4xMzEtLjE1NC4yOTYtLjI3Ni40ODItLjM1NXptLTQuNTYxLTEuMDI1YTMuMDMgMy4wMyAwIDAgMC0uOTM3LjE2MiAyLjU4NCAyLjU4NCAwIDAgMC0uOC40bC0uMS4wNzd2MS4ybC40MjMtLjM1OWEyLjEgMi4xIDAgMCAxIDEuMzY2LS41NzIuNzU3Ljc1NyAwIDAgMSAuNjYxLjI4MmMuMTUuMjMyLjIzLjUwMy4yMzEuNzc5bC0xLjIzMy4xODFhMi41OTggMi41OTggMCAwIDAtMS4zNzguNTc1IDEuNjUgMS42NSAwIDAgMC0uMDIyIDIuMzM2IDEuNzQgMS43NCAwIDAgMCAxLjI1My40NTQgMS45NiAxLjk2IDAgMCAwIDEuMTA3LS4zMzIgMi4xOSAyLjE5IDAgMCAwIC4yODYtLjIyOXYuNDQ0aC45NDFWOS43MTVhMi4xOTYgMi4xOTYgMCAwIDAtLjQ2OS0xLjUgMS42OSAxLjY5IDAgMCAwLTEuMzI5LS41NHptLjg1NyAzLjA0MWMuMDIuNDE4LS4xMi44MjktLjM5MSAxLjE0OGExLjIyIDEuMjIgMCAwIDEtLjk1NS40MjIuODMuODMgMCAwIDEtLjYwOC0uMi44MzQuODM0IDAgMCAxIDAtMS4wOTFjLjI4MS0uMTc0LjYtLjI3Ny45My0uM2wxLjAyLS4xNDguMDA0LjE2OXptOC4zMTMgMi4zMTdjLjMwNy4xMy42MzkuMTkzLjk3My4xODIuNDk1LjAxMi45ODMtLjExNCAxLjQxLS4zNjVsLjEyMy0uMDc1LjAxMy0uMDA3di0xLjE1M2wtLjQ0Ni4zMmMtLjMxNi4yMjQtLjY5Ni4zNC0xLjA4NC4zMjlhMS4zMDMgMS4zMDMgMCAwIDEtMS4wNDgtLjQ2NCAxLjk3OCAxLjk3OCAwIDAgMS0uNC0xLjMxMmMtLjAyNi0uNS4xMzUtLjk5My40NTMtMS4zODFBMS40MzYgMS40MzYgMCAwIDEgMjE1LjYgOC42Yy4zNDQtLjAwMi42ODEuMDk1Ljk3MS4yNzlsLjQyOS4yNjVWNy45N2wtLjE2OS0uMDczYTIuODk4IDIuODk4IDAgMCAwLTEuMTctLjI0NyAyLjUyIDIuNTIgMCAwIDAtMS45MjkuODE3IDIuOSAyLjkgMCAwIDAtLjc0NyAyLjA0OWMtLjAyOC43MDcuMjExIDEuNC42NjkgMS45MzkuMjIzLjI0OS40OTguNDQ2LjgwNS41Nzh6TTI2NiAzbC0xIDF2MTJsMSAxaDlsMS0xVjdsLS4yOTMtLjcwNy0zLTNMMjcyIDNoLTZ6bTAgMTNWNGg1djRoNHY4aC05em05LTlsLTMtM3YzaDN6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yNjYgMjNsLTEgMXYxMmwxIDFoOWwxLTF2LTlsLS4yOTMtLjcwNy0zLTNMMjcyIDIzaC02em0wIDEzVjI0aDV2NGg0djhoLTl6bTktOWwtMy0zdjNoM3oiIGZpbGw9IiNDNUM1QzUiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEzMCAyNGwtMSAxdjNoMXYtM2g2djVoLTR2MWg0bDEtMXYtNWwtMS0xaC02em0xIDZsLTEtMWgtNmwtMSAxdjVsMSAxaDZsMS0xdi01em0tMSAxdi0xaC02djVoNnYtNHptMS0yLjQxNGwuNDE0LjQxNEgxMzV2LTFoLTR2LjU4NnpNMTM1IDI2aC00djFoNHYtMXptLTYgNWgtNHYxaDR2LTF6bS00IDJoNHYxaC00di0xeiIgZmlsbD0iI0VFOUQyOCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTMwIDRsLTEgMXYzaDFWNWg2djVoLTR2MWg0bDEtMVY1bC0xLTFoLTZ6bTEgNmwtMS0xaC02bC0xIDF2NWwxIDFoNmwxLTF2LTV6bS0xIDF2LTFoLTZ2NWg2di00em0xLTIuNDE0bC40MTQuNDE0SDEzNVY4aC00di41ODZ6TTEzNSA2aC00djFoNFY2em0tNiA1aC00djFoNHYtMXptLTQgMmg0djFoLTR2LTF6IiBmaWxsPSIjRDY3RTAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yNDYgM2wtMSAxdjEybDEgMWg4bDEtMVY0bC0xLTFoLTh6bTAgMlY0aDh2MTJoLTh2LTFoMnYtMWgtMnYtMmg0di0xaC00VjloMlY4aC0yVjZoNFY1aC00eiIgZmlsbD0iIzQyNDI0MiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjQ2IDIzbC0xIDF2MTJsMSAxaDhsMS0xVjI0bC0xLTFoLTh6bTAgMnYtMWg4djEyaC04di0xaDJ2LTFoLTJ2LTJoNHYtMWgtNHYtMmgydi0xaC0ydi0yaDR2LTFoLTR6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+");background-repeat:no-repeat;background-position:-2px -22px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.constructor,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.function,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.method{background-position:-2px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.field,.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.variable{background-position:-22px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.class{background-position:-42px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.interface{background-position:-62px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.module{background-position:-82px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.property{background-position:-102px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.enum{background-position:-122px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.string{background-position:-202px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.rule{background-position:-242px -2px}.monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.file{background-position:-262px -2px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.constructor,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.function,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.method{background-position:-2px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.field,.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.variable{background-position:-22px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.class{background-position:-43px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.interface{background-position:-63px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.module{background-position:-82px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.property{background-position:-102px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.enum{background-position:-122px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.string{background-position:-202px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.rule{background-position:-242px -22px}.vs-dark .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.file{background-position:-262px -22px}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon{background:none;display:inline}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon:before{height:16px;width:16px;display:inline-block}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.constructor:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.function:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.method:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yIDQuODU3TDIuNDg2IDRsNS0zaDEuMDI5bDUgMyAuNDg1Ljg1N3Y2bC0uNDg2Ljg1OC01IDNINy40ODZsLTUtM0wyIDEwLjg1OHYtNnptNS41IDguN2wtNC41LTIuN1Y1LjdsNC41IDIuNDU0djUuNDAzem0xIDBsNC41LTIuN1Y1LjdMOC41IDguMTU0djUuNDAzek04IDEuODU3TDMuMjYgNC43MDIgOCA3LjI4OGw0Ljc0LTIuNTg2TDggMS44NTd6IiBmaWxsPSIjQjE4MEQ3Ii8+PC9zdmc+)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.field:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.variable:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDYuMzk0bC41NTMtLjg5NCA3LTMuNWguODk0bDUgMi41LjU1My44OTR2NC41bC0uNTUzLjg5NS03IDMuNWgtLjg5NGwtNS0yLjVMMSAxMC44OTR2LTQuNXptNS41IDYuNzVMMiAxMC44OTRWNy4xNzFsNC41IDIuMDQ1djMuOTI4em0xIDBsNi41LTMuMjVWNi4xOEw3LjUgOS4yMTN2My45MzF6TTkgMi44OTRMMi4zMzcgNi4yMjZsNC42NiAyLjExOCA2LjY3NC0zLjExNEw5IDIuODk0eiIgZmlsbD0iIzc1QkVGRiIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.class:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjM1NCA2LjY0NkwyLjA2IDUuMzU0IDUuMzU0IDIuMDZsMS4yOTIgMS4yOTMtMy4yOTIgMy4yOTJ6TTUgMUwxIDV2LjcwN2wyIDJoLjcwN2wxLjE0Ny0xLjE0NnY1Ljc5M2wuNS41aDQuNjU2di41MmwxLjMzMyAxLjMzM2guNzA3bDIuNjY3LTIuNjY2di0uNzA3TDEzLjM4MyAxMGgtLjcwN2wtMS44NTMgMS44NTRoLTQuOTd2LTMuOTZoNC4xNTd2LjQ4bDEuMzMzIDEuMzMzaC43MDdsMi42NjctMi42NjZ2LS43MDdMMTMuMzgzIDVoLS43MDdsLTEuODEzIDEuODE0aC01LjAxVjUuNTZsMS44NTQtMS44NTRWM2wtMi0ySDV6bTYuMDcgNy4wMmwuNjI3LjYyNyAxLjk2LTEuOTYtLjYyNy0uNjI2LTEuOTYgMS45NnptMCA1bC42MjcuNjI3IDEuOTYtMS45Ni0uNjI3LS42MjYtMS45NiAxLjk2eiIgZmlsbD0iI0VFOUQyOCIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.interface:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS41IDVhMi41IDIuNSAwIDEgMCAwIDUgMi41IDIuNSAwIDAgMCAwLTV6TTguMDM1IDhhMy41IDMuNSAwIDEgMCAwLTFINC45MzdhMiAyIDAgMSAwIDAgMWgzLjA5OHoiIGZpbGw9IiM3NUJFRkYiLz48L3N2Zz4=)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.module:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDIuOTg0VjJoLS4wOWMtLjMxMyAwLS42MTYuMDYyLS45MDkuMTg1YTIuMzMgMi4zMyAwIDAgMC0uNzc1LjUzIDIuMjMgMi4yMyAwIDAgMC0uNDkzLjc1M3YuMDAxYTMuNTQyIDMuNTQyIDAgMCAwLS4xOTguODN2LjAwMmE2LjA4IDYuMDggMCAwIDAtLjAyNC44NjNjLjAxMi4yOS4wMTguNTguMDE4Ljg2OSAwIC4yMDMtLjA0LjM5My0uMTE3LjU3MnYuMDAxYTEuNTA0IDEuNTA0IDAgMCAxLS43NjUuNzg3IDEuMzc2IDEuMzc2IDAgMCAxLS41NTguMTE1SDJ2Ljk4NGguMDljLjE5NSAwIC4zOC4wNC41NTYuMTIxbC4wMDEuMDAxYy4xNzguMDc4LjMyOS4xODQuNDU1LjMxOGwuMDAyLjAwMmMuMTMuMTMuMjMzLjI4NS4zMDcuNDY1bC4wMDEuMDAyYy4wNzguMTguMTE3LjM2OC4xMTcuNTY2IDAgLjI5LS4wMDYuNTgtLjAxOC44NjktLjAxMi4yOTYtLjAwNC41ODUuMDI0Ljg3di4wMDFjLjAzMy4yODMuMDk5LjU1OC4xOTcuODI0di4wMDFjLjEwNi4yNzMuMjcxLjUyNC40OTQuNzUzLjIyMy4yMy40ODIuNDA3Ljc3NS41My4yOTMuMTIzLjU5Ni4xODUuOTEuMTg1SDZ2LS45ODRoLS4wOWMtLjE5OSAwLS4zODctLjAzOC0uNTYyLS4xMTVhMS42MTMgMS42MTMgMCAwIDEtLjQ1Ny0uMzIgMS42NTkgMS42NTkgMCAwIDEtLjMwOS0uNDY3Yy0uMDc0LS4xOC0uMTEtLjM3LS4xMS0uNTczIDAtLjIyOC4wMDMtLjQ1My4wMTEtLjY3Mi4wMDgtLjIyOC4wMDgtLjQ1IDAtLjY2NWE0LjYzOSA0LjYzOSAwIDAgMC0uMDU1LS42NCAyLjY4MiAyLjY4MiAwIDAgMC0uMTY4LS42MDlBMi4yODQgMi4yODQgMCAwIDAgMy41MjIgOGEyLjI4NCAyLjI4NCAwIDAgMCAuNzM4LS45NTVjLjA4LS4xOTIuMTM1LS4zOTMuMTY4LS42MDIuMDMzLS4yMS4wNTEtLjQyMy4wNTUtLjY0LjAwOC0uMjIuMDA4LS40NDIgMC0uNjY2LS4wMDgtLjIyNC0uMDEyLS40NS0uMDEyLS42NzhhMS40NyAxLjQ3IDAgMCAxIC44NzctMS4zNTQgMS4zMyAxLjMzIDAgMCAxIC41NjMtLjEyMUg2em00IDEwLjAzMlYxNGguMDljLjMxMyAwIC42MTYtLjA2Mi45MDktLjE4NS4yOTMtLjEyMy41NTItLjMuNzc1LS41My4yMjMtLjIzLjM4OC0uNDguNDkzLS43NTN2LS4wMDFjLjEtLjI2Ni4xNjUtLjU0My4xOTgtLjgzdi0uMDAyYy4wMjgtLjI4LjAzNi0uNTY3LjAyNC0uODYzLS4wMTItLjI5LS4wMTgtLjU4LS4wMTgtLjg2OSAwLS4yMDMuMDQtLjM5My4xMTctLjU3MnYtLjAwMWExLjUwNCAxLjUwNCAwIDAgMSAuNzY1LS43ODdjLjE3Ni0uMDc3LjM2Mi0uMTE1LjU1OC0uMTE1SDE0di0uOTg0aC0uMDljLS4xOTUgMC0uMzgtLjA0LS41NTYtLjEyMWwtLjAwMS0uMDAxYTEuMzc2IDEuMzc2IDAgMCAxLS40NTUtLjMxOGwtLjAwMi0uMDAyYTEuNDE0IDEuNDE0IDAgMCAxLS4zMDctLjQ2NWwtLjAwMS0uMDAyYTEuNDA1IDEuNDA1IDAgMCAxLS4xMTctLjU2NmMwLS4yOS4wMDYtLjU4LjAxOC0uODY5YTYuMTkgNi4xOSAwIDAgMC0uMDI0LS44N3YtLjAwMWEzLjU0MiAzLjU0MiAwIDAgMC0uMTk3LS44MjR2LS4wMDFhMi4yMyAyLjIzIDAgMCAwLS40OTQtLjc1MyAyLjMzIDIuMzMgMCAwIDAtLjc3NS0uNTMgMi4zMjUgMi4zMjUgMCAwIDAtLjkxLS4xODVIMTB2Ljk4NGguMDljLjIgMCAuMzg2LjAzOC41NjIuMTE1LjE3NC4wODIuMzI2LjE4OC40NTcuMzIuMTI3LjEzNC4yMy4yOS4zMDkuNDY3LjA3NC4xOC4xMS4zNy4xMS41NzMgMCAuMjI4LS4wMDMuNDUyLS4wMTEuNjcyLS4wMDguMjI4LS4wMDguNDUgMCAuNjY1LjAwNC4yMjIuMDIyLjQzNS4wNTUuNjQuMDMzLjIxNC4wODkuNDE2LjE2OC42MDlhMi4yODIgMi4yODIgMCAwIDAgLjczOC45NTUgMi4yODIgMi4yODIgMCAwIDAtLjczOC45NTUgMi43IDIuNyAwIDAgMC0uMTY4LjYwMmMtLjAzMy4yMS0uMDUxLjQyMy0uMDU1LjY0LS4wMDguMjItLjAwOC40NDIgMCAuNjY2LjAwOC4yMjQuMDEyLjQ1LjAxMi42NzhhMS40NyAxLjQ3IDAgMCAxLS40MiAxLjAzNSAxLjQ2NiAxLjQ2NiAwIDAgMS0uNDU3LjMxOSAxLjMzIDEuMzMgMCAwIDEtLjU2My4xMjFIMTB6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.property:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuODA3IDE0Ljk3NWExLjc1IDEuNzUgMCAwIDEtMS4yNTUtLjU1NiAxLjY4NCAxLjY4NCAwIDAgMS0uNTQ0LTEuMUExLjcyIDEuNzIgMCAwIDEgMS4zNiAxMi4xQzIuNTY4IDEwLjgzIDQuOTQ3IDguNDUgNi42NzggNi43NTVhNC4yNTcgNC4yNTcgMCAwIDEgLjA0OC0zLjA3OCA0LjA5NSA0LjA5NSAwIDAgMSAxLjY2NS0xLjk2OSA0LjI1OSA0LjI1OSAwIDAgMSA0LjA0LS4zNmwuNjE3LjI2OC0yLjg2NiAyLjk1MSAxLjI1NSAxLjI1OSAyLjk0NC0yLjg3Ny4yNjcuNjE5YTQuMjk1IDQuMjk1IDAgMCAxIC4wNCAzLjMxMSA0LjE5OCA0LjE5OCAwIDAgMS0uOTIzIDEuMzkyIDQuMjcgNC4yNyAwIDAgMS0uNzQzLjU4MSA0LjIxNyA0LjIxNyAwIDAgMS0zLjgxMi40NDZDOC4xMTIgMTAuNDEgNS4zNyAxMy4xNyAzLjg5IDE0LjU1MmExLjYzIDEuNjMgMCAwIDEtMS4wODQuNDIzem03LjkzOC0xMy4wNDdhMy4zMiAzLjMyIDAgMCAwLTEuODQ5LjU1N2MtLjIxMy4xMy0uNDEyLjI4NC0uNTkxLjQ1OGEzLjMyMSAzLjMyMSAwIDAgMC0uNjU3IDMuNzMzbC4xMzUuMjk3LS4yMzMuMjI3Yy0xLjczOCAxLjY5Ny00LjI2OSA0LjIyLTUuNDg1IDUuNTA0YS44MDUuODA1IDAgMCAwIC4xMzIgMS4wNS45MTEuOTExIDAgMCAwIC4yOTguMjJjLjEuMDQ0LjIwOS4wNjkuMzE5LjA3MmEuNjk0LjY5NCAwIDAgMCAuNDUtLjE4MWMxLjU3My0xLjQ2OSA0LjYxMi00LjUzOSA1LjUwNC01LjQ0bC4yMy0uMjMyLjI5NC4xMzVhMy4yODYgMy4yODYgMCAwIDAgMy4yMjUtLjI1NCAzLjMzIDMuMzMgMCAwIDAgLjU5MS0uNDY0IDMuMjggMy4yOCAwIDAgMCAuOTY0LTIuMzU4YzAtLjIxNS0uMDIxLS40My0uMDY0LS42NDJMMTEuNDMgNy4xMjUgOC44NzkgNC41NzhsMi41MTUtMi41OWEzLjI4NiAzLjI4NiAwIDAgMC0uNjUtLjA2eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.enum:before,.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.value:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDJMNyAzdjNoMVYzaDZ2NWgtNHYxaDRsMS0xVjNsLTEtMUg4em0xIDZMOCA3SDJMMSA4djVsMSAxaDZsMS0xVjh6TTggOVY4SDJ2NWg2Vjl6bTEtMi40MTRMOS40MTQgN0gxM1Y2SDl2LjU4NnpNMTMgNEg5djFoNFY0ek03IDlIM3YxaDRWOXptLTQgMmg0djFIM3YtMXoiIGZpbGw9IiNFRTlEMjgiLz48L3N2Zz4=)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.rule:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDFMMyAydjEybDEgMWg4bDEtMVYybC0xLTFINHptMCAyVjJoOHYxMkg0di0xaDJ2LTFINHYtMmg0VjlINFY3aDJWNkg0VjRoNFYzSDR6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.file:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDFMMyAydjEybDEgMWg5bDEtMVY1bC0uMjkzLS43MDctMy0zTDEwIDFINHptMCAxM1YyaDV2NGg0djhINHptOS05bC0zLTN2M2gzeiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==)}.hc-black .monaco-quick-open-widget .quick-open-tree .quick-open-entry .quick-open-entry-icon.string:before{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjIyMyAxMC45MzNjLjMyNi4xOTIuNjk5LjI5IDEuMDc3LjI4MmEyLjE1OSAyLjE1OSAwIDAgMCAxLjc1NC0uODQyIDMuMjkxIDMuMjkxIDAgMCAwIC42NTQtMi4xMTMgMi44ODYgMi44ODYgMCAwIDAtLjU3Ni0xLjg3NyAxLjk5IDEuOTkgMCAwIDAtMS42MzQtLjczMyAyLjI5NCAyLjI5NCAwIDAgMC0xLjUyMy41NjdWMy40NzVoLS45OTFWMTEuMWguOTk1di0uMzQ0Yy4wNzYuMDY2LjE1OC4xMjUuMjQ0LjE3N3pNNy44NSA2LjdjLjE4Ni0uMDc5LjM4OC0uMTEzLjU5LS4xYTEuMDggMS4wOCAwIDAgMSAuODk2LjQyOGMuMjU3LjM2My4zODIuODAyLjM1NyAxLjI0NWEyLjQ4NSAyLjQ4NSAwIDAgMS0uNCAxLjQ4NCAxLjEzMyAxLjEzMyAwIDAgMS0uOTYuNTA4IDEuMjI0IDEuMjI0IDAgMCAxLS45NzYtLjQxN0ExLjUyMiAxLjUyMiAwIDAgMSA2Ljk3NSA4Ljh2LS42YTEuNzIyIDEuNzIyIDAgMCAxIC4zOTMtMS4xNDVjLjEzLS4xNTQuMjk2LS4yNzYuNDgyLS4zNTV6TTMuMjg5IDUuNjc1YTMuMDMgMy4wMyAwIDAgMC0uOTM3LjE2MiAyLjU5IDIuNTkgMCAwIDAtLjguNGwtLjEuMDc3djEuMmwuNDIzLS4zNTlhMi4xIDIuMSAwIDAgMSAxLjM2Ni0uNTcyLjc1OC43NTggMCAwIDEgLjY2MS4yODJjLjE1LjIzMi4yMy41MDMuMjMxLjc3OUwyLjkgNy44MjVhMi42IDIuNiAwIDAgMC0xLjM3OC41NzUgMS42NSAxLjY1IDAgMCAwLS4wMjIgMi4zMzYgMS43MzcgMS43MzcgMCAwIDAgMS4yNTMuNDU0IDEuOTYgMS45NiAwIDAgMCAxLjEwNy0uMzMyYy4xMDItLjA2OC4xOTctLjE0NS4yODYtLjIyOXYuNDQ0aC45NDFWNy43MTVhMi4xOTMgMi4xOTMgMCAwIDAtLjQ2OS0xLjUgMS42ODcgMS42ODcgMCAwIDAtMS4zMjktLjU0em0uODU3IDMuMDQxYy4wMi40MTgtLjEyLjgyOS0uMzkxIDEuMTQ4YTEuMjIxIDEuMjIxIDAgMCAxLS45NTUuNDIyLjgzMi44MzIgMCAwIDEtLjYwOC0uMi44MzMuODMzIDAgMCAxIDAtMS4wOTFjLjI4MS0uMTc0LjYtLjI3Ny45My0uM2wxLjAyLS4xNDguMDA0LjE2OXptOC4zMTMgMi4zMTdjLjMwNy4xMy42NC4xOTMuOTczLjE4Mi40OTUuMDEyLjk4My0uMTE0IDEuNDEtLjM2NWwuMTIzLS4wNzUuMDEzLS4wMDdWOS42MTVsLS40NDYuMzJjLS4zMTYuMjI0LS42OTYuMzQtMS4wODQuMzI5QTEuMyAxLjMgMCAwIDEgMTIuNCA5LjhhMS45NzUgMS45NzUgMCAwIDEtLjQtMS4zMTIgMi4wMSAyLjAxIDAgMCAxIC40NTMtMS4zODFBMS40MzIgMS40MzIgMCAwIDEgMTMuNiA2LjZhMS44IDEuOCAwIDAgMSAuOTcxLjI3OWwuNDMuMjY1VjUuOTdsLS4xNy0uMDczYTIuOSAyLjkgMCAwIDAtMS4xNy0uMjQ3IDIuNTIgMi41MiAwIDAgMC0xLjkyOS44MTcgMi45IDIuOSAwIDAgMC0uNzQ3IDIuMDQ5Yy0uMDI4LjcwNy4yMSAxLjQuNjcgMS45MzkuMjIyLjI0OS40OTcuNDQ2LjgwNC41Nzh6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+)}.monaco-editor .rename-box{z-index:100;color:inherit}.monaco-editor .rename-box .rename-input{padding:4px}.monaco-editor .snippet-placeholder{min-width:2px}.monaco-editor .finish-snippet-placeholder,.monaco-editor .snippet-placeholder{outline-style:solid;outline-width:1px}.monaco-editor .suggest-widget{z-index:40;width:430px}.monaco-editor .suggest-widget>.details,.monaco-editor .suggest-widget>.message,.monaco-editor .suggest-widget>.tree{width:100%;border-style:solid;border-width:1px;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.hc-black .suggest-widget>.details,.monaco-editor.hc-black .suggest-widget>.message,.monaco-editor.hc-black .suggest-widget>.tree{border-width:2px}.monaco-editor .suggest-widget.docs-side{width:660px}.monaco-editor .suggest-widget.docs-side>.details,.monaco-editor .suggest-widget.docs-side>.tree{width:50%;float:left}.monaco-editor .suggest-widget.docs-side.list-right>.details,.monaco-editor .suggest-widget.docs-side.list-right>.tree{float:right}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%}.monaco-editor .suggest-widget .monaco-list{-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;-o-user-select:none;user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:-webkit-box;display:-ms-flexbox;display:flex;-mox-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;-ms-touch-action:none;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{-webkit-box-flex:1;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore{opacity:.6;background-position:50%;background-repeat:no-repeat;background-size:70%;cursor:pointer}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ2LjcwNy0uNzA3TDguNzA3IDhsMy42NDYtMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDdMOCA4LjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=");position:absolute;top:0;right:0;margin-right:5px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDcuNWE1LjUgNS41IDAgMSAxIDExIDAgNS41IDUuNSAwIDAgMS0xMSAwem0tMSAwYTYuNSA2LjUgMCAxIDEgMTMgMCA2LjUgNi41IDAgMCAxLTEzIDB6TTggNVY0aDF2MUg4em0wIDVWNmgxdjRIOHoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.type-label{margin-left:.8em;-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:right;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.type-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row.focused>.contents>.main>.readMore,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused>.contents>.main>.readMore,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused>.contents>.main>.type-label,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.type-label{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main>.readMore,.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main>.type-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-description-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:50%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .monaco-icon-label.suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.suggest-icon:before{content:" ";background-repeat:no-repeat;background-position:50%;background-size:75%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor:before,.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function:before,.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yIDQuODU3TDIuNDg2IDRsNS0zaDEuMDI5bDUgMyAuNDg1Ljg1N3Y2bC0uNDg2Ljg1OC01IDNINy40ODZsLTUtM0wyIDEwLjg1OHYtNnptNS41IDguN2wtNC41LTIuN1Y1LjdsNC41IDIuNDU0djUuNDAzem0xIDBsNC41LTIuN1Y1LjdMOC41IDguMTU0djUuNDAzek04IDEuODU3TDMuMjYgNC43MDIgOCA3LjI4OGw0Ljc0LTIuNTg2TDggMS44NTd6IiBmaWxsPSIjNjUyRDkwIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDYuMzk0bC41NTMtLjg5NCA3LTMuNWguODk0bDUgMi41LjU1My44OTR2NC41bC0uNTUzLjg5NS03IDMuNWgtLjg5NGwtNS0yLjVMMSAxMC44OTR2LTQuNXptNS41IDYuNzVMMiAxMC44OTRWNy4xNzFsNC41IDIuMDQ1djMuOTI4em0xIDBsNi41LTMuMjVWNi4xOEw3LjUgOS4yMTN2My45MzF6TTkgMi44OTRMMi4zMzcgNi4yMjZsNC42NiAyLjExOCA2LjY3NC0zLjExNEw5IDIuODk0eiIgZmlsbD0iIzAwN0FDQyIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQxNCAxLjU2TDguMzEyIDFoMy4yOTRsLjgxOCAxLjU3NUwxMC4yMzYgNmgxLjc4MWwuNzIgMS42OTVMNS42MTggMTVsLTEuNjAyLTEuMTYzTDYuMTE5IDEwSDQuODk4TDQgOC41NmwzLjQxNC03ek03Ljc4IDlMNC45IDE0LjMwNSAxMi4wMTggN0g4LjMxMmwzLjI5NC01SDguMzEyTDQuODk4IDlINy43OHoiIGZpbGw9IiNENjdFMDAiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yLjg3MyAxLjFjLjMzNS4xMzYuNjAyLjM5OC43NDUuNzMuMDcyLjE3LjEwOS4zNTIuMTA3LjUzN2ExLjM0IDEuMzQgMCAwIDEtLjYxIDEuMTM1IDEuMzU5IDEuMzU5IDAgMCAxLS43NTMuMjIzQTEuMzU1IDEuMzU1IDAgMCAxIDEgMi4zNjJhMS4zNTUgMS4zNTUgMCAwIDEgLjgzLTEuMjU2Yy4zMzMtLjE0LjcwOC0uMTQxIDEuMDQzLS4wMDZ6bS0uMjk4IDEuNzY1YS41NTEuNTUxIDAgMCAwIC4zMzItLjUuNTQ4LjU0OCAwIDEgMC0uMzMyLjV6TTYuNDMgMS4xMDlMMS4xMSA2LjQzbC42ODYuNjg3IDUuMzItNS4zMi0uNjg2LS42ODd6TTExLjUgOWgxdjIuNUgxNXYxaC0yLjVWMTVoLTF2LTIuNUg5di0xaDIuNVY5em0tNS43MzIuNTI1bC43MDcuNzA3TDQuNzA3IDEybDEuNzY4IDEuNzY4LS43MDcuNzA3TDQgMTIuNzA3bC0xLjc2OCAxLjc2OC0uNzA3LS43MDdMMy4yOTMgMTJsLTEuNzY4LTEuNzY4LjcwNy0uNzA3TDQgMTEuMjkzbDEuNzY4LTEuNzY4em0xLjM1LTQuMTk1YTEuMzUzIDEuMzUzIDAgMCAwLTEuMjU2LS44MyAxLjM1NSAxLjM1NSAwIDAgMC0xLjI1Ni44MyAxLjM2MiAxLjM2MiAwIDAgMCAxLjI1NyAxLjg5NUExLjM1OCAxLjM1OCAwIDAgMCA3LjExOCA1LjMzem0tLjc1My43NDVhLjU1My41NTMgMCAwIDEtLjI4OS4yOS41NDcuNTQ3IDAgMCAxLS41OTktLjExNy41MjkuNTI5IDAgMCAxLS4xMTctLjE3My41NDQuNTQ0IDAgMCAxIC43MTYtLjcxNS41NjUuNTY1IDAgMCAxIC4xNzMuMTE2LjU0OS41NDkgMCAwIDEgLjExNi41OTl6TTE0IDNoLTR2MWg0VjN6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjUgNGwtLjUuNXY4bC41LjVINHYtMUgyVjVoMlY0SDEuNXptMTMgOWwuNS0uNXYtOGwtLjUtLjVIMTJ2MWgydjdoLTJ2MWgyLjV6TTguNzk3IDVsLTQuNSAyTDQgNy40NTd2Mi41bC4yNDMuNDI5IDIuNSAxLjUuNDYuMDI4IDQuNS0yTDEyIDkuNDU3di0yLjVsLS4yNDMtLjQyOS0yLjUtMS41TDguNzk3IDV6TTUgOC4zNHYxLjMzNGwxLjUuOVY5LjI0TDUgOC4zNHptMi41Ljk0MnYxLjQwNUwxMSA5LjEzM1Y3LjcyNkw3LjUgOS4yODJ6bTIuOTE4LTIuMzkxbC0xLjQ1Mi0uODcyLTMuMzg0IDEuNTA0IDEuNDUyLjg3MSAzLjM4NC0xLjUwM3oiIGZpbGw9IiMwMDdBQ0MiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjM1NCA2LjY0NkwyLjA2IDUuMzU0IDUuMzU0IDIuMDZsMS4yOTIgMS4yOTMtMy4yOTIgMy4yOTJ6TTUgMUwxIDV2LjcwN2wyIDJoLjcwN2wxLjE0Ny0xLjE0NnY1Ljc5M2wuNS41aDQuNjU2di41MmwxLjMzMyAxLjMzM2guNzA3bDIuNjY3LTIuNjY2di0uNzA3TDEzLjM4MyAxMGgtLjcwN2wtMS44NTMgMS44NTRoLTQuOTd2LTMuOTZoNC4xNTd2LjQ4bDEuMzMzIDEuMzMzaC43MDdsMi42NjctMi42NjZ2LS43MDdMMTMuMzgzIDVoLS43MDdsLTEuODEzIDEuODE0aC01LjAxVjUuNTZsMS44NTQtMS44NTRWM2wtMi0ySDV6bTYuMDcgNy4wMmwuNjI3LjYyNyAxLjk2LTEuOTYtLjYyNy0uNjI2LTEuOTYgMS45NnptMCA1bC42MjcuNjI3IDEuOTYtMS45Ni0uNjI3LS42MjYtMS45NiAxLjk2eiIgZmlsbD0iI0Q2N0UwMCIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS41IDVhMi41IDIuNSAwIDEgMCAwIDUgMi41IDIuNSAwIDAgMCAwLTV6TTguMDM1IDhhMy41IDMuNSAwIDEgMCAwLTFINC45MzdhMiAyIDAgMSAwIDAgMWgzLjA5OHoiIGZpbGw9IiMwMDdBQ0MiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yIDJMMSAzdjNsMSAxaDEybDEtMVYzbC0xLTFIMnptMCAxaDEydjNIMlYzem0tMSA3bDEtMWgzbDEgMXYzbC0xIDFIMmwtMS0xdi0zem0yIDBIMnYzaDN2LTNIM3ptNyAwbDEtMWgzbDEgMXYzbC0xIDFoLTNsLTEtMXYtM3ptMiAwaC0xdjNoM3YtM2gtMnoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMSA2aC0xdi0uNWEuNS41IDAgMCAwLS41LS41SDguNDc5djUuNWEuNS41IDAgMCAwIC41LjVoLjV2MWgtM3YtMWguNWEuNS41IDAgMCAwIC41LS41VjVINi41YS41LjUgMCAwIDAtLjUuNVY2SDVWNGg2djJ6bTIuOTE0IDIuMDQ4bC0xLjQ2Mi0xLjQ2Mi43MDctLjcwNyAxLjgxNiAxLjgxNnYuNzA3bC0xLjc2OCAxLjc2Ny0uNzA3LS43MDcgMS40MTQtMS40MTR6TTMuNTQ4IDkuNDYyTDIuMDg2IDggMy41IDYuNTg2bC0uNzA3LS43MDctMS43NjggMS43Njd2LjcwOGwxLjgxNiAxLjgxNS43MDctLjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDIuOTg0VjJoLS4wOWMtLjMxMyAwLS42MTYuMDYyLS45MDkuMTg1YTIuMzMgMi4zMyAwIDAgMC0uNzc1LjUzIDIuMjMgMi4yMyAwIDAgMC0uNDkzLjc1M3YuMDAxYTMuNTQyIDMuNTQyIDAgMCAwLS4xOTguODN2LjAwMmE2LjA4IDYuMDggMCAwIDAtLjAyNC44NjNjLjAxMi4yOS4wMTguNTguMDE4Ljg2OSAwIC4yMDMtLjA0LjM5My0uMTE3LjU3MnYuMDAxYTEuNTA0IDEuNTA0IDAgMCAxLS43NjUuNzg3IDEuMzc2IDEuMzc2IDAgMCAxLS41NTguMTE1SDJ2Ljk4NGguMDljLjE5NSAwIC4zOC4wNC41NTYuMTIxbC4wMDEuMDAxYy4xNzguMDc4LjMyOS4xODQuNDU1LjMxOGwuMDAyLjAwMmMuMTMuMTMuMjMzLjI4NS4zMDcuNDY1bC4wMDEuMDAyYy4wNzguMTguMTE3LjM2OC4xMTcuNTY2IDAgLjI5LS4wMDYuNTgtLjAxOC44NjktLjAxMi4yOTYtLjAwNC41ODUuMDI0Ljg3di4wMDFjLjAzMy4yODMuMDk5LjU1OC4xOTcuODI0di4wMDFjLjEwNi4yNzMuMjcxLjUyNC40OTQuNzUzLjIyMy4yMy40ODIuNDA3Ljc3NS41My4yOTMuMTIzLjU5Ni4xODUuOTEuMTg1SDZ2LS45ODRoLS4wOWMtLjE5OSAwLS4zODctLjAzOC0uNTYyLS4xMTVhMS42MTMgMS42MTMgMCAwIDEtLjQ1Ny0uMzIgMS42NTkgMS42NTkgMCAwIDEtLjMwOS0uNDY3Yy0uMDc0LS4xOC0uMTEtLjM3LS4xMS0uNTczIDAtLjIyOC4wMDMtLjQ1My4wMTEtLjY3Mi4wMDgtLjIyOC4wMDgtLjQ1IDAtLjY2NWE0LjYzOSA0LjYzOSAwIDAgMC0uMDU1LS42NCAyLjY4MiAyLjY4MiAwIDAgMC0uMTY4LS42MDlBMi4yODQgMi4yODQgMCAwIDAgMy41MjIgOGEyLjI4NCAyLjI4NCAwIDAgMCAuNzM4LS45NTVjLjA4LS4xOTIuMTM1LS4zOTMuMTY4LS42MDIuMDMzLS4yMS4wNTEtLjQyMy4wNTUtLjY0LjAwOC0uMjIuMDA4LS40NDIgMC0uNjY2LS4wMDgtLjIyNC0uMDEyLS40NS0uMDEyLS42NzhhMS40NyAxLjQ3IDAgMCAxIC44NzctMS4zNTQgMS4zMyAxLjMzIDAgMCAxIC41NjMtLjEyMUg2em00IDEwLjAzMlYxNGguMDljLjMxMyAwIC42MTYtLjA2Mi45MDktLjE4NS4yOTMtLjEyMy41NTItLjMuNzc1LS41My4yMjMtLjIzLjM4OC0uNDguNDkzLS43NTN2LS4wMDFjLjEtLjI2Ni4xNjUtLjU0My4xOTgtLjgzdi0uMDAyYy4wMjgtLjI4LjAzNi0uNTY3LjAyNC0uODYzLS4wMTItLjI5LS4wMTgtLjU4LS4wMTgtLjg2OSAwLS4yMDMuMDQtLjM5My4xMTctLjU3MnYtLjAwMWExLjUwNCAxLjUwNCAwIDAgMSAuNzY1LS43ODdjLjE3Ni0uMDc3LjM2Mi0uMTE1LjU1OC0uMTE1SDE0di0uOTg0aC0uMDljLS4xOTUgMC0uMzgtLjA0LS41NTYtLjEyMWwtLjAwMS0uMDAxYTEuMzc2IDEuMzc2IDAgMCAxLS40NTUtLjMxOGwtLjAwMi0uMDAyYTEuNDE0IDEuNDE0IDAgMCAxLS4zMDctLjQ2NWwtLjAwMS0uMDAyYTEuNDA1IDEuNDA1IDAgMCAxLS4xMTctLjU2NmMwLS4yOS4wMDYtLjU4LjAxOC0uODY5YTYuMTkgNi4xOSAwIDAgMC0uMDI0LS44N3YtLjAwMWEzLjU0MiAzLjU0MiAwIDAgMC0uMTk3LS44MjR2LS4wMDFhMi4yMyAyLjIzIDAgMCAwLS40OTQtLjc1MyAyLjMzIDIuMzMgMCAwIDAtLjc3NS0uNTMgMi4zMjUgMi4zMjUgMCAwIDAtLjkxLS4xODVIMTB2Ljk4NGguMDljLjIgMCAuMzg2LjAzOC41NjIuMTE1LjE3NC4wODIuMzI2LjE4OC40NTcuMzIuMTI3LjEzNC4yMy4yOS4zMDkuNDY3LjA3NC4xOC4xMS4zNy4xMS41NzMgMCAuMjI4LS4wMDMuNDUyLS4wMTEuNjcyLS4wMDguMjI4LS4wMDguNDUgMCAuNjY1LjAwNC4yMjIuMDIyLjQzNS4wNTUuNjQuMDMzLjIxNC4wODkuNDE2LjE2OC42MDlhMi4yODIgMi4yODIgMCAwIDAgLjczOC45NTUgMi4yODIgMi4yODIgMCAwIDAtLjczOC45NTUgMi43IDIuNyAwIDAgMC0uMTY4LjYwMmMtLjAzMy4yMS0uMDUxLjQyMy0uMDU1LjY0LS4wMDguMjItLjAwOC40NDIgMCAuNjY2LjAwOC4yMjQuMDEyLjQ1LjAxMi42NzhhMS40NyAxLjQ3IDAgMCAxLS40MiAxLjAzNSAxLjQ2NiAxLjQ2NiAwIDAgMS0uNDU3LjMxOSAxLjMzIDEuMzMgMCAwIDEtLjU2My4xMjFIMTB6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuODA3IDE0Ljk3NWExLjc1IDEuNzUgMCAwIDEtMS4yNTUtLjU1NiAxLjY4NCAxLjY4NCAwIDAgMS0uNTQ0LTEuMUExLjcyIDEuNzIgMCAwIDEgMS4zNiAxMi4xQzIuNTY4IDEwLjgzIDQuOTQ3IDguNDUgNi42NzggNi43NTVhNC4yNTcgNC4yNTcgMCAwIDEgLjA0OC0zLjA3OCA0LjA5NSA0LjA5NSAwIDAgMSAxLjY2NS0xLjk2OSA0LjI1OSA0LjI1OSAwIDAgMSA0LjA0LS4zNmwuNjE3LjI2OC0yLjg2NiAyLjk1MSAxLjI1NSAxLjI1OSAyLjk0NC0yLjg3Ny4yNjcuNjE5YTQuMjk1IDQuMjk1IDAgMCAxIC4wNCAzLjMxMSA0LjE5OCA0LjE5OCAwIDAgMS0uOTIzIDEuMzkyIDQuMjcgNC4yNyAwIDAgMS0uNzQzLjU4MSA0LjIxNyA0LjIxNyAwIDAgMS0zLjgxMi40NDZDOC4xMTIgMTAuNDEgNS4zNyAxMy4xNyAzLjg5IDE0LjU1MmExLjYzIDEuNjMgMCAwIDEtMS4wODQuNDIzem03LjkzOC0xMy4wNDdhMy4zMiAzLjMyIDAgMCAwLTEuODQ5LjU1N2MtLjIxMy4xMy0uNDEyLjI4NC0uNTkxLjQ1OGEzLjMyMSAzLjMyMSAwIDAgMC0uNjU3IDMuNzMzbC4xMzUuMjk3LS4yMzMuMjI3Yy0xLjczOCAxLjY5Ny00LjI2OSA0LjIyLTUuNDg1IDUuNTA0YS44MDUuODA1IDAgMCAwIC4xMzIgMS4wNS45MTEuOTExIDAgMCAwIC4yOTguMjJjLjEuMDQ0LjIwOS4wNjkuMzE5LjA3MmEuNjk0LjY5NCAwIDAgMCAuNDUtLjE4MWMxLjU3My0xLjQ2OSA0LjYxMi00LjUzOSA1LjUwNC01LjQ0bC4yMy0uMjMyLjI5NC4xMzVhMy4yODYgMy4yODYgMCAwIDAgMy4yMjUtLjI1NCAzLjMzIDMuMzMgMCAwIDAgLjU5MS0uNDY0IDMuMjggMy4yOCAwIDAgMCAuOTY0LTIuMzU4YzAtLjIxNS0uMDIxLS40My0uMDY0LS42NDJMMTEuNDMgNy4xMjUgOC44NzkgNC41NzhsMi41MTUtMi41OWEzLjI4NiAzLjI4NiAwIDAgMC0uNjUtLjA2eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDFMMyAydjEybDEgMWg4bDEtMVYybC0xLTFINHptMCAyVjJoOHYxMkg0di0xaDJ2LTFINHYtMmg0VjlINFY3aDJWNkg0VjRoNFYzSDR6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDZoOHYxSDRWNnptOCAzSDR2MWg4Vjl6IiBmaWxsPSIjNDI0MjQyIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDRsMS0xaDEybDEgMXY4bC0xIDFIMmwtMS0xVjR6bTEgMHY4aDEyVjRIMnoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum:before,.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDJMNyAzdjNoMVYzaDZ2NWgtNHYxaDRsMS0xVjNsLTEtMUg4em0xIDZMOCA3SDJMMSA4djVsMSAxaDZsMS0xVjh6TTggOVY4SDJ2NWg2Vjl6bTEtMi40MTRMOS40MTQgN0gxM1Y2SDl2LjU4NnpNMTMgNEg5djFoNFY0ek03IDlIM3YxaDRWOXptLTQgMmg0djFIM3YtMXoiIGZpbGw9IiNENjdFMDAiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDNsMS0xaDZsMSAxdjVsLTEgMWgtNFY4aDRWM0g4djNIN1Yzem0xIDRsMSAxdjVsLTEgMUgybC0xLTFWOGwxLTFoNnptMCAxdjVIMlY4aDZ6bTEuNDE0LTFMOSA2LjU4NlY2aDR2MUg5LjQxNHpNOSA0aDR2MUg5VjR6bS0yIDZIM3YxaDR2LTF6IiBmaWxsPSIjMDA3QUNDIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDRoLTVWM2g1djF6bS0xIDNoLTJ2MWgyVjd6bS00IDBIMXYxaDlWN3ptMiA2SDF2MWgxMXYtMXptLTUtM0gxdjFoNnYtMXptOCAwaC01djFoNXYtMXpNOCAydjNIMVYyaDd6TTcgM0gydjFoNVYzeiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjIyMyAxMC45MzNjLjMyNi4xOTIuNjk5LjI5IDEuMDc3LjI4MmEyLjE1OSAyLjE1OSAwIDAgMCAxLjc1NC0uODQyIDMuMjkxIDMuMjkxIDAgMCAwIC42NTQtMi4xMTMgMi44ODYgMi44ODYgMCAwIDAtLjU3Ni0xLjg3NyAxLjk5IDEuOTkgMCAwIDAtMS42MzQtLjczMyAyLjI5NCAyLjI5NCAwIDAgMC0xLjUyMy41NjdWMy40NzVoLS45OTFWMTEuMWguOTk1di0uMzQ0Yy4wNzYuMDY2LjE1OC4xMjUuMjQ0LjE3N3pNNy44NSA2LjdjLjE4Ni0uMDc5LjM4OC0uMTEzLjU5LS4xYTEuMDggMS4wOCAwIDAgMSAuODk2LjQyOGMuMjU3LjM2My4zODIuODAyLjM1NyAxLjI0NWEyLjQ4NSAyLjQ4NSAwIDAgMS0uNCAxLjQ4NCAxLjEzMyAxLjEzMyAwIDAgMS0uOTYuNTA4IDEuMjI0IDEuMjI0IDAgMCAxLS45NzYtLjQxN0ExLjUyMiAxLjUyMiAwIDAgMSA2Ljk3NSA4Ljh2LS42YTEuNzIyIDEuNzIyIDAgMCAxIC4zOTMtMS4xNDVjLjEzLS4xNTQuMjk2LS4yNzYuNDgyLS4zNTV6TTMuMjg5IDUuNjc1YTMuMDMgMy4wMyAwIDAgMC0uOTM3LjE2MiAyLjU5IDIuNTkgMCAwIDAtLjguNGwtLjEuMDc3djEuMmwuNDIzLS4zNTlhMi4xIDIuMSAwIDAgMSAxLjM2Ni0uNTcyLjc1OC43NTggMCAwIDEgLjY2MS4yODJjLjE1LjIzMi4yMy41MDMuMjMxLjc3OUwyLjkgNy44MjVhMi42IDIuNiAwIDAgMC0xLjM3OC41NzUgMS42NSAxLjY1IDAgMCAwLS4wMjIgMi4zMzYgMS43MzcgMS43MzcgMCAwIDAgMS4yNTMuNDU0IDEuOTYgMS45NiAwIDAgMCAxLjEwNy0uMzMyYy4xMDItLjA2OC4xOTctLjE0NS4yODYtLjIyOXYuNDQ0aC45NDFWNy43MTVhMi4xOTMgMi4xOTMgMCAwIDAtLjQ2OS0xLjUgMS42ODcgMS42ODcgMCAwIDAtMS4zMjktLjU0em0uODU3IDMuMDQxYy4wMi40MTgtLjEyLjgyOS0uMzkxIDEuMTQ4YTEuMjIxIDEuMjIxIDAgMCAxLS45NTUuNDIyLjgzMi44MzIgMCAwIDEtLjYwOC0uMi44MzMuODMzIDAgMCAxIDAtMS4wOTFjLjI4MS0uMTc0LjYtLjI3Ny45My0uM2wxLjAyLS4xNDguMDA0LjE2OXptOC4zMTMgMi4zMTdjLjMwNy4xMy42NC4xOTMuOTczLjE4Mi40OTUuMDEyLjk4My0uMTE0IDEuNDEtLjM2NWwuMTIzLS4wNzUuMDEzLS4wMDdWOS42MTVsLS40NDYuMzJjLS4zMTYuMjI0LS42OTYuMzQtMS4wODQuMzI5QTEuMyAxLjMgMCAwIDEgMTIuNCA5LjhhMS45NzUgMS45NzUgMCAwIDEtLjQtMS4zMTIgMi4wMSAyLjAxIDAgMCAxIC40NTMtMS4zODFBMS40MzIgMS40MzIgMCAwIDEgMTMuNiA2LjZhMS44IDEuOCAwIDAgMSAuOTcxLjI3OWwuNDMuMjY1VjUuOTdsLS4xNy0uMDczYTIuOSAyLjkgMCAwIDAtMS4xNy0uMjQ3IDIuNTIgMi41MiAwIDAgMC0xLjkyOS44MTcgMi45IDIuOSAwIDAgMC0uNzQ3IDIuMDQ5Yy0uMDI4LjcwNy4yMSAxLjQuNjcgMS45MzkuMjIyLjI0OS40OTcuNDQ2LjgwNC41Nzh6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02LjYgMTEuNzY3YTEuODY3IDEuODY3IDAgMCAwLTIuNjQtMi42NGMtMS4wNDIgMS4wOTgtMi44NTYuODEyLTIuOTQ3LS42OThBNyA3IDAgMSAxIDcuNCAxNC45NzVjLTEuNTk0LS4xMzYtMS45MDEtMi4wNDktLjgtMy4yMDh6bS4zNjcgMS43NzZjLS4wNjQtLjI5Ny4wMjEtLjcyOC4zNTEtMS4wOGEyLjg2NyAyLjg2NyAwIDAgMC0uMDEtNC4wNDNoLS4wMDFhMi44NjcgMi44NjcgMCAwIDAtNC4wNTQgMGwtLjAxLjAxLS4wMDguMDA5Yy0uMjk2LjMxMS0uNjY0LjM4Ny0uOTAyLjMzOGEuMzk4LjM5OCAwIDAgMS0uMjIzLS4xMTVjLS4wMzYtLjA0LS4wODktLjEyMi0uMDk5LS4yOTRhNiA2IDAgMSAxIDUuNDczIDUuNjFjLS4xOTQtLjAxNi0uMy0uMDgtLjM2LS4xMzVhLjU1NS41NTUgMCAwIDEtLjE1Ny0uM3pNNSA2YTEgMSAwIDEgMCAwLTIgMSAxIDAgMCAwIDAgMnptNyA1YTEgMSAwIDEgMS0yIDAgMSAxIDAgMCAxIDIgMHpNOCA1YTEgMSAwIDEgMCAwLTIgMSAxIDAgMCAwIDAgMnptNSAzYTEgMSAwIDEgMS0yIDAgMSAxIDAgMCAxIDIgMHptLTItMmExIDEgMCAxIDAgMC0yIDEgMSAwIDAgMCAwIDJ6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDFMMyAydjEybDEgMWg5bDEtMVY1bC0uMjkzLS43MDctMy0zTDEwIDFINHptMCAxM1YyaDV2NGg0djhINHptOS05bC0zLTN2M2gzeiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04LjA2IDMuODU0TDUuOTE1IDZsLS43MDctLjcwN0w2LjUgNGgtM2ExLjUgMS41IDAgMCAwIDAgM0g0djFoLS41YTIuNSAyLjUgMCAxIDEgMC01aDNMNiAyLjVsLS43OTMtLjc5M0w1LjkxNCAxbDIuMTQ3IDIuMTQ2di43MDh6TTUgNi41bC45MTQuOTE0TDYgNy4zMjhWMTRoOFY3aC00VjNoLS45NHYtLjI2OEw4LjMyOSAySDExLjJsLjMuMSAzLjQgMy41LjEuNHY4LjVsLS41LjVoLTlsLS41LS41di04ek0xMSAzdjNoMi45MDNMMTEgM3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yLjUgMWwtLjUuNVYxM2gxVjJoMTF2MTFoMVYxLjVsLS41LS41aC0xMnpNMiAxNXYtMWgxdjFIMnptMy0xSDR2MWgxdi0xem0xIDBoMXYxSDZ2LTF6bTMgMEg4djFoMXYtMXptMSAwaDF2MWgtMXYtMXptNSAxdi0xaC0xdjFoMXptLTMtMWgxdjFoLTF2LTF6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.customcolor:before{background-image:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjAxIDIuNWwuNS0uNWg0Ljk5N2wuMzU0LjE0Ni44NTIuODUzaDYuNzg4bC41LjV2NS40OTZsLS4wMS4wMTF2NC40OTZsLS41LjVIMS41bC0uNS0uNVY2LjUwN2wuMDEtLjAxVjIuNXpNMTQuMDAyIDR2MS4wMDNoLTYuNWwtLjM1NC4xNDctLjg1OC44NTdIMi4wMTFWM0g2LjNsLjg1My44NTMuMzUzLjE0Nmg2LjQ5NXpNNi40OTYgNy4wMDZIMi4wMTF2LjQ4OUgydjUuNTA3aDExLjk5di03SDcuNzA4bC0uODU4Ljg1OC0uMzU0LjE0NnoiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=")}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-widget .details{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;cursor:default}.monaco-editor .suggest-widget .details.no-docs{display:none}.monaco-editor .suggest-widget.docs-below .details{border-top-width:0}.monaco-editor .suggest-widget .details>.monaco-scrollable-element{-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.header>.type{-webkit-box-flex:2;-ms-flex:2;flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;word-break:break-all;margin:0 24px 0 0;padding:4px 0 12px 5px}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:normal}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-widget .details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-widget .details code{border-radius:3px;padding:0 .4em}.monaco-editor.hc-black .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close,.monaco-editor.vs-dark .suggest-widget .details>.monaco-scrollable-element>.body>.header>.close{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ2LjcwNy0uNzA3TDguNzA3IDhsMy42NDYtMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDdMOCA4LjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.readMore{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDcuNWE1LjUgNS41IDAgMSAxIDExIDAgNS41IDUuNSAwIDAgMS0xMSAwem0tMSAwYTYuNSA2LjUgMCAxIDEgMTMgMCA2LjUgNi41IDAgMCAxLTEzIDB6TTggNHYxaDFWNEg4em0wIDJ2NGgxVjZIOHoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor:before,.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function:before,.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yIDQuODU3TDIuNDg2IDRsNS0zaDEuMDI5bDUgMyAuNDg1Ljg1N3Y2bC0uNDg2Ljg1OC01IDNINy40ODZsLTUtM0wyIDEwLjg1OHYtNnptNS41IDguN2wtNC41LTIuN1Y1LjdsNC41IDIuNDU0djUuNDAzem0xIDBsNC41LTIuN1Y1LjdMOC41IDguMTU0djUuNDAzek04IDEuODU3TDMuMjYgNC43MDIgOCA3LjI4OGw0Ljc0LTIuNTg2TDggMS44NTd6IiBmaWxsPSIjQjE4MEQ3Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDYuMzk0bC41NTMtLjg5NCA3LTMuNWguODk0bDUgMi41LjU1My44OTR2NC41bC0uNTUzLjg5NS03IDMuNWgtLjg5NGwtNS0yLjVMMSAxMC44OTR2LTQuNXptNS41IDYuNzVMMiAxMC44OTRWNy4xNzFsNC41IDIuMDQ1djMuOTI4em0xIDBsNi41LTMuMjVWNi4xOEw3LjUgOS4yMTN2My45MzF6TTkgMi44OTRMMi4zMzcgNi4yMjZsNC42NiAyLjExOCA2LjY3NC0zLjExNEw5IDIuODk0eiIgZmlsbD0iIzc1QkVGRiIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQxNCAxLjU2TDguMzEyIDFoMy4yOTRsLjgxOCAxLjU3NUwxMC4yMzYgNmgxLjc4MWwuNzIgMS42OTVMNS42MTggMTVsLTEuNjAyLTEuMTYzTDYuMTE5IDEwSDQuODk4TDQgOC41NmwzLjQxNC03ek03Ljc4IDlMNC45IDE0LjMwNSAxMi4wMTggN0g4LjMxMmwzLjI5NC01SDguMzEyTDQuODk4IDlINy43OHoiIGZpbGw9IiNENjdFMDAiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yLjg3MyAxLjFjLjMzNS4xMzYuNjAyLjM5OC43NDUuNzMuMDcyLjE3LjEwOS4zNTIuMTA3LjUzN2ExLjM0IDEuMzQgMCAwIDEtLjYxIDEuMTM1IDEuMzU5IDEuMzU5IDAgMCAxLS43NTMuMjIzQTEuMzU1IDEuMzU1IDAgMCAxIDEgMi4zNjJhMS4zNTUgMS4zNTUgMCAwIDEgLjgzLTEuMjU2Yy4zMzMtLjE0LjcwOC0uMTQxIDEuMDQzLS4wMDZ6bS0uMjk4IDEuNzY1YS41NTEuNTUxIDAgMCAwIC4zMzItLjUuNTQ4LjU0OCAwIDEgMC0uMzMyLjV6TTYuNDMgMS4xMDlMMS4xMSA2LjQzbC42ODYuNjg3IDUuMzItNS4zMi0uNjg2LS42ODd6TTExLjUgOWgxdjIuNUgxNXYxaC0yLjVWMTVoLTF2LTIuNUg5di0xaDIuNVY5em0tNS43MzIuNTI1bC43MDcuNzA3TDQuNzA3IDEybDEuNzY4IDEuNzY4LS43MDcuNzA3TDQgMTIuNzA3bC0xLjc2OCAxLjc2OC0uNzA3LS43MDdMMy4yOTMgMTJsLTEuNzY4LTEuNzY4LjcwNy0uNzA3TDQgMTEuMjkzbDEuNzY4LTEuNzY4em0xLjM1LTQuMTk1YTEuMzUzIDEuMzUzIDAgMCAwLTEuMjU2LS44MyAxLjM1NSAxLjM1NSAwIDAgMC0xLjI1Ni44MyAxLjM2MiAxLjM2MiAwIDAgMCAxLjI1NyAxLjg5NUExLjM1OCAxLjM1OCAwIDAgMCA3LjExOCA1LjMzem0tLjc1My43NDVhLjU1My41NTMgMCAwIDEtLjI4OS4yOS41NDcuNTQ3IDAgMCAxLS41OTktLjExNy41MjkuNTI5IDAgMCAxLS4xMTctLjE3My41NDQuNTQ0IDAgMCAxIC43MTYtLjcxNS41NjUuNTY1IDAgMCAxIC4xNzMuMTE2LjU0OS41NDkgMCAwIDEgLjExNi41OTl6TTE0IDNoLTR2MWg0VjN6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjUgNGwtLjUuNXY4bC41LjVINHYtMUgyVjVoMlY0SDEuNXptMTMgOWwuNS0uNXYtOGwtLjUtLjVIMTJ2MWgydjdoLTJ2MWgyLjV6TTguNzk3IDVsLTQuNSAyTDQgNy40NTd2Mi41bC4yNDMuNDI5IDIuNSAxLjUuNDYuMDI4IDQuNS0yTDEyIDkuNDU3di0yLjVsLS4yNDMtLjQyOS0yLjUtMS41TDguNzk3IDV6TTUgOC4zNHYxLjMzNGwxLjUuOVY5LjI0TDUgOC4zNHptMi41Ljk0MnYxLjQwNUwxMSA5LjEzM1Y3LjcyNkw3LjUgOS4yODJ6bTIuOTE4LTIuMzkxbC0xLjQ1Mi0uODcyLTMuMzg0IDEuNTA0IDEuNDUyLjg3MSAzLjM4NC0xLjUwM3oiIGZpbGw9IiM3NUJFRkYiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjM1NCA2LjY0NkwyLjA2IDUuMzU0IDUuMzU0IDIuMDZsMS4yOTIgMS4yOTMtMy4yOTIgMy4yOTJ6TTUgMUwxIDV2LjcwN2wyIDJoLjcwN2wxLjE0Ny0xLjE0NnY1Ljc5M2wuNS41aDQuNjU2di41MmwxLjMzMyAxLjMzM2guNzA3bDIuNjY3LTIuNjY2di0uNzA3TDEzLjM4MyAxMGgtLjcwN2wtMS44NTMgMS44NTRoLTQuOTd2LTMuOTZoNC4xNTd2LjQ4bDEuMzMzIDEuMzMzaC43MDdsMi42NjctMi42NjZ2LS43MDdMMTMuMzgzIDVoLS43MDdsLTEuODEzIDEuODE0aC01LjAxVjUuNTZsMS44NTQtMS44NTRWM2wtMi0ySDV6bTYuMDcgNy4wMmwuNjI3LjYyNyAxLjk2LTEuOTYtLjYyNy0uNjI2LTEuOTYgMS45NnptMCA1bC42MjcuNjI3IDEuOTYtMS45Ni0uNjI3LS42MjYtMS45NiAxLjk2eiIgZmlsbD0iI0VFOUQyOCIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS41IDVhMi41IDIuNSAwIDEgMCAwIDUgMi41IDIuNSAwIDAgMCAwLTV6TTguMDM1IDhhMy41IDMuNSAwIDEgMCAwLTFINC45MzdhMiAyIDAgMSAwIDAgMWgzLjA5OHoiIGZpbGw9IiM3NUJFRkYiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yIDJMMSAzdjNsMSAxaDEybDEtMVYzbC0xLTFIMnptMCAxaDEydjNIMlYzem0tMSA3bDEtMWgzbDEgMXYzbC0xIDFIMmwtMS0xdi0zem0yIDBIMnYzaDN2LTNIM3ptNyAwbDEtMWgzbDEgMXYzbC0xIDFoLTNsLTEtMXYtM3ptMiAwaC0xdjNoM3YtM2gtMnoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMSA2aC0xdi0uNWEuNS41IDAgMCAwLS41LS41SDguNDc5djUuNWEuNS41IDAgMCAwIC41LjVoLjV2MWgtM3YtMWguNWEuNS41IDAgMCAwIC41LS41VjVINi41YS41LjUgMCAwIDAtLjUuNVY2SDVWNGg2djJ6bTIuOTE0IDIuMDQ4bC0xLjQ2Mi0xLjQ2Mi43MDctLjcwNyAxLjgxNiAxLjgxNnYuNzA3bC0xLjc2OCAxLjc2Ny0uNzA3LS43MDcgMS40MTQtMS40MTR6TTMuNTQ4IDkuNDYyTDIuMDg2IDggMy41IDYuNTg2bC0uNzA3LS43MDctMS43NjggMS43Njd2LjcwOGwxLjgxNiAxLjgxNS43MDctLjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDIuOTg0VjJoLS4wOWMtLjMxMyAwLS42MTYuMDYyLS45MDkuMTg1YTIuMzMgMi4zMyAwIDAgMC0uNzc1LjUzIDIuMjMgMi4yMyAwIDAgMC0uNDkzLjc1M3YuMDAxYTMuNTQyIDMuNTQyIDAgMCAwLS4xOTguODN2LjAwMmE2LjA4IDYuMDggMCAwIDAtLjAyNC44NjNjLjAxMi4yOS4wMTguNTguMDE4Ljg2OSAwIC4yMDMtLjA0LjM5My0uMTE3LjU3MnYuMDAxYTEuNTA0IDEuNTA0IDAgMCAxLS43NjUuNzg3IDEuMzc2IDEuMzc2IDAgMCAxLS41NTguMTE1SDJ2Ljk4NGguMDljLjE5NSAwIC4zOC4wNC41NTYuMTIxbC4wMDEuMDAxYy4xNzguMDc4LjMyOS4xODQuNDU1LjMxOGwuMDAyLjAwMmMuMTMuMTMuMjMzLjI4NS4zMDcuNDY1bC4wMDEuMDAyYy4wNzguMTguMTE3LjM2OC4xMTcuNTY2IDAgLjI5LS4wMDYuNTgtLjAxOC44NjktLjAxMi4yOTYtLjAwNC41ODUuMDI0Ljg3di4wMDFjLjAzMy4yODMuMDk5LjU1OC4xOTcuODI0di4wMDFjLjEwNi4yNzMuMjcxLjUyNC40OTQuNzUzLjIyMy4yMy40ODIuNDA3Ljc3NS41My4yOTMuMTIzLjU5Ni4xODUuOTEuMTg1SDZ2LS45ODRoLS4wOWMtLjE5OSAwLS4zODctLjAzOC0uNTYyLS4xMTVhMS42MTMgMS42MTMgMCAwIDEtLjQ1Ny0uMzIgMS42NTkgMS42NTkgMCAwIDEtLjMwOS0uNDY3Yy0uMDc0LS4xOC0uMTEtLjM3LS4xMS0uNTczIDAtLjIyOC4wMDMtLjQ1My4wMTEtLjY3Mi4wMDgtLjIyOC4wMDgtLjQ1IDAtLjY2NWE0LjYzOSA0LjYzOSAwIDAgMC0uMDU1LS42NCAyLjY4MiAyLjY4MiAwIDAgMC0uMTY4LS42MDlBMi4yODQgMi4yODQgMCAwIDAgMy41MjIgOGEyLjI4NCAyLjI4NCAwIDAgMCAuNzM4LS45NTVjLjA4LS4xOTIuMTM1LS4zOTMuMTY4LS42MDIuMDMzLS4yMS4wNTEtLjQyMy4wNTUtLjY0LjAwOC0uMjIuMDA4LS40NDIgMC0uNjY2LS4wMDgtLjIyNC0uMDEyLS40NS0uMDEyLS42NzhhMS40NyAxLjQ3IDAgMCAxIC44NzctMS4zNTQgMS4zMyAxLjMzIDAgMCAxIC41NjMtLjEyMUg2em00IDEwLjAzMlYxNGguMDljLjMxMyAwIC42MTYtLjA2Mi45MDktLjE4NS4yOTMtLjEyMy41NTItLjMuNzc1LS41My4yMjMtLjIzLjM4OC0uNDguNDkzLS43NTN2LS4wMDFjLjEtLjI2Ni4xNjUtLjU0My4xOTgtLjgzdi0uMDAyYy4wMjgtLjI4LjAzNi0uNTY3LjAyNC0uODYzLS4wMTItLjI5LS4wMTgtLjU4LS4wMTgtLjg2OSAwLS4yMDMuMDQtLjM5My4xMTctLjU3MnYtLjAwMWExLjUwNCAxLjUwNCAwIDAgMSAuNzY1LS43ODdjLjE3Ni0uMDc3LjM2Mi0uMTE1LjU1OC0uMTE1SDE0di0uOTg0aC0uMDljLS4xOTUgMC0uMzgtLjA0LS41NTYtLjEyMWwtLjAwMS0uMDAxYTEuMzc2IDEuMzc2IDAgMCAxLS40NTUtLjMxOGwtLjAwMi0uMDAyYTEuNDE0IDEuNDE0IDAgMCAxLS4zMDctLjQ2NWwtLjAwMS0uMDAyYTEuNDA1IDEuNDA1IDAgMCAxLS4xMTctLjU2NmMwLS4yOS4wMDYtLjU4LjAxOC0uODY5YTYuMTkgNi4xOSAwIDAgMC0uMDI0LS44N3YtLjAwMWEzLjU0MiAzLjU0MiAwIDAgMC0uMTk3LS44MjR2LS4wMDFhMi4yMyAyLjIzIDAgMCAwLS40OTQtLjc1MyAyLjMzIDIuMzMgMCAwIDAtLjc3NS0uNTMgMi4zMjUgMi4zMjUgMCAwIDAtLjkxLS4xODVIMTB2Ljk4NGguMDljLjIgMCAuMzg2LjAzOC41NjIuMTE1LjE3NC4wODIuMzI2LjE4OC40NTcuMzIuMTI3LjEzNC4yMy4yOS4zMDkuNDY3LjA3NC4xOC4xMS4zNy4xMS41NzMgMCAuMjI4LS4wMDMuNDUyLS4wMTEuNjcyLS4wMDguMjI4LS4wMDguNDUgMCAuNjY1LjAwNC4yMjIuMDIyLjQzNS4wNTUuNjQuMDMzLjIxNC4wODkuNDE2LjE2OC42MDlhMi4yODIgMi4yODIgMCAwIDAgLjczOC45NTUgMi4yODIgMi4yODIgMCAwIDAtLjczOC45NTUgMi43IDIuNyAwIDAgMC0uMTY4LjYwMmMtLjAzMy4yMS0uMDUxLjQyMy0uMDU1LjY0LS4wMDguMjItLjAwOC40NDIgMCAuNjY2LjAwOC4yMjQuMDEyLjQ1LjAxMi42NzhhMS40NyAxLjQ3IDAgMCAxLS40MiAxLjAzNSAxLjQ2NiAxLjQ2NiAwIDAgMS0uNDU3LjMxOSAxLjMzIDEuMzMgMCAwIDEtLjU2My4xMjFIMTB6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuODA3IDE0Ljk3NWExLjc1IDEuNzUgMCAwIDEtMS4yNTUtLjU1NiAxLjY4NCAxLjY4NCAwIDAgMS0uNTQ0LTEuMUExLjcyIDEuNzIgMCAwIDEgMS4zNiAxMi4xQzIuNTY4IDEwLjgzIDQuOTQ3IDguNDUgNi42NzggNi43NTVhNC4yNTcgNC4yNTcgMCAwIDEgLjA0OC0zLjA3OCA0LjA5NSA0LjA5NSAwIDAgMSAxLjY2NS0xLjk2OSA0LjI1OSA0LjI1OSAwIDAgMSA0LjA0LS4zNmwuNjE3LjI2OC0yLjg2NiAyLjk1MSAxLjI1NSAxLjI1OSAyLjk0NC0yLjg3Ny4yNjcuNjE5YTQuMjk1IDQuMjk1IDAgMCAxIC4wNCAzLjMxMSA0LjE5OCA0LjE5OCAwIDAgMS0uOTIzIDEuMzkyIDQuMjcgNC4yNyAwIDAgMS0uNzQzLjU4MSA0LjIxNyA0LjIxNyAwIDAgMS0zLjgxMi40NDZDOC4xMTIgMTAuNDEgNS4zNyAxMy4xNyAzLjg5IDE0LjU1MmExLjYzIDEuNjMgMCAwIDEtMS4wODQuNDIzem03LjkzOC0xMy4wNDdhMy4zMiAzLjMyIDAgMCAwLTEuODQ5LjU1N2MtLjIxMy4xMy0uNDEyLjI4NC0uNTkxLjQ1OGEzLjMyMSAzLjMyMSAwIDAgMC0uNjU3IDMuNzMzbC4xMzUuMjk3LS4yMzMuMjI3Yy0xLjczOCAxLjY5Ny00LjI2OSA0LjIyLTUuNDg1IDUuNTA0YS44MDUuODA1IDAgMCAwIC4xMzIgMS4wNS45MTEuOTExIDAgMCAwIC4yOTguMjJjLjEuMDQ0LjIwOS4wNjkuMzE5LjA3MmEuNjk0LjY5NCAwIDAgMCAuNDUtLjE4MWMxLjU3My0xLjQ2OSA0LjYxMi00LjUzOSA1LjUwNC01LjQ0bC4yMy0uMjMyLjI5NC4xMzVhMy4yODYgMy4yODYgMCAwIDAgMy4yMjUtLjI1NCAzLjMzIDMuMzMgMCAwIDAgLjU5MS0uNDY0IDMuMjggMy4yOCAwIDAgMCAuOTY0LTIuMzU4YzAtLjIxNS0uMDIxLS40My0uMDY0LS42NDJMMTEuNDMgNy4xMjUgOC44NzkgNC41NzhsMi41MTUtMi41OWEzLjI4NiAzLjI4NiAwIDAgMC0uNjUtLjA2eiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDFMMyAydjEybDEgMWg4bDEtMVYybC0xLTFINHptMCAyVjJoOHYxMkg0di0xaDJ2LTFINHYtMmg0VjlINFY3aDJWNkg0VjRoNFYzSDR6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDZoOHYxSDRWNnptOCAzSDR2MWg4Vjl6IiBmaWxsPSIjQzVDNUM1Ii8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDRsMS0xaDEybDEgMXY4bC0xIDFIMmwtMS0xVjR6bTEgMHY4aDEyVjRIMnoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum:before,.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDJMNyAzdjNoMVYzaDZ2NWgtNHYxaDRsMS0xVjNsLTEtMUg4em0xIDZMOCA3SDJMMSA4djVsMSAxaDZsMS0xVjh6TTggOVY4SDJ2NWg2Vjl6bTEtMi40MTRMOS40MTQgN0gxM1Y2SDl2LjU4NnpNMTMgNEg5djFoNFY0ek03IDlIM3YxaDRWOXptLTQgMmg0djFIM3YtMXoiIGZpbGw9IiNFRTlEMjgiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDNsMS0xaDZsMSAxdjVsLTEgMWgtNFY4aDRWM0g4djNIN1Yzem0xIDRsMSAxdjVsLTEgMUgybC0xLTFWOGwxLTFoNnptMCAxdjVIMlY4aDZ6bTEuNDE0LTFMOSA2LjU4NlY2aDR2MUg5LjQxNHpNOSA0aDR2MUg5VjR6bS0yIDZIM3YxaDR2LTF6IiBmaWxsPSIjNzVCRUZGIi8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDRoLTVWM2g1djF6bS0xIDNoLTJ2MWgyVjd6bS00IDBIMXYxaDlWN3ptMiA2SDF2MWgxMXYtMXptLTUtM0gxdjFoNnYtMXptOCAwaC01djFoNXYtMXpNOCAydjNIMVYyaDd6TTcgM0gydjFoNVYzeiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjIyMyAxMC45MzNjLjMyNi4xOTIuNjk5LjI5IDEuMDc3LjI4MmEyLjE1OSAyLjE1OSAwIDAgMCAxLjc1NC0uODQyIDMuMjkxIDMuMjkxIDAgMCAwIC42NTQtMi4xMTMgMi44ODYgMi44ODYgMCAwIDAtLjU3Ni0xLjg3NyAxLjk5IDEuOTkgMCAwIDAtMS42MzQtLjczMyAyLjI5NCAyLjI5NCAwIDAgMC0xLjUyMy41NjdWMy40NzVoLS45OTFWMTEuMWguOTk1di0uMzQ0Yy4wNzYuMDY2LjE1OC4xMjUuMjQ0LjE3N3pNNy44NSA2LjdjLjE4Ni0uMDc5LjM4OC0uMTEzLjU5LS4xYTEuMDggMS4wOCAwIDAgMSAuODk2LjQyOGMuMjU3LjM2My4zODIuODAyLjM1NyAxLjI0NWEyLjQ4NSAyLjQ4NSAwIDAgMS0uNCAxLjQ4NCAxLjEzMyAxLjEzMyAwIDAgMS0uOTYuNTA4IDEuMjI0IDEuMjI0IDAgMCAxLS45NzYtLjQxN0ExLjUyMiAxLjUyMiAwIDAgMSA2Ljk3NSA4Ljh2LS42YTEuNzIyIDEuNzIyIDAgMCAxIC4zOTMtMS4xNDVjLjEzLS4xNTQuMjk2LS4yNzYuNDgyLS4zNTV6TTMuMjg5IDUuNjc1YTMuMDMgMy4wMyAwIDAgMC0uOTM3LjE2MiAyLjU5IDIuNTkgMCAwIDAtLjguNGwtLjEuMDc3djEuMmwuNDIzLS4zNTlhMi4xIDIuMSAwIDAgMSAxLjM2Ni0uNTcyLjc1OC43NTggMCAwIDEgLjY2MS4yODJjLjE1LjIzMi4yMy41MDMuMjMxLjc3OUwyLjkgNy44MjVhMi42IDIuNiAwIDAgMC0xLjM3OC41NzUgMS42NSAxLjY1IDAgMCAwLS4wMjIgMi4zMzYgMS43MzcgMS43MzcgMCAwIDAgMS4yNTMuNDU0IDEuOTYgMS45NiAwIDAgMCAxLjEwNy0uMzMyYy4xMDItLjA2OC4xOTctLjE0NS4yODYtLjIyOXYuNDQ0aC45NDFWNy43MTVhMi4xOTMgMi4xOTMgMCAwIDAtLjQ2OS0xLjUgMS42ODcgMS42ODcgMCAwIDAtMS4zMjktLjU0em0uODU3IDMuMDQxYy4wMi40MTgtLjEyLjgyOS0uMzkxIDEuMTQ4YTEuMjIxIDEuMjIxIDAgMCAxLS45NTUuNDIyLjgzMi44MzIgMCAwIDEtLjYwOC0uMi44MzMuODMzIDAgMCAxIDAtMS4wOTFjLjI4MS0uMTc0LjYtLjI3Ny45My0uM2wxLjAyLS4xNDguMDA0LjE2OXptOC4zMTMgMi4zMTdjLjMwNy4xMy42NC4xOTMuOTczLjE4Mi40OTUuMDEyLjk4My0uMTE0IDEuNDEtLjM2NWwuMTIzLS4wNzUuMDEzLS4wMDdWOS42MTVsLS40NDYuMzJjLS4zMTYuMjI0LS42OTYuMzQtMS4wODQuMzI5QTEuMyAxLjMgMCAwIDEgMTIuNCA5LjhhMS45NzUgMS45NzUgMCAwIDEtLjQtMS4zMTIgMi4wMSAyLjAxIDAgMCAxIC40NTMtMS4zODFBMS40MzIgMS40MzIgMCAwIDEgMTMuNiA2LjZhMS44IDEuOCAwIDAgMSAuOTcxLjI3OWwuNDMuMjY1VjUuOTdsLS4xNy0uMDczYTIuOSAyLjkgMCAwIDAtMS4xNy0uMjQ3IDIuNTIgMi41MiAwIDAgMC0xLjkyOS44MTcgMi45IDIuOSAwIDAgMC0uNzQ3IDIuMDQ5Yy0uMDI4LjcwNy4yMSAxLjQuNjcgMS45MzkuMjIyLjI0OS40OTcuNDQ2LjgwNC41Nzh6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02LjYgMTEuNzY3YTEuODY3IDEuODY3IDAgMCAwLTIuNjQtMi42NGMtMS4wNDIgMS4wOTgtMi44NTYuODEyLTIuOTQ3LS42OThBNyA3IDAgMSAxIDcuNCAxNC45NzVjLTEuNTk0LS4xMzYtMS45MDEtMi4wNDktLjgtMy4yMDh6bS4zNjcgMS43NzZjLS4wNjQtLjI5Ny4wMjEtLjcyOC4zNTEtMS4wOGEyLjg2NyAyLjg2NyAwIDAgMC0uMDEtNC4wNDNoLS4wMDFhMi44NjcgMi44NjcgMCAwIDAtNC4wNTQgMGwtLjAxLjAxLS4wMDguMDA5Yy0uMjk2LjMxMS0uNjY0LjM4Ny0uOTAyLjMzOGEuMzk4LjM5OCAwIDAgMS0uMjIzLS4xMTVjLS4wMzYtLjA0LS4wODktLjEyMi0uMDk5LS4yOTRhNiA2IDAgMSAxIDUuNDczIDUuNjFjLS4xOTQtLjAxNi0uMy0uMDgtLjM2LS4xMzVhLjU1NS41NTUgMCAwIDEtLjE1Ny0uM3pNNSA2YTEgMSAwIDEgMCAwLTIgMSAxIDAgMCAwIDAgMnptNyA1YTEgMSAwIDEgMS0yIDAgMSAxIDAgMCAxIDIgMHpNOCA1YTEgMSAwIDEgMCAwLTIgMSAxIDAgMCAwIDAgMnptNSAzYTEgMSAwIDEgMS0yIDAgMSAxIDAgMCAxIDIgMHptLTItMmExIDEgMCAxIDAgMC0yIDEgMSAwIDAgMCAwIDJ6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDFMMyAydjEybDEgMWg5bDEtMVY1bC0uMjkzLS43MDctMy0zTDEwIDFINHptMCAxM1YyaDV2NGg0djhINHptOS05bC0zLTN2M2gzeiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04LjA2IDMuODU0TDUuOTE1IDZsLS43MDctLjcwN0w2LjUgNGgtM2ExLjUgMS41IDAgMCAwIDAgM0g0djFoLS41YTIuNSAyLjUgMCAxIDEgMC01aDNMNiAyLjVsLS43OTMtLjc5M0w1LjkxNCAxbDIuMTQ3IDIuMTQ2di43MDh6TTUgNi41bC45MTQuOTE0TDYgNy4zMjhWMTRoOFY3aC00VjNoLS45NHYtLjI2OEw4LjMyOSAySDExLjJsLjMuMSAzLjQgMy41LjEuNHY4LjVsLS41LjVoLTlsLS41LS41di04ek0xMSAzdjNoMi45MDNMMTEgM3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yLjUgMWwtLjUuNVYxM2gxVjJoMTF2MTFoMVYxLjVsLS41LS41aC0xMnpNMiAxNXYtMWgxdjFIMnptMy0xSDR2MWgxdi0xem0xIDBoMXYxSDZ2LTF6bTMgMEg4djFoMXYtMXptMSAwaDF2MWgtMXYtMXptNSAxdi0xaC0xdjFoMXptLTMtMWgxdjFoLTF2LTF6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.customcolor:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.customcolor:before{background-image:none}.monaco-editor.hc-black .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder:before,.monaco-editor.vs-dark .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjAxIDIuNWwuNS0uNWg0Ljk5N2wuMzU0LjE0Ni44NTIuODUzaDYuNzg4bC41LjV2NS40OTZsLS4wMS4wMTF2NC40OTZsLS41LjVIMS41bC0uNS0uNVY2LjUwN2wuMDEtLjAxVjIuNXpNMTQuMDAyIDR2MS4wMDNoLTYuNWwtLjM1NC4xNDctLjg1OC44NTdIMi4wMTFWM0g2LjNsLjg1My44NTMuMzUzLjE0Nmg2LjQ5NXpNNi40OTYgNy4wMDZIMi4wMTF2LjQ4OUgydjUuNTA3aDExLjk5di03SDcuNzA4bC0uODU4Ljg1OC0uMzU0LjE0NnoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=")}.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,Ubuntu,Droid Sans,sans-serif}.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor-hover p{margin:0}.monaco-editor.hc-black{-ms-high-contrast-adjust:none}@media screen and (-ms-high-contrast:active){.monaco-editor.vs-dark .view-overlays .current-line,.monaco-editor.vs .view-overlays .current-line{border-color:windowtext!important;border-left:0;border-right:0}.monaco-editor.vs-dark .cursor,.monaco-editor.vs .cursor{background-color:windowtext!important}.monaco-editor.vs-dark .dnd-target,.monaco-editor.vs .dnd-target{border-color:windowtext!important}.monaco-editor.vs-dark .selected-text,.monaco-editor.vs .selected-text{background-color:highlight!important}.monaco-editor.vs-dark .view-line,.monaco-editor.vs .view-line{-ms-high-contrast-adjust:none}.monaco-editor.vs-dark .view-line span,.monaco-editor.vs .view-line span{color:windowtext!important}.monaco-editor.vs-dark .view-line span.inline-selected-text,.monaco-editor.vs .view-line span.inline-selected-text{color:highlighttext!important}.monaco-editor.vs-dark .view-overlays,.monaco-editor.vs .view-overlays{-ms-high-contrast-adjust:none}.monaco-editor.vs-dark .reference-decoration,.monaco-editor.vs-dark .selectionHighlight,.monaco-editor.vs-dark .wordHighlight,.monaco-editor.vs-dark .wordHighlightStrong,.monaco-editor.vs .reference-decoration,.monaco-editor.vs .selectionHighlight,.monaco-editor.vs .wordHighlight,.monaco-editor.vs .wordHighlightStrong{border:2px dotted highlight!important;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .rangeHighlight,.monaco-editor.vs .rangeHighlight{background:transparent!important;border:1px dotted activeborder!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .bracket-match,.monaco-editor.vs .bracket-match{border-color:windowtext!important;background:transparent!important}.monaco-editor.vs-dark .currentFindMatch,.monaco-editor.vs-dark .findMatch,.monaco-editor.vs .currentFindMatch,.monaco-editor.vs .findMatch{border:2px dotted activeborder!important;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .find-widget,.monaco-editor.vs .find-widget{border:1px solid windowtext}.monaco-editor.vs-dark .monaco-list .monaco-list-row,.monaco-editor.vs .monaco-list .monaco-list-row{-ms-high-contrast-adjust:none;color:windowtext!important}.monaco-editor.vs-dark .monaco-list .monaco-list-row.focused,.monaco-editor.vs .monaco-list .monaco-list-row.focused{color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-list .monaco-list-row:hover,.monaco-editor.vs .monaco-list .monaco-list-row:hover{background:transparent!important;border:1px solid highlight;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .monaco-tree .monaco-tree-row,.monaco-editor.vs .monaco-tree .monaco-tree-row{-ms-high-contrast-adjust:none;color:windowtext!important}.monaco-editor.vs-dark .monaco-tree .monaco-tree-row.focused,.monaco-editor.vs-dark .monaco-tree .monaco-tree-row.selected,.monaco-editor.vs .monaco-tree .monaco-tree-row.focused,.monaco-editor.vs .monaco-tree .monaco-tree-row.selected{color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-tree .monaco-tree-row:hover,.monaco-editor.vs .monaco-tree .monaco-tree-row:hover{background:transparent!important;border:1px solid highlight;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar,.monaco-editor.vs .monaco-scrollable-element>.scrollbar{-ms-high-contrast-adjust:none;background:background!important;border:1px solid windowtext;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider{background:windowtext!important}.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active,.monaco-editor.vs-dark .monaco-scrollable-element>.scrollbar>.slider:hover,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider.active,.monaco-editor.vs .monaco-scrollable-element>.scrollbar>.slider:hover{background:highlight!important}.monaco-editor.vs-dark .decorationsOverviewRuler,.monaco-editor.vs .decorationsOverviewRuler{opacity:0}.monaco-editor.vs-dark .minimap,.monaco-editor.vs .minimap{display:none}.monaco-editor.vs-dark .squiggly-d-error,.monaco-editor.vs .squiggly-d-error{background:transparent!important;border-bottom:4px double #e47777}.monaco-editor.vs-dark .squiggly-b-info,.monaco-editor.vs-dark .squiggly-c-warning,.monaco-editor.vs .squiggly-b-info,.monaco-editor.vs .squiggly-c-warning{border-bottom:4px double #71b771}.monaco-editor.vs-dark .squiggly-a-hint,.monaco-editor.vs .squiggly-a-hint{border-bottom:4px double #6c6c6c}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{-ms-high-contrast-adjust:none;color:highlighttext!important;background-color:highlight!important}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label,.monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .action-label{-ms-high-contrast-adjust:none;background:transparent!important;border:1px solid highlight;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-diff-editor.vs-dark .diffOverviewRuler,.monaco-diff-editor.vs .diffOverviewRuler{display:none}.monaco-editor.vs-dark .line-delete,.monaco-editor.vs-dark .line-insert,.monaco-editor.vs .line-delete,.monaco-editor.vs .line-insert{background:transparent!important;border:1px solid highlight!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor.vs-dark .char-delete,.monaco-editor.vs-dark .char-insert,.monaco-editor.vs .char-delete,.monaco-editor.vs .char-insert{background:transparent!important}}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-diff-editor .diffViewport{-webkit-box-shadow:inset 0 0 1px 0 #b9b9b9;box-shadow:inset 0 0 1px 0 #b9b9b9;background:rgba(0,0,0,.1)}.monaco-diff-editor.hc-black .diffViewport,.monaco-diff-editor.vs-dark .diffViewport{background:hsla(0,0%,100%,.1)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67.1%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{background-size:60%;opacity:.7;background-repeat:no-repeat;background-position:75%;background-size:11px 11px}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign{opacity:1}.monaco-diff-editor .insert-sign,.monaco-editor .insert-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0IDd2MUg4djZIN1Y4SDFWN2g2VjFoMXY2aDZ6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-diff-editor .delete-sign,.monaco-editor .delete-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDhIMVY3aDE0djF6IiBmaWxsPSIjNDI0MjQyIi8+PC9zdmc+")}.monaco-diff-editor.hc-black .insert-sign,.monaco-diff-editor.vs-dark .insert-sign,.monaco-editor.hc-black .insert-sign,.monaco-editor.vs-dark .insert-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0IDd2MUg4djZIN1Y4SDFWN2g2VjFoMXY2aDZ6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.vs-dark .delete-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.vs-dark .delete-sign{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDhIMVY3aDE0djF6IiBmaWxsPSIjQzVDNUM1Ii8+PC9zdmc+")}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .diagonal-fill{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAChJREFUKFNjOH/+fAMDDgCSu3Dhwn9c8gwwBTgNGR4KQP4HhQOhsAIAZCBTkhtqePcAAAAASUVORK5CYII=")}.monaco-editor.vs-dark .diagonal-fill{opacity:.2}.monaco-editor.hc-black .diagonal-fill{background:none}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS42NyA4LjY1OGMtLjMzOC4zMzQtLjU5OC43MDUtLjc4MSAxLjExNC0uMTc4LjQwNy0uMjY4Ljg1LS4yNjggMS4zMjl2MS42YTEuMzA0IDEuMzA0IDAgMCAxLS43OTQgMS4xOTdjLS4xNTkuMDY4LS4zMjkuMTAyLS41MDkuMTAySDcuNzEyYTEuMjg1IDEuMjg1IDAgMCAxLS45MjItLjM3OSAxLjMwMyAxLjMwMyAwIDAgMS0uMzgtLjkydi0xLjZjMC0uNDc5LS4wOTItLjkyMS0uMjc0LTEuMzI5YTMuNTU2IDMuNTU2IDAgMCAwLS43NzYtMS4xMTQgNC42ODkgNC42ODkgMCAwIDEtMS4wMDYtMS40MzdBNC4xODcgNC4xODcgMCAwIDEgNCA1LjVhNC40MzIgNC40MzIgMCAwIDEgLjYxNi0yLjI3Yy4xOTctLjMzNi40MzItLjY0LjcwNS0uOTE0LjI3NC0uMjcyLjU3OC0uNTA2LjkxMS0uNzAyLjMzOC0uMTk2LjctLjM0OCAxLjA4NC0uNDU0QzcuNyAxLjA1MyA4LjEgMSA4LjUxNiAxYTQuNDc2IDQuNDc2IDAgMCAxIDIuMjc2LjYxNCA0LjQ3NSA0LjQ3NSAwIDAgMSAxLjYyMiAxLjYxNiA0LjQzOCA0LjQzOCAwIDAgMSAuNjE2IDIuMjdjMCAuNjE3LS4xMTcgMS4xOTEtLjM1MyAxLjcyMWE0LjY5IDQuNjkgMCAwIDEtMS4wMDYgMS40Mzd6TTkuNjIzIDEwLjVINy40MDl2Mi4yMDFjMCAuMDgxLjAyOC4xNS4wOS4yMTIuMDYyLjA2MS4xMzEuMDkuMjEzLjA5aDEuNjA2YS4yODkuMjg5IDAgMCAwIC4yMTMtLjA5LjI4Ni4yODYgMCAwIDAgLjA5LS4yMTJWMTAuNXoiIGZpbGw9IiM0MjQyNDIiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjY3IDguNjU4Yy0uMzM4LjMzNC0uNTk4LjcwNS0uNzgxIDEuMTE0LS4xNzguNDA3LS4yNjguODUtLjI2OCAxLjMyOXYxLjZhMS4zMDQgMS4zMDQgMCAwIDEtLjc5NCAxLjE5N2MtLjE1OS4wNjgtLjMyOS4xMDItLjUwOS4xMDJINy43MTJhMS4yODUgMS4yODUgMCAwIDEtLjkyMi0uMzc5IDEuMzAzIDEuMzAzIDAgMCAxLS4zOC0uOTJ2LTEuNmMwLS40NzktLjA5Mi0uOTIxLS4yNzQtMS4zMjlhMy41NTYgMy41NTYgMCAwIDAtLjc3Ni0xLjExNCA0LjY4OSA0LjY4OSAwIDAgMS0xLjAwNi0xLjQzN0E0LjE4NyA0LjE4NyAwIDAgMSA0IDUuNWE0LjQzMiA0LjQzMiAwIDAgMSAuNjE2LTIuMjdjLjE5Ny0uMzM2LjQzMi0uNjQuNzA1LS45MTQuMjc0LS4yNzIuNTc4LS41MDYuOTExLS43MDIuMzM4LS4xOTYuNy0uMzQ4IDEuMDg0LS40NTRDNy43IDEuMDUzIDguMSAxIDguNTE2IDFhNC40NzYgNC40NzYgMCAwIDEgMi4yNzYuNjE0IDQuNDc1IDQuNDc1IDAgMCAxIDEuNjIyIDEuNjE2IDQuNDM4IDQuNDM4IDAgMCAxIC42MTYgMi4yN2MwIC42MTctLjExNyAxLjE5MS0uMzUzIDEuNzIxYTQuNjkgNC42OSAwIDAgMS0xLjAwNiAxLjQzN3pNOS42MjMgMTAuNUg3LjQwOXYyLjIwMWMwIC4wODEuMDI4LjE1LjA5LjIxMi4wNjIuMDYxLjEzMS4wOS4yMTMuMDloMS42MDZhLjI4OS4yODkgMCAwIDAgLjIxMy0uMDkuMjg2LjI4NiAwIDAgMCAuMDktLjIxMlYxMC41eiIgZmlsbD0iIzQyNDI0MiIvPjwvc3ZnPg==") 50% no-repeat}.monaco-editor.hc-dark .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph,.monaco-editor.vs-dark .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS42NyA4LjY1OGMtLjMzOC4zMzQtLjU5OC43MDUtLjc4MSAxLjExNC0uMTc4LjQwNy0uMjY4Ljg1LS4yNjggMS4zMjl2MS42YTEuMzA0IDEuMzA0IDAgMCAxLS43OTQgMS4xOTdjLS4xNTkuMDY4LS4zMjkuMTAyLS41MDkuMTAySDcuNzEyYTEuMjg1IDEuMjg1IDAgMCAxLS45MjItLjM3OSAxLjMwMyAxLjMwMyAwIDAgMS0uMzgtLjkydi0xLjZjMC0uNDc5LS4wOTItLjkyMS0uMjc0LTEuMzI5YTMuNTU2IDMuNTU2IDAgMCAwLS43NzYtMS4xMTQgNC42ODkgNC42ODkgMCAwIDEtMS4wMDYtMS40MzdBNC4xODcgNC4xODcgMCAwIDEgNCA1LjVhNC40MzIgNC40MzIgMCAwIDEgLjYxNi0yLjI3Yy4xOTctLjMzNi40MzItLjY0LjcwNS0uOTE0LjI3NC0uMjcyLjU3OC0uNTA2LjkxMS0uNzAyLjMzOC0uMTk2LjctLjM0OCAxLjA4NC0uNDU0QzcuNyAxLjA1MyA4LjEgMSA4LjUxNiAxYTQuNDc2IDQuNDc2IDAgMCAxIDIuMjc2LjYxNCA0LjQ3NSA0LjQ3NSAwIDAgMSAxLjYyMiAxLjYxNiA0LjQzOCA0LjQzOCAwIDAgMSAuNjE2IDIuMjdjMCAuNjE3LS4xMTcgMS4xOTEtLjM1MyAxLjcyMWE0LjY5IDQuNjkgMCAwIDEtMS4wMDYgMS40Mzd6TTkuNjIzIDEwLjVINy40MDl2Mi4yMDFjMCAuMDgxLjAyOC4xNS4wOS4yMTIuMDYyLjA2MS4xMzEuMDkuMjEzLjA5aDEuNjA2YS4yODkuMjg5IDAgMCAwIC4yMTMtLjA5LjI4Ni4yODYgMCAwIDAgLjA5LS4yMTJWMTAuNXoiIGZpbGw9IiNDMkMyQzIiLz48L3N2Zz4=") 50% no-repeat}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-diff-editor .diff-review-line-number{text-align:right;display:inline-block}.monaco-diff-editor .diff-review{position:absolute;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.monaco-diff-editor .diff-review-summary{padding-left:10px}.monaco-diff-editor .diff-review-shadow{position:absolute}.monaco-diff-editor .diff-review-row{white-space:pre}.monaco-diff-editor .diff-review-table{display:table;min-width:100%}.monaco-diff-editor .diff-review-row{display:table-row;width:100%}.monaco-diff-editor .diff-review-cell{display:table-cell}.monaco-diff-editor .diff-review-spacer{display:inline-block;width:10px}.monaco-diff-editor .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px}.monaco-diff-editor .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-diff-editor .action-label.icon.close-diff-review{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ3LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDhMOCA4LjcwN3oiIGZpbGw9IiM0MjQyNDIiLz48L3N2Zz4=") 50% no-repeat}.monaco-diff-editor.hc-black .action-label.icon.close-diff-review,.monaco-diff-editor.vs-dark .action-label.icon.close-diff-review{background:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDguNzA3bDMuNjQ2IDMuNjQ3LjcwOC0uNzA3TDguNzA3IDhsMy42NDctMy42NDYtLjcwNy0uNzA4TDggNy4yOTMgNC4zNTQgMy42NDZsLS43MDguNzA4TDcuMjkzIDhsLTMuNjQ3IDMuNjQ2LjcwOC43MDhMOCA4LjcwN3oiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=") 50% no-repeat}.context-view .monaco-menu{min-width:130px}.context-view-block{position:fixed;left:0;top:0;z-index:-1;width:100%;height:100%}.monaco-menu .monaco-action-bar.vertical{margin-left:0;overflow:visible}.monaco-menu .monaco-action-bar.vertical .actions-container{display:block}.monaco-menu .monaco-action-bar.vertical .action-item{padding:0;-webkit-transform:none;transform:none;display:-ms-flexbox;display:-webkit-box;display:flex}.monaco-menu .monaco-action-bar.vertical .action-item.active{-webkit-transform:none;transform:none}.monaco-menu .monaco-action-bar.vertical .action-menu-item{-ms-flex:1 1 auto;-webkit-box-flex:1;flex:1 1 auto;display:-ms-flexbox;display:-webkit-box;display:flex;height:2em;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative}.monaco-menu .monaco-action-bar.vertical .action-label{-ms-flex:1 1 auto;-webkit-box-flex:1;flex:1 1 auto;text-decoration:none;padding:0 1em;background:none;font-size:12px;line-height:1}.monaco-menu .monaco-action-bar.vertical .keybinding,.monaco-menu .monaco-action-bar.vertical .submenu-indicator{display:inline-block;-ms-flex:2 1 auto;-webkit-box-flex:2;flex:2 1 auto;padding:0 1em;text-align:right;font-size:12px;line-height:1}.monaco-menu .monaco-action-bar.vertical .submenu-indicator{height:100%;-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNTIgMTIuMzY0TDkuODc5IDcgNC41MiAxLjYzNmwuNjE1LS42MTVMMTEuMTIyIDdsLTUuOTg2IDUuOTgtLjYxNS0uNjE2eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==") no-repeat 90% 50%/13px 13px;mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNTIgMTIuMzY0TDkuODc5IDcgNC41MiAxLjYzNmwuNjE1LS42MTVMMTEuMTIyIDdsLTUuOTg2IDUuOTgtLjYxNS0uNjE2eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==") no-repeat 90% 50%/13px 13px}.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator{opacity:.4}.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator){display:inline-block;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;margin:0}.monaco-menu .monaco-action-bar.vertical .action-item{position:static;overflow:visible}.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu{position:absolute}.monaco-menu .monaco-action-bar.vertical .action-label.separator{padding:.5em 0 0 0;margin-bottom:.5em;width:100%}.monaco-menu .monaco-action-bar.vertical .action-label.separator.text{padding:.7em 1em .1em 1em;font-weight:700;opacity:1}.monaco-menu .monaco-action-bar.vertical .action-label:hover{color:inherit}.monaco-menu .monaco-action-bar.vertical .menu-item-check{position:absolute;visibility:hidden;-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC40MzEgMy4zMjNsLTguNDcgMTAtLjc5LS4wMzYtMy4zNS00Ljc3LjgxOC0uNTc0IDIuOTc4IDQuMjQgOC4wNTEtOS41MDYuNzY0LjY0NnoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=") no-repeat 50% 56%/15px 15px;mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC40MzEgMy4zMjNsLTguNDcgMTAtLjc5LS4wMzYtMy4zNS00Ljc3LjgxOC0uNTc0IDIuOTc4IDQuMjQgOC4wNTEtOS41MDYuNzY0LjY0NnoiIGZpbGw9IiNDNUM1QzUiLz48L3N2Zz4=") no-repeat 50% 56%/15px 15px;width:1em;height:100%}.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check{visibility:visible}.context-view.monaco-menu-container{outline:0;border:none;-webkit-animation:fadeIn 83ms linear;animation:fadeIn 83ms linear}.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,.context-view.monaco-menu-container .monaco-action-bar.vertical :focus,.context-view.monaco-menu-container :focus{outline:0}.monaco-menu .monaco-action-bar.vertical .action-item{border:thin solid transparent}.hc-black .context-view.monaco-menu-container{-webkit-box-shadow:none;box-shadow:none}.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused{background:none}.menubar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-webkit-box-sizing:border-box;box-sizing:border-box;height:30px;overflow:hidden;-ms-flex-wrap:wrap;flex-wrap:wrap}.fullscreen .menubar{margin:0;padding:0 5px}.menubar>.menubar-menu-button{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 8px;cursor:default;-webkit-app-region:no-drag;zoom:1;white-space:nowrap;outline:0}.menubar .menubar-menu-items-holder{position:absolute;left:0;opacity:1;z-index:2000}.menubar .menubar-menu-items-holder.monaco-menu-container{outline:0;border:none}.menubar .menubar-menu-items-holder.monaco-menu-container :focus{outline:0}.menubar .toolbar-toggle-more{background-position:50%;background-repeat:no-repeat;background-size:14px;width:20px;height:100%;display:inline-block;padding:0;-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGExIDEgMCAxIDEtMiAwIDEgMSAwIDAgMSAyIDB6TTkgOGExIDEgMCAxIDEtMiAwIDEgMSAwIDAgMSAyIDB6TTE0IDhhMSAxIDAgMSAxLTIgMCAxIDEgMCAwIDEgMiAweiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") no-repeat 50% 55%/14px 14px;mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgOGExIDEgMCAxIDEtMiAwIDEgMSAwIDAgMSAyIDB6TTkgOGExIDEgMCAxIDEtMiAwIDEgMSAwIDAgMSAyIDB6TTE0IDhhMSAxIDAgMSAxLTIgMCAxIDEgMCAwIDEgMiAweiIgZmlsbD0iI0M1QzVDNSIvPjwvc3ZnPg==") no-repeat 50% 55%/14px 14px}.context-view{position:absolute;z-index:2000}.monaco-view{height:100%;position:relative} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-47a06954.702f1fa1.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-47a06954.702f1fa1.css new file mode 100644 index 000000000..c4c2305b9 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-47a06954.702f1fa1.css @@ -0,0 +1 @@ +.el-tag[data-v-82ff0dae]{margin-left:10px}.details[data-v-82ff0dae]{margin-right:5px;color:#a7a7a7;cursor:pointer;vertical-align:middle} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-4a5c704e.75ab2c7d.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-4a5c704e.75ab2c7d.css new file mode 100644 index 000000000..381057a0a --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-4a5c704e.75ab2c7d.css @@ -0,0 +1 @@ +.resources-node{list-style-type:none;padding:0;margin:0}.resources-node li{padding:4px 0}.resources-node li .ant-badge-not-a-wrapper{margin-top:-2px}.resources-node .el-button{margin-left:12px}.resource-field .field-info-item{display:-webkit-box;display:-ms-flexbox;display:flex}.resource-field .field-info-item .field-title{width:unset;-ms-flex-negative:0;flex-shrink:0}.resource-field .field-info-item .field-value .field-password{vertical-align:middle;line-height:17px}.resource-field .field-info-item .field-value .el-icon-view{margin-left:5px;cursor:pointer;color:#a2a2a2}.resource-field .field-info-item .field-value .active,.resource-field .field-info-item .field-value .el-icon-view:hover{color:#34c388}.resource-view .rule-wrapper .code,.resource-view .rule-wrapper .code-view,.resource-view .rule-wrapper .el-autocomplete,.resource-view .rule-wrapper .el-input,.resource-view .rule-wrapper .el-select,.resource-view .rule-wrapper .el-textarea{width:100%}.resource-view .rule-wrapper .code{font-size:13px;padding:4px;border:1px dashed #fff;-webkit-transition:all .3s;transition:all .3s;line-height:24px}.resource-view .rule-wrapper .code.code-border{border:1px dashed #fff}.resource-view .rule-wrapper .code.code-border:hover{border:1px dashed #d8d8d8}.resource-view .rule-wrapper .code code{word-break:break-word}.resource-view .rule-wrapper .icon,.resource-view .rule-wrapper .tips{margin-left:12px}.resource-view .rule-wrapper .tips{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:12px}.resource-view .rule-wrapper .line{width:95%;margin:30px auto 28px auto;background-color:#edeef2}.resource-view .detail-title-wrapper{margin:-28px -24px 24px;padding:10px 0}.resource-view .detail-title-wrapper .ant-card-body{padding:14px 32px}.resource-view .emq-list-card{margin-bottom:24px}.resource-view .metrics-wrapper{margin-top:-12px}.resource-view .metrics-card{color:#101010}.resource-view .metrics-card:not(.last-child){border-right:1px solid #d8d8d8}.resource-view .metrics-card .card-title{font-size:14px;height:36px;line-height:36px;font-weight:700}.resource-view .metrics-card .card-value{font-size:32px}.resource-view .metrics-card .card-unit{font-size:14px}.resource-view .metrics-card .card-desc{margin-top:8px;font-size:12px;color:#a2a2a2}.resource-view .field-title{width:110px}.resource-view .ant-badge-status-text{font-size:12px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-4aeced56.6623c461.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-4aeced56.6623c461.css new file mode 100644 index 000000000..e4f899f76 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-4aeced56.6623c461.css @@ -0,0 +1 @@ +.login{width:100vw;min-height:100vh;-webkit-box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08)}.login .ant-card-body{padding:0}.login .emq-title{margin-bottom:32px}.login .el-form-item{margin:42px 0}.login .logo-wrapper{background-image:url(../../static/img/emqx_banner.20c13f08.png);background-size:100%;background-repeat:no-repeat;position:relative;height:512px;border-radius:6px 0 0 6px;width:50%;float:left}.login .logo-wrapper .logo{position:relative;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:10;text-align:center}.login .logo-wrapper .logo img{width:84px}.login .login-wrapper{width:50%;float:left;padding:24px;height:512px}.login .login-card{width:640px;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border-radius:6px}.login .oper-wrapper{margin-top:32px}.login .sub-btn{width:100%} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-53e9a7a2.b3cd5b9f.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-53e9a7a2.b3cd5b9f.css new file mode 100644 index 000000000..d232afde7 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-53e9a7a2.b3cd5b9f.css @@ -0,0 +1 @@ +.create-subscribe .el-input,.create-subscribe .el-select{width:100%}.client-details .connection .field-title{min-width:120px}.client-details .session .field-title{min-width:160px}.client-details .detail-card{margin-bottom:24px}.client-details .emq-title{margin-bottom:28px}.client-details .field-info-item{margin-bottom:5px}.client-details .subscriptions-header{float:right}.client-details .data-list{clear:both}.client-details .view-more{margin:20px 0 0 0}.client-details .more-info{margin-top:20px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-59e5d464.dbc1edc5.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-59e5d464.dbc1edc5.css new file mode 100644 index 000000000..3eefa494e --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-59e5d464.dbc1edc5.css @@ -0,0 +1 @@ +.node-basic-card{padding:10px}.node-basic-card .field-info.stats .field-title{width:130px}.node-basic-card .version-wrapper{width:100%;padding:8px 16px;border-radius:2px;background:#f8f8f8;font-size:14px}.node-basic-card .version-wrapper .version-title{color:#333;font-weight:bolder}.node-basic-card .basic-info{margin-top:20px;padding:0 16px}.node-basic-card .basic-info .node-form .el-form-item{margin-bottom:-6px}.node-basic-card .basic-info .node-form .el-form-item__label{color:#666}.node-basic-card .basic-info .node-form .form-item-value{color:#333}.node-basic-card .basic-info .form-btn{margin-top:20px;width:120px}.node-basic-card .basic-info .ant-badge{margin-top:-3px}.node-basic-card .basic-info .ant-badge .ant-badge-status-text{font-size:14px}.node-basic-card .basic-info .ant-badge .ant-badge-status-dot{width:8px;height:8px}.node-basic-card .basic-info .el-icon-question{margin-left:6px}.node .emq-title{margin-bottom:40px}.node .el-table .caret-wrapper{left:-8px}.node .el-row.stats-row{margin-bottom:20px}.node .page-header-footer{position:absolute;bottom:-14px}.node .page-header-footer .el-tabs__item{font-weight:400}.node .page-header-footer .el-tabs__item.is-active{font-weight:500}.node .page-header-footer .el-tabs__nav-wrap:after{height:0}.node .card-wrapper .emq-list-card{margin-bottom:24px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-5f0ec173.5b55e2a1.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-5f0ec173.5b55e2a1.css new file mode 100644 index 000000000..93a1eeaf7 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-5f0ec173.5b55e2a1.css @@ -0,0 +1 @@ +.websocket-item .el-form-item .el-form-item__label{padding:0}.websocket-item .el-row .el-input,.websocket-item .el-row .emq-select{width:100%}.websocket-item .emq-list-card{border-radius:2px;-webkit-box-shadow:none;box-shadow:none;border:none}.websocket-item .emq-list-card .el-card__body{padding:24px 32px}.websocket-item .websocket-header{background-color:#fff}.websocket-item .session-item{margin-right:12px}.websocket-item .session-btn{float:right}.websocket-item .connection-wrapper .el-form-item .el-form-item__label{padding:0}.websocket-item .conn-btn{min-width:90px}.websocket-item .el-input_icon{cursor:pointer}.websocket-item .emq-title{margin-bottom:24px}.websocket-item .line{background-color:#f1f1f1;margin:24px auto}.websocket-item .emq-list-card{margin-bottom:24px}.websocket-item .sub-item-wrapper{max-height:720px}.websocket-item .sub-item.ant-card{margin:0 20px 12px 20px}.websocket-item .sub-item.ant-card .create-at,.websocket-item .sub-item.ant-card .qos{font-size:12px;color:#888;margin-right:12px}.websocket-item .sub-item.ant-card .topic{font-size:16px;color:#000;margin:4px auto}.websocket-item .sub-item.ant-card .ant-card-body{padding:12px;position:relative}.websocket-item .sub-item.ant-card .close-btn{position:absolute;top:10px;right:10px;font-size:18px;cursor:pointer;color:#d8d8d8}.websocket-item .message-item-wrapper{max-height:2048px}.websocket-item .message-item.ant-card{margin:20px auto;position:relative}.websocket-item .message-item.ant-card:not(.message-out){border-left:4px solid #d8d8d8}.websocket-item .message-item.ant-card.message-out{border-right:4px solid #d8d8d8}.websocket-item .message-item.ant-card .ant-card-body{padding:6px;position:relative;color:#000}.websocket-item .message-item.ant-card .message-item-header{font-size:12px;color:#888}.websocket-item .message-item.ant-card .message-item-header>span{margin-right:12px}.websocket-item .message-item.ant-card .message-item-header .create-at{float:right}.websocket-item .message-item.ant-card .message-item-content{margin-top:6px;padding:6px}.websocket-item .footer-area{margin-top:20px}.websocket-item .message-btn{margin:10px auto}.websocket-item .message-btn .icon{margin-left:6px;cursor:pointer}.websocket{position:relative}.websocket .el-icon-plus,.websocket .el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close{font-weight:600;overflow:visible}.websocket .el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.websocket .el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.websocket .el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.websocket .el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2){padding:0 13px}.websocket #tab-add.el-tabs__item{width:43px;padding:0 13px}.websocket .el-badge__content{background:#f56c6c;-webkit-transform:scale(.8);transform:scale(.8);border:none}.websocket .el-badge__content.is-fixed{right:-14px}html:lang(zh) .websocket .el-tabs .el-tabs__item{width:86px;padding:0 13px}html:lang(zh) .websocket .el-tabs .el-tabs__item.is-active{padding:0 13px}html:lang(en) .websocket .el-tabs .el-tabs__item{width:76px;padding:0 13px}html:lang(en) .websocket .el-tabs .el-tabs__item.is-active{padding:0 13px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-69b6fda6.59698d74.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-69b6fda6.59698d74.css new file mode 100644 index 000000000..e671faf96 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-69b6fda6.59698d74.css @@ -0,0 +1 @@ +.node-basic-card{padding:10px}.node-basic-card .field-info.stats .field-title{width:130px}.node-basic-card .version-wrapper{width:100%;padding:8px 16px;border-radius:2px;background:#f8f8f8;font-size:14px}.node-basic-card .version-wrapper .version-title{color:#333;font-weight:bolder}.node-basic-card .basic-info{margin-top:20px;padding:0 16px}.node-basic-card .basic-info .node-form .el-form-item{margin-bottom:-6px}.node-basic-card .basic-info .node-form .el-form-item__label{color:#666}.node-basic-card .basic-info .node-form .form-item-value{color:#333}.node-basic-card .basic-info .form-btn{margin-top:20px;width:120px}.node-basic-card .basic-info .ant-badge{margin-top:-3px}.node-basic-card .basic-info .ant-badge .ant-badge-status-text{font-size:14px}.node-basic-card .basic-info .ant-badge .ant-badge-status-dot{width:8px;height:8px}.node-basic-card .basic-info .el-icon-question{margin-left:6px}.percentage-cards{margin-top:20px}.percentage-cards .doughnut-card{-webkit-transition:all .15s cubic-bezier(.645,.045,.355,1);transition:all .15s cubic-bezier(.645,.045,.355,1);border-radius:8px;height:255px}.percentage-cards .doughnut-card:hover{-webkit-box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);-webkit-transform:translateY(-1px);transform:translateY(-1px);border-color:#fff}.percentage-cards .doughnut-card .ant-card-body{padding:12px}.polyline-cards .big-card,.polyline-cards .polyline-card{-webkit-transition:all .15s cubic-bezier(.645,.045,.355,1);transition:all .15s cubic-bezier(.645,.045,.355,1);border-radius:8px;margin-top:20px;position:relative}.polyline-cards .big-card:hover,.polyline-cards .polyline-card:hover{-webkit-box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);-webkit-transform:translateY(-1px);transform:translateY(-1px);border-color:#fff}.polyline-cards .big-card .ant-card-body,.polyline-cards .polyline-card .ant-card-body{padding:12px}.polyline-cards .big-card .card-title,.polyline-cards .polyline-card .card-title{font-size:16px;color:#333;font-weight:700;margin:2px 0 10px 6px}.polyline-cards .enlarge-icon,.polyline-cards .shrink-icon{position:absolute;width:16px;height:16px;background-size:100% 100%;z-index:1;cursor:pointer}.polyline-cards .enlarge-icon{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA6klEQVQ4T2Pct//4fwZsgPH/LCcHq3SsckiCjNQ24AoLM7uTnZ3Ra0I2w+ThLmBkYLjyn4FBh4GBgSRD4AawMLOL/fn7cx8DiYbADXBytGQ8dOicKLIh//4yObi4mL/F5x3GfQeOzQQpgIU43BBGhlu3b7JGpKeb/MZrADbJPXtOCt+9y/yJkGaQXkZiQnvmzDOsysp/+bB5h6ABIM2q6r9XMPxnUEOOYpjXCRpw7NgxoR8/GQ+ixw4sARI0AORF9NgBueTP35+viA4DbIZAXURcIMICGs0lYGGivAAOsP+MaVgzLTHRiM8AAK48hICWs2KMAAAAAElFTkSuQmCC) no-repeat;right:10px;bottom:10px}.polyline-cards .shrink-icon{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+ElEQVQ4T8WTPYoCQRCF35sRBXM9xUZmKvgzGxh7CYU9wsZewUBzwcALGNjKgD/RRhN5hN18YcdxSrpRWWUYuiM7q4b6+lW91wQApQ4fp9N50es1v3XtcqibQRkTiOI4fdcQpQ4DUCagTINOY5gH5HK5rRaL3kqANwBRwS8FSRL3rQGa/gyh580lTUdWCm7ywvCrkpz/FLQS4heCsjXAzAyAPisi6adpNhcWOzAurPeSuShrwGY3yQKQDLvt+izXBRfPMx+xAeSNyFcATNhardqPMcpFgY77/8RqiBOg4Jeq97BdY+8ECLp1PiQWiOwA15zcfuYdQhwv4PGIO22pe14AAAAASUVORK5CYII=) no-repeat;right:15px;bottom:15px}.polyline-cards .big-card{height:480px}.polyline-cards .big-card .shrink-icon{visibility:hidden}.polyline-cards .big-card:hover .shrink-icon{visibility:visible}.polyline-cards .polyline-card{height:255px}.polyline-cards .polyline-card .enlarge-icon{visibility:hidden}.polyline-cards .polyline-card:hover .enlarge-icon{visibility:visible}.overview .status-count{text-align:center}.overview .flux-wrapper{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.overview .flux-wrapper .simple-line{-webkit-box-sizing:border-box;box-sizing:border-box;height:32px}.overview .license-card,.overview .node-wrapper{margin-top:20px;border-radius:8px}.overview .app-card{-webkit-transition:all .15s cubic-bezier(.645,.045,.355,1);transition:all .15s cubic-bezier(.645,.045,.355,1);border-radius:8px}.overview .app-card:hover{-webkit-box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);box-shadow:0 7px 14px rgba(50,50,93,.1),0 3px 6px rgba(0,0,0,.08);-webkit-transform:translateY(-1px);transform:translateY(-1px);border-color:#fff}.overview .app-card .ant-card-head{border-bottom:none;padding:0 16px}.overview .app-card .app-card-title{font-size:14px;color:rgba(0,0,0,.4)}.overview .app-card .ant-card-body{padding:16px 16px 0 16px}.overview .app-card .content{color:rgba(0,0,0,.85);min-height:90px;font-size:30px;padding-bottom:8px;border-bottom:1px dashed #e8e8e8;position:relative}.overview .app-card .content .unit{font-size:14px;margin-left:2px}.overview .app-card .content .charts{margin-top:6px}.overview .app-card .app-footer{padding:10px 0}.overview .app-card .app-footer .footer-item{color:rgba(0,0,0,.65)}.overview .app-card .app-footer .footer-item .item-value{color:rgba(0,0,0,.85);margin-left:12px}.overview .license-card .license-card-footer,.overview .node-wrapper .emq-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.overview .license-card .license-card-footer{margin-top:12px}.overview .license-card .license-card-footer .description{font-size:12px;color:#b2b2b2;line-height:1.4;width:440px}.overview .license-card .license-card-footer .oper{width:100px;text-align:center;font-size:14px}.overview .license-card .license-card-footer .oper .el-tag{display:block}.overview .license-field{list-style-type:none;padding-left:0}.overview .license-field .item{font-size:14px;color:#666;padding:6px 0}.overview .license-field .item .key{margin-right:24px}.overview .license-field .item .value{color:#333}.overview .license-field .item .content,.overview .license-field .item .value.broker{margin-top:6px}.overview .license-field .item .el-progress .el-progress__text{display:block;padding-left:0;margin-top:6px;margin-left:0;font-size:12px!important}.overview .el-progress .el-progress-bar{padding-right:0}.overview .el-progress.status-progress .el-progress-bar__inner,.overview .el-progress.status-progress .el-progress-bar__outer{border-radius:0}.overview .emq-title{margin-bottom:20px}.overview .data-list{min-height:300px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.overview .tip-title{font-size:18px}.overview .tip-title .el-icon-warning{color:#e6a23c}.overview .tip-title span{display:inline-block;margin-left:10px}.overview .tip-content{font-size:16px}.overview .tip-content p{word-break:break-word}.overview .tip-checkbox{margin-top:10px}.overview .tip-checkbox .el-checkbox{color:#aaa}.overview .tip-button{text-align:right} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-6c281630.05abdf4e.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-6c281630.05abdf4e.css new file mode 100644 index 000000000..b31bfac43 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-6c281630.05abdf4e.css @@ -0,0 +1 @@ +.not-found[data-v-16e0548e]{text-align:center;margin-top:40px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-73c7a756.0d6e7a8d.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-73c7a756.0d6e7a8d.css new file mode 100644 index 000000000..71e0d2460 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-73c7a756.0d6e7a8d.css @@ -0,0 +1 @@ +.custom-pagination{margin-top:10px}.custom-pagination a{-webkit-transition:all .3s ease;transition:all .3s ease;color:#fff;margin-right:10px;background:#34c388;display:inline-block;border-radius:4px;padding:5px 8px;border:1px solid #e6e6e6}.custom-pagination a:hover{color:#fff}.custom-pagination a.disabled{-webkit-transition:all .3s ease;transition:all .3s ease;color:#606266;background:transparent;cursor:not-allowed}.subscriptions .data-list{clear:both}.subscriptions .page-header-content-view .content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.subscriptions .app-wrapper .search-wrapper{display:block;width:100%}.subscriptions .app-wrapper .search-wrapper .el-date-editor.el-input,.subscriptions .app-wrapper .search-wrapper .el-date-editor.el-input__inner,.subscriptions .app-wrapper .search-wrapper .el-select{width:100%}.subscriptions .app-wrapper .search-wrapper .col-oper{float:right}.subscriptions .app-wrapper .search-wrapper .show-more{margin-left:12px}.subscriptions .app-wrapper .search-wrapper .el-col-8{margin-bottom:20px}.subscriptions .app-wrapper .search-wrapper .el-col-8.form-item-col{margin-bottom:0}.subscriptions .app-wrapper .search-wrapper .form-item-row{margin-top:0}.subscriptions .app-wrapper .search-wrapper .form-item-row .el-select.match .el-input__inner{border-radius:4px 0 0 4px}.subscriptions .app-wrapper .search-wrapper .form-item-row .el-input .el-input__inner{border-radius:0 4px 4px 0} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7a115fb5.ca6ff1a6.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7a115fb5.ca6ff1a6.css new file mode 100644 index 000000000..39448056e --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7a115fb5.ca6ff1a6.css @@ -0,0 +1 @@ +.backup .el-table{margin-bottom:40px}.backup .upload-backup{text-align:right} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7a82b09c.24696130.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7a82b09c.24696130.css new file mode 100644 index 000000000..004491f16 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7a82b09c.24696130.css @@ -0,0 +1 @@ +.plugins .plugin-item{position:relative;font-size:14px;margin:0;padding:24px 32px;background:#fff;display:-webkit-box;display:-ms-flexbox;display:flex}.plugins .plugin-item .logo{border-radius:4px;overflow:hidden}.plugins .plugin-item .name{color:#101010;font-size:16px;line-height:22px;margin-bottom:12px}.plugins .plugin-item .el-tooltip.tutorial{position:relative;top:1px}.plugins .plugin-item .description{color:rgba(0,0,0,.65);font-size:14px;line-height:22px;max-width:300px}.plugins .plugin-cards-wrapper .plugin-item{height:140px;margin-bottom:20px}.plugins .plugin-cards-wrapper .plugin-item .ant-badge-status-text{color:#101010;font-size:16px}.plugins .plugin-cards-wrapper .plugin-item .header{-webkit-box-flex:1;-ms-flex:1;flex:1;padding-left:20px}.plugins .plugin-cards-wrapper .plugin-item .header .type-version{margin-top:12px;font-style:italic}.plugins .plugin-cards-wrapper .plugin-item .header .el-tooltip.tutorial{left:5px}.plugins .plugin-cards-wrapper .oper{position:relative}.plugins .plugin-cards-wrapper .oper .el-button{min-width:64px;float:right}.plugins .plugin-cards-wrapper .oper .manage-btn{position:absolute;bottom:0;right:0}.plugins .plugin-list-wrapper .plugin-item{height:110px;border-bottom:1px solid #f1f1f1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.plugins .plugin-list-wrapper .plugin-item .header{-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;padding-left:50px}.plugins .plugin-list-wrapper .plugin-item .header .el-tooltip.tutorial{left:2px}.plugins .plugin-list-wrapper .plugin-item .content{margin-left:40px;-webkit-box-flex:1;-ms-flex:1;flex:1}.plugins .plugin-list-wrapper .plugin-item .content .type,.plugins .plugin-list-wrapper .plugin-item .content .version{color:rgba(0,0,0,.55);margin-top:4px;margin-bottom:0;line-height:22px}.plugins .plugin-list-wrapper .plugin-item .state{height:18px;-webkit-box-flex:1;-ms-flex:1;flex:1}.plugins .plugin-list-wrapper .plugin-item .oper{-webkit-box-flex:50px;-ms-flex:50px;flex:50px}.plugins .search-wrapper{margin-bottom:30px}.plugins .search-wrapper .el-radio-button--small .el-radio-button__inner{font-size:13px}.plugins .search-wrapper .search-input .el-icon-loading,.plugins .search-wrapper .search-input .el-icon-search{position:relative;left:4px;top:7px}.plugins .null-plugins{min-height:130px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.plugins .tip-title{font-size:18px}.plugins .tip-title .el-icon-warning{color:#e6a23c}.plugins .tip-title span{display:inline-block;margin-left:10px}.plugins .tip-content{font-size:16px}.plugins .tip-content p{word-break:break-word}.plugins .tip-checkbox{margin-top:10px}.plugins .tip-checkbox .el-checkbox{color:#aaa}.plugins .tip-button{text-align:right} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7b01e2fb.d6669dc8.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7b01e2fb.d6669dc8.css new file mode 100644 index 000000000..b742c6401 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-7b01e2fb.d6669dc8.css @@ -0,0 +1 @@ +.config-form .show-more{text-align:center}.config-form .show-more a{display:inline-block;width:100%;position:relative;text-decoration:none;margin-top:10px}.config-form .show-more a:before{left:0}.config-form .show-more a:after,.config-form .show-more a:before{content:"";position:absolute;top:8px;z-index:9;width:46%;height:1px;background-color:#edeef2}.config-form .show-more a:after{right:0}.config-form .form-item-input .el-icon-close{visibility:hidden}.config-form .form-item-input:hover .el-icon-close{visibility:visible;cursor:pointer}.base-settings .base-form .el-form,.config-detail .no-form-margin{margin-top:0}.config-detail .form-margin{margin-top:32px}.config-detail .show-more{text-align:center}.config-detail .show-more span{display:inline-block;margin-right:55px}.config-detail .show-more a{display:inline-block;width:100%;position:relative;text-decoration:none;margin-top:10px}.config-detail .show-more a:before{left:0;width:44%}.config-detail .show-more a:after,.config-detail .show-more a:before{content:"";position:absolute;top:8px;z-index:9;height:1px;background-color:#edeef2}.config-detail .show-more a:after{right:0;width:49%}.zone-settings .el-tabs__item.is-active .delete-icon{visibility:hidden}.zone-settings .el-tabs__item.is-active:hover .delete-icon{visibility:visible}.zone-settings .label-box{position:relative}.zone-settings .label-box .delete-icon{position:absolute;cursor:pointer;right:-20px;top:0;color:#aaa}.zone-settings .label-box .delete-icon:hover{color:#23bd78}.zone-settings .label-box .hide-delete{display:none}.cluster-settings .emq-title{margin:0}.cluster-settings .cluster-form .join-status{display:inline-block;min-width:200px}.cluster-settings .cluster-form .join-status:not(.not-point):before{content:"";display:inline-block;height:8px;width:8px;margin-right:2px;border-radius:4px;background-color:transparent}.cluster-settings .cluster-form .join-status.is-join:before{background-color:#34c388}.cluster-settings .cluster-form .join-status.not-join:before{background-color:#afafaf}.cluster-settings .cluster-form .not-join__desc{color:#afafaf}.cluster-settings .cluster-form .node-oper+.node-oper{margin-left:10px}.cluster-settings .cluster-form .node-oper.danger{color:#f5222d}.listener-settings .return-button{color:#34c388;font-size:14px;cursor:pointer}.listener-settings .return-button i{font-weight:700}.listener-settings .delete-button{display:inline-block;color:red;font-size:14px;cursor:pointer}.listener-settings .el-col-offset-16{text-align:right}.settings .el-form .el-input.is-disabled .el-input__inner{color:#676767}.settings .el-form .el-col{min-height:60px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.settings .el-form .el-form-item{margin-bottom:0;-webkit-box-flex:1;-ms-flex:1;flex:1}.settings .el-form .form-item-desc{font-size:13px;color:#676767;-webkit-box-flex:1;-ms-flex:1;flex:1}.settings .el-form .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before,.settings .el-form .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{color:transparent}.settings .button-group__center{margin-top:20px;margin-bottom:10px;text-align:right}.settings .not-settings{text-align:center;margin-top:150px}.settings .not-settings img{margin-bottom:50px}.settings .not-settings .confirm-btn{width:125px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-8ed2d5e8.b90bf6aa.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-8ed2d5e8.b90bf6aa.css new file mode 100644 index 000000000..bb51fa31d --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-8ed2d5e8.b90bf6aa.css @@ -0,0 +1 @@ +.key-and-value-editor{font-size:12px!important}.key-and-value-editor .el-input{width:100%!important}.key-and-value-editor .el-input.key-input{width:120px!important}.key-and-value-editor .el-table__empty-block{min-height:40px}.file-editor .el-upload{width:100%;text-align:right}.file-editor .el-upload .file-icon{color:#34c388}.resource-dialog .line{width:100%;margin:10px auto 20px auto;background-color:#edeef2}.resource-dialog .show-more{text-align:center}.resource-dialog .show-more a{position:relative;text-decoration:none}.resource-dialog .show-more a:before{left:-215px}.resource-dialog .show-more a:after,.resource-dialog .show-more a:before{content:"";position:absolute;top:8px;z-index:9;width:200px;height:1px;background-color:#edeef2}.resource-dialog .show-more a:after{right:-215px}.resource-dialog .el-form-item .el-select{width:100%}.resource-dialog .el-form-item .el-select:not(.reset-width){width:330px}.resource-dialog .el-form-item .el-form-item__label{padding-bottom:0;font-size:12px}.resource-dialog .config-item-wrapper{min-height:100px}.resource-dialog .config-item-wrapper .params-loading-wrapper{padding:0 32px}.resource-dialog .config-item-wrapper .el-input,.resource-dialog .config-item-wrapper .el-select{width:200px!important} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-94b856f2.08867920.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-94b856f2.08867920.css new file mode 100644 index 000000000..d2bf2bd4a --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-94b856f2.08867920.css @@ -0,0 +1 @@ +.hljs{display:block;overflow-x:auto;padding:.5em;background:#002b36;color:#839496}.hljs-comment,.hljs-quote{color:#586e75}.hljs-addition,.hljs-keyword,.hljs-selector-tag{color:#859900}.hljs-doctag,.hljs-literal,.hljs-meta .hljs-meta-string,.hljs-number,.hljs-regexp,.hljs-string{color:#2aa198}.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-title{color:#268bd2}.hljs-attr,.hljs-attribute,.hljs-class .hljs-title,.hljs-template-variable,.hljs-type,.hljs-variable{color:#b58900}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-meta .hljs-keyword,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-subst,.hljs-symbol{color:#cb4b16}.hljs-built_in,.hljs-deletion{color:#dc322f}.hljs-formula{background:#073642}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.code-view{line-height:1.3}.code-view.hljs{padding:20px;border-radius:2px}.rule-metrics-table .oper-wrapper .ctl-title{margin:10px auto;text-align:center}.rule-view .rule-wrapper .code,.rule-view .rule-wrapper .code-view,.rule-view .rule-wrapper .el-autocomplete,.rule-view .rule-wrapper .el-input,.rule-view .rule-wrapper .el-select,.rule-view .rule-wrapper .el-textarea{width:100%}.rule-view .rule-wrapper .code{font-size:13px;padding:4px;border:1px dashed #fff;-webkit-transition:all .3s;transition:all .3s;line-height:24px}.rule-view .rule-wrapper .code.code-border{border:1px dashed #fff}.rule-view .rule-wrapper .code.code-border:hover{border:1px dashed #d8d8d8}.rule-view .rule-wrapper .code code{word-break:break-word}.rule-view .rule-wrapper .icon,.rule-view .rule-wrapper .tips{margin-left:12px}.rule-view .rule-wrapper .tips{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:12px}.rule-view .rule-wrapper .line{width:95%;margin:30px auto 28px auto;background-color:#edeef2}.rule-view .detail-title-wrapper{margin:-28px -24px 24px;padding:10px 0}.rule-view .detail-title-wrapper .ant-card-body{padding:14px 32px}.rule-view .emq-list-card{margin-bottom:24px}.rule-view .metrics-wrapper{margin-top:-12px}.rule-view .metrics-card{color:#101010}.rule-view .metrics-card:not(.last-child){border-right:1px solid #d8d8d8}.rule-view .metrics-card .card-title{font-size:14px;height:36px;line-height:36px;font-weight:700}.rule-view .metrics-card .card-value{font-size:32px}.rule-view .metrics-card .card-unit{font-size:14px}.rule-view .metrics-card .card-desc{margin-top:8px;font-size:12px;color:#a2a2a2}.rule-view .field-title{width:100px}.rule-view .rule-metrics-table{margin-top:20px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-a14add7e.58a5af04.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-a14add7e.58a5af04.css new file mode 100644 index 000000000..c2255f0b3 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-a14add7e.58a5af04.css @@ -0,0 +1 @@ +.mnesia-auth-table .emq-table-header{padding-bottom:3px}.mnesia-auth-table .add-form{display:block;width:100%}.mnesia-auth-table .add-form .el-select{width:100%}.mnesia-auth-table .add-form .col-oper .el-button{margin-left:12px}.mnesia-auth-table .data-list{clear:both}.mnesia-auth-table .col-oper{margin-top:4px}.acl-table-page .emq-table-header{padding-bottom:3px}.acl-table-page .add-form{display:block;width:100%}.acl-table-page .add-form .el-select{width:100%}.acl-table-page .add-form .col-oper .el-button{margin-left:12px}.acl-table-page .data-list{clear:both}.acl-table-page .col-oper{margin-top:13px}.acl-table-page .el-col-4,.acl-table-page .el-col-6{margin-top:9px}.jwt-authentication .monaco-container{height:200px}.jwt-authentication .el-date-editor.el-input,.jwt-authentication .el-date-editor.el-input__inner,.jwt-authentication .el-select{width:100%}.jwt-authentication .el-table{margin-top:40px}.jwt-authentication .jwt-payload-desc{font-size:14px;padding:12px;border-radius:4px;line-height:1.4;margin:16px 0;background:#f6f7fb}.auth-sasl .list-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:24px}.auth-sasl .list-header .title{color:#333;font-size:16px;font-weight:600}.auth-sasl .mechanism-box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-bottom:10px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.auth-sasl .mechanism-box .label{display:inline-block;color:#757575;font-size:16px;margin-right:10px}.auth-sasl .mechanism-item .el-select{width:100%}.auth-sasl .key-items{position:relative}.auth-sasl .key-items .handle-icons{position:absolute;bottom:0;right:0;width:50px;height:32px;text-align:right;font-size:16px}.auth-sasl .key-items .handle-icons i{cursor:pointer;color:#34c388}.lw-client-details .el-col-16{padding-left:0}.lw-client-details .error-red{color:#f5222d}.lw-client-details .main-green{color:#34c388}.lw-client-details .main-black{color:#101010}.lw-client-details .light-gray{color:rgba(0,0,0,.45)}.lw-client-details .row-title{font-size:16px;font-weight:600}.lw-client-details .emq-list-card:first-child{margin-bottom:24px}.lw-client-details .emq-list-card:first-child .detail-header{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:15px}.lw-client-details .emq-list-card:first-child .detail-header .el-icon-arrow-left{font-weight:600}.lw-client-details .emq-list-card:first-child .detail-header .endpoint{display:inline-block;margin-left:20px}.lw-client-details .collapse-title{width:100%;font-size:14px}.lw-client-details .collapse-content{padding:20px;padding-bottom:0}.lw-client-details .collapse-content .row-titles{min-height:42px!important}.lw-client-details .collapse-content .data-type{display:inline-block}.lw-client-details .collapse-content .content-item-row{min-height:36px!important}.lw-client-details .collapse-content .content-item-row .row-value-item{display:inline-block;margin-right:10px}.lw-client-details .collapse-content .stop-button{margin-left:1px}.lw-client-details .collapse-content .stop-button:hover .stop-icon{background-color:#34c388}.lw-client-details .collapse-content .stop-button .stop-icon{display:inline-block;width:8px;height:8px;background-color:rgba(0,0,0,.65)}.lw-client-details .el-collapse-item__content{padding-bottom:0;font-size:14px}.lw-client-details .el-collapse-item__header{padding-left:12px;border-radius:2px}.lw-client-details .el-collapse-item__arrow{color:#34c388;font-size:14px;font-weight:600}.lw-client-details .el-collapse-item__wrap{padding-bottom:20px;background-color:#f8f9fc}.lw-client-details .create-object .el-select,.lw-client-details .el-date-editor.el-input,.lw-client-details .el-date-editor.el-input__inner,.lw-client-details .el-input-number--small{width:100%}.lw-clients .page-header{margin:0 0 20px 0}.lw-clients .page-header .current-clients{display:inline-block;color:#34c388;margin-left:10px}.lw-clients .lw-clients-header,.lw-clients .page-header .content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.lw-clients .lw-clients-header{margin-bottom:24px;height:32px}.lw-clients .lw-clients-header .search-input .el-icon-loading,.lw-clients .lw-clients-header .search-input .el-icon-search{position:relative;left:4px;top:7px}.topic-metrics .el-table .expand-header{height:32px;line-height:32px;margin-bottom:20px}.topic-metrics .el-table .topic-qos-radio{float:right}.topic-metrics .el-table .message-card{height:112px;border-radius:4px;padding:6px 12px;color:#fff}.topic-metrics .el-table .message-card.in{background:-webkit-gradient(linear,left top,right top,from(#3e3ab4),to(#4c5ae0));background:linear-gradient(90deg,#3e3ab4,#4c5ae0)}.topic-metrics .el-table .message-card.out{background:-webkit-gradient(linear,left top,right top,from(#0c7cd1),to(#19bcc2));background:linear-gradient(90deg,#0c7cd1,#19bcc2)}.topic-metrics .el-table .message-card.drop{background:-webkit-gradient(linear,left top,right top,from(#00ac70),to(#34c388));background:linear-gradient(90deg,#00ac70,#34c388)}.topic-metrics .el-table .message-card .message-card--body{font-size:28px;height:80px;line-height:80px;text-align:center}.topic-metrics .el-table .message-card .message-rate{float:right} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-a8ae90d8.35afa7a6.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-a8ae90d8.35afa7a6.css new file mode 100644 index 000000000..f05a2dd75 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-a8ae90d8.35afa7a6.css @@ -0,0 +1 @@ +.modules .header-box .content[data-v-6f2e92f1],.modules .page-header-content-view .content[data-v-6f2e92f1]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-width:830px}.modules .header-box .content .modules-num[data-v-6f2e92f1],.modules .page-header-content-view .content .modules-num[data-v-6f2e92f1]{display:inline-block;min-width:38px;padding:2px 10px;text-align:center;color:#fff;font-size:13px;border-radius:15px;background-color:#2f333e;margin:0 12px}.modules .el-card[data-v-6f2e92f1]{margin-bottom:20px}.modules .module-item[data-v-6f2e92f1]{position:relative;cursor:pointer}.modules .module-item .item-error-tip[data-v-6f2e92f1],.modules .module-item[data-v-6f2e92f1]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.modules .module-item .item-error-tip[data-v-6f2e92f1]{position:absolute;top:0;left:0;width:100%;padding:5px 20px;background-color:#fff8e5;font-size:12px;border-left:5px solid #ffb900}.modules .module-item .item-error-tip .reconnect-btn[data-v-6f2e92f1]{width:40px;height:18px;line-height:8px;color:#f56e28;border:1px solid #f56e28;background-color:#fff8e5}.modules .module-item .left-box[data-v-6f2e92f1]{display:-webkit-box;display:-ms-flexbox;display:flex}.modules .module-item .item-img[data-v-6f2e92f1]{width:85px;height:85px;-ms-flex-negative:0;flex-shrink:0}.modules .module-item .item-content[data-v-6f2e92f1]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-left:20px;margin-right:10px;-ms-flex-item-align:start;align-self:flex-start}.modules .module-item .item-content .item-title[data-v-6f2e92f1]{color:#101010;font-size:16px;font-weight:700;word-break:break-word}.modules .module-item .item-content .item-des[data-v-6f2e92f1]{max-width:240px;color:rgba(0,0,0,.65);font-size:12px}.modules .module-item .item-handle[data-v-6f2e92f1]{height:85px;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.modules .module-item .item-handle .handle-icons[data-v-6f2e92f1]{width:52px;height:28px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;font-size:20px;padding-right:2px}.modules .module-item .item-handle .handle-icons .open[data-v-6f2e92f1]{width:20px;color:#23bd78;font-size:28px;position:relative}.modules .module-item .item-handle .handle-icons .el-icon-caret-right[data-v-6f2e92f1]:before{position:absolute;left:-5px}.modules .module-item .item-handle .handle-icons .close[data-v-6f2e92f1]{color:red;line-height:28px}.modules .module-item .item-handle .handle-icons .el-icon-edit-outline[data-v-6f2e92f1]{line-height:28px}.modules .module-item .item-handle .start-btn[data-v-6f2e92f1]{width:52px;color:#23bd78;border:1px solid #23bd78;font-size:14px;background-color:#f6fcf8;margin-left:0}.modules .module-item .item-handle .know-more[data-v-6f2e92f1]{font-size:13px}.modules .search-input .el-icon-loading[data-v-6f2e92f1],.modules .search-input .el-icon-search[data-v-6f2e92f1]{position:relative;left:4px;top:7px}.modules .null-modules[data-v-6f2e92f1]{min-height:130px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.modules .item-box[data-v-6f2e92f1]{position:relative}.modules .item-box .delete-icon[data-v-6f2e92f1]{visibility:hidden}.modules .item-box:hover .delete-icon[data-v-6f2e92f1]{visibility:visible}.modules .delete-icon[data-v-6f2e92f1]{position:absolute;width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABcElEQVRYR+2WMU7DMBSGn3MLrgCXYGNDYqAzTKgLU/KsZKFblEekDIiu7FRCSL1AL1EuwQ0iJUGOHCmq7NjPgNohXjLEz//n//2yLeDIQxxZH2aA03Ygz/PLNE13/5kTqwNFUayEEE8AsEHERQgEEb0DwFXXdfdSyg/TGlYAIloDwFIXsSG0+K2qF0JskyS55gKoYrWDYXhDjMV18QIRNywANZmI2BAc8d4dV285EFxxLwBfJ0LEvQFcEKHiLAAbhG5hn3ZX4NghNBUYMjGeZk27LWvOEDIg2OLsFgwwhp6rX97nxHhTbAcOxPd6sQv9ZUOwAA7Foyjq74i2bdWJGQThDWASj+P4SwGUZXkeCuEFMCU+9DMUwgngI/4biEkAjngoxNR74BkAYr3wXgVu6LnrAjO04wURH1knIRG9AcAdALDELU58IuINC0BNVs+ypmlesyz7du3a9L+qqrO6rh+klKs/PYpDYGaA2YGTdeAH4UfVIZWshvAAAAAASUVORK5CYII=) no-repeat;background-size:100% 100%;top:3px;right:3px;cursor:pointer}.modules .stop-btn[data-v-6f2e92f1]{width:52px;color:red;border:1px solid red;font-size:14px;background-color:#fbf2f2}.modules .content[data-v-6f2e92f1]{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.modules .modules-num[data-v-6f2e92f1]{margin-left:7px!important}.modules .item-handle[data-v-6f2e92f1]{cursor:default}.modules .item-handle i[data-v-6f2e92f1]{cursor:pointer}.modules .no-pointer[data-v-6f2e92f1]{cursor:default} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-cfe3eeda.d6a2593d.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-cfe3eeda.d6a2593d.css new file mode 100644 index 000000000..21fc9345d --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-cfe3eeda.d6a2593d.css @@ -0,0 +1 @@ +.custom-pagination{margin-top:10px}.custom-pagination a{-webkit-transition:all .3s ease;transition:all .3s ease;color:#fff;margin-right:10px;background:#34c388;display:inline-block;border-radius:4px;padding:5px 8px;border:1px solid #e6e6e6}.custom-pagination a:hover{color:#fff}.custom-pagination a.disabled{-webkit-transition:all .3s ease;transition:all .3s ease;color:#606266;background:transparent;cursor:not-allowed}.clients .data-list{clear:both}.clients .page-header-content-view .content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.clients .app-wrapper .search-wrapper{display:block;width:100%}.clients .app-wrapper .search-wrapper .el-date-editor.el-input,.clients .app-wrapper .search-wrapper .el-date-editor.el-input__inner,.clients .app-wrapper .search-wrapper .el-select{width:100%}.clients .app-wrapper .search-wrapper .col-oper{float:right}.clients .app-wrapper .search-wrapper .show-more{margin-left:12px;text-decoration:none}.clients .app-wrapper .search-wrapper .el-col-8{margin-bottom:20px}.clients .app-wrapper .search-wrapper .form-item-row{margin-top:0}.clients .app-wrapper .search-wrapper .form-item-row .el-select.comparator .el-input__inner{border-radius:4px 0 0 4px}.clients .app-wrapper .search-wrapper .form-item-row .el-date-editor .el-input__inner{border-radius:0 4px 4px 0} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-d3537170.0fcbc2f3.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-d3537170.0fcbc2f3.css new file mode 100644 index 000000000..8cd81d329 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-d3537170.0fcbc2f3.css @@ -0,0 +1 @@ +.stretch-height{width:100%;height:10px;background:#e6e6e6;cursor:row-resize;text-align:center}.stretch-height .el-icon-more{position:relative;top:-4px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-e7f1aeea.a0f2acee.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-e7f1aeea.a0f2acee.css new file mode 100644 index 000000000..04246dc8c --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-e7f1aeea.a0f2acee.css @@ -0,0 +1 @@ +.resources-node{list-style-type:none;padding:0;margin:0}.resources-node li{padding:4px 0}.resources-node li .ant-badge-not-a-wrapper{margin-top:-2px}.resources-node .el-button{margin-left:12px}.resources .emq-title{margin-bottom:20px}.resources .resource-node-wrapper .ant-card-body{padding:0 0 0 20px}.resources .expand-column .cell{visibility:hidden} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-vendors.57ed2864.css b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-vendors.57ed2864.css new file mode 100644 index 000000000..7be64dd84 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/css/chunk-vendors.57ed2864.css @@ -0,0 +1,7 @@ +/*! + * Waves v0.7.6 + * http://fian.my.id/Waves + * + * Copyright 2014-2018 Alfiana E. Sibuea and other contributors + * Released under the MIT license + * https://github.com/fians/Waves/blob/master/LICENSE */.waves-effect{position:relative;cursor:pointer;display:inline-block;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.waves-effect .waves-ripple{position:absolute;border-radius:50%;width:100px;height:100px;margin-top:-50px;margin-left:-50px;opacity:0;background:rgba(0,0,0,.2);background:radial-gradient(rgba(0,0,0,.2) 0,rgba(0,0,0,.3) 40%,rgba(0,0,0,.4) 50%,rgba(0,0,0,.5) 60%,hsla(0,0%,100%,0) 70%);-webkit-transition:all .5s ease-out;transition:all .5s ease-out;-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;-webkit-transform:scale(0) translate(0);transform:scale(0) translate(0);pointer-events:none}.waves-effect.waves-light .waves-ripple{background:hsla(0,0%,100%,.4);background:radial-gradient(hsla(0,0%,100%,.2) 0,hsla(0,0%,100%,.3) 40%,hsla(0,0%,100%,.4) 50%,hsla(0,0%,100%,.5) 60%,hsla(0,0%,100%,0) 70%)}.waves-effect.waves-classic .waves-ripple{background:rgba(0,0,0,.2)}.waves-effect.waves-classic.waves-light .waves-ripple{background:hsla(0,0%,100%,.4)}.waves-notransition{-webkit-transition:none!important;transition:none!important}.waves-button,.waves-circle{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.waves-button,.waves-button-input,.waves-button:hover,.waves-button:visited{white-space:nowrap;vertical-align:middle;cursor:pointer;border:none;outline:none;color:inherit;background-color:transparent;font-size:1em;line-height:1em;text-align:center;text-decoration:none;z-index:1}.waves-button{padding:.85em 1.1em;border-radius:.2em}.waves-button-input{margin:0;padding:.85em 1.1em}.waves-input-wrapper{border-radius:.2em;vertical-align:bottom}.waves-input-wrapper.waves-button{padding:0}.waves-input-wrapper .waves-button-input{position:relative;top:0;left:0;z-index:1}.waves-circle{text-align:center;width:2.5em;height:2.5em;line-height:2.5em;border-radius:50%}.waves-float{-webkit-mask-image:none;-webkit-box-shadow:0 1px 1.5px 1px rgba(0,0,0,.12);box-shadow:0 1px 1.5px 1px rgba(0,0,0,.12);-webkit-transition:all .3s;transition:all .3s}.waves-float:active{-webkit-box-shadow:0 8px 20px 1px rgba(0,0,0,.3);box-shadow:0 8px 20px 1px rgba(0,0,0,.3)}.waves-block{display:block}@font-face{font-family:Chinese Quote;src:local("PingFang SC"),local("SimSun");unicode-range:U+2018,U+2019,U+201c,U+201d}body,html{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);background-color:#fff}[tabindex="-1"]:focus{outline:none!important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;color:rgba(0,0,0,.85);font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-top:0;margin-bottom:1em}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#34c388;background-color:transparent;text-decoration:none;outline:none;cursor:pointer;-webkit-transition:color .3s;transition:color .3s;-webkit-text-decoration-skip:objects}a:focus{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto}a:hover{color:#59cf9a}a:active{color:#229c6d}a:active,a:hover{outline:0;text-decoration:none}a[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;color:rgba(0,0,0,.45);text-align:left;caption-side:bottom}th{text-align:inherit}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5em;font-size:1.5em;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}::-moz-selection{background:#34c388;color:#fff}::selection{background:#34c388;color:#fff}.clearfix{zoom:1}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}.anticon{display:inline-block;font-style:normal;vertical-align:-.125em;text-align:center;text-transform:none;line-height:0;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.anticon>*{line-height:1}.anticon svg{display:inline-block}.anticon:before{display:none}.anticon .anticon-icon{display:block}.anticon-spin,.anticon-spin:before{display:inline-block;-webkit-animation:loadingCircle 1s linear infinite;animation:loadingCircle 1s linear infinite}.fade-appear,.fade-enter,.fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-appear.fade-appear-active,.fade-enter.fade-enter-active{-webkit-animation-name:antFadeIn;animation-name:antFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.fade-leave.fade-leave-active{-webkit-animation-name:antFadeOut;animation-name:antFadeOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.fade-appear,.fade-enter{opacity:0}.fade-appear,.fade-enter,.fade-leave{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes antFadeOut{0%{opacity:1}to{opacity:0}}@keyframes antFadeOut{0%{opacity:1}to{opacity:0}}.move-up-appear,.move-up-enter,.move-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-appear.move-up-appear-active,.move-up-enter.move-up-enter-active{-webkit-animation-name:antMoveUpIn;animation-name:antMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.move-up-leave.move-up-leave-active{-webkit-animation-name:antMoveUpOut;animation-name:antMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-up-appear,.move-up-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-up-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-down-appear,.move-down-enter,.move-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-appear.move-down-appear-active,.move-down-enter.move-down-enter-active{-webkit-animation-name:antMoveDownIn;animation-name:antMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.move-down-leave.move-down-leave-active{-webkit-animation-name:antMoveDownOut;animation-name:antMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-down-appear,.move-down-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-down-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-left-appear,.move-left-enter,.move-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-appear.move-left-appear-active,.move-left-enter.move-left-enter-active{-webkit-animation-name:antMoveLeftIn;animation-name:antMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.move-left-leave.move-left-leave-active{-webkit-animation-name:antMoveLeftOut;animation-name:antMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-left-appear,.move-left-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-left-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.move-right-appear,.move-right-enter,.move-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-appear.move-right-appear-active,.move-right-enter.move-right-enter-active{-webkit-animation-name:antMoveRightIn;animation-name:antMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.move-right-leave.move-right-leave-active{-webkit-animation-name:antMoveRightOut;animation-name:antMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.move-right-appear,.move-right-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.move-right-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}@-webkit-keyframes antMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes antMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes antMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@keyframes antMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@-webkit-keyframes antMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes antMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@-webkit-keyframes antMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes antMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@-webkit-keyframes antMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes antMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes antMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes antMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes antMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes antMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes antMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}@keyframes antMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}@-webkit-keyframes loadingCircle{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loadingCircle{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}[ant-click-animating-without-extra-node],[ant-click-animating]{position:relative}.ant-click-animating-node,[ant-click-animating-without-extra-node]:after{content:"";position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;border-radius:inherit;border:0 solid #34c388;opacity:.2;-webkit-animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;display:block;pointer-events:none}@-webkit-keyframes waveEffect{to{top:-6px;left:-6px;bottom:-6px;right:-6px;border-width:6px}}@keyframes waveEffect{to{top:-6px;left:-6px;bottom:-6px;right:-6px;border-width:6px}}@-webkit-keyframes fadeEffect{to{opacity:0}}@keyframes fadeEffect{to{opacity:0}}.slide-up-appear,.slide-up-enter,.slide-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-appear.slide-up-appear-active,.slide-up-enter.slide-up-enter-active{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-leave.slide-up-leave-active{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-up-appear,.slide-up-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-up-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-down-appear,.slide-down-enter,.slide-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-appear.slide-down-appear-active,.slide-down-enter.slide-down-enter-active{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-leave.slide-down-leave-active{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-down-appear,.slide-down-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-down-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-left-appear,.slide-left-enter,.slide-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-appear.slide-left-appear-active,.slide-left-enter.slide-left-enter-active{-webkit-animation-name:antSlideLeftIn;animation-name:antSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-leave.slide-left-leave-active{-webkit-animation-name:antSlideLeftOut;animation-name:antSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-left-appear,.slide-left-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-left-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.slide-right-appear,.slide-right-enter,.slide-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-appear.slide-right-appear-active,.slide-right-enter.slide-right-enter-active{-webkit-animation-name:antSlideRightIn;animation-name:antSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-leave.slide-right-leave-active{-webkit-animation-name:antSlideRightOut;animation-name:antSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.slide-right-appear,.slide-right-enter{opacity:0;-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1)}.slide-right-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}@-webkit-keyframes antSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes antSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes antSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}to{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes antSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}to{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes antSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}to{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes antSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}to{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes antSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}to{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes antSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}to{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes antSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes antSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes antSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}to{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes antSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}to{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@-webkit-keyframes antSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}to{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes antSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}to{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes antSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}to{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes antSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}to{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}.swing-appear,.swing-enter{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.swing-appear.swing-appear-active,.swing-enter.swing-enter-active{-webkit-animation-name:antSwingIn;animation-name:antSwingIn;-webkit-animation-play-state:running;animation-play-state:running}@-webkit-keyframes antSwingIn{0%,to{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}40%{-webkit-transform:translateX(10px);transform:translateX(10px)}60%{-webkit-transform:translateX(-5px);transform:translateX(-5px)}80%{-webkit-transform:translateX(5px);transform:translateX(5px)}}@keyframes antSwingIn{0%,to{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}40%{-webkit-transform:translateX(10px);transform:translateX(10px)}60%{-webkit-transform:translateX(-5px);transform:translateX(-5px)}80%{-webkit-transform:translateX(5px);transform:translateX(5px)}}.zoom-appear,.zoom-enter,.zoom-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-appear.zoom-appear-active,.zoom-enter.zoom-enter-active{-webkit-animation-name:antZoomIn;animation-name:antZoomIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-leave.zoom-leave-active{-webkit-animation-name:antZoomOut;animation-name:antZoomOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-appear,.zoom-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-big-appear,.zoom-big-enter,.zoom-big-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-big-appear.zoom-big-appear-active,.zoom-big-enter.zoom-big-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-big-leave.zoom-big-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-big-appear,.zoom-big-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-big-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-big-fast-appear,.zoom-big-fast-enter,.zoom-big-fast-leave{-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-big-fast-appear.zoom-big-fast-appear-active,.zoom-big-fast-enter.zoom-big-fast-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-big-fast-leave.zoom-big-fast-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-big-fast-appear,.zoom-big-fast-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-big-fast-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-up-appear,.zoom-up-enter,.zoom-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-up-appear.zoom-up-appear-active,.zoom-up-enter.zoom-up-enter-active{-webkit-animation-name:antZoomUpIn;animation-name:antZoomUpIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-up-leave.zoom-up-leave-active{-webkit-animation-name:antZoomUpOut;animation-name:antZoomUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-up-appear,.zoom-up-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-up-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-down-appear,.zoom-down-enter,.zoom-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-down-appear.zoom-down-appear-active,.zoom-down-enter.zoom-down-enter-active{-webkit-animation-name:antZoomDownIn;animation-name:antZoomDownIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-down-leave.zoom-down-leave-active{-webkit-animation-name:antZoomDownOut;animation-name:antZoomDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-down-appear,.zoom-down-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-down-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-left-appear,.zoom-left-enter,.zoom-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-left-appear.zoom-left-appear-active,.zoom-left-enter.zoom-left-enter-active{-webkit-animation-name:antZoomLeftIn;animation-name:antZoomLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-left-leave.zoom-left-leave-active{-webkit-animation-name:antZoomLeftOut;animation-name:antZoomLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-left-appear,.zoom-left-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-left-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.zoom-right-appear,.zoom-right-enter,.zoom-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.zoom-right-appear.zoom-right-appear-active,.zoom-right-enter.zoom-right-enter-active{-webkit-animation-name:antZoomRightIn;animation-name:antZoomRightIn;-webkit-animation-play-state:running;animation-play-state:running}.zoom-right-leave.zoom-right-leave-active{-webkit-animation-name:antZoomRightOut;animation-name:antZoomRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.zoom-right-appear,.zoom-right-enter{-webkit-transform:scale(0);transform:scale(0);-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1)}.zoom-right-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}@-webkit-keyframes antZoomIn{0%{opacity:0;-webkit-transform:scale(.2);transform:scale(.2)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes antZoomIn{0%{opacity:0;-webkit-transform:scale(.2);transform:scale(.2)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes antZoomOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(.2);transform:scale(.2)}}@keyframes antZoomOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(.2);transform:scale(.2)}}@-webkit-keyframes antZoomBigIn{0%{opacity:0;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes antZoomBigIn{0%{opacity:0;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes antZoomBigOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(.8);transform:scale(.8)}}@keyframes antZoomBigOut{0%{-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(.8);transform:scale(.8)}}@-webkit-keyframes antZoomUpIn{0%{opacity:0;-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes antZoomUpIn{0%{opacity:0;-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes antZoomUpOut{0%{-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.8);transform:scale(.8)}}@keyframes antZoomUpOut{0%{-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.8);transform:scale(.8)}}@-webkit-keyframes antZoomLeftIn{0%{opacity:0;-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(1);transform:scale(1)}}@keyframes antZoomLeftIn{0%{opacity:0;-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes antZoomLeftOut{0%{-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(.8);transform:scale(.8)}}@keyframes antZoomLeftOut{0%{-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(.8);transform:scale(.8)}}@-webkit-keyframes antZoomRightIn{0%{opacity:0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(1);transform:scale(1)}}@keyframes antZoomRightIn{0%{opacity:0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes antZoomRightOut{0%{-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(.8);transform:scale(.8)}}@keyframes antZoomRightOut{0%{-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transform:scale(.8);transform:scale(.8)}}@-webkit-keyframes antZoomDownIn{0%{opacity:0;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(1);transform:scale(1)}}@keyframes antZoomDownIn{0%{opacity:0;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(.8);transform:scale(.8)}to{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes antZoomDownOut{0%{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(.8);transform:scale(.8)}}@keyframes antZoomDownOut{0%{-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-transform:scale(.8);transform:scale(.8)}}.ant-motion-collapse{overflow:hidden}.ant-motion-collapse-active{-webkit-transition:height .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)!important;transition:height .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)!important}.ant-drawer{position:fixed;top:0;width:0;height:100%;z-index:1000}.ant-drawer>*{-webkit-transition:-webkit-transform .3s cubic-bezier(.9,0,.3,.7);transition:-webkit-transform .3s cubic-bezier(.9,0,.3,.7);transition:transform .3s cubic-bezier(.9,0,.3,.7);transition:transform .3s cubic-bezier(.9,0,.3,.7),-webkit-transform .3s cubic-bezier(.9,0,.3,.7)}.ant-drawer-content-wrapper{position:fixed}.ant-drawer .ant-drawer-content{width:100%;height:100%}.ant-drawer-left,.ant-drawer-right{width:0;height:100%}.ant-drawer-left .ant-drawer-content-wrapper,.ant-drawer-right .ant-drawer-content-wrapper{height:100%}.ant-drawer-left.ant-drawer-open,.ant-drawer-right.ant-drawer-open{width:100%}.ant-drawer-left.ant-drawer-open.no-mask,.ant-drawer-right.ant-drawer-open.no-mask{width:0}.ant-drawer-left.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:2px 0 8px rgba(0,0,0,.15);box-shadow:2px 0 8px rgba(0,0,0,.15)}.ant-drawer-right .ant-drawer-content-wrapper{right:0}.ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:-2px 0 8px rgba(0,0,0,.15);box-shadow:-2px 0 8px rgba(0,0,0,.15)}.ant-drawer-bottom,.ant-drawer-top{width:100%;height:0%}.ant-drawer-bottom .ant-drawer-content-wrapper,.ant-drawer-top .ant-drawer-content-wrapper{width:100%}.ant-drawer-bottom.ant-drawer-open,.ant-drawer-top.ant-drawer-open{height:100%}.ant-drawer-bottom.ant-drawer-open.no-mask,.ant-drawer-top.ant-drawer-open.no-mask{height:0%}.ant-drawer-top.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15)}.ant-drawer-bottom .ant-drawer-content-wrapper{bottom:0}.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper{-webkit-box-shadow:0 -2px 8px rgba(0,0,0,.15);box-shadow:0 -2px 8px rgba(0,0,0,.15)}.ant-drawer.ant-drawer-open .ant-drawer-mask{opacity:.3;height:100%;-webkit-animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1);animation:antdDrawerFadeIn .3s cubic-bezier(.7,.3,.1,1);-webkit-transition:none;transition:none}.ant-drawer-title{margin:0;font-size:16px;line-height:22px;font-weight:500;color:rgba(0,0,0,.85)}.ant-drawer-content{position:relative;background-color:#fff;border:0;background-clip:padding-box;z-index:1}.ant-drawer-close{cursor:pointer;border:0;background:transparent;position:absolute;right:0;top:0;z-index:10;font-weight:700;line-height:1;text-decoration:none;-webkit-transition:color .3s;transition:color .3s;color:rgba(0,0,0,.45);outline:0;padding:0}.ant-drawer-close-x{display:block;font-style:normal;text-align:center;text-transform:none;text-rendering:auto;width:56px;height:56px;line-height:56px;font-size:16px}.ant-drawer-close:focus,.ant-drawer-close:hover{color:#444;text-decoration:none}.ant-drawer-header{padding:16px 24px;border-radius:4px 4px 0 0;background:#fff;color:rgba(0,0,0,.65);border-bottom:1px solid #e8e8e8}.ant-drawer-body{padding:24px;font-size:14px;line-height:1.5;word-wrap:break-word}.ant-drawer-mask{position:fixed;width:100%;height:0;opacity:0;background-color:rgba(0,0,0,.65);filter:alpha(opacity=50);-webkit-transition:opacity .3s linear,height 0s ease .3s;transition:opacity .3s linear,height 0s ease .3s}.ant-drawer-open{-webkit-transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:-webkit-transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1);transition:transform .3s cubic-bezier(.7,.3,.1,1),-webkit-transform .3s cubic-bezier(.7,.3,.1,1)}.ant-drawer-open-content{-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}@-webkit-keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:.3}}@keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:.3}}.ant-btn{line-height:1.499;display:inline-block;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:0 15px;font-size:14px;border-radius:4px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);position:relative;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);color:rgba(0,0,0,.65);background-color:#fff;border-color:#d9d9d9}.ant-btn>.anticon{line-height:1}.ant-btn,.ant-btn:active,.ant-btn:focus{outline:0}.ant-btn:not([disabled]):hover{text-decoration:none}.ant-btn:not([disabled]):active{outline:0;-webkit-box-shadow:none;box-shadow:none}.ant-btn.disabled,.ant-btn[disabled]{cursor:not-allowed}.ant-btn.disabled>*,.ant-btn[disabled]>*{pointer-events:none}.ant-btn-lg{padding:0 15px;font-size:16px;border-radius:4px;height:40px}.ant-btn-sm{padding:0 7px;font-size:14px;border-radius:4px;height:24px}.ant-btn>a:only-child{color:currentColor}.ant-btn>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn:focus,.ant-btn:hover{color:#59cf9a;background-color:#fff;border-color:#59cf9a}.ant-btn:focus>a:only-child,.ant-btn:hover>a:only-child{color:currentColor}.ant-btn:focus>a:only-child:after,.ant-btn:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn.active,.ant-btn:active{color:#229c6d;background-color:#fff;border-color:#229c6d}.ant-btn.active>a:only-child,.ant-btn:active>a:only-child{color:currentColor}.ant-btn.active>a:only-child:after,.ant-btn:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn.disabled,.ant-btn.disabled.active,.ant-btn.disabled:active,.ant-btn.disabled:focus,.ant-btn.disabled:hover,.ant-btn[disabled],.ant-btn[disabled].active,.ant-btn[disabled]:active,.ant-btn[disabled]:focus,.ant-btn[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn.disabled.active>a:only-child,.ant-btn.disabled:active>a:only-child,.ant-btn.disabled:focus>a:only-child,.ant-btn.disabled:hover>a:only-child,.ant-btn.disabled>a:only-child,.ant-btn[disabled].active>a:only-child,.ant-btn[disabled]:active>a:only-child,.ant-btn[disabled]:focus>a:only-child,.ant-btn[disabled]:hover>a:only-child,.ant-btn[disabled]>a:only-child{color:currentColor}.ant-btn.disabled.active>a:only-child:after,.ant-btn.disabled:active>a:only-child:after,.ant-btn.disabled:focus>a:only-child:after,.ant-btn.disabled:hover>a:only-child:after,.ant-btn.disabled>a:only-child:after,.ant-btn[disabled].active>a:only-child:after,.ant-btn[disabled]:active>a:only-child:after,.ant-btn[disabled]:focus>a:only-child:after,.ant-btn[disabled]:hover>a:only-child:after,.ant-btn[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn.active,.ant-btn:active,.ant-btn:focus,.ant-btn:hover{background:#fff;text-decoration:none}.ant-btn>i,.ant-btn>span{pointer-events:none;display:inline-block}.ant-btn-primary{color:#fff;background-color:#34c388;border-color:#34c388;text-shadow:0 -1px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 2px 0 rgba(0,0,0,.045);box-shadow:0 2px 0 rgba(0,0,0,.045)}.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-primary>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-primary:focus,.ant-btn-primary:hover{color:#fff;background-color:#59cf9a;border-color:#59cf9a}.ant-btn-primary:focus>a:only-child,.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-primary:focus>a:only-child:after,.ant-btn-primary:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-primary.active,.ant-btn-primary:active{color:#fff;background-color:#229c6d;border-color:#229c6d}.ant-btn-primary.active>a:only-child,.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-primary.active>a:only-child:after,.ant-btn-primary:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-primary.disabled,.ant-btn-primary.disabled.active,.ant-btn-primary.disabled:active,.ant-btn-primary.disabled:focus,.ant-btn-primary.disabled:hover,.ant-btn-primary[disabled],.ant-btn-primary[disabled].active,.ant-btn-primary[disabled]:active,.ant-btn-primary[disabled]:focus,.ant-btn-primary[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-primary.disabled.active>a:only-child,.ant-btn-primary.disabled:active>a:only-child,.ant-btn-primary.disabled:focus>a:only-child,.ant-btn-primary.disabled:hover>a:only-child,.ant-btn-primary.disabled>a:only-child,.ant-btn-primary[disabled].active>a:only-child,.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-primary.disabled.active>a:only-child:after,.ant-btn-primary.disabled:active>a:only-child:after,.ant-btn-primary.disabled:focus>a:only-child:after,.ant-btn-primary.disabled:hover>a:only-child:after,.ant-btn-primary.disabled>a:only-child:after,.ant-btn-primary[disabled].active>a:only-child:after,.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-primary[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child){border-right-color:#59cf9a;border-left-color:#59cf9a}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child):disabled{border-color:#d9d9d9}.ant-btn-group .ant-btn-primary:first-child:not(:last-child){border-right-color:#59cf9a}.ant-btn-group .ant-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#d9d9d9}.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#59cf9a}.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#d9d9d9}.ant-btn-ghost{color:rgba(0,0,0,.65);background-color:transparent;border-color:#d9d9d9}.ant-btn-ghost>a:only-child{color:currentColor}.ant-btn-ghost>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-ghost:focus,.ant-btn-ghost:hover{color:#59cf9a;background-color:transparent;border-color:#59cf9a}.ant-btn-ghost:focus>a:only-child,.ant-btn-ghost:hover>a:only-child{color:currentColor}.ant-btn-ghost:focus>a:only-child:after,.ant-btn-ghost:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-ghost.active,.ant-btn-ghost:active{color:#229c6d;background-color:transparent;border-color:#229c6d}.ant-btn-ghost.active>a:only-child,.ant-btn-ghost:active>a:only-child{color:currentColor}.ant-btn-ghost.active>a:only-child:after,.ant-btn-ghost:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-ghost.disabled,.ant-btn-ghost.disabled.active,.ant-btn-ghost.disabled:active,.ant-btn-ghost.disabled:focus,.ant-btn-ghost.disabled:hover,.ant-btn-ghost[disabled],.ant-btn-ghost[disabled].active,.ant-btn-ghost[disabled]:active,.ant-btn-ghost[disabled]:focus,.ant-btn-ghost[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-ghost.disabled.active>a:only-child,.ant-btn-ghost.disabled:active>a:only-child,.ant-btn-ghost.disabled:focus>a:only-child,.ant-btn-ghost.disabled:hover>a:only-child,.ant-btn-ghost.disabled>a:only-child,.ant-btn-ghost[disabled].active>a:only-child,.ant-btn-ghost[disabled]:active>a:only-child,.ant-btn-ghost[disabled]:focus>a:only-child,.ant-btn-ghost[disabled]:hover>a:only-child,.ant-btn-ghost[disabled]>a:only-child{color:currentColor}.ant-btn-ghost.disabled.active>a:only-child:after,.ant-btn-ghost.disabled:active>a:only-child:after,.ant-btn-ghost.disabled:focus>a:only-child:after,.ant-btn-ghost.disabled:hover>a:only-child:after,.ant-btn-ghost.disabled>a:only-child:after,.ant-btn-ghost[disabled].active>a:only-child:after,.ant-btn-ghost[disabled]:active>a:only-child:after,.ant-btn-ghost[disabled]:focus>a:only-child:after,.ant-btn-ghost[disabled]:hover>a:only-child:after,.ant-btn-ghost[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-dashed{color:rgba(0,0,0,.65);background-color:#fff;border-color:#d9d9d9;border-style:dashed}.ant-btn-dashed>a:only-child{color:currentColor}.ant-btn-dashed>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-dashed:focus,.ant-btn-dashed:hover{color:#59cf9a;background-color:#fff;border-color:#59cf9a}.ant-btn-dashed:focus>a:only-child,.ant-btn-dashed:hover>a:only-child{color:currentColor}.ant-btn-dashed:focus>a:only-child:after,.ant-btn-dashed:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-dashed.active,.ant-btn-dashed:active{color:#229c6d;background-color:#fff;border-color:#229c6d}.ant-btn-dashed.active>a:only-child,.ant-btn-dashed:active>a:only-child{color:currentColor}.ant-btn-dashed.active>a:only-child:after,.ant-btn-dashed:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-dashed.disabled,.ant-btn-dashed.disabled.active,.ant-btn-dashed.disabled:active,.ant-btn-dashed.disabled:focus,.ant-btn-dashed.disabled:hover,.ant-btn-dashed[disabled],.ant-btn-dashed[disabled].active,.ant-btn-dashed[disabled]:active,.ant-btn-dashed[disabled]:focus,.ant-btn-dashed[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-dashed.disabled.active>a:only-child,.ant-btn-dashed.disabled:active>a:only-child,.ant-btn-dashed.disabled:focus>a:only-child,.ant-btn-dashed.disabled:hover>a:only-child,.ant-btn-dashed.disabled>a:only-child,.ant-btn-dashed[disabled].active>a:only-child,.ant-btn-dashed[disabled]:active>a:only-child,.ant-btn-dashed[disabled]:focus>a:only-child,.ant-btn-dashed[disabled]:hover>a:only-child,.ant-btn-dashed[disabled]>a:only-child{color:currentColor}.ant-btn-dashed.disabled.active>a:only-child:after,.ant-btn-dashed.disabled:active>a:only-child:after,.ant-btn-dashed.disabled:focus>a:only-child:after,.ant-btn-dashed.disabled:hover>a:only-child:after,.ant-btn-dashed.disabled>a:only-child:after,.ant-btn-dashed[disabled].active>a:only-child:after,.ant-btn-dashed[disabled]:active>a:only-child:after,.ant-btn-dashed[disabled]:focus>a:only-child:after,.ant-btn-dashed[disabled]:hover>a:only-child:after,.ant-btn-dashed[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-danger{color:#f5222d;background-color:#f5f5f5;border-color:#d9d9d9}.ant-btn-danger>a:only-child{color:currentColor}.ant-btn-danger>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-danger:hover{color:#fff;background-color:#ff4d4f;border-color:#ff4d4f}.ant-btn-danger:hover>a:only-child{color:currentColor}.ant-btn-danger:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-danger:focus{color:#ff4d4f;background-color:#fff;border-color:#ff4d4f}.ant-btn-danger:focus>a:only-child{color:currentColor}.ant-btn-danger:focus>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-danger.active,.ant-btn-danger:active{color:#fff;background-color:#cf1322;border-color:#cf1322}.ant-btn-danger.active>a:only-child,.ant-btn-danger:active>a:only-child{color:currentColor}.ant-btn-danger.active>a:only-child:after,.ant-btn-danger:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-danger.disabled,.ant-btn-danger.disabled.active,.ant-btn-danger.disabled:active,.ant-btn-danger.disabled:focus,.ant-btn-danger.disabled:hover,.ant-btn-danger[disabled],.ant-btn-danger[disabled].active,.ant-btn-danger[disabled]:active,.ant-btn-danger[disabled]:focus,.ant-btn-danger[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-danger.disabled.active>a:only-child,.ant-btn-danger.disabled:active>a:only-child,.ant-btn-danger.disabled:focus>a:only-child,.ant-btn-danger.disabled:hover>a:only-child,.ant-btn-danger.disabled>a:only-child,.ant-btn-danger[disabled].active>a:only-child,.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-danger[disabled]>a:only-child{color:currentColor}.ant-btn-danger.disabled.active>a:only-child:after,.ant-btn-danger.disabled:active>a:only-child:after,.ant-btn-danger.disabled:focus>a:only-child:after,.ant-btn-danger.disabled:hover>a:only-child:after,.ant-btn-danger.disabled>a:only-child:after,.ant-btn-danger[disabled].active>a:only-child:after,.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-danger[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-circle,.ant-btn-circle-outline{width:32px;padding:0;font-size:16px;border-radius:50%;height:32px}.ant-btn-circle-outline.ant-btn-lg,.ant-btn-circle.ant-btn-lg{width:40px;padding:0;font-size:18px;border-radius:50%;height:40px}.ant-btn-circle-outline.ant-btn-sm,.ant-btn-circle.ant-btn-sm{width:24px;padding:0;font-size:14px;border-radius:50%;height:24px}.ant-btn:before{position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;background:#fff;opacity:.35;content:"";border-radius:inherit;z-index:1;-webkit-transition:opacity .2s;transition:opacity .2s;pointer-events:none;display:none}.ant-btn .anticon{-webkit-transition:margin-left .3s cubic-bezier(.645,.045,.355,1);transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.ant-btn .anticon.anticon-minus>svg,.ant-btn .anticon.anticon-plus>svg{shape-rendering:optimizeSpeed}.ant-btn.ant-btn-loading:before{display:block}.ant-btn.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only){padding-left:29px;pointer-events:none;position:relative}.ant-btn.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) .anticon:not(:last-child){margin-left:-14px}.ant-btn-sm.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only){padding-left:24px}.ant-btn-sm.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) .anticon{margin-left:-17px}.ant-btn-group{display:inline-block}.ant-btn-group,.ant-btn-group>.ant-btn,.ant-btn-group>span>.ant-btn{position:relative}.ant-btn-group>.ant-btn.active,.ant-btn-group>.ant-btn:active,.ant-btn-group>.ant-btn:focus,.ant-btn-group>.ant-btn:hover,.ant-btn-group>span>.ant-btn.active,.ant-btn-group>span>.ant-btn:active,.ant-btn-group>span>.ant-btn:focus,.ant-btn-group>span>.ant-btn:hover{z-index:2}.ant-btn-group>.ant-btn:disabled,.ant-btn-group>span>.ant-btn:disabled{z-index:0}.ant-btn-group-lg>.ant-btn,.ant-btn-group-lg>span>.ant-btn{padding:0 15px;font-size:16px;border-radius:0;height:40px;line-height:38px}.ant-btn-group-sm>.ant-btn,.ant-btn-group-sm>span>.ant-btn{padding:0 7px;font-size:14px;border-radius:0;height:24px;line-height:22px}.ant-btn-group-sm>.ant-btn>.anticon,.ant-btn-group-sm>span>.ant-btn>.anticon{font-size:14px}.ant-btn+.ant-btn-group,.ant-btn-group+.ant-btn,.ant-btn-group+.ant-btn-group,.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group .ant-btn+span,.ant-btn-group>span+span,.ant-btn-group span+.ant-btn{margin-left:-1px}.ant-btn-group .ant-btn-primary+.ant-btn:not(.ant-btn-primary):not([disabled]){border-left-color:transparent}.ant-btn-group .ant-btn{border-radius:0}.ant-btn-group>.ant-btn:first-child,.ant-btn-group>span:first-child>.ant-btn{margin-left:0}.ant-btn-group>.ant-btn:only-child,.ant-btn-group>span:only-child>.ant-btn{border-radius:4px}.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-bottom-left-radius:4px;border-top-left-radius:4px}.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-bottom-right-radius:4px;border-top-right-radius:4px}.ant-btn-group-sm>.ant-btn:only-child,.ant-btn-group-sm>span:only-child>.ant-btn{border-radius:4px}.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-bottom-left-radius:4px;border-top-left-radius:4px}.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-bottom-right-radius:4px;border-top-right-radius:4px}.ant-btn-group>.ant-btn-group{float:left}.ant-btn-group>.ant-btn-group:not(:first-child):not(:last-child)>.ant-btn{border-radius:0}.ant-btn-group>.ant-btn-group:first-child:not(:last-child)>.ant-btn:last-child{border-bottom-right-radius:0;border-top-right-radius:0;padding-right:8px}.ant-btn-group>.ant-btn-group:last-child:not(:first-child)>.ant-btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px}.ant-btn:not(.ant-btn-circle):not(.ant-btn-circle-outline).ant-btn-icon-only{padding-left:8px;padding-right:8px}.ant-btn:active>span,.ant-btn:focus>span{position:relative}.ant-btn>.anticon+span,.ant-btn>span+.anticon{margin-left:8px}.ant-btn-background-ghost{background:transparent!important;border-color:#fff;color:#fff}.ant-btn-background-ghost.ant-btn-primary{color:#34c388;background-color:transparent;border-color:#34c388;text-shadow:none}.ant-btn-background-ghost.ant-btn-primary>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-primary:focus,.ant-btn-background-ghost.ant-btn-primary:hover{color:#59cf9a;background-color:transparent;border-color:#59cf9a}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-primary.active,.ant-btn-background-ghost.ant-btn-primary:active{color:#229c6d;background-color:transparent;border-color:#229c6d}.ant-btn-background-ghost.ant-btn-primary.active>a:only-child,.ant-btn-background-ghost.ant-btn-primary:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-primary.disabled,.ant-btn-background-ghost.ant-btn-primary.disabled.active,.ant-btn-background-ghost.ant-btn-primary.disabled:active,.ant-btn-background-ghost.ant-btn-primary.disabled:focus,.ant-btn-background-ghost.ant-btn-primary.disabled:hover,.ant-btn-background-ghost.ant-btn-primary[disabled],.ant-btn-background-ghost.ant-btn-primary[disabled].active,.ant-btn-background-ghost.ant-btn-primary[disabled]:active,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-primary.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-primary.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-danger{color:#f5222d;background-color:transparent;border-color:#f5222d;text-shadow:none}.ant-btn-background-ghost.ant-btn-danger>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-danger:focus,.ant-btn-background-ghost.ant-btn-danger:hover{color:#ff4d4f;background-color:transparent;border-color:#ff4d4f}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-danger.active,.ant-btn-background-ghost.ant-btn-danger:active{color:#cf1322;background-color:transparent;border-color:#cf1322}.ant-btn-background-ghost.ant-btn-danger.active>a:only-child,.ant-btn-background-ghost.ant-btn-danger:active>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:active>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-background-ghost.ant-btn-danger.disabled,.ant-btn-background-ghost.ant-btn-danger.disabled.active,.ant-btn-background-ghost.ant-btn-danger.disabled:active,.ant-btn-background-ghost.ant-btn-danger.disabled:focus,.ant-btn-background-ghost.ant-btn-danger.disabled:hover,.ant-btn-background-ghost.ant-btn-danger[disabled],.ant-btn-background-ghost.ant-btn-danger[disabled].active,.ant-btn-background-ghost.ant-btn-danger[disabled]:active,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover{color:rgba(0,0,0,.25);background-color:#f5f5f5;border-color:#d9d9d9;text-shadow:none;-webkit-box-shadow:none;box-shadow:none}.ant-btn-background-ghost.ant-btn-danger.disabled.active>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger.disabled>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled].active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child{color:currentColor}.ant-btn-background-ghost.ant-btn-danger.disabled.active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger.disabled>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled].active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:transparent}.ant-btn-two-chinese-chars:first-letter{letter-spacing:.34em}.ant-btn-two-chinese-chars>:not(.anticon){letter-spacing:.34em;margin-right:-.34em}.ant-btn-block{width:100%}.ant-btn:empty{vertical-align:top}a.ant-btn{line-height:30px}a.ant-btn-lg{line-height:38px}a.ant-btn-sm{line-height:22px}.ant-card{font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;background:#fff;border-radius:2px;position:relative;-webkit-transition:all .3s;transition:all .3s}.ant-card-hoverable{cursor:pointer}.ant-card-hoverable:hover{-webkit-box-shadow:0 2px 8px rgba(0,0,0,.09);box-shadow:0 2px 8px rgba(0,0,0,.09);border-color:rgba(0,0,0,.09)}.ant-card-bordered{border:1px solid #e8e8e8}.ant-card-head{background:transparent;border-bottom:1px solid #e8e8e8;padding:0 24px;border-radius:2px 2px 0 0;zoom:1;margin-bottom:-1px;min-height:48px;font-size:16px;color:rgba(0,0,0,.85);font-weight:500}.ant-card-head:after,.ant-card-head:before{content:"";display:table}.ant-card-head:after{clear:both}.ant-card-head-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ant-card-head-title{padding:16px 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;-webkit-box-flex:1;-ms-flex:1;flex:1;display:inline-block}.ant-card-head .ant-tabs{margin-bottom:-17px;clear:both;font-size:14px;color:rgba(0,0,0,.65);font-weight:400}.ant-card-head .ant-tabs-bar{border-bottom:1px solid #e8e8e8}.ant-card-extra{float:right;padding:16px 0;font-size:14px;color:rgba(0,0,0,.65);font-weight:400;margin-left:auto}.ant-card-body{padding:24px;zoom:1}.ant-card-body:after,.ant-card-body:before{content:"";display:table}.ant-card-body:after{clear:both}.ant-card-contain-grid:not(.ant-card-loading) .ant-card-body{margin:-1px 0 0 -1px;padding:0}.ant-card-grid{border-radius:0;border:0;-webkit-box-shadow:1px 0 0 0 #e8e8e8,0 1px 0 0 #e8e8e8,1px 1px 0 0 #e8e8e8,1px 0 0 0 #e8e8e8 inset,0 1px 0 0 #e8e8e8 inset;box-shadow:1px 0 0 0 #e8e8e8,0 1px 0 0 #e8e8e8,1px 1px 0 0 #e8e8e8,inset 1px 0 0 0 #e8e8e8,inset 0 1px 0 0 #e8e8e8;width:33.33%;float:left;padding:24px;-webkit-transition:all .3s;transition:all .3s}.ant-card-grid:hover{position:relative;z-index:1;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15)}.ant-card-contain-tabs>.ant-card-head .ant-card-head-title{padding-bottom:0;min-height:32px}.ant-card-contain-tabs .ant-card-extra{padding-bottom:0}.ant-card-cover>*{width:100%;display:block}.ant-card-cover img{border-radius:2px 2px 0 0}.ant-card-actions{border-top:1px solid #e8e8e8;background:#fafafa;zoom:1;list-style:none;margin:0;padding:0}.ant-card-actions:after,.ant-card-actions:before{content:"";display:table}.ant-card-actions:after{clear:both}.ant-card-actions>li{float:left;text-align:center;margin:12px 0;color:rgba(0,0,0,.45)}.ant-card-actions>li>span{display:inline-block;font-size:14px;cursor:pointer;line-height:22px;min-width:32px;position:relative}.ant-card-actions>li>span:hover{color:#34c388;-webkit-transition:color .3s;transition:color .3s}.ant-card-actions>li>span>.anticon{font-size:16px;line-height:22px}.ant-card-actions>li>span a{color:rgba(0,0,0,.45);line-height:22px;display:inline-block;width:100%}.ant-card-actions>li>span a:hover{color:#34c388}.ant-card-actions>li:not(:last-child){border-right:1px solid #e8e8e8}.ant-card-wider-padding .ant-card-head{padding:0 32px}.ant-card-wider-padding .ant-card-body{padding:24px 32px}.ant-card-padding-transition .ant-card-body,.ant-card-padding-transition .ant-card-head{-webkit-transition:padding .3s;transition:padding .3s}.ant-card-type-inner .ant-card-head{padding:0 24px;background:#fafafa}.ant-card-type-inner .ant-card-head-title{padding:12px 0;font-size:14px}.ant-card-type-inner .ant-card-body{padding:16px 24px}.ant-card-type-inner .ant-card-extra{padding:13.5px 0}.ant-card-meta{margin:-4px 0;zoom:1}.ant-card-meta:after,.ant-card-meta:before{content:"";display:table}.ant-card-meta:after{clear:both}.ant-card-meta-avatar{padding-right:16px;float:left}.ant-card-meta-detail{overflow:hidden}.ant-card-meta-detail>div:not(:last-child){margin-bottom:8px}.ant-card-meta-title{font-size:16px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;color:rgba(0,0,0,.85);font-weight:500}.ant-card-meta-description{color:rgba(0,0,0,.45)}.ant-card-loading{overflow:hidden;position:relative}.ant-card-loading:after{position:absolute;bottom:0;left:0;width:100%;height:24px;background:#fff;content:""}.ant-card-loading .ant-card-body{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-card-loading-content p{margin:0}.ant-card-loading-block{height:14px;margin:4px 0;border-radius:2px;background:-webkit-gradient(linear,left top,right top,from(rgba(207,216,220,.2)),color-stop(rgba(207,216,220,.4)),to(rgba(207,216,220,.2)));background:linear-gradient(90deg,rgba(207,216,220,.2),rgba(207,216,220,.4),rgba(207,216,220,.2));-webkit-animation:card-loading 1.4s ease infinite;animation:card-loading 1.4s ease infinite;background-size:600% 600%}@-webkit-keyframes card-loading{0%,to{background-position:0 50%}50%{background-position:100% 50%}}@keyframes card-loading{0%,to{background-position:0 50%}50%{background-position:100% 50%}}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{height:40px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-ink-bar{visibility:hidden}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{margin:0;border:1px solid #e8e8e8;border-bottom:0;border-radius:4px 4px 0 0;background:#fafafa;margin-right:2px;padding:0 16px;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);line-height:38px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{background:#fff;border-color:#e8e8e8;color:#34c388;padding-bottom:1px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-inactive{padding:0}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-wrap{margin-bottom:0}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x{color:rgba(0,0,0,.45);-webkit-transition:all .3s;transition:all .3s;font-size:12px;margin-left:3px;margin-right:-5px;overflow:hidden;vertical-align:middle;width:16px;height:16px;height:14px}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab .ant-tabs-close-x:hover{color:rgba(0,0,0,.85)}.ant-tabs.ant-tabs-card .ant-tabs-card-content>.ant-tabs-tabpane,.ant-tabs.ant-tabs-editable-card .ant-tabs-card-content>.ant-tabs-tabpane{-webkit-transition:none!important;transition:none!important}.ant-tabs.ant-tabs-card .ant-tabs-card-content>.ant-tabs-tabpane-inactive,.ant-tabs.ant-tabs-editable-card .ant-tabs-card-content>.ant-tabs-tabpane-inactive{overflow:hidden}.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab:hover .anticon-close{opacity:1}.ant-tabs-extra-content{line-height:40px}.ant-tabs-extra-content .ant-tabs-new-tab{position:relative;width:20px;height:20px;line-height:20px;text-align:center;cursor:pointer;border-radius:2px;border:1px solid #e8e8e8;font-size:12px;color:rgba(0,0,0,.65);-webkit-transition:all .3s;transition:all .3s}.ant-tabs-extra-content .ant-tabs-new-tab:hover{color:#34c388;border-color:#34c388}.ant-tabs-extra-content .ant-tabs-new-tab svg{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-nav-container{height:auto}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab{border-bottom:1px solid #e8e8e8;margin-bottom:8px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab-active,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab-active{padding-bottom:4px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab:last-child,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab:last-child{margin-bottom:8px}.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-new-tab,.ant-tabs-vertical.ant-tabs-card .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-new-tab{width:90%}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-nav-wrap{margin-right:0}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab{border-right:0;border-radius:4px 0 0 4px;margin-right:1px}.ant-tabs-vertical.ant-tabs-card.ant-tabs-left .ant-tabs-card-bar.ant-tabs-left-bar .ant-tabs-tab-active{margin-right:-1px;padding-right:18px}.ant-tabs-vertical.ant-tabs-card.ant-tabs-right .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-nav-wrap{margin-left:0}.ant-tabs-vertical.ant-tabs-card.ant-tabs-right .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab{border-left:0;border-radius:0 4px 4px 0;margin-left:1px}.ant-tabs-vertical.ant-tabs-card.ant-tabs-right .ant-tabs-card-bar.ant-tabs-right-bar .ant-tabs-tab-active{margin-left:-1px;padding-left:18px}.ant-tabs .ant-tabs-card-bar.ant-tabs-bottom-bar .ant-tabs-tab{border-bottom:1px solid #e8e8e8;border-top:0;border-radius:0 0 4px 4px}.ant-tabs .ant-tabs-card-bar.ant-tabs-bottom-bar .ant-tabs-tab-active{color:#34c388;padding-bottom:0;padding-top:1px}.ant-tabs{font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;position:relative;overflow:hidden;zoom:1}.ant-tabs:after,.ant-tabs:before{content:"";display:table}.ant-tabs:after{clear:both}.ant-tabs-ink-bar{z-index:1;position:absolute;left:0;bottom:1px;-webkit-box-sizing:border-box;box-sizing:border-box;height:2px;background-color:#34c388;-webkit-transform-origin:0 0;transform-origin:0 0}.ant-tabs-bar{border-bottom:1px solid #e8e8e8;margin:0 0 16px 0;outline:none}.ant-tabs-bar,.ant-tabs-nav-container{-webkit-transition:padding .3s cubic-bezier(.645,.045,.355,1);transition:padding .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-nav-container{overflow:hidden;font-size:14px;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;white-space:nowrap;margin-bottom:-1px;zoom:1}.ant-tabs-nav-container:after,.ant-tabs-nav-container:before{content:"";display:table}.ant-tabs-nav-container:after{clear:both}.ant-tabs-nav-container-scrolling{padding-left:32px;padding-right:32px}.ant-tabs-bottom .ant-tabs-bottom-bar{margin-bottom:0;margin-top:16px;border-bottom:none;border-top:1px solid #e8e8e8}.ant-tabs-bottom .ant-tabs-bottom-bar .ant-tabs-ink-bar{bottom:auto;top:1px}.ant-tabs-bottom .ant-tabs-bottom-bar .ant-tabs-nav-container{margin-bottom:0;margin-top:-1px}.ant-tabs-tab-next,.ant-tabs-tab-prev{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2;width:0;height:100%;cursor:pointer;border:0;background-color:transparent;position:absolute;text-align:center;color:rgba(0,0,0,.45);-webkit-transition:width .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);transition:width .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);opacity:0;pointer-events:none}.ant-tabs-tab-next.ant-tabs-tab-arrow-show,.ant-tabs-tab-prev.ant-tabs-tab-arrow-show{opacity:1;width:32px;height:100%;pointer-events:auto}.ant-tabs-tab-next:hover,.ant-tabs-tab-prev:hover{color:rgba(0,0,0,.65)}.ant-tabs-tab-next-icon,.ant-tabs-tab-prev-icon{font-style:normal;font-weight:700;font-variant:normal;line-height:inherit;vertical-align:baseline;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;text-transform:none}.ant-tabs-tab-next-icon-target,.ant-tabs-tab-prev-icon-target{display:block;display:inline-block;font-size:12px;font-size:10px\9;-webkit-transform:scale(.83333333) rotate(0deg);transform:scale(.83333333) rotate(0deg)}:root .ant-tabs-tab-next-icon-target,:root .ant-tabs-tab-prev-icon-target{font-size:12px}.ant-tabs-tab-btn-disabled{cursor:not-allowed}.ant-tabs-tab-btn-disabled,.ant-tabs-tab-btn-disabled:hover{color:rgba(0,0,0,.25)}.ant-tabs-tab-next{right:2px}.ant-tabs-tab-prev{left:0}:root .ant-tabs-tab-prev{-webkit-filter:none;filter:none}.ant-tabs-nav-wrap{overflow:hidden;margin-bottom:-1px}.ant-tabs-nav-scroll{overflow:hidden;white-space:nowrap}.ant-tabs-nav{-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:0;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);position:relative;margin:0;list-style:none;display:inline-block}.ant-tabs-nav:after,.ant-tabs-nav:before{display:table;content:" "}.ant-tabs-nav:after{clear:both}.ant-tabs-nav .ant-tabs-tab{display:inline-block;height:100%;margin:0 32px 0 0;padding:12px 16px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1);cursor:pointer;text-decoration:none}.ant-tabs-nav .ant-tabs-tab:last-child{margin-right:0}.ant-tabs-nav .ant-tabs-tab:hover{color:#59cf9a}.ant-tabs-nav .ant-tabs-tab:active{color:#229c6d}.ant-tabs-nav .ant-tabs-tab .anticon{margin-right:8px}.ant-tabs-nav .ant-tabs-tab-disabled,.ant-tabs-nav .ant-tabs-tab-disabled:hover{cursor:not-allowed;color:rgba(0,0,0,.25)}.ant-tabs-nav .ant-tabs-tab-active{color:#34c388;font-weight:500}.ant-tabs .ant-tabs-large-bar .ant-tabs-nav-container{font-size:16px}.ant-tabs .ant-tabs-large-bar .ant-tabs-tab{padding:16px}.ant-tabs .ant-tabs-small-bar .ant-tabs-nav-container{font-size:14px}.ant-tabs .ant-tabs-small-bar .ant-tabs-tab{padding:8px 16px}.ant-tabs .ant-tabs-bottom-content,.ant-tabs .ant-tabs-top-content{width:100%}.ant-tabs .ant-tabs-bottom-content>.ant-tabs-tabpane,.ant-tabs .ant-tabs-top-content>.ant-tabs-tabpane{-ms-flex-negative:0;flex-shrink:0;width:100%;-webkit-transition:opacity .45s;transition:opacity .45s;opacity:1}.ant-tabs .ant-tabs-bottom-content>.ant-tabs-tabpane-inactive,.ant-tabs .ant-tabs-top-content>.ant-tabs-tabpane-inactive{opacity:0;height:0;padding:0!important;pointer-events:none}.ant-tabs .ant-tabs-bottom-content>.ant-tabs-tabpane-inactive input,.ant-tabs .ant-tabs-top-content>.ant-tabs-tabpane-inactive input{visibility:hidden}.ant-tabs .ant-tabs-bottom-content.ant-tabs-content-animated,.ant-tabs .ant-tabs-top-content.ant-tabs-content-animated{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;will-change:margin-left;-webkit-transition:margin-left .3s cubic-bezier(.645,.045,.355,1);transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs .ant-tabs-left-bar,.ant-tabs .ant-tabs-right-bar{border-bottom:0;height:100%}.ant-tabs .ant-tabs-left-bar-tab-next,.ant-tabs .ant-tabs-left-bar-tab-prev,.ant-tabs .ant-tabs-right-bar-tab-next,.ant-tabs .ant-tabs-right-bar-tab-prev{width:32px;height:0;-webkit-transition:height .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);transition:height .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs .ant-tabs-left-bar-tab-next.ant-tabs-tab-arrow-show,.ant-tabs .ant-tabs-left-bar-tab-prev.ant-tabs-tab-arrow-show,.ant-tabs .ant-tabs-right-bar-tab-next.ant-tabs-tab-arrow-show,.ant-tabs .ant-tabs-right-bar-tab-prev.ant-tabs-tab-arrow-show{width:100%;height:32px}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab{float:none;margin:0 0 16px 0;padding:8px 24px;display:block}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab:last-child,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab:last-child{margin-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-extra-content,.ant-tabs .ant-tabs-right-bar .ant-tabs-extra-content{text-align:center}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-scroll,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-scroll{width:auto}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-wrap,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-wrap{height:100%}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container{margin-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container.ant-tabs-nav-container-scrolling,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container.ant-tabs-nav-container-scrolling{padding:32px 0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-wrap,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-wrap{margin-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav{width:100%}.ant-tabs .ant-tabs-left-bar .ant-tabs-ink-bar,.ant-tabs .ant-tabs-right-bar .ant-tabs-ink-bar{width:2px;top:0;left:auto;height:auto;bottom:auto}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab-next,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab-next{width:100%;bottom:0;height:32px}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab-prev,.ant-tabs .ant-tabs-right-bar .ant-tabs-tab-prev{top:0;width:100%;height:32px}.ant-tabs .ant-tabs-left-content,.ant-tabs .ant-tabs-right-content{overflow:hidden;width:auto;margin-top:0!important}.ant-tabs .ant-tabs-left-bar{float:left;border-right:1px solid #e8e8e8;margin-right:-1px;margin-bottom:0}.ant-tabs .ant-tabs-left-bar .ant-tabs-tab{text-align:right}.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-left-bar .ant-tabs-nav-wrap{margin-right:-1px}.ant-tabs .ant-tabs-left-bar .ant-tabs-ink-bar{right:1px}.ant-tabs .ant-tabs-left-content{padding-left:24px;border-left:1px solid #e8e8e8}.ant-tabs .ant-tabs-right-bar{float:right;border-left:1px solid #e8e8e8;margin-left:-1px;margin-bottom:0}.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-container,.ant-tabs .ant-tabs-right-bar .ant-tabs-nav-wrap{margin-left:-1px}.ant-tabs .ant-tabs-right-bar .ant-tabs-ink-bar{left:1px}.ant-tabs .ant-tabs-right-content{padding-right:24px;border-right:1px solid #e8e8e8}.ant-tabs-bottom .ant-tabs-ink-bar-animated,.ant-tabs-top .ant-tabs-ink-bar-animated{-webkit-transition:width .3s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:width .3s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1),left .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-left .ant-tabs-ink-bar-animated,.ant-tabs-right .ant-tabs-ink-bar-animated{-webkit-transition:height .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:height .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),height .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),height .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-no-animation>.ant-tabs-content>.ant-tabs-content-animated,.no-flex>.ant-tabs-content>.ant-tabs-content-animated{-webkit-transform:none!important;transform:none!important;margin-left:0!important}.ant-tabs-no-animation>.ant-tabs-content>.ant-tabs-tabpane-inactive,.no-flex>.ant-tabs-content>.ant-tabs-tabpane-inactive{display:none}.ant-tabs-left-content>.ant-tabs-content-animated,.ant-tabs-right-content>.ant-tabs-content-animated{-webkit-transform:none!important;transform:none!important;margin-left:0!important}.ant-tabs-left-content>.ant-tabs-tabpane-inactive,.ant-tabs-right-content>.ant-tabs-tabpane-inactive{display:none}.ant-badge{font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;position:relative;display:inline-block;line-height:1;color:unset}.ant-badge-count{top:-10px;height:20px;border-radius:10px;min-width:20px;background:#f5222d;color:#fff;line-height:20px;text-align:center;padding:0 6px;font-size:12px;font-weight:400;white-space:nowrap;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff;z-index:10}.ant-badge-count a,.ant-badge-count a:hover{color:#fff}.ant-badge-multiple-words{padding:0 8px}.ant-badge-dot{top:-3px;height:6px;width:6px;border-radius:100%;background:#f5222d;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ant-badge-count,.ant-badge-dot,.ant-badge .ant-scroll-number-custom-component{position:absolute;right:0;-webkit-transform:translateX(50%);transform:translateX(50%);-webkit-transform-origin:100%;transform-origin:100%}.ant-badge .ant-scroll-number-custom-component{-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}.ant-badge-status{line-height:inherit;vertical-align:baseline}.ant-badge-status-dot{width:6px;height:6px;display:inline-block;border-radius:50%;vertical-align:middle;position:relative;top:-1px}.ant-badge-status-success{background-color:#52c41a}.ant-badge-status-processing{background-color:#1890ff;position:relative}.ant-badge-status-processing:after{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;border:1px solid #1890ff;content:"";-webkit-animation:antStatusProcessing 1.2s ease-in-out infinite;animation:antStatusProcessing 1.2s ease-in-out infinite}.ant-badge-status-default{background-color:#d9d9d9}.ant-badge-status-error{background-color:#f5222d}.ant-badge-status-warning{background-color:#faad14}.ant-badge-status-text{color:rgba(0,0,0,.65);font-size:14px;margin-left:8px}.ant-badge-zoom-appear,.ant-badge-zoom-enter{-webkit-animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-zoom-leave{-webkit-animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-not-a-wrapper{vertical-align:middle}.ant-badge-not-a-wrapper .ant-scroll-number{top:auto;display:block;position:relative}.ant-badge-not-a-wrapper .ant-badge-count{-webkit-transform:none;transform:none}@-webkit-keyframes antStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}to{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}@keyframes antStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}to{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}.ant-scroll-number{overflow:hidden}.ant-scroll-number-only{display:inline-block;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);height:20px}.ant-scroll-number-only>p{height:20px;margin:0}@-webkit-keyframes antZoomBadgeIn{0%{opacity:0;-webkit-transform:scale(0) translateX(50%);transform:scale(0) translateX(50%)}to{-webkit-transform:scale(1) translateX(50%);transform:scale(1) translateX(50%)}}@keyframes antZoomBadgeIn{0%{opacity:0;-webkit-transform:scale(0) translateX(50%);transform:scale(0) translateX(50%)}to{-webkit-transform:scale(1) translateX(50%);transform:scale(1) translateX(50%)}}@-webkit-keyframes antZoomBadgeOut{0%{-webkit-transform:scale(1) translateX(50%);transform:scale(1) translateX(50%)}to{opacity:0;-webkit-transform:scale(0) translateX(50%);transform:scale(0) translateX(50%)}}@keyframes antZoomBadgeOut{0%{-webkit-transform:scale(1) translateX(50%);transform:scale(1) translateX(50%)}to{opacity:0;-webkit-transform:scale(0) translateX(50%);transform:scale(0) translateX(50%)}}.ant-skeleton{display:table;width:100%}.ant-skeleton-header{display:table-cell;vertical-align:top;padding-right:16px}.ant-skeleton-header .ant-skeleton-avatar{display:inline-block;vertical-align:top;background:#f2f2f2;width:32px;height:32px;line-height:32px}.ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-lg{width:40px;height:40px;line-height:40px}.ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-sm{width:24px;height:24px;line-height:24px}.ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-content{display:table-cell;vertical-align:top;width:100%}.ant-skeleton-content .ant-skeleton-title{margin-top:16px;height:16px;width:100%;background:#f2f2f2}.ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:24px}.ant-skeleton-content .ant-skeleton-paragraph>li{height:16px;background:#f2f2f2;list-style:none;width:100%}.ant-skeleton-content .ant-skeleton-paragraph>li:last-child:not(:first-child):not(:nth-child(2)){width:61%}.ant-skeleton-content .ant-skeleton-paragraph>li+li{margin-top:16px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title{margin-top:12px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:28px}.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title{background:-webkit-gradient(linear,left top,right top,color-stop(25%,#f2f2f2),color-stop(37%,#e6e6e6),color-stop(63%,#f2f2f2));background:linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%);-webkit-animation:ant-skeleton-loading 1.4s ease infinite;animation:ant-skeleton-loading 1.4s ease infinite;background-size:400% 100%}@-webkit-keyframes ant-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes ant-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.ant-breadcrumb{font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;color:rgba(0,0,0,.45);font-size:14px}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb a{color:rgba(0,0,0,.45);-webkit-transition:color .3s;transition:color .3s}.ant-breadcrumb a:hover{color:#59cf9a}.ant-breadcrumb>span:last-child{color:rgba(0,0,0,.65)}.ant-breadcrumb>span:last-child .ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{margin:0 8px;color:rgba(0,0,0,.45)}.ant-breadcrumb-link>.anticon+span{margin-left:4px}#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;-webkit-box-shadow:0 0 10px #29d,0 0 5px #29d;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translateY(-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;-webkit-box-sizing:border-box;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.ant-menu{font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-variant:tabular-nums;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;outline:none;margin-bottom:0;padding-left:0;list-style:none;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15);color:rgba(0,0,0,.65);background:#fff;line-height:0;-webkit-transition:background .3s,width .2s;transition:background .3s,width .2s;zoom:1}.ant-menu:after,.ant-menu:before{content:"";display:table}.ant-menu:after{clear:both}.ant-menu ol,.ant-menu ul{list-style:none;margin:0;padding:0}.ant-menu-hidden{display:none}.ant-menu-item-group-title{color:rgba(0,0,0,.45);font-size:14px;line-height:1.5;padding:8px 16px;-webkit-transition:all .3s;transition:all .3s}.ant-menu-submenu,.ant-menu-submenu-inline{-webkit-transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1);transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-item:active,.ant-menu-submenu-title:active{background:#f0fff6}.ant-menu-submenu .ant-menu-sub{cursor:auto;-webkit-transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item>a{display:block;color:rgba(0,0,0,.65)}.ant-menu-item>a:hover{color:#34c388}.ant-menu-item>a:focus{text-decoration:none}.ant-menu-item>a:before{position:absolute;background-color:transparent;top:0;left:0;bottom:0;right:0;content:""}.ant-menu-item-divider{height:1px;overflow:hidden;background-color:#e8e8e8;line-height:0}.ant-menu-item-active,.ant-menu-item:hover,.ant-menu-submenu-active,.ant-menu-submenu-title:hover,.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{color:#34c388}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu{margin-top:-1px}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu .ant-menu-submenu-title:hover{background-color:transparent}.ant-menu-item-selected,.ant-menu-item-selected>a,.ant-menu-item-selected>a:hover{color:#34c388}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#f0fff6}.ant-menu-inline,.ant-menu-vertical,.ant-menu-vertical-left{border-right:1px solid #e8e8e8}.ant-menu-vertical-right{border-left:1px solid #e8e8e8}.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{border-right:0;padding:0;-webkit-transform-origin:0 0;transform-origin:0 0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item,.ant-menu-vertical.ant-menu-sub .ant-menu-item{border-right:0;margin-left:0;left:0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical.ant-menu-sub .ant-menu-item:after{border-right:0}.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{-webkit-transform-origin:0 0;transform-origin:0 0}.ant-menu-horizontal.ant-menu-sub,.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{min-width:160px}.ant-menu-item,.ant-menu-submenu-title{cursor:pointer;margin:0;padding:0 20px;position:relative;display:block;white-space:nowrap;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1),border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-item .anticon,.ant-menu-submenu-title .anticon{min-width:14px;margin-right:10px;font-size:14px;-webkit-transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1);transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-item .anticon+span,.ant-menu-submenu-title .anticon+span{-webkit-transition:opacity .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1);transition:opacity .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1);opacity:1}.ant-menu>.ant-menu-item-divider{height:1px;margin:1px 0;overflow:hidden;padding:0;line-height:0;background-color:#e8e8e8}.ant-menu-submenu-popup{position:absolute;border-radius:4px;z-index:1050;background:#fff}.ant-menu-submenu-popup .submenu-title-wrapper{padding-right:20px}.ant-menu-submenu-popup:before{position:absolute;top:-7px;left:0;right:0;bottom:0;content:" ";opacity:.0001}.ant-menu-submenu>.ant-menu{background-color:#fff;border-radius:4px}.ant-menu-submenu>.ant-menu-submenu-title:after{-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow{-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);position:absolute;top:50%;right:16px;width:10px}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{content:"";position:absolute;vertical-align:baseline;background:#fff;background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.65)),to(rgba(0,0,0,.65)));background-image:linear-gradient(90deg,rgba(0,0,0,.65),rgba(0,0,0,.65));width:6px;height:1.5px;border-radius:2px;-webkit-transition:background .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1);transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(45deg) translateY(-2px);transform:rotate(45deg) translateY(-2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(-45deg) translateY(2px);transform:rotate(-45deg) translateY(2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-inline>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-left>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical-right>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before,.ant-menu-submenu-vertical>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:after,.ant-menu-submenu-vertical>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow:before{background:-webkit-gradient(linear,left top,right top,from(#34c388),to(#34c388));background:linear-gradient(90deg,#34c388,#34c388)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(-45deg) translateX(2px);transform:rotate(-45deg) translateX(2px)}.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(45deg) translateX(-2px);transform:rotate(45deg) translateX(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow{-webkit-transform:translateY(-2px);transform:translateY(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{-webkit-transform:rotate(-45deg) translateX(-2px);transform:rotate(-45deg) translateX(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{-webkit-transform:rotate(45deg) translateX(2px);transform:rotate(45deg) translateX(2px)}.ant-menu-vertical-left .ant-menu-submenu-selected,.ant-menu-vertical-left .ant-menu-submenu-selected>a,.ant-menu-vertical-right .ant-menu-submenu-selected,.ant-menu-vertical-right .ant-menu-submenu-selected>a,.ant-menu-vertical .ant-menu-submenu-selected,.ant-menu-vertical .ant-menu-submenu-selected>a{color:#34c388}.ant-menu-horizontal{border:0;border-bottom:1px solid #e8e8e8;-webkit-box-shadow:none;box-shadow:none;line-height:46px;white-space:nowrap}.ant-menu-horizontal>.ant-menu-item,.ant-menu-horizontal>.ant-menu-submenu{position:relative;top:1px;display:inline-block;vertical-align:bottom;border-bottom:2px solid transparent}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover{border-bottom:2px solid #34c388;color:#34c388}.ant-menu-horizontal>.ant-menu-item>a{display:block;color:rgba(0,0,0,.65)}.ant-menu-horizontal>.ant-menu-item>a:hover{color:#34c388}.ant-menu-horizontal>.ant-menu-item>a:before{bottom:-2px}.ant-menu-horizontal>.ant-menu-item-selected>a{color:#34c388}.ant-menu-horizontal:after{content:" ";display:block;height:0;clear:both}.ant-menu-inline .ant-menu-item,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical .ant-menu-item{position:relative}.ant-menu-inline .ant-menu-item:after,.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-vertical .ant-menu-item:after{content:"";position:absolute;right:0;top:0;bottom:0;border-right:3px solid #34c388;-webkit-transform:scaleY(.0001);transform:scaleY(.0001);opacity:0;-webkit-transition:opacity .15s cubic-bezier(.215,.61,.355,1),-webkit-transform .15s cubic-bezier(.215,.61,.355,1);transition:opacity .15s cubic-bezier(.215,.61,.355,1),-webkit-transform .15s cubic-bezier(.215,.61,.355,1);transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1);transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1),-webkit-transform .15s cubic-bezier(.215,.61,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical-right .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical .ant-menu-submenu-title{padding:0 16px;font-size:14px;line-height:40px;height:40px;margin-top:4px;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis}.ant-menu-inline .ant-menu-submenu,.ant-menu-vertical-left .ant-menu-submenu,.ant-menu-vertical-right .ant-menu-submenu,.ant-menu-vertical .ant-menu-submenu{padding-bottom:.01px}.ant-menu-inline .ant-menu-item:not(:last-child),.ant-menu-vertical-left .ant-menu-item:not(:last-child),.ant-menu-vertical-right .ant-menu-item:not(:last-child),.ant-menu-vertical .ant-menu-item:not(:last-child){margin-bottom:8px}.ant-menu-inline>.ant-menu-item,.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-left>.ant-menu-item,.ant-menu-vertical-left>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-right>.ant-menu-item,.ant-menu-vertical-right>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical>.ant-menu-item,.ant-menu-vertical>.ant-menu-submenu>.ant-menu-submenu-title{line-height:40px;height:40px}.ant-menu-inline{width:100%}.ant-menu-inline .ant-menu-item-selected:after,.ant-menu-inline .ant-menu-selected:after{-webkit-transition:opacity .15s cubic-bezier(.645,.045,.355,1),-webkit-transform .15s cubic-bezier(.645,.045,.355,1);transition:opacity .15s cubic-bezier(.645,.045,.355,1),-webkit-transform .15s cubic-bezier(.645,.045,.355,1);transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1);transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1),-webkit-transform .15s cubic-bezier(.645,.045,.355,1);opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title{width:calc(100% + 1px)}.ant-menu-inline .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline-collapsed{width:80px}.ant-menu-inline-collapsed>.ant-menu-item,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title{left:0;text-overflow:clip;padding:0 32px!important}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{display:none}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon,.ant-menu-inline-collapsed>.ant-menu-item .anticon,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon{font-size:16px;line-height:40px;margin:0}.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon+span,.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span,.ant-menu-inline-collapsed>.ant-menu-item .anticon+span,.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span{max-width:0;display:inline-block;opacity:0}.ant-menu-inline-collapsed-tooltip{pointer-events:none}.ant-menu-inline-collapsed-tooltip .anticon{display:none}.ant-menu-inline-collapsed-tooltip a{color:hsla(0,0%,100%,.85)}.ant-menu-inline-collapsed .ant-menu-item-group-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:4px;padding-right:4px}.ant-menu-item-group-list{margin:0;padding:0}.ant-menu-item-group-list .ant-menu-item,.ant-menu-item-group-list .ant-menu-submenu-title{padding:0 16px 0 28px}.ant-menu-root.ant-menu-inline,.ant-menu-root.ant-menu-vertical,.ant-menu-root.ant-menu-vertical-left,.ant-menu-root.ant-menu-vertical-right,.ant-menu-sub.ant-menu-inline{-webkit-box-shadow:none;box-shadow:none}.ant-menu-sub.ant-menu-inline{padding:0;border:0;border-radius:0}.ant-menu-sub.ant-menu-inline>.ant-menu-item,.ant-menu-sub.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title{line-height:40px;height:40px;list-style-type:disc;list-style-position:inside}.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:32px}.ant-menu-item-disabled,.ant-menu-submenu-disabled{color:rgba(0,0,0,.25)!important;cursor:not-allowed;background:none;border-color:transparent!important}.ant-menu-item-disabled>a,.ant-menu-submenu-disabled>a{color:rgba(0,0,0,.25)!important;pointer-events:none}.ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-submenu-disabled>.ant-menu-submenu-title{color:rgba(0,0,0,.25)!important;cursor:not-allowed}.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:rgba(0,0,0,.25)!important}.ant-menu-dark,.ant-menu-dark .ant-menu-sub{color:hsla(0,0%,100%,.65);background:#001529}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:.45;-webkit-transition:all .3s;transition:all .3s}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark.ant-menu-submenu-popup{background:transparent}.ant-menu-dark .ant-menu-inline.ant-menu-sub{background:#000c17;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.45) inset;box-shadow:inset 0 2px 8px rgba(0,0,0,.45)}.ant-menu-dark.ant-menu-horizontal{border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item,.ant-menu-dark.ant-menu-horizontal>.ant-menu-submenu{border-color:#001529;border-bottom:0;top:0;margin-top:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item>a:before{bottom:0}.ant-menu-dark .ant-menu-item,.ant-menu-dark .ant-menu-item-group-title,.ant-menu-dark .ant-menu-item>a{color:hsla(0,0%,100%,.65)}.ant-menu-dark.ant-menu-inline,.ant-menu-dark.ant-menu-vertical,.ant-menu-dark.ant-menu-vertical-left,.ant-menu-dark.ant-menu-vertical-right{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item,.ant-menu-dark.ant-menu-vertical .ant-menu-item{border-right:0;margin-left:0;left:0}.ant-menu-dark.ant-menu-inline .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical .ant-menu-item:after{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-inline .ant-menu-submenu-title{width:100%}.ant-menu-dark .ant-menu-item-active,.ant-menu-dark .ant-menu-item:hover,.ant-menu-dark .ant-menu-submenu-active,.ant-menu-dark .ant-menu-submenu-open,.ant-menu-dark .ant-menu-submenu-selected,.ant-menu-dark .ant-menu-submenu-title:hover{background-color:transparent;color:#fff}.ant-menu-dark .ant-menu-item-active>a,.ant-menu-dark .ant-menu-item:hover>a,.ant-menu-dark .ant-menu-submenu-active>a,.ant-menu-dark .ant-menu-submenu-open>a,.ant-menu-dark .ant-menu-submenu-selected>a,.ant-menu-dark .ant-menu-submenu-title:hover>a{color:#fff}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow{opacity:1}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title:hover>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark .ant-menu-item-selected{border-right:0;color:#fff}.ant-menu-dark .ant-menu-item-selected:after{border-right:0}.ant-menu-dark .ant-menu-item-selected>a,.ant-menu-dark .ant-menu-item-selected>a:hover{color:#fff}.ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,.ant-menu.ant-menu-dark .ant-menu-item-selected{background-color:#34c388}.ant-menu-dark .ant-menu-item-disabled,.ant-menu-dark .ant-menu-item-disabled>a,.ant-menu-dark .ant-menu-submenu-disabled,.ant-menu-dark .ant-menu-submenu-disabled>a{opacity:.8;color:hsla(0,0%,100%,.35)!important}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title{color:hsla(0,0%,100%,.35)!important}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:hsla(0,0%,100%,.35)!important}.ant-tooltip{font-family:Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;position:absolute;z-index:1060;display:block;visibility:visible;max-width:250px}.ant-tooltip-hidden{display:none}.ant-tooltip-placement-top,.ant-tooltip-placement-topLeft,.ant-tooltip-placement-topRight{padding-bottom:8px}.ant-tooltip-placement-right,.ant-tooltip-placement-rightBottom,.ant-tooltip-placement-rightTop{padding-left:8px}.ant-tooltip-placement-bottom,.ant-tooltip-placement-bottomLeft,.ant-tooltip-placement-bottomRight{padding-top:8px}.ant-tooltip-placement-left,.ant-tooltip-placement-leftBottom,.ant-tooltip-placement-leftTop{padding-right:8px}.ant-tooltip-inner{padding:6px 8px;color:#fff;text-align:left;text-decoration:none;background-color:rgba(0,0,0,.75);border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15);min-height:32px;word-wrap:break-word}.ant-tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.ant-tooltip-placement-top .ant-tooltip-arrow,.ant-tooltip-placement-topLeft .ant-tooltip-arrow,.ant-tooltip-placement-topRight .ant-tooltip-arrow{bottom:3px;border-width:5px 5px 0;border-top-color:rgba(0,0,0,.75)}.ant-tooltip-placement-top .ant-tooltip-arrow{left:50%;margin-left:-5px}.ant-tooltip-placement-topLeft .ant-tooltip-arrow{left:16px}.ant-tooltip-placement-topRight .ant-tooltip-arrow{right:16px}.ant-tooltip-placement-right .ant-tooltip-arrow,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,.ant-tooltip-placement-rightTop .ant-tooltip-arrow{left:3px;border-width:5px 5px 5px 0;border-right-color:rgba(0,0,0,.75)}.ant-tooltip-placement-right .ant-tooltip-arrow{top:50%;margin-top:-5px}.ant-tooltip-placement-rightTop .ant-tooltip-arrow{top:8px}.ant-tooltip-placement-rightBottom .ant-tooltip-arrow{bottom:8px}.ant-tooltip-placement-left .ant-tooltip-arrow,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,.ant-tooltip-placement-leftTop .ant-tooltip-arrow{right:3px;border-width:5px 0 5px 5px;border-left-color:rgba(0,0,0,.75)}.ant-tooltip-placement-left .ant-tooltip-arrow{top:50%;margin-top:-5px}.ant-tooltip-placement-leftTop .ant-tooltip-arrow{top:8px}.ant-tooltip-placement-leftBottom .ant-tooltip-arrow{bottom:8px}.ant-tooltip-placement-bottom .ant-tooltip-arrow,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{top:3px;border-width:0 5px 5px;border-bottom-color:rgba(0,0,0,.75)}.ant-tooltip-placement-bottom .ant-tooltip-arrow{left:50%;margin-left:-5px}.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow{left:16px}.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{right:16px} \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/editor.worker.js b/apps/emqx_enterprise_dashboard/priv/www/static/editor.worker.js new file mode 100644 index 000000000..84af613fc --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/editor.worker.js @@ -0,0 +1,6 @@ +(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s="e500")})({"30db":function(e,t,n){"use strict";(function(e,r){n.d(t,"c",function(){return p}),n.d(t,"b",function(){return g}),n.d(t,"a",function(){return v});var i="en",o=!1,s=!1,u=!1,a=!1,l=void 0,h=void 0,f="undefined"!==typeof e&&"undefined"!==typeof e.versions&&"undefined"!==typeof e.versions.electron&&"renderer"===e.type;if("object"!==typeof navigator||f){if("object"===typeof e){o="win32"===e.platform,s="darwin"===e.platform,u="linux"===e.platform,l=i,i;var c=Object({VUE_APP_BUILD_ENV:"emqx",NODE_ENV:"production",BASE_URL:"/"})["VSCODE_NLS_CONFIG"];if(c)try{var d=JSON.parse(c),m=d.availableLanguages["*"];l=d.locale,m||i,d._translationsConfigFile}catch(y){}!0}}else h=navigator.userAgent,o=h.indexOf("Windows")>=0,s=h.indexOf("Macintosh")>=0,u=h.indexOf("Linux")>=0,a=!0,l=navigator.language,l;var p=o,g=a,_="object"===typeof self?self:"object"===typeof r?r:{},v=_}).call(this,n("f28c"),n("c8ba"))},5110:function(e,t,n){(function(e){ +/*! +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + */ +(function(e,t){t()})(0,function(){"use strict";function t(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}var n=setTimeout;function r(){}function i(e,t){return function(){e.apply(t,arguments)}}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!==typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function s(e,t){while(3===e._state)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(i){return void a(t.promise,i)}u(t.promise,r)}else(1===e._state?u:a)(t.promise,e._value)})):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===typeof t||"function"===typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void l(e);if("function"===typeof n)return void f(i(n,t),e)}e._state=1,e._value=t,l(e)}catch(r){a(e,r)}}function a(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;tr?e[a]=o[u++]:u>i?e[a]=o[s++]:t(o[u],o[s])<0?e[a]=o[u++]:e[a]=o[s++]}function M(e,t,n,r,i){if(!(r<=n)){var o=n+(r-n)/2|0;M(e,t,n,o,i),M(e,t,o+1,r,i),t(e[o],e[o+1])<=0||P(e,t,n,o,r,i)}}var T=function(){function e(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}return e.prototype.getOriginalEnd=function(){return this.originalStart+this.originalLength},e.prototype.getModifiedEnd=function(){return this.modifiedStart+this.modifiedLength},e}();function O(e){return{getLength:function(){return e.length},getElementAtIndex:function(t){return e.charCodeAt(t)}}}function x(e,t,n){return new F(O(e),O(t)).ComputeDiff(n)}var I,R=function(){function e(){}return e.Assert=function(e,t){if(!e)throw new Error(t)},e}(),k=function(){function e(){}return e.Copy=function(e,t,n,r,i){for(var o=0;o0||this.m_modifiedCount>0)&&this.m_changes.push(new T(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),F=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,r,i){var o=[!1],s=this.ComputeDiffRecursive(e,t,n,r,o);return i?this.PrettifyChanges(s):s},e.prototype.ComputeDiffRecursive=function(e,t,n,r,i){i[0]=!1;while(e<=t&&n<=r&&this.ElementsAreEqual(e,n))e++,n++;while(t>=e&&r>=n&&this.ElementsAreEqual(t,r))t--,r--;if(e>t||n>r){var o=void 0;return n<=r?(R.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new T(e,0,n,r-n+1)]):e<=t?(R.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[new T(e,t-e+1,n,0)]):(R.Assert(e===t+1,"originalStart should only be one more than originalEnd"),R.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}var s=[0],u=[0],a=this.ComputeRecursionPoint(e,t,n,r,s,u,i),l=s[0],h=u[0];if(null!==a)return a;if(!i[0]){var f=this.ComputeDiffRecursive(e,l,n,h,i),c=[];return c=i[0]?[new T(l+1,t-(l+1)+1,h+1,r-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,r,i),this.ConcatenateChanges(f,c)}return[new T(e,t-e+1,n,r-n+1)]},e.prototype.WALKTRACE=function(e,t,n,r,i,o,s,u,a,l,h,f,c,d,m,p,g,_){var v,y=null,b=null,C=new D,L=t,N=n,E=c[0]-p[0]-r,S=Number.MIN_VALUE,w=this.m_forwardHistory.length-1;do{v=E+e,v===L||v=0&&(a=this.m_forwardHistory[w],e=a[0],L=1,N=a.length-1)}while(--w>=-1);if(y=C.getReverseChanges(),_[0]){var A=c[0]+1,P=p[0]+1;if(null!==y&&y.length>0){var M=y[y.length-1];A=Math.max(A,M.getOriginalEnd()),P=Math.max(P,M.getModifiedEnd())}b=[new T(A,f-A+1,P,m-P+1)]}else{C=new D,L=o,N=s,E=c[0]-p[0]-u,S=Number.MAX_VALUE,w=g?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{v=E+i,v===L||v=l[v+1]?(h=l[v+1]-1,d=h-E-u,h>S&&C.MarkNextChange(),S=h+1,C.AddOriginalElement(h+1,d+1),E=v+1-i):(h=l[v-1],d=h-E-u,h>S&&C.MarkNextChange(),S=h,C.AddModifiedElement(h+1,d+1),E=v-1-i),w>=0&&(l=this.m_reverseHistory[w],i=l[0],L=1,N=l.length-1)}while(--w>=-1);b=C.getChanges()}return this.ConcatenateChanges(y,b)},e.prototype.ComputeRecursionPoint=function(e,t,n,r,i,o,s){var u,a=0,l=0,h=0,f=0,c=0,d=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var m,p,g=t-e+(r-n),_=g+1,v=new Array(_),y=new Array(_),b=r-n,C=t-e,L=e-n,N=t-r,E=C-b,S=E%2===0;for(v[b]=e,y[C]=t,s[0]=!1,u=1;u<=g/2+1;u++){var w=0,A=0;for(h=this.ClipDiagonalBound(b-u,u,b,_),f=this.ClipDiagonalBound(b+u,u,b,_),m=h;m<=f;m+=2){a=m===h||mw+A&&(w=a,A=l),!S&&Math.abs(m-C)<=u-1&&a>=y[m])return i[0]=a,o[0]=l,p<=y[m]&&U>0&&u<=U+1?this.WALKTRACE(b,h,f,L,C,c,d,N,v,y,a,t,i,l,r,o,S,s):null}var P=(w-e+(A-n)-u)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(w,this.OriginalSequence,P))return s[0]=!0,i[0]=w,o[0]=A,P>0&&U>0&&u<=U+1?this.WALKTRACE(b,h,f,L,C,c,d,N,v,y,a,t,i,l,r,o,S,s):(e++,n++,[new T(e,t-e+1,n,r-n+1)]);for(c=this.ClipDiagonalBound(C-u,u,C,_),d=this.ClipDiagonalBound(C+u,u,C,_),m=c;m<=d;m+=2){a=m===c||m=y[m+1]?y[m+1]-1:y[m-1],l=a-(m-C)-N,p=a;while(a>e&&l>n&&this.ElementsAreEqual(a,l))a--,l--;if(y[m]=a,S&&Math.abs(m-b)<=u&&a<=v[m])return i[0]=a,o[0]=l,p>=v[m]&&U>0&&u<=U+1?this.WALKTRACE(b,h,f,L,C,c,d,N,v,y,a,t,i,l,r,o,S,s):null}if(u<=U){var M=new Array(f-h+2);M[0]=b-h+1,k.Copy(v,h,M,1,f-h+1),this.m_forwardHistory.push(M),M=new Array(d-c+2),M[0]=C-c+1,k.Copy(y,c,M,1,d-c+1),this.m_reverseHistory.push(M)}}return this.WALKTRACE(b,h,f,L,C,c,d,N,v,y,a,t,i,l,r,o,S,s)},e.prototype.PrettifyChanges=function(e){for(var t=0;t0,s=n.modifiedLength>0;while(n.originalStart+n.originalLength=0;t--){n=e[t],r=0,i=0;if(t>0){var a=e[t-1];a.originalLength>0&&(r=a.originalStart+a.originalLength),a.modifiedLength>0&&(i=a.modifiedStart+a.modifiedLength)}o=n.originalLength>0,s=n.modifiedLength>0;for(var l=0,h=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),f=1;;f++){var c=n.originalStart-f,d=n.modifiedStart-f;if(ch&&(h=m,l=f)}n.originalStart-=l,n.modifiedStart-=l}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,r){var i=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(n,r)?1:0;return i+o},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var r=new Array(e.length+t.length-1);return k.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],k.Copy(t,1,r,e.length,t.length-1),r}r=new Array(e.length+t.length);return k.Copy(e,0,r,0,e.length),k.Copy(t,0,r,e.length,t.length),r},e.prototype.ChangesOverlap=function(e,t,n){if(R.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),R.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){var r=e.originalStart,i=e.originalLength,o=e.modifiedStart,s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new T(r,i,o,s),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,r){if(e>=0&&e=n?q:{done:!1,value:e[t++]}}}}function o(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()}function s(e,t){return{next:function(){var n=e.next();return n.done?q:{done:!1,value:t(n.value)}}}}function u(e,t){return{next:function(){while(1){var n=e.next();if(n.done)return q;if(t(n.value))return{done:!1,value:n.value}}}}}function a(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)}function l(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY);var n=[];if(0===t)return n;for(var r=0,i=e.next();!i.done;i=e.next())if(n.push(i.value),++r>=t)break;return n}function h(){for(var e=[],t=0;t=e.length)return q;var t=e[n],r=t.next();return r.done?(n++,this.next()):r}}}e.empty=n,e.single=r,e.fromArray=i,e.from=o,e.map=s,e.filter=u,e.forEach=a,e.collect=l,e.concat=h})(I||(I={}));var V,B=function(){function e(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===r&&(r=t-1),this.items=e,this.start=t,this.end=n,this.index=r}return e.prototype.first=function(){return this.index=this.start,this.current()},e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}(),j=(function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===r&&(r=t.length),void 0===i&&(i=n-1),e.call(this,t,n,r,i)||this}K(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null}}(B),function(){function e(e,t){this.iterator=e,this.fn=t}e.prototype.next=function(){return this.fn(this.iterator.next())}}(),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Y=/^\w[\w\d+.-]*$/,W=/^\//,H=/^\/\//,G=!0;function Q(e,t){if(!e.scheme){if(t||G)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');console.warn('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}')}if(e.scheme&&!Y.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!W.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(H.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}function z(e,t){return t||G?e||J:(e||(console.trace("BAD uri lacks scheme, falling back to file-scheme."),e="file"),e)}function X(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==$&&(t=$+t):t=$;break}return t}var J="",$="/",Z=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,ee=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),"object"===typeof e?(this.scheme=e.scheme||J,this.authority=e.authority||J,this.path=e.path||J,this.query=e.query||J,this.fragment=e.fragment||J):(this.scheme=z(e,o),this.authority=t||J,this.path=X(this.scheme,n||J),this.query=r||J,this.fragment=i||J,Q(this,o))}return e.isUri=function(t){return t instanceof e||!!t&&("string"===typeof t.authority&&"string"===typeof t.fragment&&"string"===typeof t.path&&"string"===typeof t.query&&"string"===typeof t.scheme&&"function"===typeof t.fsPath&&"function"===typeof t.with&&"function"===typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return se(this)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=J),void 0===n?n=this.authority:null===n&&(n=J),void 0===r?r=this.path:null===r&&(r=J),void 0===i?i=this.query:null===i&&(i=J),void 0===o?o=this.fragment:null===o&&(o=J),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new ne(t,n,r,i,o)},e.parse=function(e,t){void 0===t&&(t=!1);var n=Z.exec(e);return n?new ne(n[2]||J,decodeURIComponent(n[4]||J),decodeURIComponent(n[5]||J),decodeURIComponent(n[7]||J),decodeURIComponent(n[9]||J),t):new ne(J,J,J,J,J)},e.file=function(e){var t=J;if(y["c"]&&(e=e.replace(/\\/g,$)),e[0]===$&&e[1]===$){var n=e.indexOf($,2);-1===n?(t=e.substring(2),e=$):(t=e.substring(2,n),e=e.substring(n)||$)}return new ne("file",t,e,J,J)},e.from=function(e){return new ne(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),ue(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new ne(t);return n._formatted=t.external,n._fsPath=t._sep===te?t.fsPath:null,n}return t},e}(),te=y["c"]?1:void 0,ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return j(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=se(this)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?ue(this,!0):(this._formatted||(this._formatted=ue(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=te),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},t}(ee),re=(V={},V[58]="%3A",V[47]="%2F",V[63]="%3F",V[35]="%23",V[91]="%5B",V[93]="%5D",V[64]="%40",V[33]="%21",V[36]="%24",V[38]="%26",V[39]="%27",V[40]="%28",V[41]="%29",V[42]="%2A",V[43]="%2B",V[44]="%2C",V[59]="%3B",V[61]="%3D",V[32]="%20",V);function ie(e,t){for(var n=void 0,r=-1,i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var s=re[o];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=s):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function oe(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,y["c"]&&(t=t.replace(/\//g,"\\")),t}function ue(e,t){var n=t?oe:ie,r="",i=e.scheme,o=e.authority,s=e.path,u=e.query,a=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=$,r+=$),o){var l=o.indexOf("@");if(-1!==l){var h=o.substr(0,l);o=o.substr(l+1),l=h.indexOf(":"),-1===l?r+=n(h,!1):(r+=n(h.substr(0,l),!1),r+=":",r+=n(h.substr(l+1),!1)),r+="@"}o=o.toLowerCase(),l=o.indexOf(":"),-1===l?r+=n(o,!1):(r+=n(o.substr(0,l),!1),r+=o.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){var f=s.charCodeAt(1);f>=65&&f<=90&&(s="/"+String.fromCharCode(f+32)+":"+s.substr(3))}else if(s.length>=2&&58===s.charCodeAt(1)){f=s.charCodeAt(0);f>=65&&f<=90&&(s=String.fromCharCode(f+32)+":"+s.substr(2))}r+=n(s,!0)}return u&&(r+="?",r+=n(u,!1)),a&&(r+="#",r+=t?a:ie(a,!1)),r}var ae=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.with=function(t,n){return void 0===t&&(t=this.lineNumber),void 0===n&&(n=this.column),t===this.lineNumber&&n===this.column?this:new e(t,n)},e.prototype.delta=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.with(this.lineNumber+e,this.column+t)},e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(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)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(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)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var r,i,o,s;return n.startLineNumbert.endLineNumber?(o=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(o=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(o=t.endLineNumber,s=t.endColumn),new e(r,i,o,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var r=t.startLineNumber,i=t.startColumn,o=t.endLineNumber,s=t.endColumn,u=n.startLineNumber,a=n.startColumn,l=n.endLineNumber,h=n.endColumn;return rl?(o=l,s=h):o===l&&(s=Math.min(s,h)),r>o?null:r===o&&i>s?null:new e(r,i,o,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return new ae(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new ae(this.startLineNumber,this.startColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.lift=function(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null},e.isIRange=function(e){return e&&"number"===typeof e.startLineNumber&&"number"===typeof e.startColumn&&"number"===typeof e.endLineNumber&&"number"===typeof e.endColumn},e.areIntersectingOrTouching=function(e,t){return!(e.endLineNumbere.startLineNumber},e}();function he(e){for(var t=0,n=e.length;t=0;n--){var r=e.charCodeAt(n);if(32!==r&&9!==r)return n}return-1}String.fromCharCode(65279);var ce=5e3,de=3;function me(e,t,n,r){var i=new F(e,t,n);return i.ComputeDiff(r)}var pe=function(){function e(t){for(var n=[],r=[],i=0,o=t.length;i1&&m>1){var p=f.charCodeAt(d-2),g=c.charCodeAt(m-2);if(p!==g)break;d--,m--}(d>1||m>1)&&this._pushTrimWhitespaceCharChange(i,o+1,1,d,s+1,1,m);var _=pe._getLastNonBlankColumn(f,1),v=pe._getLastNonBlankColumn(c,1),y=f.length+1,b=c.length+1;while(_255?255:0|e}function Ne(e){return e<0?0:e>4294967295?4294967295:0|e}var Ee=function(){function e(e,t){this.index=e,this.remainder=t}return e}(),Se=function(){function e(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}return e.prototype.getCount=function(){return this.values.length},e.prototype.insertValues=function(e,t){e=Ne(e);var n=this.values,r=this.prefixSum,i=t.length;return 0!==i&&(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.changeValue=function(e,t){return e=Ne(e),t=Ne(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;var i=n.length-e;return t>=i&&(t=i),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},e.prototype.getAccumulatedValue=function(e){return e<0?0:(e=Ne(e),this._getAccumulatedValue(e))},e.prototype._getAccumulatedValue=function(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];var t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(var 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]},e.prototype.getIndexOf=function(e){e=Math.floor(e),this.getTotalValue();var t=0,n=this.values.length-1,r=0,i=0,o=0;while(t<=n)if(r=t+(n-t)/2|0,i=this.prefixSum[r],o=i-this.values[r],e=i))break;t=r+1}return new Ee(r,e-o)},e}(),we=(function(){function e(e){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new Se(e),this._bustCache()}e.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},e.prototype.insertValues=function(e,t){this._actual.insertValues(e,t)&&this._bustCache()},e.prototype.changeValue=function(e,t){this._actual.changeValue(e,t)&&this._bustCache()},e.prototype.removeValues=function(e,t){this._actual.removeValues(e,t)&&this._bustCache()},e.prototype.getTotalValue=function(){return this._actual.getTotalValue()},e.prototype.getAccumulatedValue=function(e){return this._actual.getAccumulatedValue(e)},e.prototype.getIndexOf=function(e){if(e=Math.floor(e),null!==this._cache){var t=e-this._cacheAccumulatedValueStart;if(t>=0&&t/?";function Pe(e){void 0===e&&(e="");for(var t="(-?\\d*\\.\\d\\w*)|([^",n=0,r=Ae;n=0||(t+="\\"+i)}return t+="\\s]+)",new RegExp(t,"g")}var Me=Pe();function Te(e){var t=Me;if(e&&e instanceof RegExp)if(e.global)t=e;else{var n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}function Oe(e,t,n,r){var i,o=e-1-r,s=n.lastIndexOf(" ",o-1)+1;t.lastIndex=s;while(i=t.exec(n)){var u=i.index||0;if(u<=o&&t.lastIndex>=o)return{word:i[0],startColumn:r+1+u,endColumn:r+1+t.lastIndex}}return null}function xe(e,t,n,r){var i,o=e-1-r;t.lastIndex=0;while(i=t.exec(n)){var s=i.index||0;if(s>o)return null;if(t.lastIndex>=o)return{word:i[0],startColumn:r+1+s,endColumn:r+1+t.lastIndex}}return null}function Ie(e,t,n,r){t.lastIndex=0;var i=t.exec(n);if(!i)return null;var o=i[0].indexOf(" ")>=0?xe(e,t,n,r):Oe(e,t,n,r);return t.lastIndex=0,o}var Re=function(){function e(t){var n=Le(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}return e._createAsciiMap=function(e){for(var t=new Uint8Array(256),n=0;n<256;n++)t[n]=e;return t},e.prototype.set=function(e,t){var n=Le(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)},e.prototype.get=function(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue},e}(),ke=(function(){function e(){this._actual=new Re(0)}e.prototype.add=function(e){this._actual.set(e,1)},e.prototype.has=function(e){return 1===this._actual.get(e)}}(),function(){function e(e){for(var t=0,n=0,r=0,i=e.length;rt&&(t=u),s>n&&(n=s),a>n&&(n=a)}t++,n++;var l=new Ce(n,t,0);for(r=0,i=e.length;r=this._maxCharCode?0:this._states.get(e,t)},e}()),Ue=null;function De(){return null===Ue&&(Ue=new ke([[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]])),Ue}var Fe=null;function Ke(){if(null===Fe){Fe=new Re(0);for(var e=" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…",t=0;tr);if(r>0){var a=t.charCodeAt(r-1),l=t.charCodeAt(o);(40===a&&41===l||91===a&&93===l||123===a&&125===l)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}},e.computeLinks=function(t,n){void 0===n&&(n=De());for(var r=Ke(),i=[],o=1,s=t.getLineCount();o<=s;o++){var u=t.getLineContent(o),a=u.length,l=0,h=0,f=0,c=1,d=!1,m=!1,p=!1;while(l=0?(r+=n?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null},e.INSTANCE=new e,e}();n("5110");function je(e){var t,n=this,r=!1;return function(){return r?t:(r=!0,t=e.apply(n,arguments),t)}}var Ye,We=function(){function e(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}return e.Undefined=new e(void 0),e}(),He=function(){function e(){this._first=We.Undefined,this._last=We.Undefined,this._size=0}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return this._first===We.Undefined},e.prototype.clear=function(){this._first=We.Undefined,this._last=We.Undefined,this._size=0},e.prototype.unshift=function(e){return this._insert(e,!1)},e.prototype.push=function(e){return this._insert(e,!0)},e.prototype._insert=function(e,t){var n=this,r=new We(e);if(this._first===We.Undefined)this._first=r,this._last=r;else if(t){var i=this._last;this._last=r,r.prev=i,i.next=r}else{var o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;var s=!1;return function(){s||(s=!0,n._remove(r))}},e.prototype.shift=function(){if(this._first!==We.Undefined){var e=this._first.element;return this._remove(this._first),e}},e.prototype.pop=function(){if(this._last!==We.Undefined){var e=this._last.element;return this._remove(this._last),e}},e.prototype._remove=function(e){if(e.prev!==We.Undefined&&e.next!==We.Undefined){var t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===We.Undefined&&e.next===We.Undefined?(this._first=We.Undefined,this._last=We.Undefined):e.next===We.Undefined?(this._last=this._last.prev,this._last.next=We.Undefined):e.prev===We.Undefined&&(this._first=this._first.next,this._first.prev=We.Undefined);this._size-=1},e.prototype.iterator=function(){var e,t=this._first;return{next:function(){return t===We.Undefined?q:(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e)}}},e.prototype.toArray=function(){for(var e=[],t=this._first;t!==We.Undefined;t=t.next)e.push(t.element);return e},e}(),Ge=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(e){return function(t,n,r){void 0===n&&(n=null);var i,o=!1;return i=e(function(e){if(!o)return i?i.dispose():o=!0,t.call(n,e)},null,r),o&&i.dispose(),i}}function n(e,t){return a(function(n,r,i){return void 0===r&&(r=null),e(function(e){return n.call(r,t(e))},null,i)})}function r(e,t){return a(function(n,r,i){return void 0===r&&(r=null),e(function(e){t(e),n.call(r,e)},null,i)})}function i(e,t){return a(function(n,r,i){return void 0===r&&(r=null),e(function(e){return t(e)&&n.call(r,e)},null,i)})}function o(e){return e}function s(){for(var e=[],t=0;t1)&&l.fire(e),a=0},n)})},onLastListenerRemove:function(){o.dispose()}});return l.event}function h(e){var r=(new Date).getTime();return n(t(e),function(e){return(new Date).getTime()-r})}function f(e){var t,n=!0;return i(e,function(e){var r=n||e!==t;return n=!1,t=e,r})}function c(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=[]);var r=n.slice(),i=e(function(e){r?r.push(e):s.fire(e)}),o=function(){r&&r.forEach(function(e){return s.fire(e)}),r=null},s=new Je({onFirstListenerAdd:function(){i||(i=e(function(e){return s.fire(e)}))},onFirstListenerDidAdd:function(){r&&(t?setTimeout(o):o())},onLastListenerRemove:function(){i&&i.dispose(),i=null}});return s.event}e.None=function(){return v.None},e.once=t,e.map=n,e.forEach=r,e.filter=i,e.signal=o,e.any=s,e.reduce=u,e.snapshot=a,e.debounce=l,e.stopwatch=h,e.latch=f,e.buffer=c;var d=function(){function e(e){this.event=e}return e.prototype.map=function(t){return new e(n(this.event,t))},e.prototype.forEach=function(t){return new e(r(this.event,t))},e.prototype.filter=function(t){return new e(i(this.event,t))},e.prototype.reduce=function(t,n){return new e(u(this.event,t,n))},e.prototype.latch=function(){return new e(f(this.event))},e.prototype.on=function(e,t,n){return this.event(e,t,n)},e.prototype.once=function(e,n,r){return t(this.event)(e,n,r)},e}();function m(e){return new d(e)}function g(e,t,n){void 0===n&&(n=function(e){return e});var r=function(){for(var e=[],t=0;t0?new Xe(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,r,i){t._listeners||(t._listeners=new He);var o=t._listeners.isEmpty();o&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var s,u,a=t._listeners.push(r?[n,r]:n);return o&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,r),t._leakageMon&&(s=t._leakageMon.check(t._listeners.size)),u={dispose:function(){if(s&&s(),u.dispose=e._noop,!t._disposed&&(a(),t._options&&t._options.onLastListenerRemove)){var n=t._listeners&&!t._listeners.isEmpty();n||t._options.onLastListenerRemove(t)}}},i instanceof _?i.add(u):Array.isArray(i)&&i.push(u),u}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new He);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);while(this._deliveryQueue.size>0){var r=this._deliveryQueue.shift(),i=r[0],s=r[1];try{"function"===typeof i?i.call(void 0,s):i[0].call(i[1],s)}catch(n){o(n)}}}},e.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},e._noop=function(){},e}(),$e=(function(e){function t(t){var n=e.call(this,t)||this;return n._isPaused=0,n._eventQueue=new He,n._mergeFn=t&&t.merge,n}Ge(t,e),t.prototype.pause=function(){this._isPaused++},t.prototype.resume=function(){if(0!==this._isPaused&&0===--this._isPaused)if(this._mergeFn){var t=this._eventQueue.toArray();this._eventQueue.clear(),e.prototype.fire.call(this,this._mergeFn(t))}else while(!this._isPaused&&0!==this._eventQueue.size)e.prototype.fire.call(this,this._eventQueue.shift())},t.prototype.fire=function(t){this._listeners&&(0!==this._isPaused?this._eventQueue.push(t):e.prototype.fire.call(this,t))}}(Je),function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new Je({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);var r=function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)};return g(je(r))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach(function(t){return e.hook(t)})},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach(function(t){return e.unhook(t)})},e.prototype.hook=function(e){var t=this;e.listener=e.event(function(e){return t.emitter.fire(e)})},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()}}(),function(){function e(){this.buffers=[]}e.prototype.wrapEvent=function(e){var t=this;return function(n,r,i){return e(function(e){var i=t.buffers[t.buffers.length-1];i?i.push(function(){return n.call(r,e)}):n.call(r,e)},void 0,i)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach(function(e){return e()}),n}}(),function(){function e(){var e=this;this.listening=!1,this.inputEvent=Ye.None,this.inputEventListener=v.None,this.emitter=new Je({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()}}(),Object.freeze(function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}}));(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof et||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ye.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$e})})(Qe||(Qe={}));var Ze,et=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?$e:(this._emitter||(this._emitter=new Je),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),tt=function(){function e(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new et),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof et&&this._token.cancel():this._token=Qe.Cancelled},e.prototype.dispose=function(){this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof et&&this._token.dispose():this._token=Qe.None},e}(),nt=function(){function e(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}return e.prototype.define=function(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e},e.prototype.keyCodeToStr=function(e){return this._keyCodeToStr[e]},e.prototype.strToKeyCode=function(e){return this._strToKeyCode[e.toLowerCase()]||0},e}(),rt=new nt,it=new nt,ot=new nt;function st(e,t){var n=(65535&t)<<16>>>0;return(e|n)>>>0}(function(){function e(e,t,n,r){void 0===n&&(n=t),void 0===r&&(r=n),rt.define(e,t),it.define(e,n),ot.define(e,r)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")})(),function(e){function t(e){return rt.keyCodeToStr(e)}function n(e){return rt.strToKeyCode(e)}function r(e){return it.keyCodeToStr(e)}function i(e){return ot.keyCodeToStr(e)}function o(e){return it.strToKeyCode(e)||ot.strToKeyCode(e)}e.toString=t,e.fromString=n,e.toUserSettingsUS=r,e.toUserSettingsGeneral=i,e.fromUserSettings=o}(Ze||(Ze={}));(function(){function e(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}e.prototype.equals=function(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode},e.prototype.isModifierKey=function(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode},e.prototype.toChord=function(){return new Dt([this])},e.prototype.isDuplicateModifierCase=function(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}})();var ut,at,lt,ht,ft,ct,dt,mt,pt,gt,_t,vt,yt,bt,Ct,Lt,Nt,Et,St,wt,At,Pt,Mt,Tt,Ot,xt,It,Rt,kt,Ut,Dt=function(){function e(e){if(0===e.length)throw l("parts");this.parts=e}return e.prototype.equals=function(e){if(null===e)return!1;if(this.parts.length!==e.parts.length)return!1;for(var t=0;t "+this.positionLineNumber+","+this.positionColumn+"]"},t.prototype.equalsSelection=function(e){return t.selectionsEqual(this,e)},t.selectionsEqual=function(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1},t.prototype.setEndPosition=function(e,n){return 0===this.getDirection()?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.getPosition=function(){return new ae(this.positionLineNumber,this.positionColumn)},t.prototype.setStartPosition=function(e,n){return 0===this.getDirection()?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.liftSelection=function(e){return new t(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)},t.selectionsArrEqual=function(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(var n=0,r=e.length;n=r._lines.length?q:(n=r._lines[i],s=r._wordenize(n,e),o=0,i+=1,u())};return{next:u}},t.prototype.getLineWords=function(e,t){for(var n=this._lines[e-1],r=this._wordenize(n,t),i=[],o=0,s=r;othis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{var i=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>i&&(n=i,r=!0)}return r?{lineNumber:t,column:n}:e},t}(we),Wt=function(){function e(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}return e.prototype.dispose=function(){this._models=Object.create(null)},e.prototype._getModel=function(e){return this._models[e]},e.prototype._getModels=function(){var e=this,t=[];return Object.keys(this._models).forEach(function(n){return t.push(e._models[n])}),t},e.prototype.acceptNewModel=function(e){this._models[e.url]=new Yt(ee.parse(e.url),e.lines,e.EOL,e.versionId)},e.prototype.acceptModelChanged=function(e,t){if(this._models[e]){var n=this._models[e];n.onEvents(t)}},e.prototype.acceptRemovedModel=function(e){this._models[e]&&delete this._models[e]},e.prototype.computeDiff=function(e,t,n){var r=this._getModel(e),i=this._getModel(t);if(!r||!i)return Promise.resolve(null);var o=r.getLinesContent(),s=i.getLinesContent(),u=new be(o,s,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0}),a=u.computeDiff(),l=!(a.length>0)&&this._modelsAreIdentical(r,i);return Promise.resolve({identical:l,changes:a})},e.prototype._modelsAreIdentical=function(e,t){var n=e.getLineCount(),r=t.getLineCount();if(n!==r)return!1;for(var i=1;i<=n;i++){var o=e.getLineContent(i),s=t.getLineContent(i);if(o!==s)return!1}return!0},e.prototype.computeMoreMinimalEdits=function(t,n){var r=this._getModel(t);if(!r)return Promise.resolve(n);var i=[],o=void 0;n=A(n,function(e,t){if(e.range&&t.range)return le.compareRangesUsingStarts(e.range,t.range);var n=e.range?0:1,r=t.range?0:1;return n-r});for(var s=0,u=n;se._diffLimit)i.push({range:l,text:h});else for(var d=x(c,h,!1),m=r.offsetAt(le.lift(l).getStartPosition()),p=0,g=d;p1)for(var n=1;n.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}")}catch(a){console&&console.log(a)}}!function(a){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(a,0);else{var h=function(){document.removeEventListener("DOMContentLoaded",h,!1),a()};document.addEventListener("DOMContentLoaded",h,!1)}else document.attachEvent&&(c=a,i=v.document,o=!1,(z=function(){try{i.documentElement.doScroll("left")}catch(a){return void setTimeout(z,50)}l()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,l())});function l(){o||(o=!0,c())}var c,i,o,z}(function(){var a,h;(a=document.createElement("div")).innerHTML=l,l=null,(h=a.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",function(a,h){h.firstChild?function(a,h){h.parentNode.insertBefore(a,h)}(a,h.firstChild):h.appendChild(a)}(h,document.body))})}(window); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.svg b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.svg new file mode 100644 index 000000000..bb47f2b06 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.svg @@ -0,0 +1,941 @@ + + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.ttf b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.ttf new file mode 100644 index 000000000..0f9ae5816 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.ttf differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.woff b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.woff new file mode 100644 index 000000000..b67cb844d Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.woff differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.woff2 b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.woff2 new file mode 100644 index 000000000..8e29ad466 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/iconfont/iconfont.woff2 differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/auth_sasl.9724eec3.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/auth_sasl.9724eec3.png new file mode 100644 index 000000000..3bd403b9f Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/auth_sasl.9724eec3.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/delayed_publish.b0b58640.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/delayed_publish.b0b58640.png new file mode 100644 index 000000000..9e305fb6a Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/delayed_publish.b0b58640.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emq_logo.94c8ee06.svg b/apps/emqx_enterprise_dashboard/priv/www/static/img/emq_logo.94c8ee06.svg new file mode 100644 index 000000000..875b61c36 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/img/emq_logo.94c8ee06.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_jwt.402c6a38.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_jwt.402c6a38.png new file mode 100644 index 000000000..f0c7ebee6 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_jwt.402c6a38.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_mnesia.cee137cc.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_mnesia.cee137cc.png new file mode 100644 index 000000000..ff4e6cde7 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_mnesia.cee137cc.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_mysql.a3615766.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_mysql.a3615766.png new file mode 100644 index 000000000..6bf9c054c Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_mysql.a3615766.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_pgsql.079ce8f3.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_pgsql.079ce8f3.png new file mode 100644 index 000000000..03f80a269 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_pgsql.079ce8f3.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_redis.e0ec3147.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_redis.e0ec3147.png new file mode 100644 index 000000000..64ed22232 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_auth_redis.e0ec3147.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_cassa.82e8858e.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_cassa.82e8858e.png new file mode 100644 index 000000000..eb81bc053 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_cassa.82e8858e.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_influxdb.0cb90da7.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_influxdb.0cb90da7.png new file mode 100644 index 000000000..4b800e0c4 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_influxdb.0cb90da7.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_mysql.a3615766.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_mysql.a3615766.png new file mode 100644 index 000000000..6bf9c054c Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_mysql.a3615766.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_pgsql.079ce8f3.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_pgsql.079ce8f3.png new file mode 100644 index 000000000..03f80a269 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_pgsql.079ce8f3.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_redis.e0ec3147.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_redis.e0ec3147.png new file mode 100644 index 000000000..64ed22232 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_redis.e0ec3147.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_timescale.5f750079.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_timescale.5f750079.png new file mode 100644 index 000000000..7d657a5e9 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_backend_timescale.5f750079.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_banner.20c13f08.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_banner.20c13f08.png new file mode 100644 index 000000000..6354d6ea9 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_banner.20c13f08.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_kafka.dcabb7d7.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_kafka.dcabb7d7.png new file mode 100644 index 000000000..ca980de62 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_kafka.dcabb7d7.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_mqtt.a3066767.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_mqtt.a3066767.png new file mode 100644 index 000000000..d2d50d221 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_mqtt.a3066767.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_pulsar.be9aa2e9.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_pulsar.be9aa2e9.png new file mode 100644 index 000000000..df14c3573 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_pulsar.be9aa2e9.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_rocket.d53d64f9.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_rocket.d53d64f9.png new file mode 100644 index 000000000..2c0f2210b Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_bridge_rocket.d53d64f9.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_conf.33ff924d.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_conf.33ff924d.png new file mode 100644 index 000000000..592c58942 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_conf.33ff924d.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_dashboard.6937edc4.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_dashboard.6937edc4.png new file mode 100644 index 000000000..5a693df81 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_dashboard.6937edc4.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_gbt32960.9ea5fd31.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_gbt32960.9ea5fd31.png new file mode 100644 index 000000000..5d6a41209 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_gbt32960.9ea5fd31.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_jt808.28a1a87c.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_jt808.28a1a87c.png new file mode 100644 index 000000000..9329bafcd Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_jt808.28a1a87c.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_lua_hook.70ea0a97.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_lua_hook.70ea0a97.png new file mode 100644 index 000000000..d2923636c Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_lua_hook.70ea0a97.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_lwm2m.0fe3f19e.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_lwm2m.0fe3f19e.png new file mode 100644 index 000000000..e222afe69 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_lwm2m.0fe3f19e.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_modules.e34e019e.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_modules.e34e019e.png new file mode 100644 index 000000000..36e482101 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_modules.e34e019e.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_prometheus.59114669.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_prometheus.59114669.png new file mode 100644 index 000000000..597213eb9 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_prometheus.59114669.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_rule_engine.31e92ad1.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_rule_engine.31e92ad1.png new file mode 100644 index 000000000..7e19b8102 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_rule_engine.31e92ad1.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_sasl.11e2cd6a.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_sasl.11e2cd6a.png new file mode 100644 index 000000000..c7274dd16 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_sasl.11e2cd6a.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_sn.2d9d907b.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_sn.2d9d907b.png new file mode 100644 index 000000000..a48b1f60d Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_sn.2d9d907b.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_stomp.14cf6644.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_stomp.14cf6644.png new file mode 100644 index 000000000..27f9669fa Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_stomp.14cf6644.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_tcp.e16bdfbd.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_tcp.e16bdfbd.png new file mode 100644 index 000000000..b9d0a584a Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_tcp.e16bdfbd.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_web_hook.a0bd461e.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_web_hook.a0bd461e.png new file mode 100644 index 000000000..77d81d1de Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/emqx_web_hook.a0bd461e.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/gbt32960_protocol.9ea5fd31.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/gbt32960_protocol.9ea5fd31.png new file mode 100644 index 000000000..5d6a41209 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/gbt32960_protocol.9ea5fd31.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/hot_confs.957f5817.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/hot_confs.957f5817.png new file mode 100644 index 000000000..098fe316e Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/hot_confs.957f5817.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/internal_acl.aca28594.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/internal_acl.aca28594.png new file mode 100644 index 000000000..4f6620b1d Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/internal_acl.aca28594.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/jt808_protocol.28a1a87c.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/jt808_protocol.28a1a87c.png new file mode 100644 index 000000000..9329bafcd Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/jt808_protocol.28a1a87c.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/jwt_authentication.402c6a38.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/jwt_authentication.402c6a38.png new file mode 100644 index 000000000..f0c7ebee6 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/jwt_authentication.402c6a38.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/kafka_consumer.e4c070e2.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/kafka_consumer.e4c070e2.png new file mode 100644 index 000000000..fd34d69c6 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/kafka_consumer.e4c070e2.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/lwm2m_protocol.0fe3f19e.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/lwm2m_protocol.0fe3f19e.png new file mode 100644 index 000000000..e222afe69 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/lwm2m_protocol.0fe3f19e.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/mnesia_authentication.cee137cc.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/mnesia_authentication.cee137cc.png new file mode 100644 index 000000000..ff4e6cde7 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/mnesia_authentication.cee137cc.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/mqtt_sn_protocol.4186d81f.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/mqtt_sn_protocol.4186d81f.png new file mode 100644 index 000000000..4b1df7e80 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/mqtt_sn_protocol.4186d81f.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/mqtt_subscriber.6a7d014d.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/mqtt_subscriber.6a7d014d.png new file mode 100644 index 000000000..5473fb770 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/mqtt_subscriber.6a7d014d.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/mysql_authentication.a3615766.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/mysql_authentication.a3615766.png new file mode 100644 index 000000000..6bf9c054c Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/mysql_authentication.a3615766.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/not_settings.01e8bfc4.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/not_settings.01e8bfc4.png new file mode 100644 index 000000000..b3c38f3d1 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/not_settings.01e8bfc4.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/pgsql_authentication.079ce8f3.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/pgsql_authentication.079ce8f3.png new file mode 100644 index 000000000..03f80a269 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/pgsql_authentication.079ce8f3.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/prometheus.59114669.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/prometheus.59114669.png new file mode 100644 index 000000000..597213eb9 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/prometheus.59114669.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/pulsar_consumer.be9aa2e9.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/pulsar_consumer.be9aa2e9.png new file mode 100644 index 000000000..df14c3573 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/pulsar_consumer.be9aa2e9.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/redis_authentication.e0ec3147.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/redis_authentication.e0ec3147.png new file mode 100644 index 000000000..64ed22232 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/redis_authentication.e0ec3147.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/retainer.a07ffddf.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/retainer.a07ffddf.png new file mode 100644 index 000000000..d879765f8 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/retainer.a07ffddf.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/sasl_authentication.11e2cd6a.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/sasl_authentication.11e2cd6a.png new file mode 100644 index 000000000..c7274dd16 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/sasl_authentication.11e2cd6a.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/stomp_protocol.14cf6644.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/stomp_protocol.14cf6644.png new file mode 100644 index 000000000..27f9669fa Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/stomp_protocol.14cf6644.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/subscription.839c01f1.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/subscription.839c01f1.png new file mode 100644 index 000000000..3c80f7fb9 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/subscription.839c01f1.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/tcp_protocol.e16bdfbd.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/tcp_protocol.e16bdfbd.png new file mode 100644 index 000000000..b9d0a584a Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/tcp_protocol.e16bdfbd.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/topic_metrics.ee87579d.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/topic_metrics.ee87579d.png new file mode 100644 index 000000000..ca1ef973c Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/topic_metrics.ee87579d.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/img/topic_rewrite.676de860.png b/apps/emqx_enterprise_dashboard/priv/www/static/img/topic_rewrite.676de860.png new file mode 100644 index 000000000..70c091437 Binary files /dev/null and b/apps/emqx_enterprise_dashboard/priv/www/static/img/topic_rewrite.676de860.png differ diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/app.235bfefd.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/app.235bfefd.js new file mode 100644 index 000000000..8194f084e --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/app.235bfefd.js @@ -0,0 +1 @@ +(function(e){function n(n){for(var a,r,o=n[0],c=n[1],l=n[2],u=0,h=[];u0&&void 0!==arguments[0]?arguments[0]:{};return s["a"].post("/auth",e,{params:{_t:!1,_m:!1}})}function o(){return s["a"].get("/brokers")}function c(){return l.apply(this,arguments)}function l(){return l=Object(r["a"])(regeneratorRuntime.mark(function e(){var n,t,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:return n=e.sent,t={},n.forEach(function(e){t[e.node]=e}),e.next=7,s["a"].get("/nodes");case 7:return r=e.sent,e.abrupt("return",r.map(function(e){var n=t[e.name]||{};return Object(a["a"])({},n,e)}));case 9:case"end":return e.stop()}},e)})),l.apply(this,arguments)}function u(){return h.apply(this,arguments)}function h(){return h=Object(r["a"])(regeneratorRuntime.mark(function e(){var n,t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["a"].get("/alarms/activated");case 2:return n=e.sent,t=[],n.forEach(function(e){var n=e.node,a=e.alarms;a.forEach(function(e){e.node=n,t.push(e)})}),e.abrupt("return",t);case 6:case"end":return e.stop()}},e)})),h.apply(this,arguments)}function d(){return p.apply(this,arguments)}function p(){return p=Object(r["a"])(regeneratorRuntime.mark(function e(){var n,t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["a"].get("/alarms/deactivated");case 2:return n=e.sent,t=[],n.forEach(function(e){var n=e.node,a=e.alarms;a.forEach(function(e){e.node=n,t.push(e)})}),e.abrupt("return",t);case 6:case"end":return e.stop()}},e)})),p.apply(this,arguments)}},"2dbd":function(e){e.exports={en:{ruleEngineTutorial:"https://docs.emqx.io/en/enterprise/latest/rule/rule-engine.html",restAPI:"https://docs.emqx.io/en/enterprise/latest/advanced/http-api.html",schemaTutorial:"https://docs.emqx.io/en/enterprise/latest/rule/schema-registry.html",auth:"https://docs.emqx.io/en/enterprise/latest/advanced/auth.html",mnesia:"https://docs.emqx.io/en/broker/latest/advanced/auth-mnesia.html",authJWT:"https://docs.emqx.io/en/broker/latest/advanced/auth-jwt.html"},zh:{ruleEngineTutorial:"https://docs.emqx.cn/cn/enterprise/latest/rule/rule-engine.html",restAPI:"https://docs.emqx.cn/cn/enterprise/latest/advanced/http-api.html",schemaTutorial:"https://docs.emqx.cn/cn/enterprise/latest/rule/schema-registry.html",auth:"https://docs.emqx.cn/cn/enterprise/latest/advanced/auth.html",mnesia:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-mnesia.html",authJWT:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-jwt.html"}}},"2f20":function(e,n,t){"use strict";t.r(n),n["default"]={topic:{zh:"主题",en:"Topic"}}},3274:function(e){e.exports={base:{baseURL:"/api/v4",httpTimeout:15e3,publicPath:"/",hide:{routes:["usersAcl"],children:[]}},cloud:{baseURL:"/dashboard",publicPath:"/",hide:{routes:["monitor","analysis","alerts","plugins","modules","setting","general","schemas"],children:["nav-header","navbar.user","monitor.connections","monitor.license","rules.schema"]}}}},"3ad0":function(e,n,t){"use strict";t.r(n),n["default"]={basic:{zh:"基础设置",en:"Basic"},cluster:{zh:"集群设置",en:"Cluster"},clusterInfo:{zh:"集群信息",en:"Cluster Info"},zone:{zh:"Zone 列表",en:"Zone"},errorRange:{zh:"填写错误:数值范围为 {min} - {max}",en:"Fill in the error: the number range is {min} - {max}"},errorType:{zh:"类型错误:请填写 {type} 类型",en:"Type error: please enter {type}"},errorUnit:{zh:"单位错误:请填写 {unit} 单位",en:"Unit error: please enter {unit}"},pleaseEnter:{zh:"请输入",en:"Please enter"},pleaseSelect:{zh:"请选择",en:"Please select"},cancelConfirm:{zh:"是否取消本次修改?",en:"You have unsaved changes, confirm cancel?"},noSaveConfirm:{zh:"当前配置未保存,是否离开并放弃?",en:"You have unsaved changes, give up and proceed?"},confirm:{zh:"确认信息",en:"Confirm"},remove:{zh:"移除",en:"Remove"},removeConfirm:{zh:"是否移除该节点?",en:"This will remove the current node. Continue?"},removeSuccess:{zh:"移除成功",en:"Remove Success"},no:{zh:"不",en:"NO"},setting:{zh:"设置",en:"Setting"},serverSetting:{zh:"服务器设置",en:"Server settings"},basicSetting:{zh:"基础设置",en:"Basic Settings"},mqtt:{zh:"MQTT 协议{0}",en:"MQTT Protocol {0}"},functional:{zh:"功能",en:"Function"},enable_acl:{zh:"是否启用 ACL 检查",en:"Enable ACL check"},acl_nomatch:{zh:"ACL 未命中时允许或拒绝通过验证",en:"Allow or deny if no ACL rules matched"},acl_deny_action:{zh:"ACL 被拒绝时的处理动作",en:"The action when acl check reject current operation"},allow_anonymous:{zh:"如果未加载身份验证插件,则默认情况下允许匿名身份验证。建议在生产部署中禁用该选项!",en:"Allow anonymous authentication by default if no auth plugins loaded. Disable the option in production deployment"},retry_interval:{zh:"QoS 1/2 消息传递的重试间隔",en:"Retry interval for QoS1/2 message delivering"},mqtt_ignore_loop_deliver:{zh:"是否忽略消息循环传递,常用于消息桥接(对于 MQTT v3.1.1)",en:"Whether to ignore loop delivery of messages (for MQTT v3.1.1)"},mqueue_store_qos0:{zh:"是否将 QoS0 的消息存储在队列中",en:"Whether to enqueue QoS0 messages"},flapping_banned_expiry_interval:{zh:"连接的 flapping 到期时间",en:"Flapping expiry interval for connections"},flapping_threshold:{zh:"每分钟的状态更改次数,指定用于检测连接是否开始 flapping 的阈值",en:"The times of state change per minute, specifying the threshold which is used to detect if the connection starts flapping"},mqtt_max_packet_size:{zh:"最大 MQTT 数据包大小",en:"Maximum MQTT packet size allowed"},mqtt_max_clientid_len:{zh:"MQTT 客户端 ID 的长度限制",en:"Maximum length of MQTT clientid allowed"},mqtt_max_topic_levels:{zh:"主题层级限制,0 表示没有限制层级",en:"Maximum topic levels allowed, 0 means no limit"},mqtt_max_qos_allowed:{zh:"最大 QoS",en:"Maximum QoS allowed"},mqtt_max_topic_alias:{zh:"最大主题别名数量,0 表示不支持主题别名",en:"Maximum Topic Alias, 0 means no topic alias supported"},mqtt_retain_available:{zh:"是否启用 Retain 消息",en:"Whether the Server supports MQTT retained messages"},mqtt_wildcard_subscription:{zh:"是否启用通配符订阅",en:"Whether the Server supports MQTT Wildcard Subscriptions"},mqtt_shared_subscription:{zh:"是否启用共享订阅",en:"Whether the Server supports MQTT Shared Subscriptions"},hibernate_after:{zh:"闲置后进入休眠状态的时间",en:"Hibernate after a duration of idle state"},acl_cache_max_size:{zh:"可以为客户端缓存最大的 ACL 数量",en:"The maximum count of ACL entries can be cached for a client"},acl_cache_ttl:{zh:"ACL 缓存后将被删除的时间",en:"The time after which an ACL cache entry will be deleted"},enable_acl_cache:{zh:"是否启用 ACL 缓存",en:"Whether to enable ACL cache"},flapping_detect_policy:{zh:"指定全局的 flapping detect 策略",en:"Specify the global flapping detect policy"},mqtt_strict_mode:{zh:"是否在严格模式下解析 MQTT 帧",en:"Whether to parse the MQTT frame in strict mode"},invite:{zh:"邀请",en:"Invite"},inviteSuccess:{zh:"邀请成功",en:"Invite Success"},clusterType:{zh:"集群方式",en:"Cluster Type"},currentNode:{zh:"当前节点",en:"Current Node"},nodeRequired:{zh:"请输入节点名称",en:"Please enter the node name"},dnsName:{zh:"DNS 名称",en:"DNS"},app:{zh:"节点前缀",en:"Node Prefix"},app_desc:{zh:"用于自动使用 IP 地址构造节点名称如:${name}@127.0.0.1",en:"Used to automatically construct a node name using an IP address: ${name}@127.0.0.1"},addr:{zh:"组播地址",en:"Multicast Address"},ports:{zh:"端口列表",en:"Ports"},iface:{zh:"多播地址",en:"Iface"},ttl:{zh:"多播 TTL",en:"TTL"},loop:{zh:"循环多播",en:"Loop"},server:{zh:"Etcd 服务器",en:"Etcd Server"},prefix:{zh:"路径前缀",en:"Path Prefix"},prefix_desc:{zh:"用于构造节点路径,路径为 v2/keys///",en:"Used to construct a node path with v2/keys///"},apiserver:{zh:"k8s 服务器列表",en:""},service_name:{zh:"服务器名称",en:"Service Name"},address_type:{zh:"地址类型",en:"Address Type"},address_type_desc:{zh:"用于从 k8s 服务中提取主机名",en:"Used to get hostname from the k8s service"},app_name:{zh:"节点前缀",en:"App Name"},app_name_desc:{zh:"用于构造节点名称",en:"Used to construct the node name"},namespace:{zh:"k8s 命名空间",en:"k8s Namespace"},suffix:{zh:"主机后缀",en:"Suffix"},manual:{zh:"手动集群",en:"Manual cluster"},dns:{zh:"DNS A 记录自动集群",en:"DNS A record automatic cluster"},static:{zh:"静态节点列表自动集群",en:"Static node list automatic cluster"},mcast:{zh:"UDP 组播自动集群",en:"UDP multicast automatic cluster"},etcd:{zh:"通过 etcd 自动集群",en:"By etcd automatic cluster"},k8s:{zh:"Kubernetes 服务自动集群",en:"Kubernetes service automatic cluster"},joined:{zh:"已加入",en:"Joined"},notJoined:{zh:"待加入",en:"Waiting to join"},zoneName:{zh:"Zone 名字",en:"Zone Name"},zoneNameTip:{zh:"名字不能为空!",en:"The name cannot be empty!"},listeners:{zh:"监听器",en:"Listeners"},monitorAlarm:{zh:"监控告警",en:"Monitor Alarm"},actions:{zh:"动作",en:"Actions"},size_limit:{zh:"大小限制",en:"Size Limit"},validity_period:{zh:"有效期",en:"Validity period"},check_interval:{zh:"CPU 占用率检查周期",en:"CPU usage check cycle"},process_high_watermark:{zh:"当前进程数量占进程最大数量的百分比超过该值时将触发告警",en:"\n When the percentage of the current number of processes to the maximum number\n of processes exceeds this value, an alarm will be triggered"},process_low_watermark:{zh:"当前进程数量占进程最大数量的百分比回落到该值以下时将触发告警",en:"\n An alarm will be triggered when the percentage of the current number of\n processes in the maximum number of processes falls below this value"},busy_dist_port:{zh:"指定是否启用集群 RPC 通道拥塞监控",en:"Specify whether to enable cluster RPC channel congestion monitoring"},busy_port:{zh:"指定是否启用进程间消息通道拥塞监控",en:"Specify whether to enable inter-process message channel congestion monitoring"},large_heap:{zh:"启用堆栈大小监控并在进程执行垃圾回收后堆栈大小仍大于设定值时触发告警,0 表示禁用此监控",en:"\n Enable stack size monitoring and trigger an alarm when the stack size is\n still greater than the set value after the process is garbage collected, 0 means disable this monitoring"},long_gc:{zh:"启用垃圾回收时间监控并在回收时间超过设定值时触发告警,0 表示禁用此监控",en:"\n Enable garbage collection time monitoring and trigger an alarm\n when the collection time exceeds the set value, 0 means disable this monitoring"},long_schedule:{zh:"启用进程调度时间监控并在调度时间超过设定值时触发告警,0 表示禁用此监控",en:"\n Enable process scheduling time monitoring and trigger an alarm when the\n scheduling time exceeds the set value, 0 means disable this monitoring"},cpu_check_interval:{zh:"CPU 占用率检查周期",en:"CPU usage check cycle"},cpu_high_watermark:{zh:"CPU 占用率超过该值时将触发告警",en:"An alarm will be triggered when the CPU usage exceeds this value"},cpu_low_watermark:{zh:"CPU 占用率回落到该值以下时将清除告警",en:"The alarm will be cleared when the CPU usage falls below this value"},mem_check_interval:{zh:"内存占用率检查周期",en:"Memory usage check cycle"},procmem_high_watermark:{zh:"EMQ X 为单个进程分配的内存占系统内存的百分比超过该值时将触发告警",en:"\n EMQ X will trigger an alarm when the percentage of system\n memory allocated by EMQ X for a single process exceeds this value"},sysmem_high_watermark:{zh:"EMQ X 为所有进程分配的内存占系统内存的百分比超过该值时将触发告警",en:"\n EMQ X will trigger an alarm when the percentage of system\n memory allocated by EMQ X for all processes exceeds this value"},listenerName:{zh:"监听器名字",en:"Listener Name"},listenerType:{zh:"监听类型",en:"Listener Type"},broker_session_locking_strategy:{zh:"会话锁策略。保证集群中 Client ID 在集群中的创建会话的唯一性。\n all 表示全集群锁,leader 表示仅主节点锁,quorum 多数节点锁,local 表仅当前节点锁",en:"Session locking policy. Ensure the uniqueness of the Client ID creation session in the cluster.\n All represents the total set group lock, the leader represents the master node lock only,\n the quorum majority node lock only, and the local table only the current node lock\n "},broker_shared_dispatch_ack_enabled:{zh:"共享订阅开启内部派发 ACK",en:"Shared subscriptions enable internal distribution ACK"},broker_shared_subscription_strategy:{zh:"共享订阅派发策略",en:"Shared subscription distribution policies"},broker_sys_heartbeat:{zh:"Broker 健康状态发布间隔",en:"Broker Health status publish interval"},broker_sys_interval:{zh:"Broker 统计信息发布间隔",en:"Broker statistics release interval"},confirmUpdateListener:{zh:"应用设置将重新启动监听器,该操作将导致当前活跃连接断开,是否继续?",en:"\n Applying settings will restart the listener.\n This operation will cause the current active connection to be disconnected.\n Do you want to continue?"},isOpened:{zh:"是否开启",en:"Is Started"},isStopListener:{zh:"确定停止监听器:",en:"Are you sure to stop the listener:"},isDeleteListener:{zh:"确认删除该监听器?",en:"Are you sure to delete this listener?"},isDeleteZone:{zh:"确认删除该 Zone?",en:"Are you sure to delete this Zone?"},returnList:{zh:"返回列表",en:"Back"},portRangeTip:{zh:"端口不能为负数且不能大于 65535",en:"The port cannot be negative and cannot be greater than 65535"},openModuleTip:{zh:"开启热配置后,EMQ X 将从配置文件中拷贝一份配置副本,所有可在 Dashboard 修改的配置都会持久化到磁盘中。\n
如果修改配置文件将会覆盖热配置,请谨慎使用。",en:"After enabling hot configuration, EMQ X will copy a configuration from the configuration file,
\n and all configurations that can be modified on the Dashboard will be persisted to the disk.
\n If modifying the configuration file will overwrite the hot configuration, please use it with caution."}}},"407c":function(e,n,t){},"52af":function(e,n,t){"use strict";var a=t("d82d"),r=t.n(a);r.a},"56d7":function(e,n,t){"use strict";t.r(n);t("cadf"),t("551c"),t("f751"),t("097d");var a=t("2b0e"),r=(t("db4d"),t("5c96")),s=t.n(r),i=t("fd01"),o=t.n(i),c=t("a925"),l=t("4897"),u=t.n(l),h=t("12cb"),d=(t("7f7f"),t("0c63")),p=t("9571"),m=t("cdeb"),f=t("a071"),z=t("1fd5"),b=t("2fc4"),g=(t("a4e9"),t("4650"),t("0ab2"),t("dbad"),t("e975"),function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("el-select",e._g(e._b({staticClass:"emq-select",attrs:{value:e.rawValue},on:{change:e.selectChange}},"el-select",e.$attrs,!1),e.$listeners),[e._t("default",e._l(e.options,function(n,a){return t("el-option",{key:a,attrs:{value:n[e.fieldName.value],label:n[e.fieldName.label],disabled:e.isDisabled(n)}},[e._t("option",null,{item:n})],2)}))],2)}),v=[],_=(t("6762"),t("2fdb"),t("96cf"),t("3b8d")),k=(t("7514"),t("6b54"),t("1f75")),y={name:"EmqSelect",components:{},props:{value:{required:!0},field:{type:Object,required:!0},fieldName:{type:Object,default:function(){return{label:"label",value:"value"}}},disabledItem:{type:Array,default:function(){return[]}},refresh:{type:Boolean}},data:function(){return{options:[],parserField:{}}},computed:{rawValue:{get:function(){return"boolean"===typeof this.value?this.value.toString():this.value},set:function(e){var n=null,t=this.fieldName.value,a=this.options.find(function(n){return n[t]===e});a&&this.parserField[t]&&(n="true"===e),this.$emit("update:value",n)}}},watch:{refresh:function(e){e&&this.loadData()},field:{handler:function(){this.loadData()},deep:!0}},created:function(){this.loadData()},methods:{selectChange:function(e){this.$emit("selectChange",e)},loadData:function(){var e=Object(_["a"])(regeneratorRuntime.mark(function e(){var n,t,a,r=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getOptions();case 2:n=e.sent,this.parserField={},t=this.fieldName.value,a=this.fieldName.label,this.options=n.map(function(e){var n=e[t],s=e[a];return"boolean"===typeof n&&(r.parserField[t]="boolean",e[t]=n.toString(),"boolean"===typeof s&&(e[a]=s.toString())),e}),this.$emit("update:refresh",!1);case 8:case"end":return e.stop()}},e,this)}));function n(){return e.apply(this,arguments)}return n}(),isDisabled:function(e){return this.disabledItem.includes(e[this.fieldName.value])},getOptions:function(){var e=Object(_["a"])(regeneratorRuntime.mark(function e(){var n,t,a,r,s,i;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.field,t=n.api,a=n.url,r=n.options,s=n.list,i=[],!r){e.next=6;break}i=r,e.next=20;break;case 6:if(!s){e.next=10;break}i=s.map(function(e){return{label:e,value:e}}),e.next=20;break;case 10:if(!t){e.next=16;break}return e.next=13,t();case 13:i=e.sent,e.next=20;break;case 16:if(!a){e.next=20;break}return e.next=19,k["a"].get(a);case 19:i=e.sent;case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}},e,this)}));function n(){return e.apply(this,arguments)}return n}()}},S=y,T=(t("581f"),t("2877")),w=Object(T["a"])(S,g,v,!1,null,null,null),C=w.exports,A=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"page-header"},[t("div",{staticClass:"page-header-content"},[e._t("default")],2)])},x=[],E={name:"PageHeader"},P=E,q=(t("201a"),Object(T["a"])(P,A,x,!1,null,null,null)),D=q.exports,M=t("90b9"),N=function(e){var n=d["a"].createFromIconfontCN({scriptUrl:"/static/iconfont/iconfont.js"});e.component(p["a"].name,p["a"]),e.component(m["a"].name,m["a"]),e.component(f["a"].name,f["a"]),e.component(z["a"].name,z["a"]),e.component(b["a"].name,b["a"]),e.component(b["a"].Item.name,b["a"].Item),e.component("IconFont",n),e.component(C.name,C),e.component(D.name,D),e.prototype.$hasShow=M["j"]},L={bind:function(e,n){var t=e;"success"===n.arg?t._v_clipboard_success=n.value:"error"===n.arg?t._v_clipboard_error=n.value:t=Object(M["b"])(t,n)},update:function(e,n){"success"===n.arg?e._v_clipboard_success=n.value:"error"===n.arg?e._v_clipboard_error=n.value:(e._v_clipboard.text=function(){return n.value},e._v_clipboard.action=function(){return"copy"})},unbind:function(e,n){"success"===n.arg?delete e._v_clipboard_success:"error"===n.arg?delete e._v_clipboard_error:(e._v_clipboard.destroy(),delete e._v_clipboard)}},O=function(e){e.directive("clipboard",L)},R=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{attrs:{id:"app"}},[t("router-view")],1)},I=[],j={data:function(){return{}}},U=j,B=Object(T["a"])(U,R,I,!1,null,null,null),$=B.exports,Q=t("e26c"),F=t("a47b");t("7cde"),t("7796"),t("78b1");a["default"].config.productionTip=!1,a["default"].use(c["a"]),a["default"].use(N),a["default"].use(s.a),a["default"].use(o.a),a["default"].use(O);var K=new c["a"]({locale:F["a"].state.lang,messages:h["default"]});u.a.i18n(function(e,n){return K.t(e,n)}),new a["default"]({router:Q["a"],store:F["a"],i18n:K,render:function(e){return e($)}}).$mount("#app")},"581f":function(e,n,t){"use strict";var a=t("407c"),r=t.n(a);r.a},"5a4e":function(e,n,t){"use strict";var a=t("9ec4"),r=t.n(a);r.a},6388:function(e,n,t){"use strict";t.r(n),n["default"]={__not:["默认是80","默认是60","默认80","默认60","莱森斯信息"],shareSubscription:{zh:"共享订阅",en:"Share Subscription"},subscription:{zh:"订阅",en:"Subscriptions"},retained:{zh:"保留消息",en:"Retained"},connectionsTips:{zh:"当前活跃连接数",en:"Currently active connections"},view:{zh:"查看",en:"View"},viewMore:{zh:"查看详情",en:"View More"},systemTime:{zh:"系统时间",en:"System Time"},uptime:{zh:"运行时长",en:"Uptime"},currentConnection:{zh:"连接",en:"Connections"},nodeState:{zh:"节点状态",en:"Node State"},running:{zh:"运行中",en:"Running"},stopped:{zh:"已停止",en:"Stopped"},memory:{zh:"内存",en:"Memory"},maxFds:{zh:"最大文件句柄",en:"Max Fds"},process:{zh:"进程",en:"Process"},load:{zh:"负载",en:"Load"},monitor:{zh:"监控",en:"Monitor"},nodeName:{zh:"节点名称",en:"Node Name"},nodeData:{zh:"节点数据",en:"Node"},currentNodeInfo:{zh:"当前节点信息如下",en:"Current node info"},basicInfo:{zh:"基础信息",en:"Basic Info"},metric:{zh:"度量指标",en:"Metric"},configuration:{zh:"配置信息",en:"Configuration"},version:{zh:"版本信息",en:"Version"},basic:{zh:"基础信息",en:"Basic"},listener:{zh:"监听器",en:"Listener"},ListeningPorts:{zh:"当前监听端口列表",en:"Listening address and ports"},listenerProtocol:{zh:"监听协议",en:"Protocol"},listenerAddress:{zh:"监听地址",en:"Address"},connectCurrentAndMax:{zh:"连接 (当前/最大)",en:"Connect (Current/Max)"},current:{zh:"当前",en:"Current"},maximum:{zh:"最大",en:"Maximum"},dataList:{zh:"数据列表",en:"Data List"},packetStatisticsOfNodes:{zh:"节点的报文信息, 消息统计与流量收发统计",en:"Packet statistics of nodes、Message I/O Statistics"},mqttPackages:{zh:"报文",en:"Packages"},messageNumber:{zh:"消息数",en:"Messages"},traffic:{zh:"流量收发(字节)",en:"Byte"},client:{zh:"客户端",en:"Client"},session:{zh:"会话",en:"Session"},mainConfiguration:{zh:"节点主要配置",en:"Main Configuration"},brokerStatus:{zh:"服务器状态",en:"Broker status"},nodesNun:{zh:"节点数",en:"Nodes"},numberOfNodesInCluster:{zh:"集群中节点数",en:"Nodes"},messageOut:{zh:"消息发出",en:"Message Out"},strip:{zh:"条",en:"strip"},second:{zh:"秒",en:"second"},currentMessageOutRate:{zh:"当前消息发出速度",en:"Current message-out rate"},messageIn:{zh:"消息流入",en:"Message In"},currentMessageInRate:{zh:"当前消息流入速度",en:"Current message-in rate"},subscriptionNumber:{zh:"订阅数",en:"Subscriptions"},topicNumber:{zh:"集群订阅关系数",en:"Topics"},connection:{zh:"连接",en:"Connection"},connectionNumber:{zh:"连接数",en:"Connections"},maxConnections:{zh:"连接数峰值",en:"Max connections"},noData:{zh:"暂无数据",en:"No data"},customer:{zh:"签发对象",en:"Customer"},numberOfConnectionLines:{zh:"License 使用情况",en:"License usage"},issuanceOfEmail:{zh:"签发邮箱",en:"Issuance of email"},issuedAt:{zh:"签发时间",en:"Issued At"},expireAt:{zh:"到期时间",en:"Expire At"},beforeTheCertificateExpires:{zh:"证书到期前 EMQ 将通过邮件通知签发邮箱,请留意信息接收以免错过续期时间对业务造成影响。",en:"EMQ will issue mailbox through email notification before the certificate expires. Please pay attention to receiving information so as not to miss the renewal time, which will affect the business."},forTrialEdition:{zh:"当前 License 为试用版",en:"The license is trial edition"},license:{zh:"License 信息",en:"License"},trialEdition:{zh:"试用版",en:"Trial Edition"},messageDrop:{zh:"消息丢弃",en:"Message Drop"},topics:{zh:"主题",en:"Topics"},Subscription:{zh:"订阅",en:"Subscription"},message:{zh:"消息",en:"Message"},rate:{zh:"速率",en:"Rate"},notPromptAgain:{zh:"不再提示",en:"don't prompt again"},licenseExpiryTip:{zh:'\n 您的试用 License 已过期,请\n 更新 License \n 或联系销售人员更新 License。\n ',en:'\n Your license has expired. Please\n update license\n or contact our customer services for an updated license.\n '},licenseEvaluationTip:{zh:'\n 当前正在使用评估 License,限制为10个连接。请\n 升级 License
如已购买\n License,请 替换 正式的 License。\n ',en:'\n You are now using the 10-connection evaluation license.
Please\n upgrade license.\n If you already applied offcial license,
please replace with your official license.\n '},konw:{zh:"知道了",en:"I knew"},expired:{zh:"过期",en:"Expired"},noSubscribers:{zh:"无订阅者",en:"No Subscribers"},receivedMsg:{zh:"消息接收",en:"Received"},sentMsg:{zh:"消息发送",en:"Sent"},droppedMsg:{zh:"消息丢弃",en:"Dropped"}}},"63c9":function(e,n,t){"use strict";t.r(n),n["default"]={modules:{zh:"模块管理",en:"Modules Manage"},name:{zh:"模块名称",en:"Name"},enable:{zh:"启用",en:"Enable"},disable:{zh:"停用",en:"Disable"},enabled:{zh:"已启用",en:"Enabled"},disabled:{zh:"已停用",en:"Disabled"},description:{zh:"描述",en:"Description"},searchTip:{zh:"搜索模块...",en:"Search modules..."},reconnect:{zh:"重连",en:"Reconnect"},moduleEdit:{zh:"模块编辑",en:"Module Edit"},moduleAdd:{zh:"模块添加",en:"Module Add"},moduleAddSuccess:{zh:"模块添加成功!",en:"Module Add Successfully!"},moduleEditSuccess:{zh:"模块编辑成功!",en:"Module Edit Successfully!"},select:{zh:"选择",en:"Select"},added:{zh:"已添加",en:"Added"},guide:{zh:"使用指引",en:"Usage Guide"},readMore:{zh:"了解更多",en:"Read More"},run:{zh:"启动",en:"Run"},stop:{zh:"停止",en:"Stop"},noData:{zh:"暂无数据",en:"No data"},stopSuccess:{zh:"停止成功",en:"Stop Success"},startSuccess:{zh:"开启成功",en:"Start Success"},thisActionWillStopTheModule:{zh:"此操作将停止该模块,确认继续?",en:"Confirm to stop the Module?"},thisActionWillDeleteTheModule:{zh:"此操作将删除该模块,确认继续?",en:"Confirm to delete the Module?"},authentication:{zh:"认证鉴权",en:"Authentication"},protocols:{zh:"协议接入",en:"Protocols"},messagePublish:{zh:"消息下发",en:"Message Publish"},extension:{zh:"多语言扩展",en:"Extensions"},monitor:{zh:"运维监控",en:"DevOps"},localModules:{zh:"内部模块",en:"Local Modules"},configuration:{zh:"配置信息",en:"Configuration"},listener:{zh:"监听器",en:"Listeners"},addListener:{zh:"添加监听器",en:"Add Listener"},editListener:{zh:"编辑监听器",en:"Edit Listener"},edit:{zh:"编辑",en:"Edit"},remove:{zh:"移除",en:"Remove"},listen_on:{zh:"监听地址",en:"Listener"},listener_type:{zh:"监听类型",en:"Listener Type"},acceptors:{zh:"接收器个数",en:"Acceptors"},active_n:{zh:"Active",en:"Active"},max_conn_rate:{zh:"每秒最大连接数",en:"Max CPS"},max_connections:{zh:"最大连接数",en:"Max Connections"},emptyListenerTip:{zh:"请添加监听器!",en:"Please add Listener!"},fileTip:{zh:"请上传文件",en:"Please upload File"},noNeedAddConfigTip:{zh:"此模块无需配置相关信息!",en:"No configuration information is required for this module!"},continueCommit:{zh:"继续提交",en:"Submit"},editTip:{zh:"应用更改将会短暂重启当前模块,可能会造成数据丢失或服务中断,请确保在不影响业务的情况下提交更改。",en:"\n Applying changes will immediately restart the current module which may cause data loss\n or service interruption. Please make sure to submit the changes without affecting the business."},auth:{zh:"认证",en:"Authentication"},confirmDelete:{zh:"确认删除?",en:"Confirm Delete?"},listNull:{zh:"列表为空,请调整过滤条件再试",en:"Empty. Please change the filter and try again"},allow:{zh:"允许",en:"Allow"},deny:{zh:"不允许",en:"Deny"},action:{zh:"主题动作",en:"Action"},isAllow:{zh:"是否允许",en:"Allowed"},useModulesTip:{zh:'EMQ X 提供了丰富的模块用于替换插件,建议您前往使用 模块。',en:'EMQ X provides a wealth of Modules to replace Plugin,\n it is recommended that you go to use Modules.'},searchClient:{zh:"请输入 IMEI",en:"Please input IMEI"},enhancedAuth:{zh:"增强认证",en:"Enhanced Auth"},mechanism:{zh:"认证机制",en:"Authentication mechanism"},addAuth:{zh:"创建认证信息",en:"Add Auth"},editAuth:{zh:"编辑认证信息",en:"Edit Auth"},viewAuth:{zh:"查看认证信息",en:"View Auth"},iterationCount:{zh:"迭代次数",en:"Iteration Count"},iterationCountTip:{zh:"必须为正整数",en:"Must be a positive integer"},serverKey:{zh:"服务密钥",en:"Server key"},storedKey:{zh:"存储密钥",en:"Stored key"},dataType:{zh:"数据类型",en:"Data Type"},lwClientOffline:{zh:"当前客户端已下线",en:"The current client is offline"},requestTimeout:{zh:"请求超时",en:"Request timed out"}}},"65ae":function(e,n,t){"use strict";var a=t("daf2"),r=t.n(a);r.a},"713e":function(e,n,t){"use strict";t.r(n),n["default"]={currentSubs:{zh:"当前订阅主题列表",en:"Current Subscriptions"},topic:{zh:"主题",en:"Topic"},share:{zh:"共享订阅",en:"Share"}}},7796:function(e,n,t){},"78b1":function(e,n,t){},"7a58":function(e,n,t){"use strict";t.r(n),n["default"]={metricsTip:{zh:"数据统计为实时刷新数据,包含自添加以来全部统计数据",en:"The metrics are real-time refresh data, including all statistics since the addition"},enable:{zh:"启用",en:"Enable"},addTopic:{zh:"添加主题",en:"Add Topic"},details:{zh:"详情数据",en:"Details"},messageIn:{zh:"消息流入",en:"Message In"},messageOut:{zh:"消息流出",en:"Message Out"},messageDrop:{zh:"消息丢弃",en:"Message Drop"},messageInDesc:{zh:"(消息流入速率)",en:"(message in rate)"},messageOutDesc:{zh:"(消息流出速率)",en:"(message out rate)"},messageDropDesc:{zh:"(消息丢弃速率)",en:"(message drop rate)"},rateItem:{zh:"{0} 条/秒",en:"{0} / second"},rate:{zh:"(速率)",en:"(rate)"}}},"7a64":function(e,n,t){"use strict";t.r(n),n["default"]={__not:[],key:{zh:"键",en:"Key"},objectKey:{zh:"对象键",en:"Key"},value:{zh:"值",en:"Value"},add:{zh:"添加",en:"Add"},delete:{zh:"删除",en:"Delete"},left:{zh:"左侧",en:"Left"},monitor:{zh:"监控",en:"Monitor"},connect:{zh:"连接",en:"Connections"},usersAcl:{zh:"认证鉴权",en:"Users & ACL"},clients:{zh:"客户端",en:"Clients"},topics:{zh:"主题",en:"Topics"},subscriptions:{zh:"订阅",en:"Subscriptions"},schemas:{zh:"编解码",en:"Schema Registry"},rule:{zh:"规则",en:"Rule"},rules:{zh:"规则引擎",en:"Rule Engine"},resources:{zh:"资源",en:"Resources"},analysis:{zh:"统计分析",en:"Analysis"},topic_metrics:{zh:"主题监控",en:"Topic metrics"},alerts:{zh:"告警",en:"Alarm"},plugins:{zh:"插件",en:"Plugin"},modules:{zh:"模块",en:"Modules"},tool:{zh:"工具",en:"Tool"},websocket:{zh:"Websocket",en:"Websocket"},general:{zh:"通用",en:"General"},application:{zh:"应用",en:"Application"},blacklist:{zh:"黑名单",en:"Blacklist"},backup:{zh:"备份",en:"Backup"},users:{zh:"用户",en:"Users"},setting:{zh:"设置",en:"Setting"},node:{zh:"节点数据",en:"Node"},ruleCreate:{zh:"创建规则",en:"Rule Create"},schemaCreate:{zh:"创建编解码",en:"Schema Create"},settings:{zh:"系统设置",en:"Settings"},usingDocuments:{zh:"使用文档",en:"Documents"},applicationManagement:{zh:"应用管理",en:"Application"},usersManagement:{zh:"用户管理",en:"Users"},logOut:{zh:"退出登录",en:"Log out"},notLoggedIn:{zh:"未登录",en:"Not logged in"},theSystemHas:{zh:"系统有",en:"The system has"},noteAlertClickView:{zh:"条告警,点击查看",en:"alerts, Click to view"},noWarning:{zh:"暂无告警",en:"No alarm"},loggedOut:{zh:"已退出登录",en:"Logged out"},whetherToLogOutOrNot:{zh:"是否退出登录?",en:"Confirm to logout"},signOut:{zh:"退出",en:"Logout"},selectModules:{zh:"选择模块",en:"Modules Select"},trace:{zh:"在线 Trace",en:"Online Trace"}}},"7cde":function(e,n,t){},"7ffd":function(e,n,t){"use strict";t.r(n),n["default"]={__not:[],listNull:{zh:"列表为空,请调整过滤条件再试",en:"Empty. Please change the filter and try again"},unit:{zh:"个插件",en:""},plugin:{zh:"插件",en:"Plugin"},numberOfPlugIns:{zh:"插件数量",en:"Number of plugins"},numPlugins:{zh:"个插件",en:"Plugins"},running:{zh:"运行中",en:"Running"},individual:{zh:"个",en:""},stop:{zh:"停 止",en:"Stop"},stopped:{zh:"已停止",en:"Stopped"},pluginsList:{zh:"插件列表",en:"Plugins"},selectNode:{zh:"节点选择",en:"Node"},all:{zh:"全部",en:"All"},startRunning:{zh:"启 动",en:"Run"},config:{zh:"配置",en:"config"},tutorial:{zh:"使用文档",en:"Tutorial"},pluginName:{zh:"插件名称",en:"Name"},version:{zh:"版本",en:"Version"},describe:{zh:"描述",en:"Description"},type:{zh:"类型",en:"Type"},state:{zh:"状态",en:"State"},authentication:{zh:"认证",en:"Auth"},backend:{zh:"持久化",en:"Backend"},bridge:{zh:"桥接",en:"Bridge"},protocol:{zh:"协议",en:"Protocol"},feature:{zh:"功能",en:"Feature"},other:{zh:"其他",en:"Other"},thisActionWillStopThePlugIn:{zh:"此操作将停止该插件,确认继续?",en:"Confirm to stops the plugin?"},runSuccess:{zh:"开启成功",en:"Run Success"},runFailed:{zh:"开启失败",en:"Run Failed"},stopSuccess:{zh:"停止成功",en:"Stop Success"},pluginTips:{zh:"该功能仅做调试使用,配置将在 Broker 重启后将丢失,请将配置写入相应配置文件",en:"The module is only used for debugging or testing, and the configuration will be lost when broker restart"},configuration:{zh:"配置信息",en:"Configuration"},save:{zh:"保存",en:"Save"},updateSuccessful:{zh:"更新成功",en:"Update Successful"},pluginBeforeSaveTips:{zh:"你的更改将不被保存,确认继续?",en:"Your changes will not be saved. Confirm to continue?"},pleaseEnter:{zh:"请输入",en:"Please enter"},searchByName:{zh:"按插件名称搜索",en:"Search by plugin name"},manage:{zh:"管理",en:"Manage"},authClientidRequired:{zh:"请填写 Client ID 和密码",en:"Client ID or Password is required"},confirmDelete:{zh:"确认删除?",en:"Confirm Delete?"},algorithm:{zh:"加密算法",en:"Algorithm"},payloadDesc:{zh:"启用 verify_claims 时有效, 可以使用 %u,%c 占位符分别替换输入的 username 和 clientid,详见",en:"It is valid when verify_claims is enabled. You can use% u and% c placeholders to replace the entered user name and clientid respectively. For details, see"},jwtDoc:{zh:"JWT 认证",en:"JWT Authentication"},dataDesc:{zh:"一行一组数据,使用逗号分割 username,clientid",en:"One line is a set of data, separated by comma username,clientid"},secret:{zh:"密钥或私钥",en:"Secret or Private key"},secretRequired:{zh:"请输入 Secret",en:"Secret is required"},payloadRequired:{zh:"请输入 Payload 模版",en:"Payload template is required"},dataRequired:{zh:"请填写 Payload 数据",en:"Payload data is required"},leaveTokenPage:{zh:"离开页面后当前输入的配置与生成的 TOKEN 信息均不再保留,确认离开?",en:"After leaving the page, the currently entered configuration and generated TOKEN information are no longer retained. Continue?"},usernameOrClientid:{zh:"用户名或 Client ID",en:"Username or Client ID"},username:{zh:"用户名",en:"Username"},mnesiaTip:{zh:"默认使用 Username,以 auth.mnesia.as 配置为准",en:"Username is used by default, but follow the auth.mnesia.as configuration"},authMnesiaRequired:{zh:"请填写完整的认证信息",en:"Authentication information is required"},auth:{zh:"认证",en:"Authentication"},isAllow:{zh:"是否允许",en:"Allowed"},allow:{zh:"允许",en:"Allow"},deny:{zh:"不允许",en:"Deny"},aclMnesiaRequired:{zh:"请填写完整的 ACL 信息",en:"ACL information is required"},action:{zh:"主题动作",en:"Action"},allUsers:{zh:"全部用户",en:"All Users"}}},"90b9":function(e,n,t){"use strict";t("3b2b"),t("6762"),t("2fdb"),t("28a5"),t("4917"),t("7f7f"),t("6b54"),t("a481");var a=t("768b"),r=(t("ffc1"),t("55dd"),t("7618")),s=(t("456d"),t("ac6a"),t("b311")),i=t.n(s),o=t("db05"),c=t.n(o),l=t("2e8e"),u=t.n(l),h=t("5c96"),d=t("a47b"),p=t("e26c"),m=t("12cb"),f=t("db41"),z=t("2dbd"),b=z.en,g=z.zh,v=f.zh,_=f.en;t.d(n,"e",function(){return S}),t.d(n,"p",function(){return T}),t.d(n,"a",function(){return w}),t.d(n,"c",function(){return A}),t.d(n,"l",function(){return x}),t.d(n,"g",function(){return E}),t.d(n,"i",function(){return P}),t.d(n,"b",function(){return q}),t.d(n,"o",function(){return D}),t.d(n,"j",function(){return M}),t.d(n,"h",function(){return N}),t.d(n,"k",function(){return L}),t.d(n,"d",function(){return O}),t.d(n,"n",function(){return R}),t.d(n,"m",function(){return I}),t.d(n,"f",function(){return j}),t.d(n,"q",function(){return U}),t.d(n,"r",function(){return B});var k=d["a"].state.lang,y=m["default"][k];function S(){return d["a"].state.user}function T(){d["a"].dispatch("UPDATE_USER_INFO",{logOut:!0}),p["a"].push({path:"/login",query:{to:p["a"].fullPath}})}var w=function(e){return e.then(function(e){return e}).catch(function(e){return null})};function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=d["a"].state.lang,t=void 0===n?"zh":n;return Object.keys(e).forEach(function(n){var a=e[n];"object"===Object(r["a"])(a)&&("en"in a&&"zh"in a?e[n]=a[t]:C(a))}),e}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;var a=d["a"].state.lang,r=void 0===a?"zh":a,s=Array.isArray(e);if("boolean"===typeof n&&(t=n,n=[]),s)e.forEach(function(e){if(t)return C(e);n.forEach(function(n){e[n]&&(e[n]=e[n][r])})});else{if(t)return C(e);n.forEach(function(n){e[n]&&(e[n]=e[n][r])})}return e}function x(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],r={},s={},i={},o=0,c=Object.entries(e);o")},bindAttributes:{type:C,field:"select"===A||"cfgselect"===A?E:void 0,placeholder:q,rows:"textarea"===C?5:0},key:u,type:C,elType:A,value:d||"configs"!==n?d:"",order:y,oneObjOfArray:"array"===A?s:{},extraConfigs:"cfgselect"===A?i:{}}),r[u]=[];var D="zh"===k?"请输入":"Field required",M="zh"===k?"请选择":"Please select",N="zh"===k?"请添加":"Please Add";if(T&&("array"===A?r[u].push({required:!0,message:N}):r[u].push({required:!0,message:"input"===A?D:M})),f){var L=f.map(function(e){return"boolean"===typeof e?e.toString():e});r[u].push({type:"enum",enum:L})}}}return t=t.sort(function(e,n){return e.order-n.order}),{form:t,rules:r}}function E(e){var n=d["a"].state.lang,t=void 0===n?"zh":n,a="zh"===t?g:b;return a[e]||"/"}function P(e){var n=d["a"].state.lang,t=void 0===n?"zh":n,a="zh"===t?v:_;return a[e]||""}var q=function(e,n){var t=new i.a(e,{text:function(){return n.value},acttion:function(){return"copy"}});return t.on("success",function(n){var t=e._v_clipboard_success;t&&t(n)}),t.on("error",function(n){var t=e._v_clipboard_error;t&&t(n)}),e._v_clipboard=t,e},D=function(e){var n=c.a.format(e),t=n.replace(/= ~/g,"=~").replace(/\n/g,"!#!"),a=t.match(/SELECT!#!(.+)!#!FROM/);if(a){var r=a[1];if(r){var s=r.replace(/(!#!|\s)/g," ").split(/[,,]/).join(", ");t=t.replace(r,"".concat(s))}}return t.replace(/!#!/g,"\n\r")},M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=d["a"].state.config.hide||{routes:[],children:[]};return!e||!(n.routes.includes(e)||n.children.includes(e))},N=function(e,n){var t=new RegExp("".concat(n,"=([^&]*)"),"i"),a=e.match(t)[1];return decodeURIComponent(a)},L=function(e,n,t){return new Promise(function(a,r){try{var s=e.filter(function(e){if(e[n]){var a=e[n].toLowerCase().replace(/\s+/g,""),r=t.toLocaleLowerCase().replace(/\s+/g,"");return a.match(r)}return null});return a(s)}catch(i){return r(i)}})},O=function(e){var n=1e3,t=["K","M","G","T"],a=Math.round(e%n/100),r=Math.round(e/n),s=0;while(r>n)a=Math.round(r%n/100),r=Math.round(r/n),s+=1;return"".concat(r,".").concat(a).concat(t[s],"B")};function R(e){var n=e.replace(/\"/g,""),t=["message.publish","message.deliver","message.acked","message.dropped","client.connected","client.disconnected","client.subscribe","client.unsubscribe"],r=null;return t.forEach(function(e){var t=e.split("."),s=Object(a["a"])(t,2),i=s[0],o=s[1],c=new RegExp("".concat(i,"\\.").concat(o),"gim");n.match(c)&&(r=n.match(c))}),r}function I(e,n){var t={"message.publish":"","message.deliver":"$events/message_delivered","message.acked":"$events/message_acked","message.dropped":"$events/message_dropped","client.connected":"$events/client_connected","client.disconnected":"$events/client_disconnected","client.subscribe":"$events/session_subscribed","client.unsubscribe":"$events/session_unsubscribed"},a=t[n],r=e.replace(/\"/g,"");try{var s=u.a.parse(r);return""===a&&(s.value.where=null,a="#"),s.value.from.value[0].value.value.value='"'.concat(a,'"'),u.a.stringify(s)}catch(i){h["Message"].error(i.toString())}}function j(e){var n=Math.floor(e/1e3),t=Math.floor(n/86400),a=n%86400,r=Math.floor(a/3600),s=Math.floor(n%3600/60),i=n%60;return[t,r,s,i].map(function(e){return e>10?e:"0".concat(e)}).join(":")}var U=function(e,n,t){var a=/^[0-9a-zA-Z_:]{1,64}$/;n?n.length>64?t(new Error(y.RuleEngine.id_len_tip)):a.test(n)?t():t(new Error(y.RuleEngine.id_char_tip)):t(new Error(y.RuleEngine.pleaseEnter))},B=function(e,n,t){if(n){var a=n.includes(":")?n.split(":")[1]:n,r=parseInt(a,10);r>65535||r<=0?t(new Error(y.Settings.portRangeTip)):t()}else t(new Error(y.RuleEngine.pleaseEnter))}},"9cfb":function(e,n,t){"use strict";t.r(n),n["default"]={__not:[],maxSix:{zh:"最大支持 6 个连接",en:"Maximum support for 6 connection"},defaultConnection:{zh:"默认连接",en:"Default"},connectionName:{zh:"新连接",en:"New"},connectionConfiguration:{zh:"连接配置",en:"Connection"},protocolType:{zh:"协议类型",en:"Protocol Type"},host:{zh:"主机名",en:"Host"},port:{zh:"端口",en:"Port"},mountPoint:{zh:"挂载点",en:"Mountpoint"},randomGeneration:{zh:"随机生成",en:"Random"},connected:{zh:"已连接",en:"Connected"},inConnection:{zh:"连接中",en:"Connecting"},disconnected:{zh:"已断开连接",en:"Disconnected"},connect:{zh:"连接",en:"Connect"},cancelConnection:{zh:"取消连接",en:"Cancel connection"},disconnect:{zh:"断开连接",en:"Disconnect"},Subscription:{zh:"订阅",en:"Subscription"},Subscribe:{zh:"订阅",en:"Subscribe"},time:{zh:"时间",en:"Time"},publish:{zh:"发布",en:"Publish"},received:{zh:"已接收",en:"Received"},clear:{zh:"清除",en:"Clear"},published:{zh:"已发送",en:"Published"},pleaseEnter:{zh:"请输入",en:"Please enter"},rangeError:{zh:"范围错误",en:"range error"},clientNotConnected:{zh:"客户端未连接",en:"Client not connected"},subscriptionFailure:{zh:"订阅失败",en:"Subscription failure"},publishingFailure:{zh:"发布失败",en:"Publishing failure"},connectionDisconnected:{zh:"连接已断开",en:"connection disconnected"}}},"9ec4":function(e,n,t){},a47b:function(e,n,t){"use strict";var a=t("768b"),r=(t("ac4d"),t("8a81"),t("ac6a"),t("75fc")),s=t("cebc"),i=(t("6762"),t("2fdb"),t("2b0e")),o=t("2f62"),c=t("3274");i["default"].use(o["a"]);function l(e){return["en","zh"].includes(e)?e:""}function u(){var e=l(navigator.language.substr(0,2)),n=l(localStorage.getItem("language")),t=(window.EMQX_CONFIG||{}).language;return n||t||e||"en"}function h(){var e="emqx",n=c[e]||c.base;return Object(s["a"])({},c.base,n)}function d(){return JSON.parse(localStorage.getItem("navTabs"))||[]}function p(){var e=localStorage.getItem("leftBarCollapse");return null!==e&&JSON.parse(e)}n["a"]=new o["a"].Store({state:{loading:!1,user:JSON.parse(localStorage.user||sessionStorage.user||"{}")||{},lang:u(),leftBarCollapse:p(),alertCount:0,config:h(),navTabs:d(),selectedModule:JSON.parse(localStorage.getItem("selectedModule"))||{}},actions:{UPDATE_MODULE:function(e,n){var t=e.commit;localStorage.setItem("selectedModule",JSON.stringify(n)),t("UPDATE_MODULE",n)},UPDATE_CONFIG:function(e,n){var t=e.commit;t("UPDATE_CONFIG",n)},SET_ALERT_COUNT:function(e){var n=e.commit,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n("SET_ALERT_COUNT",t)},SET_LANGUAGE:function(e){var n=e.commit,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";localStorage.setItem("language",t),n("SET_LANGUAGE",t),setTimeout(function(){location.reload()},400)},SET_LEFT_BAR_COLLAPSE:function(e){var n=e.commit,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n("SET_LEFT_BAR_COLLAPSE",!!t)},UPDATE_USER_INFO:function(e){var n=e.commit,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.logOut,r=void 0!==a&&a,s=t.remember;r?(localStorage.removeItem("user"),sessionStorage.removeItem("user")):s?localStorage.setItem("user",JSON.stringify(t)):sessionStorage.setItem("user",JSON.stringify(t)),n("UPDATE_USER_INFO",r?{}:t)},LOADING:function(e){var n=e.commit,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n("LOADING",t)},ADD_NAV_TABS:function(e,n){var t=e.commit;t("ADD_NAV_TABS",n)},REMOVE_NAV_TABS:function(e,n){var t=e.commit,s=e.state,i=Object(r["a"])(s.navTabs),o=!0,c=!1,l=void 0;try{for(var u,h=i.entries()[Symbol.iterator]();!(o=(u=h.next()).done);o=!0){var d=Object(a["a"])(u.value,2),p=d[0],m=d[1];if(m.url===n.url){i.splice(p,1);break}}}catch(f){c=!0,l=f}finally{try{o||null==h.return||h.return()}finally{if(c)throw l}}return t("REMOVE_NAV_TABS",i),i}},mutations:{UPDATE_MODULE:function(e,n){e.selectedModule=n},UPDATE_CONFIG:function(e,n){e.config=n},SET_ALERT_COUNT:function(e,n){e.alertCount=n},UPDATE_USER_INFO:function(e,n){e.user=n},LOADING:function(e,n){e.loading=n},SET_LEFT_BAR_COLLAPSE:function(e,n){e.leftBarCollapse=n,localStorage.setItem("leftBarCollapse",n)},SET_LANGUAGE:function(e,n){e.lang=n},ADD_NAV_TABS:function(e,n){e.navTabs.push(n),localStorage.setItem("navTabs",JSON.stringify(e.navTabs))},REMOVE_NAV_TABS:function(e,n){e.navTabs=n,localStorage.setItem("navTabs",JSON.stringify(e.navTabs))}}})},ab41:function(e,n,t){"use strict";t.r(n),n["default"]={__not:[],userCreate:{zh:"https://docs.emqx.cn/cn/broker/latest/advanced/cli.html#admins-%E5%91%BD%E4%BB%A4",en:"https://docs.emqx.io/en/broker/latest/advanced/cli.html#admins-command"},loginUserAccount:{zh:"使用 Dashboard 用户登录",en:"Login using Dashboard accounts"},forgetPassword:{zh:"忘记密码?",en:"Forget the password?"},signIn:{zh:"登录",en:"Sign in"},userName:{zh:"用户名",en:"Username"},password:{zh:"密码",en:"Password"},remember:{zh:"记住",en:"remember"},resourcesNotFound:{zh:"资源未找到",en:"Resources not found"},loging:{zh:"登录中...",en:"logging in..."},copied:{zh:"复制成功!",en:"Copied!"},copy:{zh:"复制",en:"Copy"},generate:{zh:"生成",en:"Generate"},warning:{zh:"警告",en:"Warning"},view:{zh:"详情",en:"View"},detail:{zh:"详情",en:"View"},edit:{zh:"编辑",en:"Edit"},homePage:{zh:"首页",en:"Home"},save:{zh:"保存",en:"Save"},apply:{zh:"应用",en:"Apply"},create:{zh:"创建",en:"Create"},cancel:{zh:"取消",en:"Cancel"},confirm:{zh:"确定",en:"Confirm"},add:{zh:"添加",en:"Add"},delete:{zh:"删除",en:"Delete"},saveSuccess:{zh:"保存成功",en:"Save Success"},applySuccess:{zh:"应用成功",en:"Apply Success"},createSuccess:{zh:"创建成功",en:"Create Success"},deleteSuccess:{zh:"删除成功",en:"Delete Success"},viewMore:{zh:"查看更多",en:"View More"},collapse:{zh:"收起",en:"Collapse"},next:{zh:"下一页",en:"Next"},prev:{zh:"上一页",en:"Previous"},editSuccess:{zh:"编辑成功",en:"Edit Success"},day:{zh:"天",en:"day | days"},year:{zh:"年",en:"year | years"},enableSuccess:{zh:"启用成功",en:"Enable Success"},disabledSuccess:{zh:"停用成功",en:"Disable Success"},select:{zh:"选择",en:"Select"},manage:{zh:"管理",en:"Manage"},tips:{zh:"提示",en:"Tips"},operateSuccess:{zh:"操作成功",en:"Successful operation"}}},c690:function(e,n,t){"use strict";t.r(n),n["default"]={__not:["应用为调用","认证凭证,通过","可查询","调整","集群信息,对设备进行管理操作","请求一组数据","密码长度为三到三十二位","密码长度为三到三十二位","取消修改密码,删除密码数据"],confirmDelete:{zh:"确认删除应用?",en:"Confirm delete?"},applicationIsCalled:{zh:"应用为调用 REST API 认证凭证,通过 REST API 可查询、调整 EMQ X 集群信息,对设备进行管理操作",en:"In order to invoke the certificate of REST API, the application can query and adjust EMQ X cluster information through REST API, and manage and operate the equipment"},appId:{zh:"应用 ID",en:"AppID"},application:{zh:"应用",en:"Application"},productDocumentation:{zh:"产品文档",en:"Document"},appName:{zh:"应用名称",en:"App Name"},expireAt:{zh:"到期时间",en:"Expire At"},remark:{zh:"备注",en:"Remark"},isEnabled:{zh:"是否启用",en:"Is Enabled"},enabled:{zh:"启用",en:"Enabled"},edit:{zh:"编辑",en:"Edit"},delete:{zh:"删除",en:"Delete"},editApp:{zh:"编辑应用",en:"Edit"},createApp:{zh:"创建应用",en:"Create App"},secret:{zh:"密钥",en:"Secret"},disabled:{zh:"不启用",en:"Disabled"},pleaseEnterAppName:{zh:"请输入应用名称",en:"Please enter the app name."},pleaseEnterTheAppId:{zh:"请输入应用 ID",en:"Please enter the appid"},pleaseChoose:{zh:"请选择",en:"Please select"},pleaseEnter:{zh:"请输入",en:"Please enter"},neverExpire:{zh:"永不过期",en:"Never expire"},editorialSuccess:{zh:"编辑成功",en:"Edit Success"},successfulAppCreation:{zh:"创建应用成功",en:"Successful app creation"},determineToDeleteTheApp:{zh:"确定删除该应用",en:"Determine to delete the app"},successfulDeletion:{zh:"删除成功",en:"Successful deletion"},cancelConfirm:{zh:"是否取消本次修改?",en:"You have unsaved changes, confirm cancel?"},confirm:{zh:"确认信息",en:"Confirm"},no:{zh:"不",en:"NO"},user:{zh:"用户",en:"Users"},manageDashboardUsers:{zh:"Dashboard 登录管理用户",en:"Manage Dashboard users"},userName:{zh:"用户名",en:"Username"},editorUser:{zh:"编辑用户",en:"Edit"},creatingUser:{zh:"创建用户",en:"Create"},oldPassword:{zh:"旧密码",en:"Old password"},password:{zh:"密码",en:"Password"},newPassword:{zh:"新密码",en:"New password"},confirmPassword:{zh:"确认新密码",en:"Confirm password"},dontChangePassword:{zh:"不修改密码",en:"Dot change password"},changePassword:{zh:"修改密码",en:"Change Password"},pleaseEnterYourPasswordAgain:{zh:"请再次输入密码",en:"Please enter your password again."},confirmNotMatch:{zh:"两次输入密码不一致",en:"Two inputs don't match!"},twoInconsistenciesInPasswordInput:{zh:"两次输入密码不一致",en:"Two inconsistencies in password input"},enterOneUserName:{zh:"请输入用户名",en:"Please enter username"},pleaseEnterNotes:{zh:"请输入备注",en:"Please enter notes"},pleaseEnterPassword:{zh:"请输入密码",en:"Please enter password"},pleaseEnterNewPassword:{zh:"请输入新密码",en:"Please enter new password"},pleaseEnterAConfirmationPassword:{zh:"请输入确认密码",en:"Please enter confirm password."},createUserSuccess:{zh:"创建用户成功",en:"Create User Success"},determineToDeleteTheUser:{zh:"确定删除该用户",en:"Confirm to delete the user"},passwordLength:{zh:"密码长度为 3~32 位",en:"Password length is 3~32"},confirmDeleteUser:{zh:"确认删除该用户?",en:"Confirm delete?"},blacklistTips:{zh:"通过黑名单禁止客户端建立连接,该功能适用于管理少量客户端,客户端认证请使用",en:"The blacklist prohibits clients from establishing connections. This function is suitable for managing a small number of clients. For client authentication, view"},authDocs:{zh:"认证文档",en:"authentication document"},blacklist:{zh:"黑名单",en:"Blacklist"},createBlacklist:{zh:"创建黑名单",en:"Create"},determineToDeleteTheBlacklist:{zh:"确定删除该黑名单",en:"Determine to delete the blacklist"},createBlacklistSuccess:{zh:"创建黑名单成功",en:"Create Blacklist Success"},who:{zh:"禁用值",en:"Value"},as:{zh:"禁用属性",en:"Property"},reason:{zh:"原因",en:"Reason"},desc:{zh:"描述",en:"Description"},until:{zh:"到期时间",en:"Until"},enterWho:{zh:"请输入禁用值",en:"Please enter value"},enterAs:{zh:"请选择禁用属性",en:"Please select property"}}},cf43:function(e,n,t){},d6c8:function(e,n,t){"use strict";t.r(n),n["default"]={__not:["此操作将停用并删除该资源,确认继续","规则要处理的主题,支持","主题通配符","规则引擎使用说起来语句配置二面消息流与设备事件的处理规则,内置多种灵活的数据处理方案"],foldDetails:{zh:"折叠详情",en:"Fold Details"},showDetails:{zh:"详细信息",en:"Show Details"},node:{zh:"节点",en:"Node"},view:{zh:"点击查看",en:"View"},hide:{zh:"点击收起",en:"Hide"},detailedMetrics:{zh:"详细统计",en:"Detailed metrics"},actionMetricsTips:{zh:"节点上的动作统计信息",en:"Metrics on nodes"},detailedStatus:{zh:"详细状态",en:"Detailed status"},resourceStatusTips:{zh:"节点上的资源状态信息",en:"Resource status on nodes"},status:{zh:"状态",en:"Status"},ruleEnabled:{zh:"已启动",en:"Enabled"},ruleDisabled:{zh:"已停止",en:"Disabled"},resourceStatus:{zh:"资源状态",en:"Status"},deleteResource:{zh:"此操作将停用并删除该资源,确认继续?",en:"This operation will disable and delete the resource"},createResources:{zh:"创建资源",en:"Create"},editResources:{zh:"编辑资源",en:"Edit"},editResourceTips:{zh:"确定修改该资源相关配置信息?",en:"Are you sure to modify the configuration information of this resource?"},resourceTypes:{zh:"资源类型",en:"Types"},resourceName:{zh:"资源名称",en:"Resource Name"},testConnection:{zh:"测试连接",en:"Test"},remark:{zh:"备注",en:"Remark"},pleaseEnter:{zh:"请输入",en:"Please enter"},pleaseChoose:{zh:"请选择",en:"Please select"},resourceAvailable:{zh:"资源可用",en:"available"},actionType:{zh:"动作类型",en:"Action Type"},edit:{zh:"编辑",en:"Edit"},delete:{zh:"删除",en:"Delete"},remove:{zh:"移除",en:"Remove"},success:{zh:"成功",en:"Success"},fail:{zh:"失败",en:"Fail"},addAction:{zh:"添加动作",en:"Add action"},addActions:{zh:"新增动作",en:"Add Action"},editActions:{zh:"编辑动作",en:"Edit Action"},useOfResources:{zh:"使用资源",en:"Use of resources"},createNew:{zh:"新建",en:"Create"},all:{zh:"全部",en:"All"},totalResources:{zh:"全部资源",en:"Resources"},resources:{zh:"资源",en:"Resources"},state:{zh:"状态",en:"State"},reconnect:{zh:"重连",en:"Reconnect"},successfulDeletion:{zh:"删除成功",en:"Successful deletion"},details:{zh:"详情",en:"Details"},basicInfo:{zh:"基本信息",en:"Basic Info"},available:{zh:"可用",en:"available"},notAvailable:{zh:"不可用",en:"Not available"},instructions:{zh:"资源说明",en:"Instructions"},configuration:{zh:"配置信息",en:"Configuration"},ruleEngine:{zh:"规则引擎",en:"Rule Engine"},createRules:{zh:"创建规则",en:"Create Rules"},condition:{zh:"条件",en:"Condition"},definingRuleConditionsAndDataProcessing:{zh:"使用 SQL 设定规则,对消息数据筛选、编解码、变型,灵活地将处理后的数据无缝转发至数据库、流处理、API 网关等数据目的地",en:"Use SQL to set rules to filter, encode, decode, and modify message data, and seamlessly forward processed data to data destinations such as databases, stream processing, and API gateways"},triggerEvent:{zh:"触发事件",en:"Trigger Event"},topic:{zh:"主题",en:"Topic"},selectFiled:{zh:"查询字段",en:"Select field"},sqlInput:{zh:"SQL 输入",en:"SQL"},availableField:{zh:"可用字段",en:"Available field"},selectConditions:{zh:"筛选条件",en:"Conditions"},sqlTest:{zh:"SQL 测试",en:"SQL Test"},inputMetadata:{zh:"输入元数据进行 SQL 匹配测试",en:"Input metadata for SQL test"},testOutput:{zh:"测试输出",en:"Result"},currentEventAvailableField:{zh:"当前事件可用字段",en:"Current Event Available Field"},upgradeTip:{zh:"升级提示",en:"Upgrade Tip"},jsonDecodeUpgrade:{zh:"当前版本取消对 payload 的自动 JSON 解码,选择 payload 中的字段请使用 json_decode 解码,如 SQL 示例。",en:"The current version cancels the automatic JSON decoding of the payload. Select the field in the payload and use json_decode to decode it, as in the SQL example."},exampleSql:{zh:"规则 SQL 示例",en:"SQL Example"},responseAction:{zh:"响应动作",en:"Action"},processingMessagesForHitRules:{zh:"处理命中规则的消息",en:"Processing messages for hit rules"},pleaseSelectTheTriggerEvent:{zh:"请选择触发事件",en:"Please select the trigger event"},pleaseEnterTheTopic:{zh:"请输入主题",en:"Please enter the topic"},pleaseEnterTheSelectField:{zh:"请输入查询字段",en:"Please enter the select field"},pleaseEnterTheSQL:{zh:"请输入 SQL 语句",en:"Please enter the SQL field"},nullCharacterError:{zh:"空字符错误",en:"Null character error"},fieldFillingError:{zh:"字段填写错误",en:"field required"},pleaseAddAResponseAction:{zh:"请添加响应动作",en:"Please add a action"},createSuccess:{zh:"创建成功",en:"Create Success"},editSuccess:{zh:"编辑成功",en:"Edit Success"},resultIsEmpty:{zh:"输出为空",en:"Result is empty"},checkForErrors:{zh:"请检查 SQL 语句",en:"SQL is error"},quickStart:{zh:"快速开始",en:"Quick Start"},productDocumentation:{zh:"产品文档",en:"Document"},monitor:{zh:"监控",en:"Monitor"},describe:{zh:"描述",en:"Description"},ruleMetrics:{zh:"规则统计",en:"Metrics"},matched:{zh:"命中次数",en:"matched"},second:{zh:"秒",en:"second"},times:{zh:"次",en:"matched"},currentSpeed:{zh:"当前速度",en:"Current Speed"},maximumSpeed:{zh:"最大执行速度",en:"Maximum speed"},last5MinutesSpeed:{zh:"最近5分钟执行速度",en:"Last 5 minutes speed"},actionMetrics:{zh:"动作统计",en:"Action metrics"},deleteRuleConfirm:{zh:"此操作将停用并删除该规则,确认继续?",en:"This operation will disable and delete the rule"},runningMetrics:{zh:"运行统计",en:"Metrics"},numberOfHits:{zh:"命中次数",en:"Hits"},numberOfRulesExecutedAfterEnabling:{zh:"规则启用后的执行次数",en:"Number of rules hits after enabling"},averageExecutionSpeedInTheLast5Minutes:{zh:"最近5分钟平均执行速度",en:"Average speed in the last 5 minutes"},rule:{zh:"规则",en:"Rule"},messageProcessingForHitRules:{zh:"命中规则的消息处理方式",en:"Message processing for rule data"},clientid_doc:{en:"Current MQTT clientid",zh:"当前客户端 MQTT clientid"},username_doc:{en:"Current MQTT username",zh:"当前客户端 MQTT username"},event_doc:{en:"Trigger event name",zh:"触发事件名称"},id_doc:{en:"MQTT message id",zh:"MQTT message id"},payload_doc:{en:"The payload, if in JSON format, will be automatically decoded, and the object information will be obtained by using payload.x in SQL",zh:"消息内容, 如果是 JSON 格式将自动解码, 在 SQL 中使用 payload.x 获取对象信息"},peername_doc:{en:"Client peer host",zh:"客户端网络地址"},qos_doc:{en:"Enumeration of message QoS 0,1,2",zh:"消息 QoS 0,1,2 中枚举"},timestamp_doc:{en:"Timestamp(millisecond)",zh:"当前毫秒级时间戳"},topic_doc:{en:"Currently MQTT topic can be filtered by wildcards in SQL. When multiple topics are included in subscribe and unsubscribe, only the first one will be obtained here. To obtain all topics, please use topic_filters",zh:"当前 MQTT 主题, SQL 中可以使用通配符进行筛选.\nSubscribe 与 Unsubscribe 请求中包含多个主题时, 这里只会获取到第一个, 如需获取全部请使用 topic_filters"},node_doc:{en:"Node name of the trigger event",zh:"触发事件的节点名称"},message_delivered:{en:"message delivered",zh:"消息投递"},message_acked:{en:"message acked",zh:"消息应答"},message_dropped:{en:"message dropped",zh:"消息丢弃"},client_connected:{en:"client connected",zh:"连接建立"},client_disconnected:{en:"client disconnected",zh:"连接断开"},session_subscribed:{en:"session subscribed",zh:"会话订阅"},session_unsubscribed:{en:"session unsubscribed",zh:"会话取消订阅"},parse_confirm:{en:"Detected incompatible old SQL syntax, confirm to automatically convert it to the new version?",zh:"检测到不兼容的旧版 SQL 语法,是否自动转换为新版语法?"},fallbackAction:{en:"Fallback Actions",zh:"失败备选动作"},fallbackActionCreate:{en:"Set the action that will be performed when an action execution error occurs (optional)",zh:"设置发生动作执行错误时将执行的动作(可选)"},fallbackActionTip:{en:"Action to be performed when the action execution error",zh:"动作执行错误时将执行的操作"},data_persist:{zh:"数据持久化",en:"Data persist"},offline_msgs:{zh:"离线消息",en:"Offline messages"},data_forward:{zh:"数据转发",en:"Data forward"},debug:{zh:"调试",en:"Debug"},server_side_subscription:{zh:"代理订阅",en:"Server side subscription"},resourceID:{zh:"资源 ID",en:"Resource ID"},resourceDes:{zh:"描述",en:"Description"},id_len_tip:{zh:"最长64位",en:"The longest 64"},id_char_tip:{zh:"仅支持数字、字母、下划线和冒号",en:"Only Numbers, letters, underscores, and colons are supported"},ruleID:{zh:"规则 ID",en:"Rule ID"},resourceSelectTip:{zh:"下拉选项优先显示资源描述信息,没有描述信息则显示资源 ID,选中后显示的值为其 ID",en:"The drag-and-drop option gives priority to the resource description information,\n if there is no description information, the resource ID is displayed, but the relative ID displayed after selection"}}},d82d:function(e,n,t){},d8f3:function(e,n,t){"use strict";var a=t("1205"),r=t.n(a);r.a},daf2:function(e,n,t){},db41:function(e){e.exports={en:{emqx_auth_clientid:"https://docs.emqx.io/en/broker/latest/advanced/auth-clientid.html",emqx_auth_username:"https://docs.emqx.io/en/broker/latest/advanced/auth-username.html",emqx_auth_http:"https://docs.emqx.io/en/broker/latest/advanced/auth-http.html",emqx_auth_jwt:"https://docs.emqx.io/en/broker/latest/advanced/auth-jwt.html",emqx_auth_ldap:"https://docs.emqx.io/en/broker/latest/advanced/auth-ldap.html",emqx_auth_mnesia:"https://docs.emqx.io/en/broker/latest/advanced/auth-mnesia.html",emqx_auth_mongo:"https://docs.emqx.io/en/broker/latest/advanced/auth-mongodb.html",emqx_auth_mysql:"https://docs.emqx.io/en/broker/latest/advanced/auth-mysql.html",emqx_auth_pgsql:"https://docs.emqx.io/en/broker/latest/advanced/auth-postgresql.html",emqx_auth_redis:"https://docs.emqx.io/en/broker/latest/advanced/auth-redis.html",emqx_dashboard:"https://docs.emqx.io/en/broker/latest/getting-started/dashboard.html",emqx_extension_hook:"https://docs.emqx.io/en/broker/latest/advanced/lang-lua.html",emqx_rule_engine:"https://docs.emqx.io/en/broker/latest/rule/rule-engine.html"},zh:{emqx_auth_clientid:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-clientid.html",emqx_auth_username:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-username.html",emqx_auth_http:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-http.html",emqx_auth_jwt:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-jwt.html",emqx_auth_ldap:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-ldap.html",emqx_auth_mnesia:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-mnesia.html",emqx_auth_mongo:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-mongodb.html",emqx_auth_mysql:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-mysql.html",emqx_auth_pgsql:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-postgresql.html",emqx_auth_redis:"https://docs.emqx.cn/cn/broker/latest/advanced/auth-redis.html",emqx_dashboard:"https://docs.emqx.cn/cn/broker/latest/getting-started/dashboard.html",emqx_extension_hook:"https://docs.emqx.cn/cn/broker/latest/advanced/lang-lua.html",emqx_rule_engine:"https://docs.emqx.cn/cn/broker/latest/rule/rule-engine.html"}}},e26c:function(e,n,t){"use strict";var a,r=t("2b0e"),s=t("8c4f"),i=t("a47b"),o=(t("ac6a"),function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("el-container",{staticClass:"layout",staticStyle:{"min-height":"100vh"}},[t("el-aside",{attrs:{width:"auto"}},[t("left-bar")],1),t("el-main",{staticStyle:{margin:"0",padding:"0"},style:e.elMainStyle},[e.$hasShow("nav-header")?t("el-header",{staticStyle:{height:"80px",padding:"0"}},[t("nav-header"),t("nav-tabs")],1):e._e(),t("div",{style:{minHeight:"360px",minWidth:"600px",overflowX:"hidden"}},[t("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[t("keep-alive",[e.$route.meta.keepAlive?t("router-view"):e._e()],1)],1),t("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[e.$route.meta.keepAlive?e._e():t("router-view")],1)],1)],1)],1)}),c=[],l=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"left-bar",style:{width:e.leftBarCollapse?"80px":"200px"}},[a("div",{staticClass:"logo",style:{paddingLeft:e.leftBarCollapse?"6px":"20px"}},[a("img",{staticClass:"logo-img",attrs:{src:t("05da"),alt:"logo"}})]),a("a-menu",{staticClass:"menu-wrapper",attrs:{"default-selected-keys":e.defaultSelectedKeys,"selected-keys":e.defaultSelectedKeys,"open-keys":e.defaultOpenKeys,mode:"inline",theme:"dark","inline-collapsed":e.leftBarCollapse},on:{"update:openKeys":function(n){e.defaultOpenKeys=n},"update:open-keys":function(n){e.defaultOpenKeys=n},click:e.handleClick}},[e._l(e.menus,function(n){return[e.$hasShow(n.key)?[n.children&&n.children.length>0?a("a-sub-menu",{key:n.key,on:{titleClick:function(t){return e.titleClick(n)}}},[a("span",{attrs:{slot:"title"},slot:"title"},[a("icon-font",{attrs:{type:n.icon}}),a("span",[e._v(e._s(n.title))])],1),e._l(n.children,function(n){return[e.$hasShow(n.key)?a("a-menu-item",{key:n.path},[e._v("\n "+e._s(n.title)+"\n ")]):e._e()]})],2):!n.children&&e.$hasShow(n.key)?a("a-menu-item",{key:n.path},[a("icon-font",{attrs:{type:n.icon}}),a("span",[e._v(e._s(n.title))])],1):e._e()]:e._e()]})],2)],1)},u=[],h=(t("6762"),t("2fdb"),t("7514"),t("28a5"),t("bd86")),d=(t("7f7f"),t("55f1")),p=(t("956a"),{name:"LeftBar",components:(a={},Object(h["a"])(a,d["a"].name,d["a"]),Object(h["a"])(a,d["a"].Item.name,d["a"].Item),Object(h["a"])(a,d["a"].ItemGroup.name,d["a"].ItemGroup),Object(h["a"])(a,d["a"].SubMenu.name,d["a"].SubMenu),Object(h["a"])(a,d["a"].Divider.name,d["a"].Divider),a),props:{},data:function(){return{menus:[],defaultOpenKeys:[]}},computed:{leftBarCollapse:function(){return this.$store.state.leftBarCollapse},defaultSelectedKeys:function(){var e=this.$route.path;return["/".concat(e.split("/")[1])]},logoStyle:function(){return{left:this.$store.state.leftBarCollapse?"-200px":0}}},watch:{$route:function(){this.initRouter()},leftBarCollapse:function(e){e?this.defaultOpenKeys=[]:this.initRouter()}},created:function(){this.menus=[{title:this.$t("components.monitor"),path:"/monitor",key:"monitor",icon:"icon-yibiaopan"},{title:this.$t("components.usersAcl"),path:"/users_and_acl",key:"usersAcl",icon:"icon-kongjian"},{title:this.$t("components.clients"),path:"/clients",icon:"icon-guanlianshebei"},{title:this.$t("components.topics"),path:"/topics",icon:"icon-zuzhiqunzu"},{title:this.$t("components.subscriptions"),path:"/subscriptions",icon:"icon-shebeiguanli"},{title:this.$t("components.rules"),key:"rules",icon:"icon-guizeyinqing",children:[{title:this.$t("components.rule"),key:"rules.ruleEngine",path:"/rules",parentKey:"rules"},{title:this.$t("components.resources"),key:"rules.resources",path:"/resources",parentKey:"rules"},{title:this.$t("components.schemas"),key:"rules.schema",path:"/schemas",parentKey:"rules"}]},{title:this.$t("components.modules"),key:"modules",path:"/modules",icon:"icon-changjingguanli"},{title:this.$t("components.plugins"),key:"plugins",path:"/plugins",icon:"icon-kongjian"},{title:this.$t("components.alerts"),key:"alerts",path:"/alerts",icon:"icon-gaojingkongxin"},{title:this.$t("components.tool"),key:"tools",icon:"icon-gongju",children:[{title:"WebSocket",key:"tool.WebSocket",path:"/websocket",parentKey:"tools"}]},{title:this.$t("components.setting"),key:"setting",path:"/setting",icon:"icon-icon_shezhi"},{title:this.$t("components.general"),key:"general",icon:"icon-fenzuguanli",children:[{title:this.$t("components.application"),key:"general.application",path:"/application",parentKey:"general"},{title:this.$t("components.users"),key:"general.user",path:"/users",parentKey:"general"},{title:this.$t("components.blacklist"),key:"general.blacklist",path:"/blacklist",parentKey:"general"},{title:this.$t("components.backup"),key:"general.backup",path:"/backup",parentKey:"general"}]}],this.initRouter()},methods:{handleClick:function(e){this.$router.push({path:e.key})},titleClick:function(){},initRouter:function(){var e=this;if(!this.leftBarCollapse){var n=this.$route.path;this.menus.forEach(function(t){t.key&&t.children&&t.children.find(function(e){return n.includes(e.path)||n===e.path})&&(e.defaultOpenKeys.includes(t.key)||e.defaultOpenKeys.push(t.key))})}}}}),m=p,f=(t("65ae"),t("2877")),z=Object(f["a"])(m,l,u,!1,null,null,null),b=z.exports,g=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"nav-header",style:e.navHeadStyle},[t("div",{staticClass:"pull-left"},[t("div",{staticClass:"func-item",on:{click:e.toggleLeftNarCollapse}},[t("i",{class:["iconfont",e.$store.state.leftBarCollapse?"el-icon-s-unfold":"el-icon-s-fold"],staticStyle:{"font-size":"20px","line-height":"41px"}})])]),t("breadcrumb"),t("div",{staticClass:"pull-right"},[t("el-tooltip",{attrs:{effect:"dark",content:e.alertText,placement:"bottom","visible-arrow":!1}},[t("div",{staticClass:"alert-info func-item"},[t("a-badge",{attrs:{count:e.alertCount}},[t("router-link",{staticClass:"iconfont icon-Notificationlisttongzhiliebiao",attrs:{to:"/alerts/list",tag:"i"},on:{click:e.clearAlert}})],1)],1)]),t("el-dropdown",{staticClass:"user-info-dropdown",attrs:{placement:"bottom"},on:{command:e.handleLanguageDropdownCommand}},[t("div",{staticClass:"user-info func-item"},[t("span",[t("i",{staticClass:"iconfont icon-i18n"})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{class:{active:"en"===e.language},attrs:{command:"en"}},[e._v("English")]),t("el-dropdown-item",{class:{active:"zh"===e.language},attrs:{command:"zh"}},[e._v("中文")])],1)],1)]),e.$hasShow("navbar.user")?t("el-dropdown",{staticClass:"user-info-dropdown",attrs:{placement:"bottom"},on:{command:e.handleDropdownCommand}},[t("div",{staticClass:"user-info func-item"},[t("span",[e._v(e._s(e.username))]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"application"}},[e._v(e._s(e.$t("components.applicationManagement")))]),t("el-dropdown-item",{attrs:{command:"users"}},[e._v(e._s(e.$t("components.usersManagement")))]),t("el-dropdown-item",{attrs:{divided:"",command:"login"}},[e._v(e._s(e.$t("components.logOut")))])],1)],1)]):e._e()],1)],1)},v=[],_=(t("96cf"),t("3b8d")),k=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"breadcrumb"},[t("a-breadcrumb",[t("a-breadcrumb-item",[t("router-link",{staticClass:"btn btn-default raw",attrs:{to:"/",tag:"span"}},[e._v("\n "+e._s(e.$t("Base.homePage"))+"\n ")])],1),e.isIndex?e._e():[t("a-breadcrumb-item",[e.backPath?t("router-link",{staticClass:"btn btn-default raw",attrs:{to:e.backPath,tag:"span"}},[e._v("\n "+e._s(e.currentTitle)+"\n ")]):t("span",{staticClass:"btn btn-default raw"},[e._v("\n "+e._s(e.currentTitle)+"\n ")])],1),e.oper?t("a-breadcrumb-item",[t("span",{staticClass:"btn btn-default raw"},[e._v("\n "+e._s(e.oper)+"\n ")])]):e._e()]],2)],1)},y=[],S={name:"Breadcrumb",data:function(){return{isIndex:!1,backPath:void 0,currentTitle:"",oper:""}},watch:{$route:function(){this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route,n=e.path,t=e.query,a=e.name,r=n.split("/"),s=r[1],i=t.oper||r[2];this.isIndex="/monitor"===n,this.oper="",this.backPath=void 0,this.currentTitle=this.$t("components.".concat(s)),["create","view","detail","add","select","manage"].includes(i)?(this.oper=this.$t("Base.".concat(i)),this.backPath="/".concat(s)):"node"===i&&(this.currentTitle=this.$t("Overview.nodeData")),"pluginsName"===a&&this.$route.params.pluginName&&(this.oper=this.$route.params.pluginName,this.backPath="/".concat(s))}}},T=S,w=(t("28e0"),Object(f["a"])(T,k,y,!1,null,null,null)),C=w.exports,A=t("2934"),x={name:"NavHeader",components:{Breadcrumb:C},props:{},data:function(){return{}},computed:{alertCount:function(){return this.$store.state.alertCount},navHeadStyle:function(){return{left:this.$store.state.leftBarCollapse?"80px":"201px"}},username:function(){return this.$store.state.user.username||this.$t("components.notLoggedIn")},alertText:function(){return this.alertCount>0?"".concat(this.$t("components.theSystemHas")," ").concat(this.alertCount," ").concat(this.$t("components.noteAlertClickView")):this.$t("components.noWarning")},language:function(){return this.$store.state.lang}},created:function(){this.loadData(),this.setHtmlLangAttr(this.language)},mounted:function(){window.onfocus=this.loadData()},methods:{setHtmlLangAttr:function(e){document.querySelector("html").setAttribute("lang",e)},handleLanguageDropdownCommand:function(e){this.language!==e&&(this.setHtmlLangAttr(e),this.$store.dispatch("SET_LANGUAGE",e))},clearAlert:function(){},loadData:function(){var e=Object(_["a"])(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(A["b"])();case 2:n=e.sent,this.$store.dispatch("SET_ALERT_COUNT",(n||[]).length);case 4:case"end":return e.stop()}},e,this)}));function n(){return e.apply(this,arguments)}return n}(),logout:function(){var e=this;this.$store.dispatch("UPDATE_USER_INFO",{logOut:!0}),setTimeout(function(){e.$message.success(e.$t("components.loggedOut")),e.$router.push("/login")},300)},toggleLeftNarCollapse:function(){var e=!this.$store.state.leftBarCollapse;this.$store.dispatch("SET_LEFT_BAR_COLLAPSE",e)},handleDropdownCommand:function(e){var n=this;e&&("login"===e?this.$msgbox.confirm(this.$t("components.whetherToLogOutOrNot"),{confirmButtonText:this.$t("components.signOut"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(function(){n.logout()}).catch(function(){}):this.$router.push({path:"/".concat(e)}))}}},E=x,P=(t("5a4e"),Object(f["a"])(E,g,v,!1,null,"72830772",null)),q=P.exports,D=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"nav-tabs",style:{left:e.$store.state.leftBarCollapse?"80px":"201px"}},[t("el-scrollbar",{ref:"scrollContainer",staticClass:"scroll-container",attrs:{vertical:!1}},[t("el-button",{class:{active:e.isIndex},attrs:{plain:"",size:"mini"},on:{click:function(n){return e.$router.push("/")}}},[e._v("\n "+e._s(e.$t("Base.homePage"))+"\n ")]),e._l(e.tabs,function(n,a){return t("el-button",{key:a,class:{active:n.url===e.currentUrl},attrs:{plain:"",size:"mini"},on:{click:function(t){return e.navTab(n)}}},["node"===n.name?[e._v("\n "+e._s(e._f("getNodeName")(n.url))+"\n ")]:"clientid"===n.name?[e._v("\n "+e._s(e._f("getClientId")(n.url))+"\n ")]:"ruleId"===n.name||"resourceId"===n.name||"schemaName"===n.name?[e._v("\n "+e._s(e._f("getParamsId")(n.url))+"\n ")]:[e._v("\n "+e._s(e.$t("components."+n.name))+"\n ")],t("a",{staticClass:"btn-close",attrs:{href:"javascript:;"},on:{click:function(t){return t.stopPropagation(),e.closeTab(n)}}},[t("i",{staticClass:"el-icon-close"})])],2)})],2)],1)},M=[],N=(t("20d6"),t("90b9")),L={name:"NavTabs",components:{},filters:{getNodeName:function(e){return Object(N["h"])(e,"name")},getClientId:function(e){return Object(N["h"])(e,"clientid")},getParamsId:function(e){var n=e.split("?")[0];return n.split("/")[2]}},data:function(){return{isIndex:!0,isActive:!1}},computed:{tabs:function(){return this.$store.state.navTabs},currentUrl:function(){return this.$route.fullPath}},watch:{$route:function(){this.loadTabs()}},created:function(){this.loadTabs()},methods:{getTabName:function(e,n){return"monitor"===e&&"node"===n?"node":"rules"===e&&"create"===n?"ruleCreate":"schemas"===e&&"create"===n?"schemaCreate":"modules"===e&&"select"===n?"selectModules":e},loadTabs:function(){var e=this.$route,n=e.path,t=e.fullPath,a=e.query,r=n.split("/"),s=r[1],i=a.oper||r[2];if(this.isIndex="/monitor"===n,!this.isIndex){s=this.getTabName(s,i);var o=this.tabs.findIndex(function(e){return e.url===t||e.name===s});if(-1===o){var c={name:s,url:t};this.$store.dispatch("ADD_NAV_TABS",c)}}},navTab:function(e){this.$router.push({path:e.url})},closeTab:function(e){var n=this;this.$store.dispatch("REMOVE_NAV_TABS",e).then(function(t){var a=e.url===n.currentUrl;if(a){var r=t.length-1,s="/";-1!==r&&(s=t[r].url),n.$router.push({path:s})}})}}},O=L,R=(t("d8f3"),Object(f["a"])(O,D,M,!1,null,null,null)),I=R.exports,j={name:"Layout",components:{NavHeader:q,LeftBar:b,NavTabs:I},data:function(){return{collapsed:!1,theme:"light"}},computed:{elAsideWidth:function(){return this.$store.state.leftBarCollapse?"auto":"200px"},elMainStyle:function(){return{marginLeft:this.$store.state.leftBarCollapse?"80px":"200px"}}}},U=j,B=(t("52af"),Object(f["a"])(U,o,c,!1,null,"24e2d574",null)),$=B.exports,Q=i["a"].state.config.hide||{routes:[],children:[]},F=[{path:"/login",name:"login",meta:{hideKey:"base",authRequired:!1},component:function(){return t.e("chunk-4aeced56").then(t.bind(null,"8ebf"))}},{path:"/login/:username/:password",name:"login-no-auth",meta:{hideKey:"base",authRequired:!1},component:function(){return t.e("chunk-4aeced56").then(t.bind(null,"8ebf"))}},{path:"/",component:$,redirect:"/monitor",meta:{hideKey:"monitor",authRequired:!0},children:[{path:"/monitor",name:"monitor",component:function(){return Promise.all([t.e("chunk-a950fa80"),t.e("chunk-69b6fda6")]).then(t.bind(null,"269c"))}},{path:"/monitor/node",name:"node",component:function(){return t.e("chunk-59e5d464").then(t.bind(null,"4aed"))}}]},{path:"/users_and_acl",component:$,meta:{hideKey:"usersAcl",authRequired:!0},children:[{path:"",name:"users_and_acl",component:function(){return Promise.all([t.e("chunk-3adcb268"),t.e("chunk-c5bf9d5c"),t.e("chunk-ead04a98"),t.e("chunk-19e46f15")]).then(t.bind(null,"9be9"))}}]},{path:"/clients",component:$,meta:{hideKey:"clients",authRequired:!0},children:[{path:"",name:"clients",component:function(){return t.e("chunk-cfe3eeda").then(t.bind(null,"101d"))}},{path:"detail",name:"clients-view",component:function(){return t.e("chunk-53e9a7a2").then(t.bind(null,"b62e"))}}]},{path:"/topics",component:$,meta:{hideKey:"topics",authRequired:!0},children:[{path:"",name:"topics",component:function(){return t.e("chunk-2d0d7a87").then(t.bind(null,"786f"))}}]},{path:"/subscriptions",component:$,meta:{hideKey:"subscriptions",authRequired:!0},children:[{path:"",name:"subscriptions",component:function(){return t.e("chunk-73c7a756").then(t.bind(null,"df2a"))}}]},{path:"/schemas",component:$,meta:{hideKey:"schemas",authRequired:!0},children:[{path:"",name:"schemas",component:function(){return t.e("chunk-39509ba9").then(t.bind(null,"c993"))}},{path:":id",name:"schemas-details",component:function(){return Promise.all([t.e("chunk-3adcb268"),t.e("chunk-d3537170")]).then(t.bind(null,"906d"))}}]},{path:"/rules",component:$,meta:{hideKey:"rules",authRequired:!0},children:[{path:"",name:"rules",component:function(){return t.e("chunk-1aa6ec30").then(t.bind(null,"4ed8c"))}},{path:"create",name:"rules-create",component:function(){return Promise.all([t.e("chunk-3adcb268"),t.e("chunk-2d0be333"),t.e("chunk-8ed2d5e8"),t.e("chunk-3208fb9c"),t.e("chunk-2095c2f3")]).then(t.bind(null,"e94e"))}},{path:":id",name:"rules-view",component:function(){return Promise.all([t.e("chunk-3adcb268"),t.e("chunk-2d0be333"),t.e("chunk-8ed2d5e8"),t.e("chunk-3208fb9c"),t.e("chunk-94b856f2")]).then(t.bind(null,"6c3e"))}}]},{path:"/resources",component:$,meta:{hideKey:"rules",authRequired:!0},children:[{path:"",name:"resources",component:function(){return Promise.all([t.e("chunk-2d0be333"),t.e("chunk-8ed2d5e8"),t.e("chunk-e7f1aeea")]).then(t.bind(null,"e9f7"))}},{path:":id",name:"resources-view",component:function(){return t.e("chunk-4a5c704e").then(t.bind(null,"3d99"))}}]},{path:"/alerts",component:$,redirect:"/alerts/list",meta:{hideKey:"alerts",authRequired:!0},children:[{path:"list",name:"alerts",component:function(){return t.e("chunk-47a06954").then(t.bind(null,"9b7b"))}}]},{path:"/websocket",component:$,meta:{hideKey:"tools",authRequired:!0},children:[{path:"",name:"websocket",component:function(){return Promise.all([t.e("chunk-a950fa80"),t.e("chunk-c5bf9d5c"),t.e("chunk-5f0ec173")]).then(t.bind(null,"175c"))},meta:{keepAlive:!0}}]},{path:"/blacklist",component:$,meta:{hideKey:"general",authRequired:!0},children:[{path:"",name:"blacklist",component:function(){return Promise.all([t.e("chunk-a950fa80"),t.e("chunk-2be77691")]).then(t.bind(null,"0ea8"))}}]},{path:"/backup",component:$,meta:{hideKey:"general",authRequired:!0},children:[{path:"",name:"backup",component:function(){return t.e("chunk-7a115fb5").then(t.bind(null,"0dba"))}}]},{path:"/trace",component:$,meta:{hideKey:"general",authRequired:!0},children:[{path:"",name:"trace",component:function(){return t.e("chunk-2d2134e7").then(t.bind(null,"abb2"))}}]},{path:"/application",component:$,meta:{hideKey:"general",authRequired:!0},children:[{path:"",name:"application",component:function(){return Promise.all([t.e("chunk-a950fa80"),t.e("chunk-214e9a45")]).then(t.bind(null,"51ac"))}}]},{path:"/users",component:$,meta:{hideKey:"general",authRequired:!0},children:[{path:"",name:"users",component:function(){return t.e("chunk-1de6578b").then(t.bind(null,"872a1"))}}]},{path:"/setting",component:$,meta:{hideKey:"setting",authRequired:!0},children:[{path:"",name:"setting",component:function(){return Promise.all([t.e("chunk-2d0be333"),t.e("chunk-7b01e2fb")]).then(t.bind(null,"3f42"))}}]},{path:"/plugins",component:$,meta:{hideKey:"plugins",authRequired:!0},children:[{path:"",name:"plugins",component:function(){return t.e("chunk-7a82b09c").then(t.bind(null,"80f9"))}},{path:"/plugins/:pluginName",name:"pluginsName",component:function(){return Promise.all([t.e("chunk-3adcb268"),t.e("chunk-c5bf9d5c"),t.e("chunk-ead04a98"),t.e("chunk-19e46f15")]).then(t.bind(null,"9be9"))}}]},{path:"/modules",component:$,meta:{hideKey:"modules",authRequired:!0},children:[{path:"",name:"modules",component:function(){return Promise.all([t.e("chunk-174a5ac2"),t.e("chunk-a8ae90d8")]).then(t.bind(null,"1959"))}},{path:"select",name:"modules-select",component:function(){return Promise.all([t.e("chunk-174a5ac2"),t.e("chunk-32291c05")]).then(t.bind(null,"2e41"))}},{path:"detail",name:"module-detail",component:function(){return Promise.all([t.e("chunk-2d0be333"),t.e("chunk-18aaaf52")]).then(t.bind(null,"2c0e"))}},{path:"manage",name:"module-manage",component:function(){return Promise.all([t.e("chunk-3adcb268"),t.e("chunk-c5bf9d5c"),t.e("chunk-ead04a98"),t.e("chunk-a14add7e")]).then(t.bind(null,"fcce"))}}]},{path:"*",component:$,meta:{},children:[{path:"",name:"not-found",component:function(){return t.e("chunk-6c281630").then(t.bind(null,"6a7e"))}}]}];Q.routes&&Q.routes.length&&Q.routes.forEach(function(e){F=F.filter(function(n){return n.meta.hideKey!==e})});var K=F;r["default"].use(s["a"]);var V=new s["a"]({mode:"hash",base:"/",scrollBehavior:function(e,n,t){return"/modules/detail"===e.path||e.meta.keepAlive&&t?t:{x:0,y:0}},routes:K});V.beforeEach(function(e,n,t){var a=n.meta,r=a.authRequired,s=void 0!==r&&r,o=a.before,c=a.hideLeftBar,l=void 0!==c&&c,u=e.meta.hideLeftBar,h=void 0!==u&&u;s&&!Object(N["e"])().username?Object(N["p"])():(o&&o(),h!==l&&i["a"].dispatch("SET_LEFT_BAR_COLLAPSE",!l),t())});n["a"]=V},e4be:function(e,n,t){"use strict";t.r(n),n["default"]={__not:[],alarm:{zh:"告警",en:"Alarm"},currentAlarm:{zh:"当前告警",en:"Current Alarm"},historyAlarm:{zh:"历史告警",en:"History Alarm"},node:{zh:"节点",en:"Node"},type:{zh:"类型",en:"Type"},triggerThreshold:{zh:"触发阈值",en:"Trigger threshold"},triggerNode:{zh:"触发节点",en:"Trigger Node"},alarmMsg:{zh:"告警消息",en:"Alarm Message"},alarmName:{zh:"告警名称",en:"Alarm Name"},activateAt:{zh:"开始时间",en:"Activate At"},deactivateAt:{zh:"结束时间",en:"Deactivate At"},duration:{zh:"持续时间",en:"Duration"},alarmLevel:{zh:"告警级别",en:"Alarm level"},system:{zh:"系统",en:"System"},describe:{zh:"描述",en:"Description"},state:{zh:"状态",en:"State"},alarmValue:{zh:"告警值",en:"Alarm value"},alarmTime:{zh:"告警时间",en:"Create At"},clearanceTime:{zh:"清除时间",en:"Clearance time"},endingTime:{zh:"结束时间",en:"Ending time"},delete:{zh:"删除",en:"Delete"},alarms:{zh:"告警列表",en:"Alarms"},normal:{zh:"正常",en:"normal"},abnormal:{zh:"异常",en:"Alarm"},second:{zh:"次",en:"second"},durationTips:{zh:"日:时:分:秒",en:"Days: Hours: Minutes: Seconds"}}},f9f6:function(e,n,t){"use strict";t.r(n),n["default"]={logTraceDescription:{zh:"支持针对 ClientID 或 Topic 过滤日志并输出到文件。在使用日志追踪之前,必须将 primary log level 设置为 debug",en:"Support filtering logs for ClientID or Topic and output to files. Before using log tracking,\n the primary log level must be set to debug"},createTrace:{zh:"创建 Trace",en:"Create Trace"},viewTrace:{zh:"查看 Trace",en:"View Trace"},filter:{zh:"过滤器(客户端 ID/主题)",en:"Filter(clientId/topic)"},type:{zh:"类型",en:"Type"},level:{zh:"等级",en:"Level"},logPath:{zh:"日志路径",en:"Log Path"}}}}); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-174a5ac2.b9cebe6b.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-174a5ac2.b9cebe6b.js new file mode 100644 index 000000000..0db8c1c53 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-174a5ac2.b9cebe6b.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-174a5ac2"],{"07ff":function(A,n,t){A.exports=t.p+"static/img/prometheus.59114669.png"},"08d0":function(A,n,t){A.exports=t.p+"static/img/kafka_consumer.e4c070e2.png"},"0a51":function(A,n,t){A.exports=t.p+"static/img/pulsar_consumer.be9aa2e9.png"},"0c68":function(A,n,t){A.exports=t.p+"static/img/mqtt_sn_protocol.4186d81f.png"},"0eba":function(A,n,t){A.exports=t.p+"static/img/stomp_protocol.14cf6644.png"},"0fde":function(A,n,t){A.exports=t.p+"static/img/gbt32960_protocol.9ea5fd31.png"},1124:function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACxpJREFUeAHtnV1sXEcVx8/u2rt2HCeOEwc7TkiaxE1pcQghVgoUUbUVUFFAFQ+Fl1YgBOINXnnlgSfggReQKAiJhwoEL6XiKy1taQOFlDYtTZsmcRonzWeTOP5c75c5Z93Nzp29u3Y8d5cze/8jWXv33pm5Z8757ZkzM9dzEzNz+UVCggZWqYHkKsuhGDRQ1gAAAghOGgBATupDYQAEBpw0AICc1IfCAAgMOGkAADmpD4UBEBhw0gAAclIfCgMgMOCkAQDkpD4UBkBgwEkDAMhJfSgMgMCAkwYAkJP6UBgAgQEnDQAgJ/WhMAACA04aAEBO6kNhAAQGnDTQ4VQ64sIvnS/QE8cWIq41ftX9+IGeljUaHqhlqm7PGwGg9rRry1oFgFqm6va8EQBqT7u2rFUAqGWqbs8bAaD2tGvLWgWAWqbq9rxRS+eBXr1caKjFialSw+sj/Un6xNbOhnna/eIH16Xo+y/MqWlmSwH61Wtuk4QnrpXoxDW3OtRofpWCfOXOzCpLNqcYurDm6DU2tQKg2Ji6OQ0FQM3Ra2xqBUCxMXVzGgqAmqPX2NQKgGJj6uY0tKXD+OWasG+zKnGWE7cp1yeminQt68++p6os9theXXMcTSFkmUrlgTp5sM6XhC7MF0splRMAKTWML2IBIF8spVROAKTUML6IBYB8sZRSOQGQUsP4IhYA8sVSSuUEQEoN44tYAMgXSymVEwApNYwvYgEgXyylVE4ApNQwvogFgHyxlFI5AZBSw/giFgDyxVJK5QRASg3ji1gAyBdLKZUTACk1jC9iASBfLKVUTgCk1DC+iAWAfLGUUjkBkFLD+CIWAPLFUkrlBEBKDeOLWADIF0splRMAKTWML2IBIF8spVROVf8bb+toOrdIx94r0snrRZpeKFG2mKD+rgRt7E7SbX1JunNTyi5S831yYZH+y5t7np4s0XSuRAulBPXwPp0Da5J0R3+Kbt+YolSipljNiYuzJXr1UjFw/oEdndQR8hM8fC5PU7lA1sCXbta6tKG/O0Fb1oZUEMit+4tKgAq8Weuhd/L0zDs5ylsbt565UVXo1nVJemhXmvYwBHbK8v4ET53KkRizFLLZxZtUpOcn8mzIBH1xJEN7N9fWYdb5NMtz5EJw04NNXPbAUK0KX3y3QOenLcHNyoxjAehBbsOHBxrf3yii6lAd/gLMz49m6c/jtfDYmjvH2wL/7JUsHbU8wxR7nZ8cmacXzobDY9ZzdX6Rfvlalv40njdPB47n8ovsfYLwSIbD52rPBQqu4Mv5mRI9zu0VmH1M6gD6zZsLdPxqsKtopFhxLr9+I0sTN5bKFPnE47ydsBjmVpIA+0/2HGHp3+x5xCva6TTfU7q2KNKTJ3N04RZljuK+rnXU+l/XGh3KH79WLHcTEpKYvY7EOrs3pGgDdxmT7DFeZm8g3ifBGRc5oxj36TN5+treFP3tTO4mTKYo+z/QQdu4y+vNJOjyLMdFV7ibsQz2++MLdBffS/KY6R91wJI8cu3h29Nm9prjTRzvjBpd1Gxhkcavl+i9+Sp80obXWSbfkiqAnnvfjZvwfHlPmu7ZFtyd/tPbO8vdzuuXq55Kgu0ZDrqfnwgaoZN97Nc/0kV3WHHSZ3Z20m/Z25mbOUn3+dzZAj20u3q/8ckiXWrgZY5cyHP+NMl96qWhXo6zLMgkLvvB4fkARAJ010oi+no3+j+cb9Ds1kvzttV1jWxI1sAjUol/+NzO4K9efsF/OZ3nkZaJH9GnGD4bHqlD7PTwngytTQe9jXgmM9nex7bvHIcuR0PiI7OOsOMk33Zjd/DKjIeb8KvyQBK/mOngcNUTmOflWEYvj3woQ0Xpw95PJ/lVCHayvZd5PcMDnwODHfSsEcCKt5GgeU1novxpB88f53d1vMXezux+JJgOG42Z9zKPxfuc4mmF0zeC8g5ymwphQ0azsLJjVQDZupFhcqN093BQ/EuzwckXmaPZwPNGjdLAmtrrU+zFBKCw4PkgD9vX81aOT52sGr8STA/2hDv0N64U6XvPzpbFENxliiEsDXNXd+ZG9QcRlkfbufAWK5FSjHgracFyYT1W9xRW19p0rQpyHORKskdlW3qTJHNPY4Od5W7UrM/u6sxr4lTmGRr5qwePeNSxofoe16xP03HwJ6xJMpZFPMHAmvpCXZkr0Tx3N5VUqMbU5VNTvF2uGE/ijXrperbqSSp5uhlcCZ7tIbrML/3wX/PlbFKnyasE01/gYDpsZrpSb71PmV1/dDSzqrL16mzVedUAXeHh9q6++qr46X+ygT2VbeMJWhd5ZCOeo16y514EjPWZJAfktRGtjPLkLyxJMC3x0kpjoV72jv08vB8bStHdHOvZwXnYPTSeUwWQACCjqUr6Oy9D2HFO5drbHDDbG3Lftz3Nhg/GQX/l5ZDHRrsqxQKf19lDvXwxGJBs4xe6SSBrB8+BgnW+1AumZanlqxzwV5J4uLSfKxeVJtz8rP/TvJmldQd7B4I8y3rS747nAlCJNFd5Au6JY9mAYDIcl7kdO5CVBdAnT+QC3Y0UlO7vF7yEYQIr5w8MpkKDZ7m2XKoE03Y+gWU9d1OVv3aBR9oZtJjd8hZ/v3d7B73C3YDZSch61lFeTR/mILOPjTDJXuMEz1ib8YeIOcbDcekGPrurk+w3Iz7Ds9RH2NMMc1cmXYfMRJ+bLtbA08cz0DJ18KOXluKcSvPX8flvfbTWi12dWyxDWMknn42CaTNfuxyrAki6j/t3pOkQdzsS91ZAmubg9a2FaoQs18x02/oUPcgBrCR538axoWLZi5h5JACeMuowr8mxxD6P8qsWzvK7KuzgWeaKwh672LJ2aT7KXBKRYLqn0bS0fWPPv6vqwkSXn+dlhHt5qaICT5h+zWvSZX1jXyawlPAIv1f04JaV/za6OOs393WRgBjmQQ5a802mTGPW4xwSTEv3GJe0ci23UCNfGkmXH/aSFep36zxXIzHP/fxA1z08M2yPvqQrk5fT3rWpg/7Iq+z2SKvSFMm3n72LPI8jE45hj23sYKg288Nn9dLHGKA/sJx2l1ovf7udVwmQKFlGLnt4sUhGWqfkiUR+mjBbkKcREzw3lKCtvallRzKj/JDY6ObuskcY56WDKX6qMcdPNfZwbycr5CP8RKIsZ5jp2/uDsU5fV314pJzEVN8Z66ZcgyWInlucEDXl0X6sFqCK4mSSrd/qJirXVvopj6/K33JJZr539llELVeIr8vsdFxTfFseV4tH3G4AFLFC41YdAIqbxSNuLwCKWKFxqw4Axc3iEbcXAEWs0LhVB4DiZvGI2wuAIlZo3KoDQHGzeMTtBUARKzRu1QGguFk84vYCoIgVGrfqAFDcLB5xewFQxAqNW3UAKG4Wj7i9AChihcatOgAUN4tH3F4AFLFC41YdAIqbxSNuLwCKWKFxqw4AeWbxFyPYGTbKJgOgKLXZgrrkP2c1JQCkyRoeygKAPDSaJpEBkCZreCgLAPLQaJpEBkCarOGhLADIQ6NpEln95gqalKVBlk9u7aDdvKuIlqQKoO8eWtqMW4tyNMohu7jJLmxaErowLZbwVA4A5KnhtIgNgLRYwlM5AJCnhtMiNgDSYglP5QBAnhpOi9gASIslPJUjMSObIyNBA6vUADzQKhWHYksaAEAgwUkDAMhJfSgMgMCAkwYAkJP6UBgAgQEnDQAgJ/WhMAACA04aAEBO6kNhAAQGnDQAgJzUh8IACAw4aQAAOakPhQEQGHDSAAByUh8KAyAw4KQBAOSkPhQGQGDASQMAyEl9KAyAwICTBv4H3irZ8ohYpM0AAAAASUVORK5CYII="},1775:function(A,n,t){var g={"./auth_sasl.png":"f7e2","./coap_protocol.png":"1124","./delayed_publish.png":"7ff7","./exhook.png":"64f1","./exproto.png":"9ab4","./gbt32960_protocol.png":"0fde","./hot_confs.png":"7b60","./http_authentication.png":"7391","./internal_acl.png":"aad0","./jt808_protocol.png":"8217","./jwt_authentication.png":"beb7","./kafka_consumer.png":"08d0","./ldap_authentication.png":"4e1a","./lwm2m_protocol.png":"5d60","./mnesia_authentication.png":"9defa","./mongo_authentication.png":"1d15","./mqtt_sn_protocol.png":"0c68","./mqtt_subscriber.png":"548a","./mysql_authentication.png":"7848","./pgsql_authentication.png":"65be","./presence.png":"3ec8","./prometheus.png":"07ff","./psk_authentication.png":"94a9","./pulsar_consumer.png":"0a51","./recon.png":"efbf","./redis_authentication.png":"8b77","./reloader.png":"4c41","./retainer.png":"7a95","./sasl_authentication.png":"6367","./stomp_protocol.png":"0eba","./subscription.png":"b9ef","./tcp_protocol.png":"edff","./topic_metrics.png":"9372","./topic_rewrite.png":"8000"};function o(A){var n=r(A);return t(n)}function r(A){var n=g[A];if(!(n+1)){var t=new Error("Cannot find module '"+A+"'");throw t.code="MODULE_NOT_FOUND",t}return n}o.keys=function(){return Object.keys(g)},o.resolve=r,A.exports=o,o.id="1775"},"1d15":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAADpNJREFUeAHtnWlwHMUVx9/eu1pJu5JlSysJ+XaMMTa28BmMynaApPgQ+ECRGyephCRVKYeEMhDjCiQQIBUoXCkoCAFSFQKBFFQgJuHwFR8YYYRtbAsjJEuWbVmXdWt1rHaVadl7n7PT071vpufLzvT09f79256e7p5uw5DXNwniEApkqYAxy3AimFBgSgEBkABBkQICoBTyNfc1prgrbhEFBEBJOBgcH4Qj7bVJ7grnoAICoKASMb9tg2eg29sJHcMXYu6Iy0gFBECRakScH+usg1H/KLz12RsRruI0VgEBUKwi0nXPSBfsaX4XxidGYWfjTujydiTwJZyIAgKgGA4CkwF48dhT4Av4YFQCiFy/fuK1GF/iMqiAACioxOXfvx1/Bj7rPjl1NTLhnfrd1bQTGi9+HuNTXBIFBECXORiTapun6h6D/a17QmSQGih4PHv46anaKHgtfi8pIACSdOgf6YHHDm2DIxc+juIiEqCW3hZ4u+HNqPviQtRA0Om9AI8cuh9a+1vieBiT3sIij5ePvgSNPacinXR/rusaqG3oLDx6cJvU39OVFASH2R66NxGYgEf2PgznB86G3PR+oluACDx/PPQgDIz1p2TAarFF3R8YG4AHd28THYyXVdElQF3edng8A3iIRlajJQogctE70gu/2blV9A9JWugOoP7RXnjiw99Bf5qaJ0iNxRwPELl30XsRHth1P/R4u4NedfmrK4DIq/r2ww9LNUdnxoVtNpqT+u0c6oQH92yDvtG+pH60fkM3AE3CJDx3bLv0tnVGVpmajaaU/tsG2uD3/3sAvL5LnY4pPWvwpm4AeuPUS3A0pp8nk/JMVQMFwzf3NMMf9j8E5C1Nb4cuAKrrOAT/bXwrq7I1GjOT6GTHSXi6dntWaWAOlJk6iC3s9LbBi0eeztoCoyFzifa37IPXTrycdVoYA2auDkLryIj6M3VPTI2qZ5t9kwyASBr/PP4q1J7/INvk0IXTNEBvNrwiu9EcW4IGoyHWKe31nz54UnG6aRPJEQ+aBaixtx7eafy3YpkNBvkAjU2MweMHHlVU8ynOOKMINAkQ6e95/shTVCQ0gnyASMLk9f6Fumep5CGXI9EkQG9+8aqszsJUBZRNDRSMb8/p3XCgdW/wUpO/mgPonPQ1xftN/6FYWNnVQMEM/PmjZ6BXGvbQ6qE5gF4+8RepzzlArbyyaAJFpT3iG4Fn6+g8TqMizpELTQFU27YPGi7SnfBlyLINFFm+defqYN+Z3ZFOmjnXDECkz+f1z+h34il7gIU5efHj52FwbDDsoJEzzQC0r/U96XsuFdoalAgaGh+Seqn/rhFswmZoAiAy+X1HQ+5/Qfpuwztwpu90WH0NnGkCoF0tO2BwfECd4qC4/BaZUvLCJ8+pk09OsaIHaMw/Bu81vc1JPvnJ1nfUw9H26M+H5MeSOyHQA3To/F4Y9g2ppyilNlBkBl85pp22EGqAyCPhvaYdkWWD4vx0z2n46Jw2RuxRA3Ss4zB0DrejgCY2k//4lH6XQ2waLK5RA7SrmeaQRWK5KbahoxI4239W+pT6cJQbxgu0AHWPdIRW0VBTeIP0mFTreOvUv9SKmlm8aAH68Nw+ZiKpldCJ9hPQ3It7IU+0AB04G16GRa0CZhHvjs+zm+zPIm+ZpIESoC966lMuiJCJ4Zn6mZxU7xFG8nCw5QAMjKrUCZqpkQr8oQSotm2/ApNlBlWhHygyB/5JPxxEPOkMJUCxC0FFFgjG851N72PM9lSe0QF0pr9RWhiB3bfoaj/CSCm09rVCU08DSojQAXS88whboVV+hAWN2duMc8IZOoCOSr3PTA9129AhUz5oPYhyEU9UAJG1fVr6mkOiMzlhVAORN7GG7nomJtFMBBVAjX105ztnJCSjGojkpfY8vs1dUAHU1Mu+oTlpYEfQh634RuhRAcRliV2VOxIja8Hu4W443fNFpFPOn6MByOcfl+YTM27/TBUfo0bQZVSOtn+S89BEZhANQK0DTUB6bVkfZNIay+N4+6csk1OcFhqAmqUORD0cp7pOAZnnjeVAA9CFwfN8NGXYBiIGknUWG7o5vG1mqS4agNqH2rI0UVmwSbZNoKnMnuw8rizTDEOjAaht8BxDWSKSYlwDkZRPdOBpB6EAaFj6LJjsosznYF8Fne3Ds5kLCoA6vZzaPxKx7PGBqUXLh8eH+fxfZKaKBCB+m96yfYkPl95FGdsxhEOxP0MBEMv5P/FFwAehbmnnaAwHCoAGpT26eB2sOxKDdnZJG7lgOFAANKTWyhs5XEJdw6IGolY8A+OpdxWkllCiiPg8waitMpvIJJpuKGogno+wAMUFO+UUnKiB5KiVxm+6fU3TBEd5e9Q3iiLfKGogsvI8r4PFVxmJbOMx8yBRPtK5oQAonRFq3qe55rScfGLZvA4JQDz6gy8Vd2CS3qLlcgDyB9jPfZKTv6BfFAAp2a8iaGi2v7wKUtRA2ZZYgnD86h+QZkGKGihBkYScUNRAfIY0L2kU4DCNlqTMq+YLkZHhCQqAjEp3PMlQjETeeAFkSrPdeKK88nBDAVCBrZCHNlNp8nqEuewubjbLSRgFQEWOaXJsouo3wOltyO1wU7VDrchQAFRs5wcQrw49UQNRRJ5nDcSrMVtoFzUQNYSK9FgD2UQbiB5AtiJqccmNiFdPdKEASG5RJfdf5qxMflPlOwbg00wszS9V2TI60fNRR2be3dJbmNvOpxbi1Qc10zVbpkp8vKMAiEgzt3g+F4WMBvYSuaUGtNvB5w8jV2T26sjN4WX/s93zsgypLBiPgdzZ0+YoyzTD0HgAcvGpgXi0geYUzWWIgLKk0ABU5ZorfSXKflyeRxtoZhGO9g9BDw1ADrMD5k1boOzvkkVoHm2guaIGyqKkMghS7VmVgS+6XgyMG9HlheUww1lG1wgVY0NTAxENls5YoaIUiaNmXQNdW7kycUZy1BUVQNPzyqCy8AqmUlqMFqbpLfdUM01PaWKoACLGVntWK7VZVniz0SzLvxLPpJ23cPpVSqJgHhYdQMvL2AJkYQjQsoplYDKYmEOgJEF0AFUUVMGCaQuV2CwrrJnhI2zlFWtk5S0XPKMDiIi2ftZXmWnHam5yvjUfVpYLgJgU7PLSVcBquoOR0SNl/dwNYDGxbbDTKCyUNZBJapfUzPwKDfvTxsGqTbJxzo1p85KLHlACRISsqbpBanCq/4bEoiNxUekiqGDcPUELRrQAuaVprjWz1K+FWIzG3zj/a7TKk3k8aAEiSt0851ZQvaNP5aXqPQUeWFN5HfOCp5UgaoBcjmLYMOcmWlpwiee2q78BrIdLaBqKGiAixI2zbwGryUpTk6i41Pysp0IaOP1y1fVR6WG7QA+QS/p64eb5t6qmu9+v3uocty35Jurah4iOHiBixE1zboGyfA85pX74pO2X1Diq3FWw9op1akTNNE5NAEQGPL+z+IeqCDfu96kS749W3MllhiVtYzQBEBFlYclSWFm5lrY+MDZOf/fADXM3SvldTD2vPCLUDEBEvNsXbgKnxUlVx2Gfl2p8ZMzr20s2UY2TZ2SaAsglfXx4xzU/oarn8BhdgL677A4otPNb74iqOFJkmgKIiLO8dDWsq1pPRSeHOQ9sZhuVuEgk1ZXVUr8VzjGvZCJoDiBi6O2LfgDT82Ykszlj90JrAeRZHBn7T+WRfG360xWbU3lBeU+TANnNdrhz+S9A6XRU0p7KM9mpFOzP12wGLItGyTFYkwARAWa558P3lvxYjhZxfvNNTrBTAOjrV94CS8qWx8WvBQfNAkQKZ23letgwO/vZi3kGO9gUDpMsK78GvrX0Di2wktAGTQNELL590Sb4UsmVCY1P5+gAKxSYsm8DkbGuzWu2oB+uSKWT5gEiMwp/Vn0PlBfIX6TKNmECJ2T3Fua0OuGemvuB/Gr50DxApPBIY/iulVuhSOYiVSZpFMPhky+RzWSDX0vwePIrtMzOlG3y1UEqSZGjBDav2iq9ludlbIFpxA/W4fGM/ROPpMbbcv29sKBkkaxwWD3rBiBSQJUFM+FXq7cB6SBMd5BaBEbHwTARkB5/mY30k4lhd627W7NvXIk00xVARICZrnnwy9VbgfQVpTqmO6aHbs/Lnxk6T3ZC+pzuXrcFVlXQH9BNlmYuuOsOICL6bPeCqZoo1cDrNGtxqHzK/KkbwuR7rntrtsKKCnwfBoaMzPJElwARrQhEW9b+Fly2xCvCuwxhaGx9o0kfY4XSRjD3rb0Hlmq0ozAdV7oFiAhDvrO/77qHpLel8jidnL7oedYrnAvj/JQXlMNDNzwCV1eyX7coLjOcHHQNENG8xFEK9659GK4suSqqCCwD0TMRC3vGYdmMJSE/1Z5l8OhNT4Ani/6lUCQaODEMeX2TGrBDsQlkV55X6/8Ku5vfAY/TAyt6EnQ8Go3QUTwJ0/JK4NZrNwGLjw4VG6ZyBAKgGIFr2/ZBy4V6cLQMxNy5dFlQWAw1G78PRiQ7CiY0gqKj7h9hsVquKr8eritN/q3W4iXrBTwRogmAIsQInpaWzUsIicORD9NL8SwCHrRHzV8BUAJ1zWYrlHriF/v2lM9L4FvfTgKgJOVfXBz/al/gCvdOJwmmO2cBUJIid7nj9+vKd+LYQSeJSao4C4CSyFrgigfIaks/CJskOs06C4CSFK1NgsVqi56NaLFGXycJqitnAVCK4nbmRX8AaBB9P3FqCYDiJAk72PMKwhfSGeaFoKIMoXghAEohpsMRWwMJuWLlEorEKhJxbYtp87BYsTUieRSnAqAUxWS2RE/pEIOn8WIJgOI1CbmQHunIIxBQb7m7yHQwnQuAUpSWyRy99UBApeXuUmQh528JgFIVUcx2lwG/OuslpspCrt8TAKUoIZvFLo3KhyXy++V9I5Yias3cEhPK0hSlzzcGHRca4HxrPSxcXAMuN54NcdOYRuW2AIiKjPqNJFw/61cDYbkCBQRACsQTQQH+D2nQZqbLPYHkAAAAAElFTkSuQmCC"},"3ec8":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACl5JREFUeAHtnXtsHEcdx3/ns8+O7+z4eY7tNE3sxHVK2iZBIjTtHw0tSYCmSQFRIWgbkJCQUCUiBKoQ0DaIVggBUpEQBSQqAogqqCkEqS20adMGaOkLKInjpHGb5mHHjt+P+G3md07rEMszuzc3dzO7359k+eyd3zy+v8/N7s7M7kSGRiZmCAYF0lQgL00/uEGBlAIACCBoKQCAtOSDMwACA1oKACAt+eAMgMCAlgIASEs+OAMgMKClAADSkg/OAAgMaCkAgLTkgzMAAgNaCgAgLfngDIDAgJYCAEhLPjgDIDCgpQAA0pIPzgAIDGgpAIC05IMzAAIDWgoAIC354AyAwICWAgBISz4450OC+QpMTk/RuYkBGp4cTx2M58eopqCU8vOi8xOH/D8A6BIAhqfG6dft/6Anuv5FY9OTlxwhKszLpx3Va+mu2uspHo3937Ew/xHBk6mz4e8cH6CvH3+cTo52S3m4sqiSfrDqk5SMlUrTheUgroFEpLm3ufetfUp4GAoGjNNe3kOFBZjL2wmAhCJ7O1+ltgvnL9dmwb85LfvAiACQoGBf1799s5COj+9CHHAIPUBvi96ke3zId6jY5x3F9ZLvTB10CD1A5yf8w/NenLvGB9/7GNrfoQdI52J4XIwXhd1CD1DYAdBtPwDSVTDk/qEdiX53tIee622lZ3uOpo3AI2deoBMXOumm8qtoWVFF2vm47BiqkegOMdr8dPdhOth7zNe4j5cANyyqok0CpM2VV1NNiEapQwHQ4OQY7Wl/iR7vep0mZ6a98JB2moJIlD6VXE931m4Qc2aFaefjimOgAWJY9nW+QXs6XqKBydGsxmRx/iLaKSZeb0uupShFslp2NgsLLEB8jfOtE38k/p1LWyFObd9r3E51hWW5rIaxsgMJ0KsDJ+n+tv00NDVmTDg/GZfmF9Huhu20tmSpHzcn0gYOID5l/eTUczRNeu9PLxZrfq6O14qTT4SODJ8lXiukY9FIHu1adjPdWnWtTjbW+QYKoF+cOUS/7Xg5LZErCorp2sRSuiZRL37XU2NxUsw0z167MIwnRrroP0On6c2hM6nfPRMjaZXzhbqNdLe4NgqKBQagJ7v/S99/52lfcamMJeimsiYxjrNKgOP99MJ925sCpufFcAD/9EwM+yr32w2foJvLm3352Jo4EABxMHcd2+v5Fp3Hab5UfyPdUrFaOy4M0197jtAvTx+izglvk6sxcav/8FV3ULM4RbpuzgPEg4NfbvkN9U1eUMaiKK+AdtZ9WIzTfJB4vCaTxpOyeztfS403eZmgrSiI0yPNn6PqWEkmq5H1vJwH6J7W36euS1TKJUWgHmq8XVzbVKuSah0/NnyOvtn2BJ33sMZofckV9KOmz2iVl2tnpydTD4i5LL6oVdmaeL34tn/eODxcj6Z4Df1clNUcX6KqFr0+eIoO9b2lTGdzAmcB4tPEz04fVGrbVFxDP2z6NJWLu6xsGZ+efix6Fp4fU9lPRRsmZtxdV+QsQI+de4U6FSsCOZAPNu5IPdOlCmSmjy8S11sPrbydysSUhszOjvXRH869Jkti9TEnAeJ5rd91vCIVNl8M3D0ophCqxK16rozv9r7beJtyLmyPGLsatmTU3K9WTgJ0oPcojU5PSNvKd1o23Cbz+NJ2MaEqsxExyn2gp1WWxNpjTgL0pFjTIzM+bdwlllPYYjtrNxLPh8nsKUWbZL65POYcQPwYTutwh1SzL9bdYNVaHIZHNX1xWMy35XrlgFTUBQ46B9BT3UcWaMrsvzlYH6+6RpomFwe3VV+nfCmDi72QcwC92HdcGv+PiDkmvoC2zXj6YpNi/uvFXnnbbGsT18c+pSUq9Yu7L77tldkWsSbZVttaJa/bqbFe4uW3LplTAB0dbpdqWxdbTKstnqDkEXHVgvujI/I2SgXIwUGnAGpRiLsmUZcDCf0VuSYur2OL4kvirzTzqd0CSHH31VSsnn8yL6m8BNUcWYuijfLcs3/UKYBU7/BpTtRkX0GfJTaLyVaZ8cpHl8wpgAYUa35WLZIHx4bArBKTuzLrn7ogO2zdMWcA4hlr2UItfgkm/9huvKhNVk9uo+mHHzOpkTMADSoeDEwopgoyKZpuXqonVlU9rW75mfR3B6Ap+ZOlJXnuPEZcGpXPiw0q2ppJAHTzCgxACUVQdIXKpL+qrgAok2pfzGtyWv6gYH6eO8+fq+qqaqsBedPO0pkeKO0WwtGoAgDIqLzBzxwABT/GRlsIgIzKG/zMAVDwY2y0hQDIqLzBzxwABT/GRlsIgIzKG/zMAVDwY2y0hQDIqLzBzxwABT/GRlsIgIzKG/zMAVDwY2y0hQDIqLzBzxwABT/GRlsIgIzKG/zMAVDwY2y0hQDIqLwLZD7jzurJBVrw/r8B0PtSZPFDRL48N4s10S4KAGlLmEYG6IHSEA0ucwqgB5rTAp/SUAA9UBqiwWVOAfRAc1pk49OU2K9rX9cb2SgqO2UoeiBuK7fZBbP+IpqF3N3259RW3S4I6qmOih6ItyXnNrsAkdUAzcKzP1jweCKMUm3eLfZ9tR0iawGag8fbm0tXii0qXTGvdT0o3tpqO0RWAjQl9nt/QHz7WEAvtqXyA/SVpZu8JLUiDdeV6+zFWAPWgjWx0awDiIW6/+399IJHeLaKQNy7fOvF7XFtlHh+nXgig+vMdfdirAVrYiNEVu1YyALdJ75tXjdhWyJ2w+FdkCMRN+eWZmZm6Fdn/068bacXu7FsJT3QsI14C3FbzBqAGJ7vtP2J/tZ3whZtrKzHDWWNtLtBbCFlCURWoMzvBAQ83njlLxhrZct7FK0A6D70PN7ouZiKIWLNbDArAMJpyz8KtmhmBUD+5YOHLQoAIFsi4Wg9AJCjgbOl2la82n1zhXwfLVvEQj3mK2DNOND8quE/LiiAU5gLUbK4jgDI4uC4UDUrroGyJdRj7f+kl/vbjBa3YXED3VH7IaNl2JR5qABqHxugZ7pbjOq/rKjKaP62ZR6qU1gyVmJc/5pC82UYb4SPAkIF0LrSK3xIk17SdSXL0nN01CtUAK0WuzovEVuDm7LawjJqTtSayt7KfEMFEEdge806Y4HYkTSXt7FKa2YcOoDurt9I5QXFmrLNd68siBPnHTYLHUCJaCHtWr4543H+2ootVByNZTxf2zMMHUAcED7VfLZ2Q8Zic2fd9XRr9XUZy8+ljEIJEAfoGyu20rbkWu1Y7ahZT9z7hNVCP5n66JlD9PDJZ32vMS6IROmryz9K3PuE2UIPEAf/3dEeAdEz9Jfzhz2x8LGqNXTPlbfQ0qJyT+mDnAgAXRLdjvF+er67VTyXdpzaR/upa2L2ea3qglKqKyojfi5rU0UzJQtLL/EK90cAFO74a7c+tBfR2sohg5QCAAggaCkAgLTkgzMAAgNaCgAgLfngDIDAgJYCAEhLPjgDIDCgpQAA0pIPzgAIDGgpAIC05IMzAAIDWgoAIC354AyAwICWAgBISz44AyAwoKUAANKSD84ACAxoKQCAtOSDMwACA1oKACAt+eAMgMCAlgL/A2V401dKCJUxAAAAAElFTkSuQmCC"},"4c41":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAADPBJREFUeAHtnWtsHFcVx48fu2uvH2niJHbSOIlTJ3FISSg0hESFFsTHIpUiQEFUQmoCKh9KQa0I0NJvoIqHCghKSSVKQSAQbRHiS6mI+m5FCg0orZPmYeeBHTu2E7/fNuc/7sSbHc/uzM7cnTt3z5GS2Z2dO3Pvf36euY9zzy0bGZueJzFRoEAFygtMJ8lEAUsBAUhACKSAABRIPkksAAkDgRQQgALJJ4kFIGEgkAICUCD5JLEAJAwEUkAACiSfJBaAhIFACghAgeSTxAKQMBBIAQEokHySWAASBgIpIAAFkk8SC0DCQCAFBKBA8kliAUgYCKSAABRIPkksAAkDgRSoDJTa4MRHRwfozMQIlXEZW6pq6QM1KwwubeFFE4CytMMUlXvPHKF/jfRRsrycASqjyrIyuqWukR5evyPraPkqr7AsBh7rPkH/5acPQJqcm6OJuVkamZ2hw0Pd9Mj/3s46Wr4KQBkMDM1O0x/7O2lqfi5j78LHKYbprwPnCceILSogAC1qQV2TY5Qsc5ckXV5hHZORpOQ/uqtVgtJME548qDa72yTNuv9Ygr8IQCV408MssgAUppoleC4BqARvephFFoDCVLMEzyUAleBND7PIAlCYapbguQSgErzpYRZZa4D6pifpyEg/YSumpwJaDqYOzEzRvhMv0QQPKVTzgOb47Czdel0T3b/2fVRfkVCqpG7x/jAOd3F6nBoqU7SsMkm6/cVrBxDGmu5oP0yz8/NWv/AUD2bCXhy8SAnuJb53zTYWUi1ESgn1eHKA/FTvGfp17ylKsDcAxuJWMEQ/2PhBaq2u93gW9YfpBjQ92tVuuVBkD2dCwOevdNP+06/R4IzZA5qA59tn36Lf9J5mj4AFbwAM8OJJdNfJV2lAo1e6dgAdHx9ccjQcf0vTEHFqwmiIbHjeGL5E43MzjkcIRuq+3vmmY39UO7QDqIIf17lsRjFEua+eK2fBf8uEB35ISxmO6WBPSV1MO4BuTC8nrxDdfSr81xluUBTmBR47X3n+xuzDirLVDqBvrN1mVaDzlR5Poh6uE6iAKN+1w/7dFzx88eZkjeUxGXY+CjmfdgAl2KHr2W23Ua2H5voMt9TiDpEfeHCDU+zUdnDd9jxeS4WgUFga7QBCMZoS1XSo9SNUEwFExawD+YaH/7geWreD8JrXxbQECOJsTNXSExFBVIybUwg8323eSZ/gDlWdTFuAIJKpEJkCD+6R1gCZCJFJ8MQCIJMgMg2e2AAUBKIrPDCrg5kIT6wAKhSi/adep6ghMhWe2AEUR4hMhieWAKmEqI77neZz9PFyvyXVlSeRBU9mOjwQQftWmNudspv4fnqs873OVlZW0Rg7cLnZDMO1OlHl9vM1+0sBHhQ4tgAh84AIPdZ+IZrkcbSlrLaikh64/kYrnEv273Dq+tqaNr6WNx88+PPAJcNtVD3z/CnuYdaxkzAzj26fYw0QCuUXIjhlfeb4C2560KcbmumepjZrzAmw2MMpBxq38G/rXdNl/vD988fotaFe4+FBmctMWfa7c3KEDpx6g0bZJRavj3z2vQ030ceXuQ8L9LPX37mpUcLYGEa/GxKpfKe0fj/Uc5J+y56E06gw5bE4P3nsosX+CWQXxH4S1fBTI9+AKCKOdTBwuQzA3MRh7RDazis8XVPj9PtLHSUDD/QzBiAUZgGiPfzayQ0RwtZVs1tE2HaWoYQ7Sj4z4cljlzF/ae0jY7L1AlGKpwptqVoWeokqGJ6lq+eLlzIJHpTKOIBQqEWIEo4nQiXf5Fvrm+hDteFHXd3IdSXUwdzMNHhQTiMBQsEA0ZOb99JOrsPghZYur7ReW/sbN9ODze/HIaHb6mQV3ceTH90srk11t/JgvzGtsFyFnOV2WQ9PB1rBMzurFNR9sq/93JUujuh6jMrmeUIg9zkludL+1JZb6PpkOvvQ2H8vCYCiuEvjPC2nb2aChz4SVkcnWn4mmgBk4l0tYpmMrQMVUcOSvpQAVNK3P3jhBaDgGpb0GbwNLQeQCJP/5rgVNM3RNVRbVcVC73IFN9t1NLQGYRMc70i1JbizNFfU/bCurxSgV3hE+oe8QAkCRuVy1AqrMBiiaExW00Pcz7NDo8l3KN/piWH6Frt4XOTxsmJogbHcNA/pPNi8gz5WvzosiR3nUdYKe5JHpB+/+K7jgsXa8WjLLtpdt7JYl8t5nVeHLtH9EYZkgY/TneymosKU1IGwUNtTDFCUdl/HEWuZpijzgGsjRN3D545Gmo2fdbfT8bFBJXlQAhCCREVtGJE/l8dloxh5PI88RFwlQ83r6OhlJcVVAtDlGV7TxoNDlZISvXfSCh7mQ90rahvgcHzIS5SGezE1r6birqRkLak6Ko+4636SBcNap1Eb8jA8Gy3IiKXUlr5OiRRKANpbv8rKbL5IY0pKxCdNllXQ7cvXaTF4uZZbhR+tbyxKk3opPdGUX5+qoQ/XNiz1c+B9ylphmPnwQMeb9M57lTdMiVFtGLBEYMrdtavoRy03R131uFpclByO9v8Y7OYnM4KFqtcCTwYsGbypuo4eu2E3v0bVVMSUAWSr9/bYFeqcHOU4x2rewfZ1sK3j+NEb2Klrs0ZxlDPzd3J8iB31x2ioCHUzrDgNn6it1cuWnKaUma8gn5UDFCRzklZ/BZTUgfQvtuQwLAUEoLCULNHzCEAleuPDKrYAFJaSJXoepaPxJaopdyXM0i8vnqB27sJAyJibuQ8G8+qL4dBfbM2NBwgL1r002GNNZW7jJu0XVrVYszNUCY3A53e0v2B1HGJGBuw/PA51lrsy7mnaatxSVUY343/adZz+0NdxlRWEaEHv+KHWvdRaVXd1f1gf4DC278TLdIFhye4qxITGJu6VfuKGPUZBZGQdCDfvm53/pj/1dV7DBnqAJ9gz8q53X1Hi6nGKOwovc1SPbHiQiYVVhsZ5qarXjVrvzDiAcPMOMjz/HOkj24X0Gor4C1w9Xhzqyd4d+Dv8oCjHILKJEBkFUCY8uSKDjbFPsoo1t1p46ICWfP4ssmkaRMYA5BUe3Mp0RTltyuPqgQBTb432878Bwmcv1pZeRmsT6byuLCZBZEQl2g88AKGGAy08w0tKua0A/TsOEvXz7uNWeLsyfqKg7vSVpi20b+XGvByhtXWAF8IbzhGs0z6JCRXr2D+B/MKDvpjv8KwNN3ie7T/HkwFOWPcYoVrg04yFb3/BQP1l4Lx97123G9j35lete6xgnPkcKEx4EsUaIL/wID4P1ttyi40IWH7CoGAuW7Zh3yMXjnlqvS3GJ8odKQ3XiDtEsQWoEHjyxedBNI1cUTTw6uudnshma8nvixDlX+M+zhDFEiAV8ICCYX5lYXKim6GFPjzn3b95ASKvcayxpHn8+oliB5AqeNygCbrfdIhiBVDc4LHhMxmi2AAUV3hMhygWAMUdHpMh0h4gU+DJhsheg8Pev9Q2Dq0zrQEyDR4bEtSJvC9prnfrTFuATIUnCER38xDJUI5A5va5i7nVEqAo4cG1i2V+n0Q93Il5+zuHi5U9T9fREiAs1naUR8FzuWTYpYv78gF+IZpmN9kfd7XbxY98qx1Afxu4QEeG+zw9quMOj333/UCENH+/3GUnjXyrHUDPDJyjUQ6QkM9Mgccupx+IoA9mfuhg2gHU58F5yzR4bBC8QrScg0h4WZfMPq/KrXYAYXnJXGYqPHaZbYjs79lbxPv50urWnF4D2WlUftcOoC+vaXX1S09x4Kh8LhkqxSrWuQHRc9s/SY28xDiWqYIh1g8MkWfv9Lj4r5VA8X/aTSzcmV5BX1y5iZ4eOEvj7PyOZjVcP9Er+3jrbivejWJNtDg9PCb/3HYbPd1/lk5yjOlVDBPWcFUVaazQQmsHEAry1TVbaRf/pT3P627BgQszSj/bsMHz4reFiqFbOji3fd6DH3aU+dYSIAiyi+eT41+xzd2drNg5icf1tKsDxUM2yaWtgABkKyHbghQQgAqSTRLZCghAthKyLUgBAagg2SSRrYAAZCsh24IUEIAKkk0S2QoIQLYSvF1YIjK3S1mKFw0QW1RAAFrUgtYk0zSWw00CMQ/XptIZKeSjAJTBAMafPrW8mZIcwSPb8HT6XMNG16ge2ceXyndthzKiugEH1223wrm8PNxrDeAi4tgkx1XcwQOZGKMTu1YBIwJMXVukcL7BJxth8DA2toGjmWEkXMypgADk1ET2+FBA6kA+xJJDnQoIQE5NZI8PBQQgH2LJoU4FBCCnJrLHhwICkA+x5FCnAgKQUxPZ40MBAciHWHKoUwEByKmJ7PGhgADkQyw51KmAAOTURPb4UEAA8iGWHOpUQAByaiJ7fCggAPkQSw51KiAAOTWRPT4UEIB8iCWHOhUQgJyayB4fCghAPsSSQ50KCEBOTWSPDwUEIB9iyaFOBQQgpyayx4cC/weq3J3ZtRQWZwAAAABJRU5ErkJggg=="},"4e1a":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACYBJREFUeAHtnVmMFEUYx7/Z+2BPdlkXkCsLBAzEqBAgKIpEY4jggw/EhAeNvhijiZHEVw0PXi/qo76RaHwg8YgsEMGEYBCDGDkjGpZzOfZgL2ZhZw/rm90O3TM1O9Nb3TU9Vf9Kxumuru+rqv/32+6qrhqJDcUTE4QEBWaoQNEM7WAGBZIKACCAoKQAAFKSD8YACAwoKQCAlOSDMQACA0oKACAl+WAMgMCAkgIASEk+GAMgMKCkAABSkg/GAAgMKCkAgJTkgzEAAgNKCgAgJflgDIDAgJICAEhJPhgDIDCgpAAAUpIPxgAIDCgpAICU5IMxAAIDSgoAICX5YAyAwICSAgBIST4YAyAwoKQAAFKSD8YACAwoKQCAlOSDMQACA0oKACAl+WAMgMCAkgIlStYzNF5/qn2GljALUoFjq19Qdoc7kLKEdjsAQHbHX7n3AEhZQrsdACC746/cewCkLKHdDgCQ3fFX7j0AUpbQbgd5eQ+UTfIg3k9kq8OG6zret+EOZANJIfYRAIUorg2uAZANUQ6xjwAoRHFtcB3IIPq/e4OBahW0v0AbF2FnbRU12lsXCEA7LxwNtOFB+wu0cRF2lo/ZKx5hEQaiEJoGgAohShFuIwCKcHAKoWkAqBCiFOE2AqAIB6cQmgaACiFKEW5jINP4bP3Lx/uJbG0qxOtRfD+mBaA9yzYWYrwi12Ydq+t+O41HmF/FUN6jAADyyIETvwoAIL+KobxHAQDkkQMnfhUAQH4VQ3mPAgDIIwdO/CoAgPwqhvIeBQCQRw6c+FUAAPlVDOU9CgAgjxw48asAAPKrGMp7FNCyFuau8Zuui+7T5PGj1Y20sqo+LX+6DJkfT/lYjGYVlVBdcRm1llXS0spainkK5HZyqP8m3RqJewq3lFXRs3UPefJST7K2b8qgNFZMs4pLqEW0cXlFLVWL40JK2lv75Y1/0vR5s3W5b4BkftIcuzJqi0tpXU0T7WxeQm0CplxSfHyMdl89RffEtztVFBXT+ppmqhLfmZLf9jl+1s6aTTuaFyf9O3lR/rbmETYwlqCDfTdo57+/0YcCivsT41nj8mv/jTR42IiB4mthpD+GeujdjhPJNo7RRBhVBOrTGoAc1WLiQdZ+5zq9dfE49Y8mnGzp98+9ndJ8zpzuWkajHC/wo5bb+Om1szla5K+YdQBNTP1Vn7nbRx9c/Tuj8jcSw/TX3R5xXTZyiiWvcZkgk1OTc9/5ofcqnY/3BVlF4L60j4EC74HL4WstS5NnExMTFB8fpVsiwKdFAHoS912lHhweG+yi73uu0EuzFzzInDpq7702deSE011kMm+/uEu8OqfNfSGnY6edXJjbOjieoIvDg3Tybm+a/U+ijhU+JxhpTkLMMAqgN1rSg8mhPixmUp9cP0MDkkfWnq4O2i4Acv76Ha3b72R+fDll9vXODCBZO9kn33E+unbGcZ/8PjmUDpWnQJ5PjH+EMRg85f5i8RoqEVP71NQppujHB7s92afid+haytTdU2DqhMtw2aDS5rrWNFfdo/fS8qKUYTxAjtjLK+toS/1c59Tz/aeY+bgT31lSU3msiCol03ZZ2VTbXM/HJDPDkfHss8Vc/YdRzhqAWLyna1ukGp51DVRHRBAPSabo62ubiT+picuyTRCpvS8d3PqSsiBch+bDqDFQNpX4bbQs3Rx5MJs6MnCLhsZG04ptrm+lIjFSOtx303ONy7LNFsnjx1PQdfLZ9XOuMxJjsxHquD9Esp/tRP0nUVYB1JDhr5lnQU6SPZL48bWxZk6yCL+FTn0zzTZ+ANrbc9mpLuv3U7WT9WYtmKcCVj3CyiVjGNZ9eGxyqaJXTPePi6l9alonHl08/uEPL2GkJrZh26DTXLE+trVxftBuA/Vn1R0oLnk0sZrOAub+/k6SjWZuCzh2Xz2dFP5mIn1WxDZs+0rT4mSZIP7DC6wfL3yMSsXdL8rJKoBuS4LPwakRC62c2iWzL87nt8HZ3gizbVAAPT6rkd6fv4rmi1X/qCerADo/LF8WWFBeTReGB6SD2FwDyANg9rEsw0Cd/fDdhMdQ7lRWVCS2nZSKLScVtKKynp6pa0luPXGXifKxVQDx0oMsraquJ9kUWlZ2ujz2MR1A2xofpvfmrZzORcFdi/YDNkA5D/R10gleFkh/GU1PiD04B3JYusjWnIPCRyFswcjWDz/Xjb8D8bjnu65L9G13x6QuKWujj4iFSt7WcUe8i0lNPAuqErsaZYkXaztd74+4TK/wcWygizZGfOot689M8+TqzNTbDO32dl+hI/23c7b+qm2dtOyuS38m83nLRlxMzfkFYbYtF6+LFfwfxSKmO/FNil8aft22gTK9O2LgXjx3WMzanA0ikx72icckAHKrqeGYt13wRzUdHcgdQq7r5aaFYittHe26dMJTNd+k1ortr5ng4cJ8bU3NbPo9ZSGW28C7H21J1oyBUgO6tWEevdO6gn4R21xHxZ6c1PRcg3zh1V3uecnibEKsi7FPW1IkHmE6xebN9bwJbEfzomS1/MhJTbx0sSnDwqu77CaxTaRc7N9J3V8t8+m2C+s4H/+HfysA4n1Aq6saaINYktjeuCD5MxoO4uX7d8m9Eu8E9kkBj2zrhnPd+eYyPN7hn/64k8yn+3pYx7LF2LDqcvxqB+jzJWudupW+s/nhgXAN/y6stIyaSsqlSwLV4rrMzyLxYjHX9PbcFbRNsiVWZt9SWiHLLug87QDx756CSEH4aSotJ/6opDkCCv7YmqwdRNsa8KD7DYCCVtQyfwDIsoAH3V0AFLSilvnTPoi2TF+t3c3HvwgAgLSGONzK8rEBH4+wcGNqvHcAZHyIw+0gAApXX+O9AyDjQxxuB7UMoqP471yFK6s93nEHsifWofQUAIUiqz1OAZA9sQ6lpwAoFFntcQqA7Il1KD0FQKHIao9TAGRPrEPpaWwonkj/TUsoVcGpiQrgDmRiVDX2CQBpFNvEqgCQiVHV2CcApFFsE6sCQCZGVWOfAJBGsU2sCgCZGFWNfQJAGsU2sSoAZGJUNfYJAGkU28SqAJCJUdXYJwCkUWwTqwJAJkZVY58AkEaxTawKAJkYVY19AkAaxTaxKgBkYlQ19gkAaRTbxKoAkIlR1dgnAKRRbBOrAkAmRlVjnwCQRrFNrAoAmRhVjX0CQBrFNrEqAGRiVDX2CQBpFNvEqgCQiVHV2CcApFFsE6sCQCZGVWOfAJBGsU2sCgCZGFWNfQJAGsU2sar/Aa24D179QQhGAAAAAElFTkSuQmCC"},"548a":function(A,n,t){A.exports=t.p+"static/img/mqtt_subscriber.6a7d014d.png"},"5d60":function(A,n,t){A.exports=t.p+"static/img/lwm2m_protocol.0fe3f19e.png"},6367:function(A,n,t){A.exports=t.p+"static/img/sasl_authentication.11e2cd6a.png"},"64f1":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACttJREFUeAHtnXtsFMcdx3+2wQYb8AM7xuZRMHEgahISp0AgIOKIqggSl1ZEhRJVSK3IP8kfgT+iFKmN2kr5I/CHKzWpqlb9g1ZNQCpV4zxERBQSUkFiCiVNSCE2GIOB8wM/8Plx9rnzW3P4zje7Pt/szu2Nv3OydnceOzPf+XhmdnZnJuN2MDRCMFAgSQUykwyHYFDAUgAAAQQlBQCQknwIDIDAgJICAEhJPgQGQGBASQEApCQfAgMgMKCkAABSkg+BARAYUFIAACnJh8AACAwoKQCAlORDYAAEBpQUAEBK8iEwAAIDSgoAICX5EBgAgQElBQCQknwIDIDAgJICAEhJPgQGQGBASQEApCQfAgMgMKCkAABSkg+BARAYUFIAACnJh8AACAwoKQCAlORDYAAEBpQUAEBK8iEwAAIDSgr4CqCbg93098AZpQwhsF4FpumNzj62tsHb9OKFw9Qy0Em3hoL00/LH7T3DxTcK+KIG6ggFac/FUXhYmYPXT9IbVz/2jUhIiL0CKQeod3iQ9gp4rvR3xKTyrZufU23zhzF2uPCfAikHKC8rm6pmL5Iqc0T0h/Y3fUBYBVQqjy8sUw4Qq/DCwmraXrpSKkhd2zl69fJ7FAZGUn1Sbel6JzoomqQ+8ccFzr+wyGF4JHIujuKc3SJ2fM2/6sL7qGe4n95p+yJOk6PtX9FQeJj2VWyhLMqIc4dF6hTIcHud6D+1fGp1gr3I0rqCe+mViqdpWoYvKk4vsph293S9JDI9rCFOdH5D+xr+QYMjw2kntKkJdr0Jy/C4hTnVdYnevPEZ/aRszd0yeeL0gbvnU/3ko0f3apUgrWogVmZDYSXtnLdaq0iIzF4B12ug3Mwcmps9i7gp48qIj9a5qJqij5ni2vrdOUau20I9xKPSMrOxaDm9vGQzOtIycVJk5zpA20qriP+SMa83H6dDgXpp0E1zv00vLd5kQSn1AMuUKOA6QMnmorb5GB0JnJUGrylZQXsWbZS6wTK1CqQcIB5lfq3pKL0rGf9habg2e35BdWpVQuy2CqQcIB50vBgMSBO4o3QVPbdgvdQNlv5QwPWnsMlmK1e8C9tfuY0qZhbHBN1VthbwxCjiz4uUA8Sy5E+bQQcqn6FFM4oslXbPX0e7ysfGefwpHVLFCrj+KkNF1o5QL53saqTNxQ+q3MbosBMNmqb9QKJK6RVNzwM8KgKmIGzKO9FOeZ7ov80prGluumuWRPXzRR8o0cTCn/8UAED+K5O0ShEASqvi8l9iAZD/yiStUgSA0qq4/JdYAOS/MkmrFAGgtCou/yXW1+NAPxOvNKaC+eO1E2mbTV8D9OwU+XQVAE3i/yedxZpENhPyakINq70G+suNUwmJOxU8mQAQOtFTgVQP8wiAPBR3KtxaexPmtaj502bSA7PKqTyngGZl5Yh5+iFqHeyhL3tb6IZYAQ3GXQWMA+jQg7spJ1OerTM9zfRbsebQpb42d1WcwnczrgkbCA/ZFucjsxfS75fvpGV582z9wGFyChgH0KADQCwN106/qaihoum5k1MKvqUKGAdQ/0hImtFoy5Ls2WJRqyejrXCepALGAeTUhEVrVF24LG4qUbQ7zhNTQN7bTCysL339suFtGhLrB83Lzqcd81bS6vwltul8tuwx+lVjna07HCZWwLga6OrALetx/eztZvq5WIyqvrvJVoUNYlk9ngkCk7wCxgEULcXwSJh+famOeClhmeH1FmuKV8icYJegAkYDxBp0DfXTX8WKZnbmKTGJEQt32qkzsb3xALEEDX3yxRvYrVgshrWu8F4+hUlCgSkBED9xOZnvlzzi5Aw3BwWMB4iXBOblgZ1MlRihjizs4OQPbvEKGA/QqvzF1kvV+KzH2mwteTjWAlcJKWA8QNWFyxMS4ntiDcYZmdMT8gtPYwoYDVB2RhY9nr90LLcOZ7zpy3fn3u/gA04yBYwbiY7O5GMFFcQroCVqthY/TG+3nkvUe0r8+W2VDqNroImevsYTsDS3hB7Imz/eGtcOChgLEH+2sTbB5itan633oDMdrcdE58YCxH0fuy8T32//0laXJ8T7sQLxWSxMYgoYC5DT09efW/5F/WH5d0M8brSl+KHE1IMvsX2FgYY7zqsL5J9xNARbibcXP9HZYJvzmpKHsKWCrTqxDkYCxM0XP8LLTH3P6OcdxzrOy5wtu9LsObRGPMHBTKyAkQA5NV//7rliqfJZ92XqFm/q7cwP8H7MTpoYe+MA4rlg/PpCZvj7oP/0XLWc+Px45wWZN8tu5ZzF1twyWw9wsBQwDiB+cWq3pypPLozuPB9r/9oRg+2l33F0hyPvB2eYeVJsSmdnTnePNl8Rd/7stWWgM3IZd3xKdKaXziyJs4fFmAJGvcrgPTcenfOtsdyNOxsPEDvXtf2XeG8OmeEdFmuX/Yj+cO0TOiPgaxbfW3th3Hg9wU+Wn4onyx/eo/fbJqNqoPUF99l+ntonxn3OiyZsvHm//YuYZm28O/epeLO73y3/8Xgn31zzFqEvXjhsTdvmbdd1GqMAqi6y//KQO8/DxNvbxZqOUFDscz/xmkWtYi9XPxpO/56Lh+82xQevn6Q3rn6sLanGAFQopirz3Hc7c/rO+I/M/dDNeuLpQE7GbiNgpzBeu/Fsk70Cniv9HTFRvXXzc6oVi0joMMYAtEE0X9xnsTOy/k/Eb0hMRPxFwz9tp/+wv4APayD+hqlq9qJINmKORwJnaH/TB5I6N8ab8oUxADk1X7dENd/Y1+ooVqNY8mX3+YN0+s5A43jPAbHGkB/NCwuraXvpSmnS6trO0auX36OwhxgZ8xTG7T7vPS8zwaEBmXWc3TXxSL9XdEbni8Wp7s8ro4LpM0WnPIt6hvvprA1YcTdRsAiKJon3kOUC519Y3Cs8EjkXR3HObhE7vuZftfiCgNP4jmTj4qPtX9FQeJj2VWyxfcBQSDIZA9DXvddVdIgJyyDxn27zN9F34U6w2+bDW/+jwYZheqXiadtB1mTjNKYJS1YAP4Vz6sOppvNE5ze0T6wVMCj6e24aAOSmmor3smmBFe86FvxU1yV602Ga95jPxM+0N2EmrI2cuLyT8+llDcQp2VBYSTtdXv1fO0BTZfuCyaEz6js3M4fmirn6DBI/DvDROhdVU/SRHxas351j5LpNDDXYjVdtFO8IX16y2fWOtK+2/U5GdIQZVeD15uN0KFAvlWOTmDT50uJNFpRSDwqW2msghbQiqI0Ctc3H6EjgrNS1pmSF9S5P6uiCJQByQcRU3YLf7L3WdJTelYz/cJq2lVbR8wuqPU0eAPJUXm9vzoOOF4PytY92lK6i5xas9zYB4u54jPdcYu8i4Nkn+yu3xa02u6tsrRZ4OGcAyLvy1XJn/ojuQOUzd9c34o/jdpWv0RI3R4KnMG1SextRR6iXTnY10max5qNOA4B0qm1gXGjCDCxUnVkCQDrVNjAuAGRgoerMEgDSqbaBcQEgAwtVZ5YAkE61DYwLABlYqDqzBIB0qm1gXADIwELVmSUApFNtA+MCQAYWqs4sASCdahsYFwAysFB1ZgkA6VTbwLgAkIGFqjNLAEin2gbGBYAMLFSdWQJAOtU2MC4AZGCh6swSANKptoFxASADC1VnlgCQTrUNjAsAGVioOrMEgHSqbWBcAMjAQtWZJQCkU20D4wJABhaqziwBIJ1qGxgXADKwUHVmCQDpVNvAuP4PcliGf3KCtX0AAAAASUVORK5CYII="},"65be":function(A,n,t){A.exports=t.p+"static/img/pgsql_authentication.079ce8f3.png"},7391:function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACNZJREFUeAHtncuPFEUcx38zy7KzuyyIEBQUza5wEGMkoqKJHkxM8KJe1ZMHDh7wgCY+/gDjKyhGD0SjMSbGGA9eOGCExHgQBQQRBMVlwRWQRZTX7jyYmR1/tTosM9O91d3V9dr+VrIZprer6lff34dfPbq6NjderDYICQokVCCfMB+yQYEpBQAQQFBSAAApyYfMAAgMKCkAgJTkQ2YABAaUFABASvIhMwACA0oKACAl+ZAZAIEBJQUAkJJ8yAyAwICSAgBIST5kBkBgQEkBAKQkHzIDIDCgpAAAUpIPmQEQGFBSAAApyYfMAAgMKCkAgJTkQ2YABAaUFABASvIh8xzTEmzcPmG6Smv1LenP04Y1BRqYm7Nmg+6KEYE0KnxmYpJe21mk0/w5WxMA0uzZiSrRpu9LdOTc7IQIAGkGSBRfY3a27C3RtydqBmozWwUAMqR3g08g+PyXCn1x5LKhGs1UA4DM6Hyllm9Gq/TevvJUVLpy0eN/ACALzjv8d5027SrRxCw4GAUAWQBIVHl6fJJe3VmisyW/B9fG14Fk/nrroX7ZLU79XmVda/xyg15niJ7mtaKhBV1OtSuqMYhAUZXSdF+VA9C7e8q0608/Z2gASBMYcYoVM7RPf67Q1qOVONmcuBcAaXZDV4ynGDuO1ejDn8pU9+jQQQCkGaBn1/ZSb4yR5oEzddq8q0glT3o0AKQZoGXz8vTifX20qDd6KDpxqcEztCKdK7sfigCQZoBE8fN7cvT8vX00dE10uS9WGvQKQzR6sW7AwuRVRG9R8jqQkxWYy7P0DXf10tobovdnVWbn7d1l2nfaXYgAkEG8RSf2+K099OjKuZFrneRe7OODZfpyxM1naAAosivTu/HBm7tp/eoC5aMPi2jbSJVBqpBroyIAlB4XsUq6bXEXPccztEL0Ho27shpt3l2iikM9GgCK5fZ0bxYztJd4hnZtjBna6AXxDK1IYpDtQgJAlr0gZmgv8AxtcEF0V5zn6f3LDNFJfiBrO0W32rals7h+MUN75u5eumdZ9P7sMi80vslbZQ/+Zbc/A0COgCnG00+s6qFHYs7QPthfph3H7c3QoiPviNC+maGy3SNqW7cOV2ms2KAnGUDTCRHItOKa6tt9qkYnL5kfEwEgTQ61UWxdrDoaTgDIsOA6qzOPDxEAUvTouqHojyUUq5JmN9+BASCpU2Q3PDzUTa5AJHY2mk6IQCko7gpEk40YD9dSaLcoAgClJKQLEFkYQxPWgVICSBQjIBI/utIWfqP1V34pMSw1LPRhiEBh3nDwumz7h40IBIAcBCXMJNkIx8IYGmOgMGe5eB0RyEWveGRTThKC0IV55EwbpsoikIUxNLowGyAkrTNPM4egSQs7pjGITupNC/lkEQhdmAWn+FSlbAxkowtzciFxmE80HT7XuWC2pD9Hd14XbPLesRqdmbAxkU0HwRx3P2J/9OK+LlrMm+wXFjq7q84rrXXbaH2wN1rtMv5NwBP0It0qfhUmDKAf+HydQ2c7oTNufEoV3sQHTj22sptfh54+eApdWEriZqGY0Qt1eocPnvrs8PSZQXKAzMcgDKIdp/G7kzX6+nc+rZxTTjIIwiDacWfaMu+r49WpY4FlEQiDaA0e6u/OUR//tKca/3cNOn9HDF7nSDwVN2+Rj/MNOtJ3xcIuuoV/RKrzdsKxYp0O8gFT7R2RyH+M30iVmEU2IpCTg+h2Z6t8v3958BaLU/wGwxv8Yl57Wn9HgZYNzNyzx80rDkYImhQIeFq3f3TTJ3xW4p6AAzfHxutOAjSzUu3q4rt2BRb0BLukzAcndsbRVnPaI1frb/V88yoCneCo8dGBcqASf1h4JyrQEMWL58vBW+MLfFpnSXKyfaOj81M0JkJ2rwASJ1LsH5s9az1Heb1r28h/Xrp6DBTkt+v5JI8LlWC4mvdjDNRUIiOfYsE0aMW9vfnz+C8eDvKC4m//uAdQcIfb3gJ8t6rAusFuEudNS5aBeBYmGyWl3wwAlL6mqZb4AM8ixUxSpHxu5mEy1oEk0ouHjYMhR+WOnJ+kS46c2iVpRqRfi2dg4lmYeCbWTFgHaiqR8PNGXp956vZCYO73fyzTIZcODwy0svWigGP1kmlABsTTeH4Sv6g3H/iXnuUAzRyhWmtP55tXs7B0muxOKUt5e4o4sTVqyklWgszjgzdTo/rOiftkQ2QA5ISb3DVC3oWZtx2zMPOaJ64RACWWDhmFAvJ1IPM6IQKZ1zxxjbIIZONwBSdnYWKfDAWc/CU21YelNUvn0PL501Pi5n1TZTW/XPUppsxBB0OJ67IUN29Ye8SyRJyUl4QgPAv7X80VC/MkfuKksM32YWUM8POl1r04YXd2Xo+bN0l7OmsVK9FBV6ev2QAonpembcW/LCgg4cfCZg6sA1nAIHmVkh6MbDwLQwRK7k/jOdGFGZd8dlWIwxVmlz+Nt0bWhWEQbdwlflUo68IwBvLLn8atlQGECGTcJX5ViGm8X/5yzlpEIOdc4pdBssMVbDwLwzqQRwwhAnnkLBdNlb2Vgdd6XPSaQzbJ1oEwjXfIWS6aIhtvzPzeqp4WyWzSUytKTaQApvGJZEOmpgLyDWXm38tABGp6x4NPzMI8cJLLJmIQ7bJ3PLANEcgDJ7lsIgBy2Tse2IYuzAMnuWwiZmEue8cD27AO5IGTXDZRtuaClWiXveeAbS4Oop17tXnj9gkHXOWnCXiY6qffnLEae6KdcYWfhmBHop9+c8ZqRCBnXOGnIeafxeNwBT9JCbEaEShEGFyOpgAAiqYT7gpRwAZAuXHx9xSRoEBCBWSr4wmLRbasKACAsuJpTe0EQJqEzUqxACgrntbUTgCkSdisFAuAsuJpTe0EQJqEzUqxACgrntbUTgCkSdisFAuAsuJpTe0EQJqEzUqxACgrntbUTgCkSdisFAuAsuJpTe0EQJqEzUqxACgrntbUTgCkSdisFAuAsuJpTe0EQJqEzUqxACgrntbUTgCkSdisFAuAsuJpTe0EQJqEzUqx/wL7VgURNZ79+AAAAABJRU5ErkJggg=="},7848:function(A,n,t){A.exports=t.p+"static/img/mysql_authentication.a3615766.png"},"7a95":function(A,n,t){A.exports=t.p+"static/img/retainer.a07ffddf.png"},"7b60":function(A,n,t){A.exports=t.p+"static/img/hot_confs.957f5817.png"},"7ff7":function(A,n,t){A.exports=t.p+"static/img/delayed_publish.b0b58640.png"},8000:function(A,n,t){A.exports=t.p+"static/img/topic_rewrite.676de860.png"},8217:function(A,n,t){A.exports=t.p+"static/img/jt808_protocol.28a1a87c.png"},"8b77":function(A,n,t){A.exports=t.p+"static/img/redis_authentication.e0ec3147.png"},9372:function(A,n,t){A.exports=t.p+"static/img/topic_metrics.ee87579d.png"},"943d":function(A,n,t){"use strict";t.d(n,"o",function(){return r}),t.d(n,"d",function(){return e}),t.d(n,"q",function(){return c}),t.d(n,"s",function(){return a}),t.d(n,"i",function(){return i}),t.d(n,"v",function(){return p}),t.d(n,"b",function(){return u}),t.d(n,"p",function(){return C}),t.d(n,"u",function(){return s}),t.d(n,"g",function(){return Q}),t.d(n,"n",function(){return B}),t.d(n,"a",function(){return I}),t.d(n,"f",function(){return E}),t.d(n,"e",function(){return f}),t.d(n,"m",function(){return d}),t.d(n,"c",function(){return l}),t.d(n,"j",function(){return D}),t.d(n,"h",function(){return m}),t.d(n,"t",function(){return K}),t.d(n,"k",function(){return S}),t.d(n,"l",function(){return J}),t.d(n,"r",function(){return z});t("ac6a"),t("456d"),t("96cf");var g=t("3b8d"),o=t("1f75");function r(){return o["a"].get("/module_types")}function e(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o["a"].post("/modules",A)}function c(){return o["a"].get("/modules")}function a(A){return o["a"].get("/modules/".concat(A))}function i(A){return o["a"].delete("/modules/".concat(A))}function p(A){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o["a"].put("/modules/".concat(A),n)}function u(A){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o["a"].post("/auth_".concat(A),n)}function C(A){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o["a"].get("/auth_".concat(A),{params:n})}function s(A,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o["a"].put("/auth_".concat(A,"/").concat(encodeURIComponent(n)),t)}function Q(A,n){return o["a"].delete("/auth_".concat(A,"/").concat(encodeURIComponent(n)))}function B(A){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o["a"].get("/acl/".concat(A),{params:n})}function I(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o["a"].post("/acl",A)}function E(A,n,t){return o["a"].delete("/acl/".concat(A,"/").concat(encodeURIComponent(n),"/topic/").concat(encodeURIComponent(t)))}function f(A){return o["a"].delete("/acl/$all/topic/".concat(encodeURIComponent(A)))}function d(A){return U.apply(this,arguments)}function U(){return U=Object(g["a"])(regeneratorRuntime.mark(function A(n){var t,g,r;return regeneratorRuntime.wrap(function(A){while(1)switch(A.prev=A.next){case 0:return A.next=2,o["a"].get("/sasl?mechanism=".concat(n));case 2:return t=A.sent,g=Object.keys(t)[0],r=[],t[g].forEach(function(A){var n={username:A};r.push(n)}),A.abrupt("return",r);case 7:case"end":return A.stop()}},A)})),U.apply(this,arguments)}function l(A){return o["a"].post("/sasl",A)}function D(A){return o["a"].put("/sasl",A)}function m(A,n){return o["a"].delete("/sasl?mechanism=".concat(A,"&username=").concat(encodeURIComponent(n)))}function K(A,n){return o["a"].get("/sasl?mechanism=".concat(A,"&username=").concat(encodeURIComponent(n)))}function S(A){return o["a"].get("/nodes/".concat(A,"/lwm2m_channels"))}function J(A,n,t,g){return o["a"].get("/nodes/".concat(A,"/lookup_cmd/").concat(n,"?msgType=").concat(t,"&path=").concat(g))}function z(A){return o["a"].post("/mqtt/publish",A)}},"94a9":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAAC2tJREFUeAHtndtvHFcdx3+7612vnZuTtEmTNkmTNDdC6qRJuDRJaUiqIgRUgCgqKQJRwQMSIP4CJN54qpAAkQcoErcXqOChLa0q0YZLlZY0SUlQnabNxSRp0lyc2vHa612b33e2g9fjs/bsnt2dPbPfn2TPzsz+5sx8z2fP+c05Z84khobHJoRGBWpUIFmjH92ogKcAASIIVgoQICv56EyAyICVAgTISj46EyAyYKUAAbKSj84EiAxYKUCArOSjMwEiA1YKECAr+ehMgMiAlQIEyEo+OhMgMmClAAGyko/OBIgMWClAgKzkozMBIgNWChAgK/noTIDIgJUCBMhKPjoTIDJgpQABspKPzgSIDFgpQICs5KMzASIDVgoQICv56EyAyICVAgTISj46dzRSgu+/eKuRhw917AXZhOxflZaP3ZmWDv5cQmlWzZcSjZzepRUA8sUASPsUpI8TJF+SuizbBiBfrfmdJZDuv4slkq+JzbLtAPLFAkif1BIJIKVZtfmyVL1sW4B8peb5IGnVlkn5W7kMq0DbA+QLNS+TkL13p2UXQfIlCbUkQAGZ5ipIqNp2adXGEikgjmGVABlEwSaAtHdVh4KUkU5WbRVUEokUoCf3z6l4YrY7bunksy+dK8jf+vMyWqz9aHPSCXlQQdqzgiCZVIwtQP7FYhbjl86XQBop+FurX3YrSA+s6JAlc9y7Zdu2tHHtxY07cvV51BAPZPyn16blwZUdcqi/IIfO5yVXA0gA8S/vjDXkHBt9UAJUB4UB0qfWpOUTK9Py8vmxmkGqw6nE6hCxL4GCudWlV+yDhNLoUP+YDLtZsAQvLZL1tgPIVxkgPbwmoyVSxgu0ESfxrQ++OuGXbQuQL1FWFXhodUYe8EHSOzfcwdHCKdD2APkyoa1n/90Z73b973rrjxJpKE+QfH0qLQlQQBmAtE9B2q3tPv/475j89dwYQQpoVL5KgMrVKPsMkNClsVu7NABS//vjZXtb6+PRyzW0S9TpEgjQLEKiP2yvgtTKFiVA7jWrtnJOtuG5EaA2zPR6XnJLVGHPv5Ov5zW1xbHQhtUK1hIAudrHFGUGtgpArMKipCAGaROgGGRilJdAgKJUPwZpE6AYZGKUl0CAolQ/BmkToBhkYpSX0BK38RjgRXNTgZYAqFXaNNzMwmjPmlVYtPo7nzoBcj4Lo70AAhSt/s6nToCcz8JoL4AARau/86kTIOezMNoLIEDR6u986gTI+SyM9gIIULT6O586AXI+C6O9gJboyphNgrDzTacSIpiFoyeblJXzk7JlSUo2LNLncmax94bH5ZULBbmiyxu5CbmWG5dUMiELdW7pRV0Jua0rqfNLd8jt3ebfm+n8dizrkAObOyumfHNkQn5yZESualomQ/+gC108TgBkEti0rahPIg/q48iD+aI+CFj0HghcPi8pX/lQp9ypy6BdGhqXF3TOn+NXCjLtIWY9GCZbuDAIr6LOdjYmvUs65GGda+gOy0mmZoPns+sy3kONwfNtxfXpqrbiWVqc08XBcfnxazk5c3PqPHfHLxflyVdzcswEjyE9AIbvwuetG+ZSw+A2bdP7oxPy09crlzyfX+8OPLi42AOEixzT/P7VG6OiBZNngOrXJ0a87aUt4f/jGE8dzwlAqNbgg2oLVabJHt2EWULcGtrSFgAhs5B5hy+WZpL606lRQXVXq2GKvGferu5ZtkGUPBXg0dDNi5fwHg/XLFYx0Gzin3yv6MUxpiqoS4Pvh3Si8dU9SS8QH9H456oGuv/UeRXfHpha/SGdYzqhwRc2dIaaAtiDR6stBOlB01hdHv9wpzRyHsNgmvVcdxqg4DTBKFWG9Jd+TmfSeFZLiMu3pmbYJV2/Mmwuer64ISPb75gqx8oF4mXswddz0nd96rFQlZ3VuGq2uzwE9Yh5gueCTMRd49e2ZL27xXpmajOPFasqDBmC1zrdq7fvjxtuoW9pZuYr1F2jBTNYqF726wxmJruksdRMBnh+ptWWCR68u+yJXrfhwbVP/cnNpIZj+0zzOWOqlh4FzGRP9+W9JgDEIXiTT7ndszAleCnLsAJRbjMF0pjdDPC8GygF4Y/zeKK3S9Yvcv/3G1uATHc68zuTsmxuUnoUhgGt6soNBROe0X9e/9ZpxqLNZ4v+4SUssB/u6S7/+qyf37w2PW6CEyau+ta2rKzRWCsOFiuA/BjovMZAzxlm/FirJQlw2KfB8h+1xDEZsDql8c6p63n5w5t5WbswqbFRWnp1tnfM7Gprn7kno/DM3jpum06z/OsgSbNOdXo6pi6E6d+a3PKRZaWM270iLf0av7x6ceap4QDTaW00PH1jVJ7uG5X7NMgGfJW6NCZTqvzpOa+ES8lSy9bsyik0d088ytEQmu3UvqlVCyZ/+Y9p9wbuvPBWHt8mP/lbJpdojDyswP3olZzOK137zOToHjl4dKSmhsjJs2mdT20BEDpVv6zABA0l0Q92d8tXt3TKptu0epuJoA+cUU0i4H7xrLkKDKZhWr+h7UsHj42IzctfTMeNYpvTVdhsgqEDFRNkBtt3yv1wO32fxjf4Q+nwb21sROfqW9eLUvjgLh1gTaA+K7NnT4/JRu3pv2v+ZKlWttv7iN78jYtTXk9/cB+6U556I6cBdZfXHhTc78q6swChl319YKhGSnO6Oz2hwzBKwzkW6zCMcgMQB4/myjd5n3dpSbRV77gwFOSjyzu8P5QOJ64W5F+XCtJnuKMCTy9rK/WBzWaAAM93dnR5Q0JyWuOhIzZoCNZ/f3LUa4kO7nNl3VmAcCfziA57qMZQ2py9Of7/ksX37ckWPYD8dSzxCoQdGjTjDz33vzk5Ms3vjKGLwz8G7vgAEeyAdlUMHJnwWq79/f7yyLsFr93pc1Vei+8f9XLqTzTqs2lC+hgcFrQ+ra5mst6lKS9GCn7nZqAtKbjfXy+1OnfKYh2cFjRswWz4eAWVizZdTRevoopzNg0GQ2fnTEEx+r2uGfrQ0AEb1nC3982tWa0mp3r4odWfT+WN1dzUb7femrNVWK1SbtVg2RSPPKNB8ZmBccF+dGVkNbQZ1ButC4NFeU3joGs61DVoy6tsy0Hbz9fv7RJ0zga75HD0354YlbnbEoKuE1es7QDafHvK2JWBDPvP1aL3FzbztmvbUrW2Tlu20aTwOw2eg4Yg/5fHR7zgG10uLpgbZ1lHJRGPPLppeptQtUms1EZJDJyvxdCoiXeUmQyD1dBGhHHTLljbAYRMQaPhlzZmvH4xrIePZPBt8bohvqGNj9X6lbxL//EiYLQ9mQzw/Fxbq2t5ObDpeI3c1pYAQdD79TVO396elQ3a0Bf2t47Rg3u0zeh7O7u8cUe2GfOYjllaXda9Un48DAP5hZZEfmNm+b5W+mz+CbTSGeq5BEce1uv0EKziD5l1WJ8LwzNaGOYxoCUABpjh+bJFWYwhSnqPBSHA9od3lJ9DreeH6vS7OzUBh80JgBqtL27tH9HHaWjVK9C2VVj1UtHDpAABMqnCbaEVIEChpeIXTQoQIJMq3BZaAQIUWip+0aQAATKpwm2hFSBAoaXiF00KECCTKtwWWgECFFoqftGkAAEyqcJtoRWItCuj2gcDQ18Vv9g0BVgCNU3qeCZEgOKZr027KgLUNKnjmRABime+Nu2qCFDTpI5nQgQonvnatKsiQE2TOp4JJYYwJQWNCtSoAEugGoWjW0kBAkQSrBQgQFby0ZkAkQErBQiQlXx0JkBkwEoBAmQlH50JEBmwUoAAWclHZwJEBqwUIEBW8tGZAJEBKwUIkJV8dCZAZMBKAQJkJR+dCRAZsFKAAFnJR2cCRAasFCBAVvLRmQCRASsFCJCVfHQmQGTASgECZCUfnQkQGbBSgABZyUdnAkQGrBQgQFby0ZkAkQErBf4HktkGV9qyU2YAAAAASUVORK5CYII="},"9ab4":function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAADkBJREFUeAHtXQtwVsUVPnknJCFPXnnwCgRBXo4gUEEppYADqExBWpW2tj6KM7ZDpy2003Y6tbUVSpHO1HHQ6Wit2Kk6lqFAQaAgWBR8gTFAgJCQhLyf5EHePecOt96f3P/mv3f3/9kl5zDM//979+ye/c539+7d3bMJa27t7AUWRsAjAuEe9ViNETAQYAIxEYQQYAIJwcfKTCDmgBACTCAh+FiZCcQcEEKACSQEHyszgZgDQggwgYTgY2UmEHNACAEmkBB8rMwEYg4IIcAEEoKPlZlAzAEhBJhAQvCxMhOIOSCEABNICD5WZgIxB4QQYAIJwcfKTCDmgBACTCAh+FiZCcQcEEKACSQEHyszgZgDQggwgYTgY2UmEHNACAEmkBB8rMwEYg4IIcAEEoKPlZlAzAEhBJhAQvCxMhOIOSCEABNICD5WZgIxB4QQYAIJwcfKTCDmgBACTCAh+FiZCcQcEEIgUkg7hMrHGgvhrcqP4GxrJVzpbg9hzaGrKjEiBiYMGgYrh90Os5PGhq5igZrCVD8nur2nC/54aT/srf1coJn6qS5OuxV+OHIhxISrfY8r/wjbVnZkwJGH6E43DLVddVGaQHktZfBW1ceqYxg0+6jthIHKojSBdtcMrMeWHVH2KI6B0gQqbqu1w3RApRUpjoHSBGrr6RhQZLFrrOoYKE0gO0A5TS0E1H5H7Aerv0z6FoyNS+8nl9qXC9tq4Dv5r6htpIN10glE8zZ1XS0OVfpeSoqIg0ER0b6Jmv3qgV5o7mqHDmw74Pfo8ChIwEnB8LCwoLaktbsDGrvbAq4jNTJe+rySNAK1YGM2Fe+Fd+vPAQHqRmYljYENo5ZAStQgN2o3PO/plnJ4vfIEHG8sgqs9nT720E0xa/AYeHD4HTB+0FCfa6I/6jtb4ffF/4YPGi+6KiocwuDulFz40ahFEC/pppU2Bnq+9BAcqi9wTR5CgID4w6V9rsC4kZmpl32maA+sPbPduGGuJw/ZRr3Df+rPwmOnX4XNxe9AZ2+3NJMJK7fkocrpxiabyFeyRBqBjjacE7Lp/YZCqSALGeOg3IzrcE+d/Tvsq813yOV7aWfNKVh39g1ou66X8s0V2C8iImElIkcbzouo++hKI1BcuNg4JhrXfCLDInyMU+0H3cG/KtwJBbig61ZoRvk3F3e5VeuTnzAirEQkDsdoskQagVYMvU3IpvuG3IZPaLVlZ/VJ+LCp2LOR7zVccNVz2VVEGN03ZLrdpYDTRH1lrUiMypaSVg+bAYOQ2XtrT0NtZ7PlivPXJBw4fzllPKxCfZWlCx8dr5QfEzbxpctHYWHaRKABrVd5PGsevnDE4XjmHDTigDpQSYtKgMVY9/Ih0wJV6TefNAJRTWSYTOP6tT6EGc60VkCdg7Miw8JhckIG9OILaF7LZeju7bG1rqrjCpxqLoXpCdm21wNJJPKtHjbT+B9I/mDmkUqgYBp6o8vOby73a0JyZBxsyX0Axlyb1DzXWgXrCv4BNOC2kxONxUIEsivzRqVJGwPdqAaEql6n3uebI+b8nzxkD837PDh8pl/TKjsa/V7T7QITKECPNXT5n/EdGZvWpxS7NDPTzbQllwlketXhc3dNHhxr8j93ktdS2kc7r/lynzQzIQkfeTeL8BjIwZNVnVdgU9E+ONFU5DhH9XrFCciJHQrzUsYZpR2oPwNvVH3kt+TsmBS/13S7IJVANMVPbxg1Ll7jUyIHwZSETFybiVEKu901n8GfSw8BrfGRdDssRVC7f1G4A6hn6cV/TV1XHdsiI+KiBQfonzWXQX1X4K/x6fgaPzUhS+qCqjQClbTXw48L3oSKjiZH8OwupkbFw+9y7ocJ8cPtLoc0zdrrWCsmYkA/czeNDuMksywaYIsurp5tqYCfXvgnTisEvuvBrH949GDYlLsSZPWC0sZAWy8d8EQeahgBsVGBxdRd2Os88vnLxiPLBPyLT+8Tf1+UAfBE5l3Wn56+E1ZeyEOV0Q1OvpIl0nqgfNzaICIXWquBHgVu4qA+xLFJydU6kWoNXepb/oULniLLFIEY8cDQGTBj8KhAsvrNQxgRViIi6itr3dIIlBGTDOdxAs2rpEUnuCIP1fN86WGv1YVcbwkGCn4vW7z3oRuMHvleeyBqOPlKlkh7hD2ROQ8icDrfi9DDYa2Ert1L3W51yNZVGHr8aOZcCGRVmzZufT97AWwYvURo/ctq55NZd/czGrPm9v1OPiJfyRJpPdDMwaPhxYkPw8G6AneLqfgWNh9ff2+JHyGrTUErJwtfvzeMWQyT4zONOpamTYEduEJ/BPdCXWjzfayMxxj3u5LHwb24cp4UGSvVpoWpEyELe5FD9eeh0cVbGC2mLkjNxX3kQ6TZI41AZBEZNjZTnnHSWilYEPU6dODBoxlzfR6ztAX32xlzjP9duHhK+6JpT3Qivs5HBHk/NN1wKtx0Ugkk6Ccl1a/vdfwZSavxybjFYqAJE8iPx42xDr41fTfzTp9ex0/2AZvMBLJxPU2yrbeMdWyycNI1BLQm0AwcuMsKTzEZkR2TCmtGzOrT63QbM9FmLnmfwSpXnoXOJWlNIHqdDXZkKsVgPVeyHw7j9lGWvghIJxBFLlwx3kb6VmaXkoDzJF7nj+zKk5lGMVTP4bR/IGtcMusNtCzaNtt8bbE3EJ3ESIyW9TyDZF+DNALRFPvWkoNwoO60sSRhX13f1CgMU5mH8yXrRn4VX3/lrsjTltJPmkqgEtd/WnragVb+s2JTYRqu/juRlnqdLdjrUJStikI36JZL7+D803lXsXQ0i/0VnEP6AU5sulkycsJAGoFeKHsXaAuEW6FAuYN4pxsxV2OXu1W3zU9rRRT9cBwjXu3GGDRuuid9MqwZPtvYgmEthGzZimcyNvazJcOqE+rvm3ExlaKA3Qrd5OQjIg+RSIZII9AhBF5EKFqSJuNoPkVEXio7Cn+r+MCxCNrj82blx7AHdxr+fMxSmIMnotKeZxrrqNrrmA0ijEQjS8lXyhEoCsSiSumRInqaxdOFu4B2AwYqRKSfnX8blg2ZisQpULrXMdtEGBFWRCSvIuora71it7ulpOXoBBFZmj5FaID3cvl/XZHHtJW2cuysPqUFechmGgQTViIi6itr3dIeYQ+PmA1R4RFG6K6byNRkPLNmPh45sgb1vUop7oZ8tdz5seW17Ov1aIZa9puM3Tjt+nqtv5/Mmg+JEbHGOKjBxVlMtJi6KG2S1IBEaQQiYL+O0ZL0P9Ty1/L3/UaCyrSF7nxynszJSy8nlNE48ZGMLxn/ZbbPS1nSCOSlchk6NBZ4z+G4EiL2XdjDZUQnw0kMv8l3CLfxZ8/Q6ET4yajFwrsJ/ZWvc7r2BLqI+3DMyAk7RzwzboXxlmVeo7mqt6s+MX/2+7ksfSqsxRlvmb1Ov5VqlEF7AjmFHNMBBvSKbpXHcTfejqpP/Z+kRqcj4JsO9zpW1Px/155AdsfLmc21O3ORtqHGRUQ59FphsPxar6P74Z8mDsH81J5ATmHCJ5tLDKJYHz+fXkuzA5XGS5tyV+FYZ6TdZU6zQUDaPJBN2SFJGonbL/wJPd5oopCOW6FDL+mEsKcv7vaXHUbhIQlMHr/w2F6Q2gMZR7jV5UNtR4ttZXaJtA2U5oFoo7gXSY2Ox0jPYUiSSlv1kxhqTSelBiJzcVFXF9mPi9a0W6Cx0zmM2tqeNMRqUeokuDM5x5os9F0agfbU5sGzRXs9GUNrO9V4ctc38ExlL7ICIx824hnVIkJzK7SkoYNsx7W+bbjm51rwvj6MSzbrRy+Ge9Imu1a3U5D2CHut/Lhd+QGnvVbhXX9J+q2QIxiq8rWhtwPFjesg2/E0EBER9ZW1bmkEanARn2Q1wPxOY5QOhxMwzHx2n7S08Ouce3F639t+Ijod5DEMFNRBCCM6mUNERH1lrVsage7A/ckiMi0xC6IFzonOxEC7TeNXAoVIu5HpWO9v8WQQ0W0kbuoUyUsYTU/0fkAn1S3qK6v90gj0FG5QorNnvAgdd7IeQ39F5RY8HmbbhIdgQcqEfouKxfkgCgrcPH4VDJYcOdpv5YIZCCuvR8SQj8hXskTaIJom7f40YbVxfEgNnuwVqKTgajz1HrKEeqBfjl0GD7XNwjDrs8ZRLdVozxXcYUh/rSY7NsX4k9q0tTNVsz/uYmJEY7UXJ66BsvYGPGAq8Dfe9KhE6eM8aQSyNk6FwSgNqnMwzFqXsY2Jn5tPuvFk3nxu6jbzSieQWXAoPo83FcLFqzWhqCpodVR7ONEtaMZ4KFhrAr1QesRDk1lFJgLSBtEyjTLLCpMcw2SWq9On6hgoTSDZ5+roRBzTVtUxUJpAUzxOC5jg3wyfqmOgNIHuN073irsZeOCpDbRVhTBQWZQmEM0trRu5UGX8gmobtd1uU1xQK3VZeFhzayeFRikt9KcGNhbvM1bslTZUknFDjE38i4DOnVRdtCAQgUgb52krAv29UppVvhklEZdUcnFvE/1pbusuSpXbqg2BVAZxINum9BhoIDtGl7YzgXTxlKJ2MoEUdYwuZjGBdPGUonYygRR1jC5mMYF08ZSidjKBFHWMLmYxgXTxlKJ2MoEUdYwuZjGBdPGUonYygRR1jC5mMYF08ZSidjKBFHWMLmYxgXTxlKJ2MoEUdYwuZjGBdPGUonYygRR1jC5mMYF08ZSidjKBFHWMLmYxgXTxlKJ2MoEUdYwuZjGBdPGUonYygRR1jC5mMYF08ZSidjKBFHWMLmYxgXTxlKJ2MoEUdYwuZjGBdPGUonYygRR1jC5mMYF08ZSidjKBFHWMLmYxgXTxlKJ2MoEUdYwuZjGBdPGUonYygRR1jC5mMYF08ZSidjKBFHWMLmYxgXTxlKJ2/g/s2tdM/kcD0QAAAABJRU5ErkJggg=="},"9defa":function(A,n,t){A.exports=t.p+"static/img/mnesia_authentication.cee137cc.png"},aad0:function(A,n,t){A.exports=t.p+"static/img/internal_acl.aca28594.png"},b9ef:function(A,n,t){A.exports=t.p+"static/img/subscription.839c01f1.png"},beb7:function(A,n,t){A.exports=t.p+"static/img/jwt_authentication.402c6a38.png"},edff:function(A,n,t){A.exports=t.p+"static/img/tcp_protocol.e16bdfbd.png"},efbf:function(A,n){A.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACPZJREFUeAHtnWlsFVUUx09blkILbSi0pWxdWbSARqDsoBG3CJFCy6qgJpqgqYRNQIulUCMao0KkRiGCRj+YaAyEWg2IS6H4gSUBGoSWhBYRoUCXV0hbaX3nJWMmTcvMvDsz7547Z5LmTefdc+///M8vM/PumzcT5rvd2g68sANBOhAeZByHsQMBBxggBkHIAQZIyD4OZoCYASEHGCAh+ziYAWIGhBxggITs42AGiBkQcoABErKPgxkgZkDIAQZIyD4OZoCYASEHGCAh+ziYAWIGhBxggITs42AGiBkQcoABErKPgxkgZkDIAQZIyD4OZoCYASEHGCAh+ziYAWIGhBxggITs42AGiBkQcoABErKPgxkgZkDIAQZIyD4OZoCYASEHlAXou2+/ga+/+lLIHDuCa2qqoWDTRqivr7ejO+n6UBIgDR7tNVSua/CcOXNaWYiUA6gjNB3/dwsmDR5tz9Pxf7d0OD2OUgB1BUtX250ytytYutrulA43+lUGICNIjN63y2wjSIzet0uHW/0oAZBZOMy2C9Z8s3CYbResDjfjyAN0+OeDlj5tOQWRVSiwfeHmfGhra3Oz3raPRR6gCVmTID1juCVj7IbIKjwoNiIiAnJzF0F4OO0S0FbvL0RUVBTkbyoMGUTBwrNq9euQNXGSJfBlbBymyl1am5qaYEvhJqi8cN6Sz9nzcmHxkmf/j6m7dQtqa68HJv7q6+ugpaUF+sbEQExMrP8vBgYOTArsPTDA6/CgB8oAhMkEC9HUqdOhuaUZKisvwK2bN7GrLpfu3btDckoqpKWlQ/nRMkszzHjYUmXPoxmkFECYVLAQaYY49aoiPOgV+XOgjgUP9pyoYz92/q8qPOiRcgBhUjJBpDI8ygKkQZSdnYOrIV1GjBgFD40bH1INTg6u5B4IDTt54jh8+MF7Tnpnqu+KijOw1f/pEM/NVFyUO4nGIpUfPRKA5+7du9LUbMiQoYH5qn5xcdJoskOIcgD9cvgQ7Px4u5RfEcTHJ0BBYRHgqyqLUgCV/nAAdn32idS1ievfHwo2FwUmJKUWalKcMudAfxwrlx4erMmN2loo2lIADQ0NJkskdzMlALpYVQnbP3pfbqd16q5e/RvefacIWltbdVtprpIHyOfzwbZtRdDc3EyqAufOVcDePbtJae5MLHmAdn1aHDgsdJac7Nt+LC2x/OWvbDlJcxKN5wZWl1OnTkDxzh1Ww6Rqj1/MbtiYD2DxybVR0dEQGRkZ8lykAWh+9uyQm0FJwLLlL8LsOc+EXDL5Q1jIHfS4AAbI4wCIps8AiTro8XgGyOMAiKbPAIk66PF4BsjjAIimzwCJOujxeAbI4wCIpt9NtAO74nFizGhpb2+DL/Z+btTM1PvDklNg5sxHTLU1anT9+jUoObDfqJmp9/Hy18zMMYZtMzNHG7Zxo4E0AJmZVb1y5S/bAEpKSrJtJvf8n+dsA6hfvzjbdLkBEKlDWPWlS254EtIxaqqrQzq+1cFJAdTYqMZFWPcqUkMDrXspkgJIhQuw7gUPvkctR1IAyfQrCyMQgn2/zf9BgdJCCiBKxnpFKwPklUo7lCcD5JCxXumWAfJKpR3Kky9pdchYp7vlS1qddpj7d8UBPoS5YrO6gzBA6tbWlcwYIFdsVncQBkjd2rqSGQPkis3qDsIAqVtbVzJjgFyxWd1BSF2ReLGqCs6ePW1LNfCRBePGT7ClL7y7fVnZb7b0hTdMmPXYE4Z9paalGbZxo4E0AJm5Jnr/vu9tAyg5JQXMjGmmCHhJq10A4V037NJlRrtoGz6EiTro8XgGyOMAiKbPAIk66PF4UgCFhYWpXy6LdyoLtSGkAOrWTZpzfsfqhs8jo7SQAqhHjx6UvA1KKwMUlG3mghISE801JNyKWo6k9kBDhyYTRsOc9GHDUsw1lKSVNJe0vvzS86YsCeZ2wJ11jIfDPn37dvaW5W3/+u84X19vzy9K8WF5kb16GWrIyVkIj8563LCd0w2kOSu1CwyzhuHTmN0e04w2fK6YmWeL3blzx0x3jrchdQhz3A0ewLIDDJBlyzhA7wADpHeD1y07wABZtowD9A4wQHo3eN2yAwyQZcs4QO8AA6R3g9ctOyDNPNCkyVMsi8f7CV6+XGM5TqaAiIgImJA10bKkQYMGW45xIkCamehgksPb667MW0HucZf6XBctXgrz5i/QbyK1TvoQNmBAPCxZuoyU4Xqxw0eMhLnZOfpN5NZJA4RuP/nU0zBq1P3kjO/l/74r77VVEB5OuwS01fuxwasUV69dD7g3orLgec+atRsgMXEgFcld6iQPEGYWGxsLb+QXAH6TTWFZ8UoejH3gQQpSDTUqARBmOXjwEFi3/k3o2bOnYdKhbPDc8hdghk3P6AhlHtrYpD+FaUnoXy9WVcLbRZuhrq5Ovznk63jYwj2PSvCgqcoBhEldu/YPbC18C/DhLDIsvXv3hjXrNsKYMWNlkGOrBiUBQodu374Ne/fshkMHf7LVMKudjRx5H7yat1KJE+bOclcWIC3ZkyeOQ3HxDrh544a2yZVX/HUFThLOnjM38EnRlUFDMIjyAKGnePlnyYF9gDdn8Pl8jtqM8zrTZzwMObkLISFB/V+ReAIgjRgNpNLSEsBbsti54B5n8pRpMD9nAeCtY7yyeAograjt7e1QUXEWyn7/FY6VH4HGxkbtLUuvuLcZ7T8xnjZtBmRNnAw4u+y1xZMA6YuMMOGntcrKC1Dl/6upvgQNfqB8/r+mJl/g+V3R/nv2REVFQ3SfPhDvn/FOy8iA9PQMSE1Nl37eSZ+rE+ueB8gJU73UpzIz0V4qmky5MkAyVYOgFgaIYNFkkswAyVQNgloYIIJFk0kyAyRTNQhqYYAIFk0myQyQTNUgqIUBIlg0mSQzQDJVg6AWBohg0WSSzADJVA2CWhgggkWTSTIDJFM1CGphgAgWTSbJDJBM1SCohQEiWDSZJDNAMlWDoBYGiGDRZJLMAMlUDYJaGCCCRZNJMgMkUzUIamGACBZNJskMkEzVIKiFASJYNJkkM0AyVYOgFgaIYNFkkswAyVQNglr+A1t5lrEKh5ZVAAAAAElFTkSuQmCC"},f7e2:function(A,n,t){A.exports=t.p+"static/img/auth_sasl.9724eec3.png"}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-18aaaf52.04b806a1.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-18aaaf52.04b806a1.js new file mode 100644 index 000000000..d20e466aa --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-18aaaf52.04b806a1.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-18aaaf52"],{"01c8":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("178b"),r=n("3953"),s=n("1df6");function o(e){return Object(i["a"])(e)||Object(r["a"])(e)||Object(s["a"])()}},"0870":function(e,t,n){"use strict";var i=n("d283"),r=n.n(i);r.a},"0ea0":function(e,t,n){"use strict";var i=n("777d"),r=n.n(i);r.a},"205f":function(e,t,n){},"2c0e":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"module-detail"},[n("page-header",[n("div",{staticClass:"page-header-title-view"},[n("div",{staticClass:"title"},[e._v("\n "+e._s(e.moduleData.title[e.lang])+"\n ")])]),n("div",{staticClass:"page-header-content-view"},[n("div",{staticClass:"content"},[n("p",{staticClass:"description"},[e._v("\n "+e._s(e.moduleData.description[e.lang])+"\n ")])])]),"edit"===e.oper?n("div",{staticClass:"page-header-top-start delete-btn",on:{click:e.deleteModule}},[n("el-button",{attrs:{type:"danger",size:"small"}},[e._v("\n "+e._s(e.$t("RuleEngine.delete"))+"\n ")])],1):e._e()]),n("div",{staticClass:"app-wrapper"},[n("el-card",[n("div",{staticClass:"emq-title module-title"},[e._v("\n "+e._s(e.$t("Modules.configuration"))+"\n ")]),n("el-form",{ref:"record",attrs:{model:e.record,rules:e.rules,"label-position":"top",size:"small"}},[n("el-row",{staticClass:"config-item-wrapper",attrs:{gutter:30}},[e.configList.length>0?[n("el-col",{attrs:{span:16}},e._l(e.configList,function(t,i){return n("div",{key:i},["listener"!==t.key?[n("el-col",{attrs:{span:"textarea"===t.type||"object"===t.type||"array"===t.type?24:12}},["file"===t.elType||["verify","tls_version"].includes(t.key)?[["true",!0].includes(e.record.config["https_enabled"])||["true",!0].includes(e.record.config["ssl"])||void 0===e.record.config["ssl"]&&void 0===e.record.config["https_enabled"]?n("el-form-item",e._b({},"el-form-item",t.formItemAttributes,!1),["file"===t.elType?n("file-editor",{model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}}):n("emq-select",e._b({staticClass:"reset-width",model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"emq-select",t.bindAttributes,!1))],1):e._e()]:n("el-form-item",e._b({},"el-form-item",t.formItemAttributes,!1),[t.formItemAttributes.description?n("template",{slot:"label"},[e._v("\n "+e._s(t.formItemAttributes.label)+"\n "),n("el-popover",{attrs:{width:"220",trigger:"hover",placement:"top"}},[n("div",{staticClass:"emq-popover-content",domProps:{innerHTML:e._s(t.formItemAttributes.description)}}),n("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1):e._e(),"object"===t.elType?[n("key-and-value-editor",{model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}})]:"array"===t.elType?[n("array-editor",{ref:"arrayEditor",refInFor:!0,attrs:{data:t.oneObjOfArray,isDadRequired:e.rules.config[t.key].length>0},on:{updateValidate:e.updateValidate},model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}})]:"cfgselect"===t.elType?[n("config-select",e._b({staticClass:"reset-width",attrs:{extraConfigs:t.extraConfigs},on:{updateConfig:e.addConfigAccordingType},model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"config-select",t.bindAttributes,!1))]:"select"!==t.elType?["number"===t.type?n("el-input",e._b({model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,e._n(n))},expression:"record.config[item.key]"}},"el-input",t.bindAttributes,!1)):"password"===t.type?n("el-input",e._b({attrs:{"show-password":""},model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"el-input",t.bindAttributes,!1)):n("el-input",e._b({model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"el-input",t.bindAttributes,!1))]:["number"===t.type?n("emq-select",e._b({staticClass:"reset-width",model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,e._n(n))},expression:"record.config[item.key]"}},"emq-select",t.bindAttributes,!1)):n("emq-select",e._b({staticClass:"reset-width",model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"emq-select",t.bindAttributes,!1))]],2)],2)]:e._e()],2)}),0)]:n("div",{staticClass:"params-loading-wrapper"},[n("a-skeleton",{attrs:{active:""}})],1)],2)],1)],1),Object.keys(e.listener).length?n("el-card",{staticClass:"listener-wrapper"},[n("div",{staticClass:"emq-title listener-title"},[e._v("\n "+e._s(e.$t("Modules.listener"))+"\n ")]),n("Listeners",{attrs:{listenerData:e.listener},model:{value:e.record.config["listeners"],callback:function(t){e.$set(e.record.config,"listeners",t)},expression:"record.config['listeners']"}})],1):e._e()],1),n("el-col",{attrs:{span:1===e.configList.length&&-1===e.fullSpanType.indexOf(e.configList[0].type)?9:16}},[n("div",{staticClass:"button-group__center"},[n("el-button",{attrs:{size:"small"},on:{click:function(t){return e.exitDetail(!0)}}},[e._v(e._s(e.$t("Base.cancel")))]),n("el-button",{staticClass:"dialog-primary-btn",attrs:{loading:e.buttonLoading,type:"primary",size:"small"},on:{click:function(t){return e.handleCreate()}}},["add"===e.oper?n("span",[e._v(e._s(e.$t("Base.add")))]):n("span",[e._v(e._s(e.$t("Base.confirm")))])])],1)])],1)},r=[],s=n("01c8"),o=(n("7f7f"),n("7514"),n("8615"),n("96cf"),n("3b8d")),a=(n("2fdb"),n("7618")),c=(n("456d"),n("6762"),n("ac6a"),n("a8db")),l=n("943d"),u=n("90b9"),d=n("caba"),f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"array-editor"},[n("el-form",{ref:"form",attrs:{rules:e.form.rules,model:e.form}},[n("el-table",{staticClass:"array-editor",attrs:{data:e.form.tableData,size:"mini","header-cell-class-name":e.addHeaderCellClassName}},[e._l(e.headers,function(t,i){return n("el-table-column",{key:i,attrs:{label:t},scopedSlots:e._u([{key:"default",fn:function(i){var r=i.row,s=i.$index;return[n("el-form-item",{attrs:{prop:"tableData."+s+"."+r[t].formItemAttributes.prop,rules:e.form.rules[r[t].formItemAttributes.prop]}},["select"!==r[t].elType?["number"===r[t].type?n("el-input",e._b({attrs:{size:"small"},on:{input:e.atInputChange},model:{value:r[r[t].key],callback:function(n){e.$set(r,r[t].key,e._n(n))},expression:"row[row[item].key]"}},"el-input",r[t].bindAttributes,!1)):n("el-input",e._b({attrs:{size:"small"},on:{input:e.atInputChange},model:{value:r[r[t].key],callback:function(n){e.$set(r,r[t].key,n)},expression:"row[row[item].key]"}},"el-input",r[t].bindAttributes,!1))]:["number"===r[t].type?n("emq-select",e._b({staticClass:"reset-width",attrs:{size:"small"},on:{change:e.atInputChange},model:{value:r[r[t].key],callback:function(n){e.$set(r,r[t].key,e._n(n))},expression:"row[row[item].key]"}},"emq-select",r[t].bindAttributes,!1)):n("emq-select",e._b({staticClass:"reset-width",attrs:{size:"small"},on:{change:e.atInputChange},model:{value:r[r[t].key],callback:function(n){e.$set(r,r[t].key,n)},expression:"row[row[item].key]"}},"emq-select",r[t].bindAttributes,!1))]],2)]}}],null,!0)},[n("template",{slot:"header"},[n("span",{staticClass:"my-header"},[e._v("\n "+e._s(t)+"\n "),e.descriptionDic[t]?n("el-popover",{attrs:{width:"220",trigger:"hover",placement:"top"}},[n("div",{staticClass:"emq-popover-content",domProps:{innerHTML:e._s(e.descriptionDic[t])}}),n("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})]):e._e()],1)])],2)}),n("el-table-column",{attrs:{width:"60px"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",{staticClass:"btn",on:{click:function(t){return e.deleteItem(i)}}},[e._v("\n "+e._s(e.$t("components.delete"))+"\n ")])]}}])},[n("span",{staticClass:"btn",attrs:{slot:"header"},on:{click:e.addColumn},slot:"header"},[e._v("\n "+e._s(e.$t("components.add"))+"\n ")])])],2)],1)],1)},p=[],m=(n("6b54"),n("cebc")),h=n("768b"),g=(n("ffc1"),{name:"MulObjectEditor",components:{},model:{prop:"value",event:"update"},props:{value:{type:Array,required:!0},notNull:{type:Boolean,default:!1},data:{type:Object,required:!0},isDadRequired:{type:Boolean,default:!1}},data:function(){return{headers:[],oneRow:{},defaultConfig:{},allColumnRule:{},form:{tableData:[],rules:{}},innerValid:!0,descriptionDic:{}}},computed:{},created:function(){this.initData()},methods:{assignValue:function(){var e=this;if(this.value.length){for(var t=0;t0?e._l(e.showConfigList,function(t,i){return n("div",{key:i},[n("el-col",{attrs:{span:"textarea"===t.type||"object"===t.type?24:12}},[n("el-form-item",e._b({},"el-form-item",t.formItemAttributes,!1),[t.formItemAttributes.description?n("template",{slot:"label"},[e._v("\n "+e._s(t.formItemAttributes.label)+"\n "),n("el-popover",{attrs:{width:"220",trigger:"hover",placement:"top"}},[n("div",{staticClass:"emq-popover-content",domProps:{innerHTML:e._s(t.formItemAttributes.description)}}),n("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1):e._e(),"object"===t.elType?[n("key-and-value-editor",{model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}})]:"file"===t.elType?[n("file-editor",{model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}})]:"select"!==t.elType?["number"===t.type?n("el-input",e._b({model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,e._n(n))},expression:"record.config[item.key]"}},"el-input",t.bindAttributes,!1)):"password"===t.type?n("el-input",e._b({attrs:{"show-password":""},model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"el-input",t.bindAttributes,!1)):n("el-input",e._b({model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"el-input",t.bindAttributes,!1))]:["number"===t.type?n("emq-select",e._b({staticClass:"reset-width",model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,e._n(n))},expression:"record.config[item.key]"}},"emq-select",t.bindAttributes,!1)):n("emq-select",e._b({staticClass:"reset-width",model:{value:e.record.config[t.key],callback:function(n){e.$set(e.record.config,t.key,n)},expression:"record.config[item.key]"}},"emq-select",t.bindAttributes,!1))]],2)],1)],1)}):e._e()],2)],1),n("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:e.handleCancel}},[e._v("\n "+e._s(e.$t("Base.cancel"))+"\n ")]),n("el-button",{staticClass:"dialog-primary-btn",attrs:{type:"primary",size:"small"},on:{click:e.handleCreate}},[e._v("\n "+e._s(e.$t("Base.confirm"))+"\n ")])],1)],1)],2)},C=[],$=n("faa11"),w={name:"Listeners",components:{KeyAndValueEditor:d["a"],FileEditor:$["a"]},model:{prop:"value",event:"update"},props:{value:{type:Array,required:!0},listenerData:{type:Object,required:!0}},data:function(){return{listenerDialogTitle:this.$t("Modules.addListener"),listenerDialogVisible:!1,record:{config:{}},rules:{config:{}},showConfigList:[],commonConfigs:[],commonRules:{config:{}},commonRecord:{config:{}},optionConfig:{},configLoading:!1,showItemList:[],listenerList:[],currentOper:"",selectedListener:{},currentEditIndex:0}},computed:{listener_type:function(){return this.record.config.listener_type}},watch:{listener_type:function(e){this.addDataAccordingListenerType(e)}},created:function(){var e=this;this.value.length&&(this.listenerList=this.value,this.value.forEach(function(t){var n=t.listen_on,i=t.listener_type,r=t.acceptors,s=t.active_n,o=t.max_conn_rate,a=t.max_connections;e.showItemList.push({listen_on:n,listener_type:i,acceptors:r,active_n:s,max_conn_rate:o,max_connections:a})}))},methods:{addDataAccordingListenerType:function(e){var t=this,n="".concat(e,"_options"),i=this.optionConfig[n],r=i.form,o=i.rules,a=Object(s["a"])(this.commonConfigs),c=a.slice(0),l=Object.assign({},this.commonRules.config),d=Object.assign({},this.commonRecord.config);this.showConfigList=c.concat(r);var f={};r.forEach(function(e){var n=e.key,i=e.value;t.$set(f,n,i)}),this.record.config=Object.assign(d,f),this.rules.config=Object.assign(l,o);var p=[{required:!0,validator:u["r"]}];this.rules.config.listen_on=p,"edit"===this.currentOper&&Object.assign(this.record.config,this.selectedListener),this.record.config.listener_type=e,this.$refs.record&&setTimeout(this.$refs.record.clearValidate,10)},cleanOldData:function(){this.commonConfigs=[],this.commonRules.config={},this.rules.config={},this.optionConfig={},this.record.config={},this.showConfigList=[]},loadConfigList:function(){var e=this;this.cleanOldData(),this.configLoading=!0;var t=Object.assign({},this.listenerData);Object.keys(t).forEach(function(n){if(t[n]=Object(u["l"])(t[n],"config"),n.includes("options"))e.optionConfig[n]=t[n];else{var i=t[n],r=i.form,s=i.rules;e.commonConfigs=e.commonConfigs.concat(r),e.commonRules.config=Object.assign(e.commonRules.config,s)}}),this.commonRecord.config={},this.commonConfigs.forEach(function(t){var n=t.key,i=t.value;e.$set(e.commonRecord.config,n,i)}),this.showConfigList=this.commonConfigs,this.record=Object(m["a"])({},this.commonRecord),"add"===this.currentOper?this.addDataAccordingListenerType(this.commonRecord.config.listener_type):this.addDataAccordingListenerType(this.selectedListener.listener_type),this.configLoading=!1,this.$refs.record&&setTimeout(this.$refs.record.clearValidate,10)},atDialogClose:function(){var e=this;setTimeout(function(){e.$refs.record.clearValidate(),e.listenerDialogVisible=!1},10)},handleCreate:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,n,i,r,s,o,a,c,l,u=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$refs.record.validate();case 2:if(t=e.sent,t){e.next=5;break}return e.abrupt("return");case 5:n=this.record.config,Object.keys(n).forEach(function(e){var t=n[e];"true"===t&&(u.record.config[e]=!0),"false"===t&&(u.record.config[e]=!1)}),i=n.listen_on,r=n.listener_type,s=n.acceptors,o=n.active_n,a=n.max_conn_rate,c=n.max_connections,"add"===this.currentOper?(this.showItemList.push({listen_on:i,listener_type:r,acceptors:s,active_n:o,max_conn_rate:a,max_connections:c}),this.listenerList.push(n)):(l={listen_on:i,listener_type:r,acceptors:s,active_n:o,max_conn_rate:a,max_connections:c},this.listenerList.splice(this.currentEditIndex,1,n),this.showItemList.splice(this.currentEditIndex,1,l)),this.$emit("update",this.listenerList),this.atDialogClose();case 11:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleCancel:function(){this.atDialogClose()},addListener:function(){this.currentOper="add",this.listenerDialogTitle=this.$t("Modules.addListener"),this.listenerDialogVisible=!0},editListener:function(e){this.currentOper="edit",this.currentEditIndex=e,this.listenerDialogTitle=this.$t("Modules.editListener"),this.selectedListener=Object(m["a"])({},this.listenerList[e]),this.listenerDialogVisible=!0},removeListener:function(e){this.showItemList.splice(e,1),this.listenerList.splice(e,1),this.$emit("update",this.listenerList)}}},x=w,O=(n("5555"),Object(v["a"])(x,_,C,!1,null,null,null)),j=O.exports,L=n("6985"),D=n("2ef0"),R=n.n(D),I={name:"ModuleDetail",components:{KeyAndValueEditor:d["a"],ArrayEditor:k,Listeners:j,FileEditor:$["a"],ConfigSelect:L["a"]},inheritAttrs:!1,data:function(){return{configLoading:!1,configList:[],record:{config:{}},rules:{config:{}},allModuleList:[],listener:{},fullSpanType:["array","object","textarea"],originConfigList:[],originRules:{config:{}},originRecord:{config:{}},buttonLoading:!1}},computed:{oper:function(){return this.$store.state.selectedModule.oper},moduleData:function(){return this.$store.state.selectedModule},from:function(){return this.$store.state.selectedModule.from},lang:function(){return this.$store.state.lang},recordConfig:function(){return this.record.config},listeners:function(){return this.record.config.listeners}},watch:{listeners:{deep:!0,immediate:!0,handler:"handlelistenersChange"}},created:function(){this.loadData(),this.initListeners(),document.documentElement.scrollTop=0,document.body.scrollTop=0},methods:{handlelistenersChange:function(e){this.originRecord.config.listeners=R.a.cloneDeep(e)},updateValidate:function(){this.$refs.record.validate()},loadData:function(){var e=this;"add"===this.oper?this.loadConfigList(this.moduleData.paramsData):this.loadParams().then(function(t){e.loadConfigList(t)}).catch()},cleanForm:function(){var e=this;this.$refs.record&&setTimeout(function(){e.$refs.record.resetFields(),e.configList=[]},10)},loadConfigList:function(e){var t=this,n=e.listener,i=Object(c["a"])(e,["listener"]);n&&(this.listener=n),this.configLoading=!0;var r=Object(u["l"])(i,"config"),s=r.form,o=r.rules;this.configList=s,this.rules.config=o,this.record.config={},s.forEach(function(e){var n=e.key,i=e.value;t.$set(t.record.config,n,i)}),this.initListeners(),this.storeOriginData(r),this.configLoading=!1,this.$refs.record&&setTimeout(this.$refs.record.clearValidate,10)},cleanFileContent:function(e){var t=[!1,"false"];(t.includes(e.ssl)||t.includes(e.https_enabled))&&(e.verify=!1,Object.keys(e).forEach(function(t){var n=e[t];"object"===Object(a["a"])(n)&&Object.keys(n).includes("file")&&(e[t]={file:"",filename:""})}))},handleCreate:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,n,i,r,s,o,a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=this.$refs.arrayEditor,!t||!1!==t[0]._data.innerValid){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.$refs.record.validate();case 5:if(n=e.sent,n){e.next=8;break}return e.abrupt("return");case 8:if(!Object.keys(this.listener).length||this.record.config.listeners.length){e.next=11;break}return this.$message.error(this.$t("Modules.emptyListenerTip")),e.abrupt("return");case 11:if(i=this.record.config,Object.keys(i).forEach(function(e){var t=i[e];"true"===t&&(a.record.config[e]=!0),"false"===t&&(a.record.config[e]=!1)}),this.cleanFileContent(i),"add"!==this.oper){e.next=28;break}return this.buttonLoading=!0,this.record.type=this.moduleData.type,e.next=19,Object(l["d"])(this.record);case 19:r=e.sent,s=JSON.parse(localStorage.getItem("addedModules"))||{},s[r.type]=r.id,localStorage.setItem("addedModules",JSON.stringify(s)),this.$message.success(this.$t("Modules.moduleAddSuccess")),this.exitDetail(),this.buttonLoading=!1,e.next=30;break;case 28:o=!R.a.isEqual(this.record.config,this.originRecord.config),o?this.$confirm(this.$t("Modules.editTip"),this.$t("Base.warning"),{type:"warning",cancelButtonText:this.$t("Base.cancel"),confirmButtonText:this.$t("Modules.continueCommit")}).then(function(){a.confirmEditModule()}).catch(function(){}):this.exitDetail();case 30:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),confirmEditModule:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,n,i,r,s,o;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=this.moduleData,n=t.type,i=t.id,r=t.enabled,s=t.description,o={type:n,id:i,enabled:r,description:s,config:this.record.config},e.next=4,Object(l["v"])(i,o);case 4:this.$message.success(this.$t("Modules.moduleEditSuccess")),this.exitDetail();case 6:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),parseI18n:function(e){var t=Object(u["c"])(e,["title","description"]).map(function(e){return e.params=Object(u["c"])(e.params,!0),e});return t},loadParams:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,n,i,r=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(l["o"])();case 2:return t=e.sent,Object.values(t).forEach(function(e){r.allModuleList=r.allModuleList.concat(e)}),n=this.allModuleList.find(function(e){return e.name===r.moduleData.type}),this.parseI18n([n]),i=n.params,Object.keys(i).forEach(function(e){void 0!==r.moduleData.config[e]&&(i[e].default=r.moduleData.config[e])}),e.abrupt("return",i);case 9:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),deleteModule:function(){var e=this;this.$msgbox.confirm(this.$t("Modules.thisActionWillDeleteTheModule"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(l["i"])(e.moduleData.id);case 2:e.$message.success(e.$t("Base.deleteSuccess")),n=JSON.parse(localStorage.getItem("addedModules"))||{},delete n[e.moduleData.type],localStorage.setItem("addedModules",JSON.stringify(n)),e.exitDetail();case 7:case"end":return t.stop()}},t)}))).catch(function(){})},exitDetail:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.cleanForm(),setTimeout(function(){"modules"!==e.from&&t?e.$router.push("/modules/select?id=".concat(e.$route.query.id,"&top=").concat(e.$route.query.top)):e.$router.push("/modules")},10)},initListeners:function(){if(Object.keys(this.listener).length)if("add"===this.oper)this.record.config.listeners=[];else{var e=this.moduleData.config.listeners;this.record.config.listeners=e||[]}this.originRecord.config.listeners=R.a.cloneDeep(this.record.config.listeners)},storeOriginData:function(e){var t=this,n=e.form,i=e.rules;this.originConfigList=n,this.originRules.config=i,this.originRecord.config={},n.forEach(function(e){var n=e.key,i=e.value;t.$set(t.originRecord.config,n,i)})},addConfigAccordingType:function(e,t){var n=this,i=Object(s["a"])(this.originConfigList),r=i.slice(0),o=Object.assign({},this.originRules.config),a=Object.assign({},this.originRecord.config);if(Object.keys(e).length){var c=Object(u["l"])(e,"config"),l=c.form,d=c.rules,f={};l.forEach(function(e){var t=e.key,i=e.value;n.$set(f,t,i)}),this.configList=r.concat(l),this.rules.config=Object.assign(o,d),this.record.config=Object.assign(a,f)}else this.configList=r,this.rules.config=o,this.record.config=a;this.record.config.type=t,this.$refs.record&&setTimeout(this.$refs.record.clearValidate,10)}}},E=I,A=(n("b4ec"),Object(v["a"])(E,i,r,!1,null,null,null));t["default"]=A.exports},4964:function(e,t,n){"use strict";var i=n("61e3"),r=n.n(i);r.a},5555:function(e,t,n){"use strict";var i=n("c776"),r=n.n(i);r.a},"61e3":function(e,t,n){},6985:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",e._g(e._b({staticClass:"emq-select",attrs:{value:e.rawValue},on:{change:e.valueChange}},"el-select",e.$attrs,!1),e.$listeners),[e._t("default",e._l(e.options,function(t,i){return n("el-option",{key:i,attrs:{value:t[e.fieldName.value],label:t[e.fieldName.label],disabled:e.isDisabled(t)}},[e._t("option",null,{item:t})],2)}))],2)},r=[],s=(n("6762"),n("2fdb"),n("96cf"),n("3b8d")),o=(n("7514"),n("6b54"),n("1f75")),a={name:"ConfigSelect",components:{},props:{value:{required:!0},field:{type:Object,required:!0},fieldName:{type:Object,default:function(){return{label:"label",value:"value"}}},disabledItem:{type:Array,default:function(){return[]}},refresh:{type:Boolean},extraConfigs:{type:Object,defaule:function(){}}},data:function(){return{options:[],parserField:{}}},computed:{rawValue:{get:function(){return"boolean"===typeof this.value?this.value.toString():this.value},set:function(e){var t=null,n=this.fieldName.value,i=this.options.find(function(t){return t[n]===e});i&&this.parserField[n]&&(t="true"===e),this.$emit("update:value",t)}}},watch:{refresh:function(e){e&&this.loadData()},field:{handler:function(){this.loadData()},deep:!0}},created:function(){this.loadData(),this.$emit("updateConfig",this.extraConfigs[this.rawValue],this.rawValue,this.extraConfigs)},methods:{valueChange:function(e){e&&this.$emit("updateConfig",this.extraConfigs[e],e,this.extraConfigs)},loadData:function(){var e=Object(s["a"])(regeneratorRuntime.mark(function e(){var t,n,i,r=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getOptions();case 2:t=e.sent,this.parserField={},n=this.fieldName.value,i=this.fieldName.label,this.options=t.map(function(e){var t=e[n],s=e[i];return"boolean"===typeof t&&(r.parserField[n]="boolean",e[n]=t.toString(),"boolean"===typeof s&&(e[i]=s.toString())),e}),this.$emit("update:refresh",!1);case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),isDisabled:function(e){return this.disabledItem.includes(e[this.fieldName.value])},getOptions:function(){var e=Object(s["a"])(regeneratorRuntime.mark(function e(){var t,n,i,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=this.field,n=t.api,i=t.url,r=t.options,s=t.list,a=[],!r){e.next=6;break}a=r,e.next=20;break;case 6:if(!s){e.next=10;break}a=s.map(function(e){return{label:e,value:e}}),e.next=20;break;case 10:if(!n){e.next=16;break}return e.next=13,n();case 13:a=e.sent,e.next=20;break;case 16:if(!i){e.next=20;break}return e.next=19,o["a"].get(i);case 19:a=e.sent;case 20:return e.abrupt("return",a);case 21:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}},c=a,l=(n("4964"),n("2877")),u=Object(l["a"])(c,i,r,!1,null,null,null);t["a"]=u.exports},"6fc1":function(e,t,n){},"777d":function(e,t,n){},"943d":function(e,t,n){"use strict";n.d(t,"o",function(){return s}),n.d(t,"d",function(){return o}),n.d(t,"q",function(){return a}),n.d(t,"s",function(){return c}),n.d(t,"i",function(){return l}),n.d(t,"v",function(){return u}),n.d(t,"b",function(){return d}),n.d(t,"p",function(){return f}),n.d(t,"u",function(){return p}),n.d(t,"g",function(){return m}),n.d(t,"n",function(){return h}),n.d(t,"a",function(){return g}),n.d(t,"f",function(){return b}),n.d(t,"e",function(){return v}),n.d(t,"m",function(){return y}),n.d(t,"c",function(){return _}),n.d(t,"j",function(){return C}),n.d(t,"h",function(){return $}),n.d(t,"t",function(){return w}),n.d(t,"k",function(){return x}),n.d(t,"l",function(){return O}),n.d(t,"r",function(){return j});n("ac6a"),n("456d"),n("96cf");var i=n("3b8d"),r=n("1f75");function s(){return r["a"].get("/module_types")}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["a"].post("/modules",e)}function a(){return r["a"].get("/modules")}function c(e){return r["a"].get("/modules/".concat(e))}function l(e){return r["a"].delete("/modules/".concat(e))}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].put("/modules/".concat(e),t)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].post("/auth_".concat(e),t)}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].get("/auth_".concat(e),{params:t})}function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r["a"].put("/auth_".concat(e,"/").concat(encodeURIComponent(t)),n)}function m(e,t){return r["a"].delete("/auth_".concat(e,"/").concat(encodeURIComponent(t)))}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].get("/acl/".concat(e),{params:t})}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["a"].post("/acl",e)}function b(e,t,n){return r["a"].delete("/acl/".concat(e,"/").concat(encodeURIComponent(t),"/topic/").concat(encodeURIComponent(n)))}function v(e){return r["a"].delete("/acl/$all/topic/".concat(encodeURIComponent(e)))}function y(e){return k.apply(this,arguments)}function k(){return k=Object(i["a"])(regeneratorRuntime.mark(function e(t){var n,i,s;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,r["a"].get("/sasl?mechanism=".concat(t));case 2:return n=e.sent,i=Object.keys(n)[0],s=[],n[i].forEach(function(e){var t={username:e};s.push(t)}),e.abrupt("return",s);case 7:case"end":return e.stop()}},e)})),k.apply(this,arguments)}function _(e){return r["a"].post("/sasl",e)}function C(e){return r["a"].put("/sasl",e)}function $(e,t){return r["a"].delete("/sasl?mechanism=".concat(e,"&username=").concat(encodeURIComponent(t)))}function w(e,t){return r["a"].get("/sasl?mechanism=".concat(e,"&username=").concat(encodeURIComponent(t)))}function x(e){return r["a"].get("/nodes/".concat(e,"/lwm2m_channels"))}function O(e,t,n,i){return r["a"].get("/nodes/".concat(e,"/lookup_cmd/").concat(t,"?msgType=").concat(n,"&path=").concat(i))}function j(e){return r["a"].post("/mqtt/publish",e)}},a8db:function(e,t,n){"use strict";var i=n("e265"),r=n.n(i),s=n("a4bb"),o=n.n(s);function a(e,t){if(null==e)return{};var n,i,r={},s=o()(e);for(i=0;i=0||(r[n]=e[n]);return r}function c(e,t){if(null==e)return{};var n,i,s=a(e,t);if(r.a){var o=r()(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}n.d(t,"a",function(){return c})},b4ec:function(e,t,n){"use strict";var i=n("205f"),r=n.n(i);r.a},c776:function(e,t,n){},caba:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-table",{staticClass:"key-and-value-editor",attrs:{data:e.tableData,size:"mini"}},[n("el-table-column",{attrs:{prop:"key",label:e.$t("components.key"),"min-width":"80px"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("el-input",{staticClass:"key-input",staticStyle:{width:"120px !important"},attrs:{size:"mini",placeholder:e.$t("components.objectKey")},on:{input:e.atInputChange},model:{value:i.key,callback:function(t){e.$set(i,"key",t)},expression:"row.key"}})]}}])}),n("el-table-column",{attrs:{prop:"value",label:e.$t("components.value"),"min-width":"150px"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("el-input",{attrs:{size:"mini"},on:{input:e.atInputChange},model:{value:i.value,callback:function(t){e.$set(i,"value",t)},expression:"row.value"}})]}}])}),n("el-table-column",{attrs:{width:"60px"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",{staticClass:"btn",on:{click:function(t){return e.deleteItem(i)}}},[e._v("\n "+e._s(e.$t("components.delete"))+"\n ")])]}}])},[n("span",{staticClass:"btn",attrs:{slot:"header"},on:{click:e.addColumn},slot:"header"},[e._v("\n "+e._s(e.$t("components.add"))+"\n ")])])],1)},r=[],s=n("768b"),o=(n("ffc1"),n("ac6a"),{name:"KeyAndValueEditor",components:{},model:{prop:"value",event:"update"},props:{value:{type:Object,required:!0},notNull:{type:Boolean,default:!1}},data:function(){return{row:{key:"",value:"",state:0},tableData:[]}},computed:{},created:function(){var e=[],t=this.value;Object.entries(t).forEach(function(t){var n=Object(s["a"])(t,2),i=n[0],r=n[1];e.push({key:i,value:r,state:0})}),this.tableData=e},methods:{atInputChange:function(){var e={};this.tableData.forEach(function(t){var n=t.key,i=t.value;e[n]=i}),this.$emit("update",e)},deleteItem:function(e){this.tableData=this.tableData.filter(function(t){return t.key!==e.key}),this.atInputChange()},addColumn:function(){this.tableData.push({key:"",value:"",state:0})}}}),a=o,c=(n("db2b"),n("2877")),l=Object(c["a"])(a,i,r,!1,null,null,null);t["a"]=l.exports},d283:function(e,t,n){},db2b:function(e,t,n){"use strict";var i=n("6fc1"),r=n.n(i);r.a},faa11:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"file-editor"},[n("el-row",[n("el-col",{attrs:{span:22}},[n("el-form-item",{staticStyle:{"margin-bottom":"0px"}},[n("el-input",{attrs:{placeholder:e.$t("Modules.fileTip")},model:{value:e.value.filename,callback:function(t){e.$set(e.value,"filename",t)},expression:"value.filename"}})],1)],1),n("el-col",{attrs:{span:2}},[n("el-upload",{ref:"upload",attrs:{"show-file-list":!1,action:"/api/v4/data/file","auto-upload":!1,"on-change":e.handleChange,"on-error":e.handleError}},[n("i",{staticClass:"el-icon-folder-opened file-icon"})])],1)],1)],1)},r=[],s=(n("6b54"),n("7f7f"),n("96cf"),n("3b8d")),o={name:"FileEditor",model:{prop:"value",event:"update"},props:{value:{type:Object,required:!0}},methods:{handleChange:function(e){var t=this,n=new FileReader;n.readAsText(e.raw),n.onload=function(){var n=Object(s["a"])(regeneratorRuntime.mark(function n(i){var r,s;return regeneratorRuntime.wrap(function(n){while(1)switch(n.prev=n.next){case 0:r=i.currentTarget.result,s={file:r,filename:e.name},t.$emit("update",s);case 3:case"end":return n.stop()}},n)}));return function(e){return n.apply(this,arguments)}}(),n.onerror=function(){t.$message.error(t.$t("Backup.uploadFailed"))}},handleError:function(e){this.$message.error(e.toString())}}},a=o,c=(n("0870"),n("2877")),l=Object(c["a"])(a,i,r,!1,null,null,null);t["a"]=l.exports}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-19e46f15.d147220b.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-19e46f15.d147220b.js new file mode 100644 index 000000000..242f150a1 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-19e46f15.d147220b.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-19e46f15"],{2327:function(e,t,a){},"2bbf":function(e,t,a){},"53cc":function(e,t,a){},"5f03":function(e,t,a){"use strict";var n=a("6a76"),r=a.n(n);r.a},"6a76":function(e,t,a){},"71f9":function(e,t,a){"use strict";var n=a("2bbf"),r=a.n(n);r.a},"8f2b":function(e,t,a){"use strict";var n=a("2327"),r=a.n(n);r.a},"8fd4":function(e,t,a){"use strict";var n=a("53cc"),r=a.n(n);r.a},"9be9":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"plugin-manage"},["emqx_auth_clientid"===e.pluginName?[a("auth-clientId-table")]:e._e(),"emqx_auth_username"===e.pluginName?[a("auth-username-table")]:e._e(),"emqx_auth_mnesia"===e.pluginName?[a("auth-mnesia-table")]:e._e(),"emqx_auth_jwt"===e.pluginName?[a("generate-JWT")]:e._e()],2)},r=[],s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"auth-clientid-table"},[a("div",{staticClass:"app-wrapper"},[a("a-card",{staticClass:"emq-list-card",attrs:{loading:e.listLoading}},[a("div",{staticClass:"emq-table-header"},[a("el-row",{staticClass:"add-form",attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{size:"small",placeholder:e.$t("Clients.clientId")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.save(t)}},model:{value:e.record.clientid,callback:function(t){e.$set(e.record,"clientid",t)},expression:"record.clientid"}})],1),a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{size:"small",type:"password",placeholder:e.$t("Base.password")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.save(t)}},model:{value:e.record.password,callback:function(t){e.$set(e.record,"password",t)},expression:"record.password"}})],1),a("div",{staticClass:"col-oper"},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.save}},[e._v("\n "+e._s(e.$t("Base.add"))+"\n ")])],1)],1)],1),a("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[a("el-table-column",{attrs:{prop:"clientid",label:e.$t("Clients.clientId")}}),a("el-table-column",{attrs:{prop:"oper",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.showEdit(n)}}},[e._v("\n "+e._s(e.$t("Base.edit"))+"\n ")]),a("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.handleDelete(n)}}},[e._v("\n "+e._s(e.$t("Base.delete"))+"\n ")])]}}])})],1)],1)],1),a("el-dialog",{attrs:{visible:e.editVisible,width:"400px",title:e.$t("Base.edit")},on:{"update:visible":function(t){e.editVisible=t}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleEdit(t)}}},[a("el-form",{ref:"editRecord",staticClass:"el-form--public app-info",attrs:{size:"medium",rules:e.rules,model:e.editRecord}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"clientid",label:"Client ID"}},[a("el-input",{attrs:{disabled:""},model:{value:e.editRecord.clientid,callback:function(t){e.$set(e.editRecord,"clientid",t)},expression:"editRecord.clientid"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"password",label:"Password"}},[a("el-input",{attrs:{type:"password"},model:{value:e.editRecord.password,callback:function(t){e.$set(e.editRecord,"password",t)},expression:"editRecord.password"}})],1)],1)],1)],1),a("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"cache-btn",attrs:{plain:"",size:"small"},on:{click:function(t){e.editVisible=!1}}},[e._v("\n "+e._s(e.$t("Base.cancel"))+"\n ")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.handleEdit}},[e._v("\n "+e._s(e.$t("Base.confirm"))+"\n ")])],1)],1)],1)},i=[],l=a("cebc"),o=(a("96cf"),a("3b8d")),c=a("c65d"),u={name:"AuthClientIdTable",data:function(){return{editVisible:!1,listLoading:!0,record:{},tableData:[],editRecord:{},rules:{clientid:{required:!0,message:this.$t("Plugins.pleaseEnter")},password:{required:!0,message:this.$t("Plugins.pleaseEnter")}}}},created:function(){this.loadData()},methods:{loadData:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["i"])();case 2:t=e.sent,this.tableData=t.map(function(e){return{clientid:e}}),this.listLoading=!1;case 5:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),save:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.record.clientid&&this.record.password){e.next=3;break}return this.$message.warning(this.$t("Plugins.authClientidRequired")),e.abrupt("return");case 3:return t=Object(l["a"])({},this.record),e.next=6,Object(c["a"])(t);case 6:a=e.sent,a&&(this.loadData(),this.record={});case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleDelete:function(e){var t=this,a=e.clientid;this.$confirm(this.$t("Plugins.confirmDelete"),this.$t("Base.warning"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["e"])(a);case 2:n=e.sent,n&&t.loadData();case 4:case"end":return e.stop()}},e)}))).catch(function(){})},showEdit:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(t){var a,n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=t.clientid,this.editVisible=!0,e.next=4,Object(c["m"])(a);case 4:n=e.sent,this.editRecord=n,this.editRecord.password="",this.$refs.editRecord.resetFields();case 8:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),handleEdit:function(){var e=this;this.$refs.editRecord.validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(a){var n,r,s,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(a){t.next=2;break}return t.abrupt("return");case 2:return n=e.editRecord,r=n.clientid,s=n.password,i={password:s},t.next=6,Object(c["s"])(r,i);case 6:e.loadData(),e.$message.success(e.$t("Base.editSuccess")),e.editRecord={},e.editVisible=!1,e.$refs.editRecord.resetFields();case 11:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}},d=u,p=(a("71f9"),a("2877")),h=Object(p["a"])(d,s,i,!1,null,null,null),m=h.exports,f=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"auth-username-table"},[a("div",{staticClass:"app-wrapper"},[a("a-card",{staticClass:"emq-list-card",attrs:{loading:e.listLoading}},[a("div",{staticClass:"emq-table-header"},[a("el-row",{staticClass:"add-form",attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{size:"small",placeholder:e.$t("Clients.username")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.save(t)}},model:{value:e.record.username,callback:function(t){e.$set(e.record,"username",t)},expression:"record.username"}})],1),a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{size:"small",type:"password",placeholder:e.$t("Base.password")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.save(t)}},model:{value:e.record.password,callback:function(t){e.$set(e.record,"password",t)},expression:"record.password"}})],1),a("div",{staticClass:"col-oper"},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.save}},[e._v("\n "+e._s(e.$t("Base.add"))+"\n ")])],1)],1)],1),a("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[a("el-table-column",{attrs:{prop:"username",label:e.$t("Clients.username")}}),a("el-table-column",{attrs:{prop:"oper",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.showEdit(n)}}},[e._v("\n "+e._s(e.$t("Base.edit"))+"\n ")]),a("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.handleDelete(n)}}},[e._v("\n "+e._s(e.$t("Base.delete"))+"\n ")])]}}])})],1)],1)],1),a("el-dialog",{attrs:{visible:e.editVisible,width:"400px",title:e.$t("Base.edit")},on:{"update:visible":function(t){e.editVisible=t}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleEdit(t)}}},[a("el-form",{ref:"editRecord",staticClass:"el-form--public app-info",attrs:{size:"medium",rules:e.rules,model:e.editRecord}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"username",label:e.$t("Clients.username")}},[a("el-input",{attrs:{disabled:""},model:{value:e.editRecord.username,callback:function(t){e.$set(e.editRecord,"username",t)},expression:"editRecord.username"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"password",label:"Password"}},[a("el-input",{attrs:{type:"password"},model:{value:e.editRecord.password,callback:function(t){e.$set(e.editRecord,"password",t)},expression:"editRecord.password"}})],1)],1)],1)],1),a("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"cache-btn",attrs:{plain:"",size:"small"},on:{click:function(t){e.editVisible=!1}}},[e._v("\n "+e._s(e.$t("Base.cancel"))+"\n ")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.handleEdit}},[e._v("\n "+e._s(e.$t("Base.confirm"))+"\n ")])],1)],1)],1)},g=[],b={name:"AuthUsernameTable",data:function(){return{editVisible:!1,listLoading:!0,record:{},tableData:[],editRecord:{},rules:{username:{required:!0,message:this.$t("Plugins.pleaseEnter")},password:{required:!0,message:this.$t("Plugins.pleaseEnter")}}}},created:function(){this.loadData()},methods:{loadData:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["j"])();case 2:t=e.sent,this.tableData=t.map(function(e){return{username:e}}),this.listLoading=!1;case 5:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),save:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.record.username&&this.record.password){e.next=3;break}return this.$message.warning(this.$t("Plugins.authClientidRequired")),e.abrupt("return");case 3:return t=Object(l["a"])({},this.record),e.next=6,Object(c["d"])(t);case 6:a=e.sent,a&&(this.loadData(),this.record={});case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleDelete:function(e){var t=this,a=e.username;this.$confirm(this.$t("Plugins.confirmDelete"),this.$t("Base.warning"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["h"])(a);case 2:n=e.sent,n&&t.loadData();case 4:case"end":return e.stop()}},e)}))).catch(function(){})},showEdit:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(t){var a,n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=t.username,this.editVisible=!0,e.next=4,Object(c["o"])(a);case 4:n=e.sent,this.editRecord=n,this.editRecord.password="",this.$refs.editRecord.resetFields();case 8:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),handleEdit:function(){var e=this;this.$refs.editRecord.validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(a){var n,r,s,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(a){t.next=2;break}return t.abrupt("return");case 2:return n=e.editRecord,r=n.username,s=n.password,i={password:s},t.next=6,Object(c["u"])(r,i);case 6:e.loadData(),e.$message.success(e.$t("Base.editSuccess")),e.editRecord={},e.editVisible=!1,e.$refs.editRecord.resetFields();case 11:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}},v=b,w=(a("8f2b"),Object(p["a"])(v,f,g,!1,null,null,null)),$=w.exports,k=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"auth-mnesia-table"},[a("div",{staticClass:"app-wrapper"},[a("a-card",{staticClass:"emq-list-card",attrs:{loading:e.listLoading}},[a("div",{staticClass:"auth"},[a("h3",[e._v(e._s(e.$t("Plugins.auth")))]),a("div",{staticClass:"emq-table-header"},[a("el-row",{staticClass:"add-form",attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{size:"small",placeholder:e.fromCloud?e.$t("Plugins.username"):e.$t("Plugins.usernameOrClientid")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.AuthSave(t)}},model:{value:e.authRecord.login,callback:function(t){e.$set(e.authRecord,"login",t)},expression:"authRecord.login"}}),e.fromCloud?e._e():a("el-popover",{attrs:{trigger:"hover",placement:"top",content:e.$t("Plugins.mnesiaTip"),tabindex:-1}},[a("a",{staticClass:"tutorial",attrs:{slot:"reference",href:e.mnesiaDoc,target:"_blank",rel:"noopener"},slot:"reference"},[a("i",{staticClass:"iconfont icon-bangzhu"})])])],1),a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{size:"small",type:"password",placeholder:e.$t("Base.password")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.AuthSave(t)}},model:{value:e.authRecord.password,callback:function(t){e.$set(e.authRecord,"password",t)},expression:"authRecord.password"}})],1),a("div",{staticClass:"col-oper"},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.AuthSave}},[e._v("\n "+e._s(e.$t("Base.add"))+"\n ")])],1)],1)],1),a("el-table",{staticClass:"data-list",attrs:{data:e.authTableData}},[a("el-table-column",{attrs:{prop:"login",label:e.fromCloud?e.$t("Plugins.username"):e.$t("Plugins.usernameOrClientid")}}),a("el-table-column",{attrs:{prop:"oper",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.showAuthEdit(n)}}},[e._v("\n "+e._s(e.$t("Base.edit"))+"\n ")]),a("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.handleAuthDelete(n)}}},[e._v("\n "+e._s(e.$t("Base.delete"))+"\n ")])]}}])})],1),a("div",{staticClass:"emq-table-footer"},[e.authCount>10?a("el-pagination",{attrs:{background:"",layout:"total, sizes, prev, pager, next","page-sizes":[10,50,100,500],"page-size":e.authParams._limit,"current-page":e.authParams._page,total:e.authCount},on:{"update:pageSize":function(t){return e.$set(e.authParams,"_limit",t)},"update:page-size":function(t){return e.$set(e.authParams,"_limit",t)},"update:currentPage":function(t){return e.$set(e.authParams,"_page",t)},"update:current-page":function(t){return e.$set(e.authParams,"_page",t)},"size-change":e.handleAuthSizeChange,"current-change":e.handleAuthCurrentPageChange}}):e._e()],1)],1),a("div",{staticClass:"acl"},[a("h3",[e._v("ACL")]),a("div",{staticClass:"emq-table-header"},[a("el-row",{staticClass:"add-form",attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-autocomplete",{attrs:{size:"small","value-key":"label","fetch-suggestions":e.queryACLSearch,placeholder:e.fromCloud?e.$t("Plugins.username"):e.$t("Plugins.usernameOrClientid")},on:{select:e.handleACLSelect},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.ACLSave(t)}},model:{value:e.aclRecord.login,callback:function(t){e.$set(e.aclRecord,"login",t)},expression:"aclRecord.login"}}),e.fromCloud?e._e():a("el-popover",{attrs:{trigger:"hover",placement:"top",content:e.$t("Plugins.mnesiaTip"),tabindex:-1}},[a("a",{staticClass:"tutorial",attrs:{slot:"reference",href:e.mnesiaDoc,target:"_blank",rel:"noopener"},slot:"reference"},[a("i",{staticClass:"iconfont icon-bangzhu"})])])],1),a("el-col",{attrs:{span:6}},[a("el-input",{attrs:{size:"small",placeholder:e.$t("Topics.topic")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.ACLSave(t)}},model:{value:e.aclRecord.topic,callback:function(t){e.$set(e.aclRecord,"topic",t)},expression:"aclRecord.topic"}})],1),a("el-col",{attrs:{span:4}},[a("emq-select",{attrs:{size:"small",field:{options:e.allowOptions}},model:{value:e.aclRecord.allow,callback:function(t){e.$set(e.aclRecord,"allow",t)},expression:"aclRecord.allow"}})],1),a("el-col",{attrs:{span:4}},[a("emq-select",{attrs:{size:"small",field:{options:e.actionOptions}},model:{value:e.aclRecord.action,callback:function(t){e.$set(e.aclRecord,"action",t)},expression:"aclRecord.action"}})],1),a("div",{staticClass:"col-oper"},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.ACLSave}},[e._v("\n "+e._s(e.$t("Base.add"))+"\n ")])],1)],1)],1),a("el-table",{staticClass:"data-list",attrs:{data:e.aclTableData}},[a("el-table-column",{attrs:{prop:"login",label:e.fromCloud?e.$t("Plugins.username"):e.$t("Plugins.usernameOrClientid")}}),a("el-table-column",{attrs:{prop:"topic",label:e.$t("Topics.topic")}}),a("el-table-column",{attrs:{prop:"action",label:e.$t("Plugins.action")}}),a("el-table-column",{attrs:{prop:"allow",label:e.$t("Plugins.isAllow")},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v("\n "+e._s(a.allow?e.$t("Plugins.allow"):e.$t("Plugins.deny"))+"\n ")]}}])}),a("el-table-column",{attrs:{prop:"oper",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.handleACLDelete(n)}}},[e._v("\n "+e._s(e.$t("Base.delete"))+"\n ")])]}}])})],1),a("div",{staticClass:"emq-table-footer"},[e.aclCount>10?a("el-pagination",{attrs:{background:"",layout:"total, sizes, prev, pager, next","page-sizes":[10,50,100,500],"page-size":e.aclParams._limit,"current-page":e.aclParams._page,total:e.aclCount},on:{"update:pageSize":function(t){return e.$set(e.aclParams,"_limit",t)},"update:page-size":function(t){return e.$set(e.aclParams,"_limit",t)},"update:currentPage":function(t){return e.$set(e.aclParams,"_page",t)},"update:current-page":function(t){return e.$set(e.aclParams,"_page",t)},"size-change":e.handleACLSizeChange,"current-change":e.handleACLCurrentPageChange}}):e._e()],1)],1)])],1),a("el-dialog",{attrs:{visible:e.editVisible,width:"400px",title:e.$t("Base.edit")},on:{"update:visible":function(t){e.editVisible=t}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleAuthEdit(t)}}},[a("el-form",{ref:"editRecord",staticClass:"el-form--public app-info",attrs:{size:"medium",rules:e.rules,model:e.editRecord}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"login",label:e.fromCloud?e.$t("Plugins.username"):e.$t("Plugins.usernameOrClientid")}},[a("el-input",{attrs:{disabled:""},model:{value:e.editRecord.login,callback:function(t){e.$set(e.editRecord,"login",t)},expression:"editRecord.login"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"password",label:"Password"}},[a("el-input",{attrs:{type:"password"},model:{value:e.editRecord.password,callback:function(t){e.$set(e.editRecord,"password",t)},expression:"editRecord.password"}})],1)],1)],1)],1),a("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"cache-btn",attrs:{plain:"",size:"small"},on:{click:function(t){e.editVisible=!1}}},[e._v("\n "+e._s(e.$t("Base.cancel"))+"\n ")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.handleAuthEdit}},[e._v("\n "+e._s(e.$t("Base.confirm"))+"\n ")])],1)],1)],1)},y=[],_=a("90b9"),C=a("a47b"),x={name:"AuthMnesiaTable",data:function(){return{editVisible:!1,listLoading:!0,authRecord:{is_superuser:!1},aclRecord:{action:"pubsub",allow:!0},authTableData:[],aclTableData:[],editRecord:{},rules:{login:{required:!0,message:this.$t("Plugins.pleaseEnter")},password:{required:!0,message:this.$t("Plugins.pleaseEnter")}},authParams:{_page:1,_limit:10},authCount:0,aclParams:{_page:1,_limit:10},aclCount:0,allowOptions:[{label:this.$t("Plugins.allow"),value:!0},{label:this.$t("Plugins.deny"),value:!1}],actionOptions:[{label:"pub",value:"pub"},{label:"sub",value:"sub"},{label:"pubsub",value:"pubsub"}],fromCloud:!1}},computed:{mnesiaDoc:function(){return Object(_["g"])("mnesia")}},created:function(){"/dashboard"===C["a"].state.config.baseURL&&(this.fromCloud=!0),this.loadMnesia(),this.loadACL()},methods:{loadMnesia:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(t){var a,n,r,s,i;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t&&(this.authParams._page=1),e.next=3,Object(c["k"])(Object(l["a"])({},this.authParams));case 3:a=e.sent,n=a.items,r=void 0===n?[]:n,s=a.meta.count,i=void 0===s?0:s,this.authTableData=r,this.authCount=i,this.listLoading=!1;case 8:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),AuthSave:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.authRecord.login&&this.authRecord.password){e.next=3;break}return this.$message.warning(this.$t("Plugins.authMnesiaRequired")),e.abrupt("return");case 3:return t=Object(l["a"])({},this.authRecord),e.next=6,Object(c["b"])(t);case 6:a=e.sent,a&&(this.loadMnesia(),this.authRecord={is_superuser:!1});case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleAuthDelete:function(e){var t=this,a=e.login;this.$confirm(this.$t("Plugins.confirmDelete"),this.$t("Base.warning"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["f"])(a);case 2:n=e.sent,n&&t.loadMnesia(!0);case 4:case"end":return e.stop()}},e)}))).catch(function(){})},showAuthEdit:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(t){var a,n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=t.login,this.editVisible=!0,e.next=4,Object(c["n"])(a);case 4:n=e.sent,this.editRecord=n,this.editRecord.password="",this.$refs.editRecord.resetFields();case 8:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),handleAuthEdit:function(){var e=this;this.$refs.editRecord.validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(a){var n,r,s,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(a){t.next=2;break}return t.abrupt("return");case 2:return n=e.editRecord,r=n.login,s=n.password,i={password:s,is_superuser:!1},t.next=6,Object(c["t"])(r,i);case 6:e.loadMnesia(),e.$message.success(e.$t("Base.editSuccess")),e.editRecord={},e.editVisible=!1,e.$refs.editRecord.resetFields();case 11:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},handleAuthSizeChange:function(){this.loadMnesia(!0)},handleAuthCurrentPageChange:function(){this.loadMnesia()},loadACL:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(t){var a,n,r,s,i;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t&&(this.aclParams._page=1),e.next=3,Object(c["l"])(Object(l["a"])({},this.aclParams));case 3:a=e.sent,n=a.items,r=void 0===n?[]:n,s=a.meta.count,i=void 0===s?0:s,this.aclTableData=r,this.aclCount=i,this.listLoading=!1;case 8:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),ACLSave:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.aclRecord.login&&this.aclRecord.topic){e.next=3;break}return this.$message.warning(this.$t("Plugins.aclMnesiaRequired")),e.abrupt("return");case 3:return t=Object(l["a"])({},this.aclRecord),t.allow="false"!==this.aclRecord.allow,e.next=7,Object(c["c"])(t);case 7:a=e.sent,a&&(this.loadACL(),this.aclRecord={action:"pubsub",allow:!0});case 9:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleACLDelete:function(e){var t=this,a=e.login,n=e.topic;this.$confirm(this.$t("Plugins.confirmDelete"),this.$t("Base.warning"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["g"])(a,n);case 2:r=e.sent,r&&t.loadACL(!0);case 4:case"end":return e.stop()}},e)}))).catch(function(){})},queryACLSearch:function(e,t){var a=[{value:"$all",label:this.$t("Plugins.allUsers")}];t(a)},handleACLSelect:function(e){this.aclRecord.login=e.value},handleACLSizeChange:function(){this.loadACL(!0)},handleACLCurrentPageChange:function(){this.loadACL()}}},R=x,O=(a("5f03"),Object(p["a"])(R,k,y,!1,null,null,null)),P=O.exports,j=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"generate-jwt"},[a("div",{staticClass:"app-wrapper"},[a("a-card",{staticClass:"emq-list-card"},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:14}},[a("el-form",{ref:"record",attrs:{model:e.record,rules:e.rules}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"alg"}},[a("emq-select",{staticClass:"el-select--public",attrs:{size:"small","popper-class":"el-select--public",field:{list:e.algsOptions},placeholder:e.$t("Plugins.algorithm")},model:{value:e.record.alg,callback:function(t){e.$set(e.record,"alg",t)},expression:"record.alg"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"secret"}},[a("el-input",{attrs:{placeholder:e.$t("Plugins.secret"),size:"small"},model:{value:e.record.secret,callback:function(t){e.$set(e.record,"secret",t)},expression:"record.secret"}})],1)],1)],1),a("el-form-item",[a("el-checkbox",{attrs:{size:"small"},model:{value:e.payloadVisible,callback:function(t){e.payloadVisible=t},expression:"payloadVisible"}},[e._v("Payload")])],1),e.payloadVisible?[a("p",{staticClass:"jwt-payload-desc"},[e._v("\n "+e._s(e.$t("Plugins.payloadDesc"))+"\n "),a("a",{attrs:{href:e.jwtDoc,target:"_blank",rel:"noopener"}},[e._v(e._s(e.$t("Plugins.jwtDoc")))])]),a("el-form-item",{attrs:{prop:"payload"}},[a("div",{staticClass:"monaco-container",staticStyle:{height:"200px"}},[a("monaco",{attrs:{id:"jwt-payload",lang:"json"},model:{value:e.record.payload,callback:function(t){e.$set(e.record,"payload",t)},expression:"record.payload"}})],1)]),a("p",{staticClass:"jwt-payload-desc"},[e._v("\n "+e._s(e.$t("Plugins.dataDesc"))+"\n ")]),a("el-form-item",{attrs:{prop:"data"}},[a("div",{staticClass:"monaco-container",staticStyle:{height:"200px"}},[a("monaco",{attrs:{id:"jwt-data",lang:"plaintext"},model:{value:e.record.data,callback:function(t){e.$set(e.record,"data",t)},expression:"record.data"}})],1)])]:e._e(),a("el-form-item",{attrs:{prop:"expired"}},[a("el-date-picker",{attrs:{"picker-options":e.pickerOptions,placeholder:e.$t("General.neverExpire"),"value-format":"timestamp",size:"small"},model:{value:e.record.expired,callback:function(t){e.$set(e.record,"expired",t)},expression:"record.expired"}})],1),a("el-button",{staticClass:"add",attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v("\n "+e._s(e.$t("Base.generate"))+"\n ")])],2)],1)],1),a("el-table",{attrs:{data:e.records}},[a("el-table-column",{attrs:{prop:"username",label:"Username"}}),a("el-table-column",{attrs:{prop:"clientid",label:"Client ID"}}),a("el-table-column",{attrs:{"min-width":"160px",prop:"token",label:"token","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{directives:[{name:"clipboard",rawName:"v-clipboard:cpoy",value:n.token,expression:"row.token",arg:"cpoy"},{name:"clipboard",rawName:"v-clipboard:success",value:e.copySuccessed,expression:"copySuccessed",arg:"success"}],attrs:{type:"dashed",size:"mini",icon:"el-icon-document-copy"}},[e._v("\n "+e._s(e.$t("Base.copy"))+"\n ")])]}}])})],1)],1)],1)])},B=[],z=(a("a481"),a("768b")),D=(a("28a5"),a("14b7")),S=a.n(D),A=a("9146"),q={name:"GenerateJwt",components:{Monaco:A["a"]},data:function(){return{record:{alg:"HS256",payload:JSON.stringify({username:"%u",clientid:"%c"},null,2),data:""},rules:{secret:{required:!0,message:this.$t("Plugins.secretRequired")},payload:{required:!0,message:this.$t("Plugins.payloadRequired")},data:{required:!0,message:this.$t("Plugins.dataRequired")}},algsOptions:["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],payloadVisible:!1,pickerOptions:{disabledDate:function(e){return e.getTime()0&&void 0!==arguments[0]?arguments[0]:{};return n["a"].post("/auth_clientid",e)}function c(e){return n["a"].delete("/auth_clientid/".concat(e))}function u(e){return n["a"].get("/auth_clientid/".concat(e))}function d(e,t){return n["a"].put("/auth_clientid/".concat(e),t)}function p(){return n["a"].get("/auth_username")}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["a"].post("/auth_username",e)}function m(e){return n["a"].delete("/auth_username/".concat(e))}function f(e){return n["a"].get("/auth_username/".concat(e))}function g(e,t){return n["a"].put("/auth_username/".concat(e),t)}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["a"].get("/auth_user",{params:e})}function v(e){return n["a"].post("/auth_user",e)}function w(e){return n["a"].delete("/auth_user/".concat(encodeURIComponent(e)))}function $(e){return n["a"].get("/auth_user/".concat(encodeURIComponent(e)))}function k(e,t){return n["a"].put("/auth_user/".concat(encodeURIComponent(e)),t)}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["a"].get("/emqx_acl",{params:e})}function _(e){return n["a"].post("/emqx_acl",e)}function C(e,t){return n["a"].delete("/emqx_acl/".concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)))}}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-1aa6ec30.e7c745ea.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-1aa6ec30.e7c745ea.js new file mode 100644 index 000000000..8529fe077 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-1aa6ec30.e7c745ea.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1aa6ec30"],{"32ca":function(e,t,n){"use strict";var r=n("3a5e"),i=n.n(r);i.a},"3a5e":function(e,t,n){},"4ed8c":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"rules"},[n("page-header",[n("div",{staticClass:"page-header-content-view"},[n("div",{staticClass:"content"},[n("p",{staticClass:"description"},[e._v("\n "+e._s(e.$t("RuleEngine.definingRuleConditionsAndDataProcessing"))+"\n ")]),n("div",{staticClass:"page-header-top-start"},[n("a",{staticClass:"link-item",attrs:{rel:"noopener",href:e.docs.tutorial,target:"_blank"}},[n("i",{staticClass:"icon el-icon-position"}),e._v("\n "+e._s(e.$t("RuleEngine.quickStart"))+"\n ")])])])])]),n("div",{staticClass:"app-wrapper"},[n("a-card",{staticClass:"emq-list-card",attrs:{loading:e.listLoading}},[n("div",{staticClass:"emq-table-header"},[n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:function(t){return e.$router.push("/rules/create")}}},[e._v("\n "+e._s(e.$t("Base.create"))+"\n ")])],1),n("el-table",e._b({staticClass:"data-list",attrs:{data:e.tableData}},"el-table",e.rulesTable,!1),[n("el-table-column",{attrs:{type:"index",width:"50",label:" "}}),n("el-table-column",{attrs:{prop:"id",label:"ID"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("router-link",{attrs:{to:{path:"/rules/"+r.id,query:{oper:"view"}}}},[e._v(e._s(r.id))])]}}])}),n("el-table-column",{attrs:{prop:"for","min-width":"120",label:e.$t("RuleEngine.topic")},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return e._l(r.for,function(t,r){return n("div",{key:r},[e._v("\n "+e._s(t)+"\n ")])})}}])}),n("el-table-column",{attrs:{prop:"metrics",label:e.$t("RuleEngine.monitor")},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("i",{staticClass:"iconfont icon-tubiao-zhuzhuangtu btn btn-default",on:{click:function(t){return e.showMetrics(r)}}})]}}])}),n("el-table-column",{attrs:{prop:"description","show-overflow-tooltip":"",label:e.$t("RuleEngine.describe")}}),n("el-table-column",{attrs:{prop:"status",label:e.$t("RuleEngine.status")},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("el-tooltip",{attrs:{content:r.enabled?e.$t("RuleEngine.ruleEnabled"):e.$t("RuleEngine.ruleDisabled"),placement:"left"}},[n("el-switch",{attrs:{"active-text":"","inactive-text":"","active-color":"#13ce66","inactive-color":"#d0d3e0"},on:{change:function(t){return e.updateRule(r)}},model:{value:r.enabled,callback:function(t){e.$set(r,"enabled",t)},expression:"row.enabled"}})],1)]}}])}),n("el-table-column",{attrs:{prop:"actions",filters:e.filterOptions.actions,"filter-method":e.actionsColumnFilter,"filter-placement":"bottom",formatter:e.actionsFormatter,label:e.$t("RuleEngine.responseAction")}}),n("el-table-column",{attrs:{width:"120px",prop:"id"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.editRule(r)}}},[e._v("\n "+e._s(e.$t("RuleEngine.edit"))+"\n ")]),n("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.deleteRule(r)}}},[e._v("\n "+e._s(e.$t("RuleEngine.delete"))+"\n ")])]}}])})],1)],1)],1),n("a-drawer",e._b({attrs:{placement:"right",closable:"",visible:e.metricsDrawerVisible},on:{close:e.onMetricsClose}},"a-drawer",e.rulesDrawer,!1),[n("div",{staticClass:"rule-metrics"},[n("div",{staticClass:"metrics-item"},[n("div",{staticClass:"metrics-item-title"},[e._v("\n "+e._s(e.$t("RuleEngine.ruleMetrics"))+"\n ")]),n("ul",{staticClass:"metrics-item-body field-info rule-metrics"},[n("li",{staticClass:"field-info-item"},[n("div",{staticClass:"field-title"},[e._v(e._s(e.$t("RuleEngine.matched"))+":")]),n("span",{staticClass:"field-value"},[e._v("\n "+e._s(e.currentRules.metricsData.matched)+"\n "),n("span",{staticClass:"unit"},[e._v(e._s(e.$t("RuleEngine.times")))])])]),n("li",{staticClass:"field-info-item"},[n("div",{staticClass:"field-title"},[e._v(e._s(e.$t("RuleEngine.currentSpeed"))+":")]),n("span",{staticClass:"field-value"},[e._v("\n "+e._s(e.currentRules.metricsData.speed)+"\n "),n("span",{staticClass:"unit"},[e._v(e._s(e.$t("RuleEngine.times"))+"/"+e._s(e.$t("RuleEngine.second")))])])]),n("li",{staticClass:"field-info-item"},[n("div",{staticClass:"field-title"},[e._v(e._s(e.$t("RuleEngine.maximumSpeed"))+":")]),n("span",{staticClass:"field-value"},[e._v("\n "+e._s(e.currentRules.metricsData.speed_max)+"\n "),n("span",{staticClass:"unit"},[e._v(e._s(e.$t("RuleEngine.times"))+"/"+e._s(e.$t("RuleEngine.second")))])])]),n("li",{staticClass:"field-info-item"},[n("div",{staticClass:"field-title"},[e._v(e._s(e.$t("RuleEngine.last5MinutesSpeed"))+":")]),n("span",{staticClass:"field-value"},[e._v("\n "+e._s(e.currentRules.metricsData.speed_last5m)+"\n "),n("span",{staticClass:"unit"},[e._v(e._s(e.$t("RuleEngine.times"))+"/"+e._s(e.$t("RuleEngine.second")))])])])])]),n("div",{staticClass:"metrics-item"},[n("div",{staticClass:"metrics-item-title"},[e._v(e._s(e.$t("RuleEngine.actionMetrics")))]),0===e.currentRules.actions.length?void 0:e._e(),e._l(e.currentRules.actions,function(t,r){return n("div",{key:r,staticClass:"metrics-item-body"},[n("ul",{staticClass:"field-info metrics-item-body action-metrics"},[n("div",{staticClass:"item-title"},[e._v("\n "+e._s(t.name)+"\n ")]),n("li",{staticClass:"field-info-item"},[n("div",{staticClass:"field-title"},[e._v(e._s(e.$t("RuleEngine.success"))+":")]),n("span",{staticClass:"field-value"},[e._v("\n "+e._s(t.success)+"\n ")])]),n("li",{staticClass:"field-info-item"},[n("div",{staticClass:"field-title"},[e._v(e._s(e.$t("RuleEngine.fail"))+":")]),n("span",{staticClass:"field-value"},[e._v("\n "+e._s(t.failed)+"\n ")])])])])})],2)])])],1)},i=[],a=(n("ac6a"),n("7f7f"),n("7514"),n("6762"),n("2fdb"),n("96cf"),n("3b8d")),s=n("bd43"),c=n("90b9"),u={name:"Rules",props:{},data:function(){return{docs:{tutorial:Object(c["g"])("ruleEngineTutorial"),docs:""},listLoading:!1,metricsDrawerVisible:!1,currentRules:{actions:[{id:"do_nothing_1562653876521962460",metrics:[{failed:0,node:"emqx@127.0.0.1",success:3}],name:"do_nothing",params:{}}],description:"",enabled:!0,for:["client.connected"],id:"rule:33570eea",metrics:[{matched:3,node:"emqx@127.0.0.1",speed:0,speed_last5m:0,speed_max:.1}],rawsql:'SELECT * FROM "client.connected"',event:{columns:["clientid","username","event","auth_result","clean_start","connack","connected_at","is_bridge","keepalive","mountpoint","peername","proto_ver","timestamp","node"],description:"连接建立",event:"client.connected",sql_example:'SELECT * FROM "client.connected"',test_columns:{clientid:"c_emqx",username:"u_emqx",auth_result:"success",peername:"127.0.0.1:63412"},title:"连接建立"},metricsData:{matched:3,speed:0,speed_last5m:0,speed_max:.1}},filterOptions:{for:[],actions:[]},rulesDrawer:{title:"",width:"400px"},rulesTable:{"row-key":"id"},tableData:[],actionsMap:{},actionsFormatter:function(e,t,n){return n.map(function(e){return e._name}).join(",")}}},created:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["m"])();case 2:t=e.sent,this.filterOptions.for=t.map(function(e){return{text:e.event,value:e.event}}),this.loadActionsFilter().then(this.loadData);case 5:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),methods:{deleteRule:function(e){var t=this;this.$msgbox.confirm(this.$t("RuleEngine.deleteRuleConfirm"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(a["a"])(regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(s["e"])(e.id);case 2:t.loadData(),t.$message.success(t.$t("RuleEngine.successfulDeletion"));case 4:case"end":return n.stop()}},n)}))).catch(function(){})},forColumnFilter:function(e,t){return(t.for||[]).includes(e)},actionsColumnFilter:function(e,t){return(t.actions||[]).find(function(t){return t.name===e})},loadData:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t,n=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["n"])();case 2:t=e.sent,t.forEach(function(e){e.actions.forEach(function(e){e._name=n.actionsMap[e.name]})}),this.tableData=t;case 5:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),loadActionsFilter:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t,n=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["g"])({fillI18n:!0});case 2:t=e.sent,this.filterOptions.actions=t.map(function(e){return{text:e.title,value:e.name}}),this.actionsMap={},this.filterOptions.actions.forEach(function(e){var t=e.text,r=e.value;n.actionsMap[r]=t});case 6:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),showMetrics:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["l"])(t.id);case 2:this.currentRules=e.sent,this.rulesDrawer.title=t.id,this.metricsDrawerVisible=!0;case 5:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),onMetricsClose:function(){this.metricsDrawerVisible=!1},updateRule:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(t){var n,r,i=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:n=t.id,r=t.enabled,Object(s["p"])(n,{enabled:r}).then(function(e){if(e){var t=r?i.$t("RuleEngine.ruleEnabled"):i.$t("RuleEngine.ruleDisabled");i.$message.success(t)}}).catch(function(){t.enabled=!0!==t.enabled});case 2:case"end":return e.stop()}},e)}));function t(t){return e.apply(this,arguments)}return t}(),editRule:function(e){this.$router.push("/rules/create?rule=".concat(e.id))}}},o=u,l=(n("32ca"),n("2877")),d=Object(l["a"])(o,r,i,!1,null,"0b7b7823",null);t["default"]=d.exports},bd43:function(e,t,n){"use strict";n.d(t,"m",function(){return u}),n.d(t,"n",function(){return l}),n.d(t,"l",function(){return d}),n.d(t,"g",function(){return p}),n.d(t,"e",function(){return v}),n.d(t,"d",function(){return h}),n.d(t,"o",function(){return b}),n.d(t,"a",function(){return g}),n.d(t,"h",function(){return _}),n.d(t,"k",function(){return R}),n.d(t,"i",function(){return E}),n.d(t,"j",function(){return k}),n.d(t,"b",function(){return O}),n.d(t,"f",function(){return j}),n.d(t,"c",function(){return D}),n.d(t,"p",function(){return M});n("7f7f"),n("456d"),n("ac6a"),n("96cf");var r=n("3b8d"),i=n("1f75"),a=n("90b9"),s=[],c={};function u(){return o.apply(this,arguments)}function o(){return o=Object(r["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(0!==s.length){e.next=5;break}return e.next=3,i["a"].get("/rule_events");case 3:t=e.sent,s=Object(a["c"])(t,["title","description"]);case 5:return s.forEach(function(e){c[e.event]=e}),e.abrupt("return",s);case 7:case"end":return e.stop()}},e)})),o.apply(this,arguments)}function l(e){return i["a"].get("/rules",e)}function d(e){return f.apply(this,arguments)}function f(){return f=Object(r["a"])(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,i["a"].get("/rules/".concat(t));case 2:return n=e.sent,e.next=5,u();case 5:return n.events=n.for.map(function(e){return c[e]?c[e]:c["$events/message_publish"]}),n.metricsData={},n.metrics.forEach(function(e){["matched","speed","speed_last5m","speed_max"].forEach(function(t){n.metricsData[t]=n.metricsData[t]||0,n.metricsData[t]+=e[t]||0})}),n.actions=n.actions.map(function(e){return e.failed=0,e.success=0,e.metrics.forEach(function(t){e.failed+=t.failed,e.success+=t.success}),e}),e.abrupt("return",n);case 10:case"end":return e.stop()}},e)})),f.apply(this,arguments)}function p(){return m.apply(this,arguments)}function m(){return m=Object(r["a"])(regeneratorRuntime.mark(function e(){var t,n,r=arguments;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{fillI18n:!1},e.next=3,i["a"].get("/actions");case 3:if(n=e.sent,t.fillI18n){e.next=6;break}return e.abrupt("return",n);case 6:return e.abrupt("return",Object(a["c"])(n,["title","description"]));case 7:case"end":return e.stop()}},e)})),m.apply(this,arguments)}function v(e){return i["a"].delete("/rules/".concat(e))}function h(e){return i["a"].delete("/resources/".concat(e))}function b(e){return i["a"].post("/resources/".concat(e))}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i["a"].post("/rules?test=true",e,{params:{_m:!1}})}function _(){return w.apply(this,arguments)}function w(){return w=Object(r["a"])(regeneratorRuntime.mark(function e(){var t,n,r=arguments;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.next=3,i["a"].get("/actions",{params:t});case 3:return n=e.sent,e.abrupt("return",n.map(function(e){return e=Object(a["c"])(e,["title","description"]),e.params=Object(a["c"])(e.params,!0),e}));case 5:case"end":return e.stop()}},e)})),w.apply(this,arguments)}function R(){return x.apply(this,arguments)}function x(){return x=Object(r["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,i["a"].get("/resource_types");case 2:return t=e.sent,t=Object(a["c"])(t,["title","description"]).map(function(e){return e.params=Object(a["c"])(e.params,!0),e}),e.abrupt("return",t);case 5:case"end":return e.stop()}},e)})),x.apply(this,arguments)}var C={};function E(){return y.apply(this,arguments)}function y(){return y=Object(r["a"])(regeneratorRuntime.mark(function e(){var t,n,r,a=arguments;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},0!==Object.keys(C).length){e.next=6;break}return e.next=4,R();case 4:n=e.sent,n.forEach(function(e){C[e.name]=e});case 6:return e.next=8,i["a"].get("/resources",{params:t});case 8:return r=e.sent,e.abrupt("return",r.map(function(e){var t=e.config;return e.configVal=t,e.config=C[e.type]||{},e}));case 10:case"end":return e.stop()}},e)})),y.apply(this,arguments)}function k(e){return $.apply(this,arguments)}function $(){return $=Object(r["a"])(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(0!==Object.keys(C).length){e.next=5;break}return e.next=3,R();case 3:n=e.sent,n.forEach(function(e){C[e.name]=e});case 5:return e.prev=5,e.next=8,i["a"].get("/resources/".concat(t));case 8:return r=e.sent,r.typeInfo=C[r.type]||{},r._config=[],Object.keys(r.config).forEach(function(e){var t=r.config[e],n=r.typeInfo.params[e]||{},i=n.title,a=n.description;r._config.push({key:e,value:t,title:i||t,description:a})}),e.abrupt("return",r);case 15:return e.prev=15,e.t0=e["catch"](5),console.error(e.t0),e.abrupt("return",!1);case 19:case"end":return e.stop()}},e,null,[[5,15]])})),$.apply(this,arguments)}function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i["a"].post("/resources",e,{params:{test:t?"true":void 0}})}function j(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i["a"].put("/resources/".concat(e.id),e)}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i["a"].post("/rules",e)}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i["a"].put("/rules/".concat(e),t)}}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-1de6578b.f726be8a.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-1de6578b.f726be8a.js new file mode 100644 index 000000000..64fe936fa --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-1de6578b.f726be8a.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1de6578b"],{"72db":function(e,t,r){"use strict";r.d(t,"h",function(){return n}),r.d(t,"k",function(){return s}),r.d(t,"b",function(){return o}),r.d(t,"l",function(){return i}),r.d(t,"f",function(){return c}),r.d(t,"j",function(){return l}),r.d(t,"d",function(){return u}),r.d(t,"m",function(){return d}),r.d(t,"a",function(){return p}),r.d(t,"g",function(){return m}),r.d(t,"i",function(){return g}),r.d(t,"c",function(){return f}),r.d(t,"e",function(){return h});var a=r("1f75");function n(){return a["a"].get("/apps")}function s(e){return a["a"].get("/apps/".concat(e))}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a["a"].post("/apps",e)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a["a"].put("/apps/".concat(e),t)}function c(e){return a["a"].delete("/apps/".concat(e))}function l(){return a["a"].get("/users")}function u(e){return a["a"].post("/users",e)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a["a"].put("/users/".concat(e),t)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a["a"].put("/change_pwd/".concat(e),t)}function m(e){return a["a"].delete("/users/".concat(e))}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a["a"].get("/banned",{params:e})}function f(e){return a["a"].post("/banned",e)}function h(e){var t=e.who,r=e.as;return a["a"].delete("/banned/".concat(r,"/").concat(encodeURIComponent(t)))}},"872a1":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"users"},[r("page-header",[r("div",{staticClass:"page-header-content-view"},[r("div",{staticClass:"content"},[e._v("\n "+e._s(e.$t("General.manageDashboardUsers"))+"\n ")])])]),r("div",{staticClass:"app-wrapper"},[r("a-card",{staticClass:"emq-list-card"},[r("div",{staticClass:"emq-table-header"},[r("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:function(t){return e.showDialog("create")}}},[e._v("\n "+e._s(e.$t("Base.create"))+"\n ")])],1),r("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[r("el-table-column",{attrs:{"min-width":"120px",prop:"username",label:e.$t("General.userName")}}),r("el-table-column",{attrs:{"min-width":"60px",prop:"tags",label:e.$t("General.remark")}}),r("el-table-column",{attrs:{width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[r("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.showDialog("edit",a)}}},[e._v(e._s(e.$t("General.edit"))+"\n ")]),"administrator"!==a.tags&&"admin"!==a.username?r("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.deleteConfirm(a)}}},[e._v(e._s(e.$t("General.delete"))+"\n ")]):e._e()]}}])})],1)],1)],1),r("el-dialog",{attrs:{width:"520px",title:"edit"===e.accessType?e.$t("General.editorUser"):e.$t("General.creatingUser"),visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t},close:e.clearInput}},[r("el-form",{ref:"recordForm",attrs:{size:"small",model:e.record,rules:e.rules}},[r("el-form-item",{attrs:{prop:"username",label:e.$t("General.userName")}},[r("el-input",{attrs:{disabled:"edit"===e.accessType},model:{value:e.record.username,callback:function(t){e.$set(e.record,"username",t)},expression:"record.username"}})],1),r("el-form-item",{attrs:{prop:"tags",label:e.$t("General.remark")}},[r("el-input",{model:{value:e.record.tags,callback:function(t){e.$set(e.record,"tags",t)},expression:"record.tags"}})],1),"edit"!==e.accessType||e.allowChange?r("el-form-item",{attrs:{prop:"password",label:"edit"===e.accessType?e.$t("General.oldPassword"):e.$t("General.password")}},[r("el-input",{attrs:{type:"password"},model:{value:e.record.password,callback:function(t){e.$set(e.record,"password",t)},expression:"record.password"}})],1):e._e(),e.allowChange?r("el-form-item",{attrs:{prop:"newPassword",label:e.$t("General.newPassword")}},[r("el-input",{attrs:{type:"password"},model:{value:e.record.newPassword,callback:function(t){e.$set(e.record,"newPassword",t)},expression:"record.newPassword"}})],1):e._e(),e.allowChange?r("el-form-item",{attrs:{prop:"repeatPassword",label:e.$t("General.confirmPassword")}},[r("el-input",{attrs:{type:"password"},model:{value:e.record.repeatPassword,callback:function(t){e.$set(e.record,"repeatPassword",t)},expression:"record.repeatPassword"}})],1):e._e(),"edit"===e.accessType?r("el-link",{attrs:{underline:!1},on:{click:e.togglePassword}},[e._v("\n "+e._s(e.allowChange?e.$t("General.dontChangePassword"):e.$t("General.changePassword"))+"\n ")]):e._e()],1),r("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{plain:"",size:"small"},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Base.cancel")))]),r("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Base.confirm")))])],1)],1)],1)},n=[],s=(r("96cf"),r("3b8d")),o=r("72db"),i={name:"Users",components:{},props:{},data:function(){var e=this,t=function(t,r,a){""===r?a(new Error(e.$t("General.pleaseEnterYourPasswordAgain"))):r!==e.record.newPassword?a(new Error(e.$t("General.confirmNotMatch"))):a()};return{dialogVisible:!1,tableData:[],accessType:"",allowChange:!1,record:{},rules:{username:[{required:!0,message:this.$t("General.enterOneUserName")}],tags:[{required:!0,message:this.$t("General.pleaseEnterNotes")}],password:[{required:!0,message:this.$t("General.pleaseEnterPassword"),trigger:["blur","change"]},{min:3,max:32,message:this.$t("General.passwordLength"),trigger:["blur","change"]}],newPassword:[{required:!0,message:this.$t("General.pleaseEnterNewPassword"),trigger:["blur","change"]},{min:3,max:32,message:this.$t("General.passwordLength"),trigger:["blur","change"]}],repeatPassword:[{required:!0,message:this.$t("General.pleaseEnterAConfirmationPassword")},{validator:t,trigger:["blur","change"]}]}}},created:function(){this.loadData()},methods:{clearInput:function(){this.$refs.recordForm&&this.$refs.recordForm.resetFields()},loadData:function(){var e=Object(s["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["j"])();case 2:this.tableData=e.sent;case 3:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),showDialog:function(e,t){this.record={username:"",tags:""},this.accessType="create","edit"===e&&(Object.assign(this.record,t),this.accessType="edit"),this.dialogVisible=!0},closeDialog:function(){this.dialogVisible=!1,this.allowChange=!1},togglePassword:function(){this.allowChange=!this.allowChange,this.allowChange||(this.record={tags:this.record.tags,username:this.record.username})},save:function(){var e=Object(s["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:t=this,this.$refs.recordForm.validate(function(e){if(!e)return!1;if("edit"===t.accessType){var r=t.record,a=r.username,n=r.password;Object(o["m"])(a,t.record).then(Object(s["a"])(regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!t.allowChange){e.next=5;break}return r={new_pwd:t.record.newPassword,old_pwd:t.record.password},e.next=4,Object(o["a"])(a,r);case 4:t.$store.dispatch("UPDATE_USER_INFO",{username:a,password:n});case 5:t.$message.success(t.$t("General.editorialSuccess")),t.dialogVisible=!1,t.allowChange=!1,t.accessType="",t.record={},t.loadData();case 11:case"end":return e.stop()}},e)})))}else Object(o["d"])(t.record).then(function(){t.$message.success(t.$t("General.createUserSuccess")),t.dialogVisible=!1,t.accessType="",t.record={},t.loadData()})});case 2:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),deleteConfirm:function(e){var t=this,r=this;this.$msgbox.confirm(this.$t("General.confirmDeleteUser"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(s["a"])(regeneratorRuntime.mark(function a(){return regeneratorRuntime.wrap(function(a){while(1)switch(a.prev=a.next){case 0:Object(o["g"])(e.username).then(function(){r.$message.success(t.$t("General.successfulDeletion")),r.loadData()});case 1:case"end":return a.stop()}},a)}))).catch(function(){})}}},c=i,l=r("2877"),u=Object(l["a"])(c,a,n,!1,null,null,null);t["default"]=u.exports}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2095c2f3.87ded140.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2095c2f3.87ded140.js new file mode 100644 index 000000000..0dea669c3 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2095c2f3.87ded140.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2095c2f3"],{"12b7":function(e,t,n){},2870:function(e,t,n){},"2b0b":function(e,t,n){"use strict";var s=n("12b7"),a=n.n(s);a.a},a495:function(e,t,n){"use strict";var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"stretch-height",attrs:{id:"stretch-height"},on:{mousedown:e.handleMousedown}},[n("i",{staticClass:"el-icon-more"})])},a=[],i=(n("c5f6"),{name:"StretchHeight",model:{prop:"value",event:"change"},props:{value:{required:!0,type:Number}},data:function(){return{}},created:function(){document.onmouseup=function(){document.onmousemove=null}},methods:{handleMousedown:function(e){var t=this,n=e.y;document.onmousemove=function(e){var s=e.y,a=s-n;n=e.y,t.$emit("change",t.value+a)}}}}),r=i,c=(n("2b0b"),n("2877")),o=Object(c["a"])(r,s,a,!1,null,null,null);t["a"]=o.exports},b395:function(e,t,n){"use strict";var s=n("2870"),a=n.n(s);a.a},e94e:function(e,t,n){"use strict";n.r(t);var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"rule-create"},[n("page-header",[n("div",{staticClass:"page-header-title-view"},[n("div",{staticClass:"title"},[e._v(e._s(e.$t("RuleEngine.createRules")))])]),n("div",{staticClass:"page-header-content-view"},[n("div",{staticClass:"content"},[n("p",{staticClass:"description"},[e._v("\n "+e._s(e.$t("RuleEngine.definingRuleConditionsAndDataProcessing"))+"\n ")])])])]),n("div",{staticClass:"emq-list-body rule-wrapper app-wrapper"},[n("a-card",{staticClass:"emq-list-card"},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:15}},[n("el-form",{ref:"record",attrs:{model:e.record,rules:e.rules,"label-width":"120px","label-position":"left",size:"small","label-suffix":":"}},[n("el-form-item",{staticClass:"code-editor__item",attrs:{prop:"rawsql",label:e.$t("RuleEngine.sqlInput")}},[n("div",{staticClass:"monaco-container monaco-sql",style:{height:e.sqlEditorHeight+"px"}},[n("monaco",{staticClass:"sql",attrs:{id:"rule-sql",warp:"",lang:"sql",provider:e.sqlProvider},on:{"qucik-save":e.handleSQLTest},model:{value:e.record.rawsql,callback:function(t){e.$set(e.record,"rawsql",t)},expression:"record.rawsql"}})],1),n("stretch-height",{model:{value:e.sqlEditorHeight,callback:function(t){e.sqlEditorHeight=t},expression:"sqlEditorHeight"}})],1),n("el-form-item",{attrs:{prop:"id",label:e.$t("RuleEngine.ruleID")}},[n("el-input",{attrs:{disabled:e.isEdit},model:{value:e.record.id,callback:function(t){e.$set(e.record,"id",t)},expression:"record.id"}})],1),n("el-form-item",{attrs:{prop:"description",label:e.$t("RuleEngine.resourceDes")}},[n("el-input",{model:{value:e.record.description,callback:function(t){e.$set(e.record,"description",t)},expression:"record.description"}})],1),n("el-form-item",{attrs:{label:e.$t("RuleEngine.sqlTest")}},[n("el-switch",{on:{change:e.initTestFormItem},model:{value:e.showTest,callback:function(t){e.showTest=t},expression:"showTest"}}),n("el-popover",{attrs:{width:"220",placement:"right",trigger:"hover"}},[e._v("\n "+e._s(e.$t("RuleEngine.inputMetadata"))+"\n "),n("i",{staticClass:"icon el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),n("el-collapse-transition",[e.showTest?n("div",[e._l(Object.keys(e.selectEvent.test_columns),function(t){return n("el-form-item",e._b({key:t,class:{"code-sql":"payload"===t,payload:"payload"===t}},"el-form-item",{label:t,prop:"ctx."+t},!1),["payload"!==t?n("el-input",{model:{value:e.record.ctx[t],callback:function(n){e.$set(e.record.ctx,t,n)},expression:"record.ctx[k]"}}):[n("div",{staticClass:"monaco-container monaco-payload",style:{height:e.payloadEditorHeight+"px"}},[n("monaco",{staticClass:"payload",attrs:{id:"payload",lang:e.payloadType},on:{"qucik-save":e.handleSQLTest},model:{value:e.record.ctx.payload,callback:function(t){e.$set(e.record.ctx,"payload",t)},expression:"record.ctx.payload"}})],1),n("div",{staticClass:"payload-type"},[n("el-radio-group",{model:{value:e.payloadType,callback:function(t){e.payloadType=t},expression:"payloadType"}},[n("el-radio",{attrs:{label:"json"}},[e._v("JSON")]),n("el-radio",{attrs:{label:"plaintext"}},[e._v("Plaintext")])],1)],1),n("stretch-height",{staticClass:"payload",model:{value:e.payloadEditorHeight,callback:function(t){e.payloadEditorHeight=t},expression:"payloadEditorHeight"}})]],2)}),n("el-form-item",[n("span",{attrs:{slot:"label"},slot:"label"},[e._v(" ")]),n("el-button",{attrs:{type:"primary"},on:{click:e.handleSQLTest}},[e._v("\n "+e._s(e.$t("RuleEngine.sqlTest"))+"\n ")])],1),n("el-form-item",{staticClass:"code-editor__item",attrs:{label:e.$t("RuleEngine.testOutput")}},[n("div",{staticClass:"monaco-container monaco-test-output",staticStyle:{height:"200px"}},[n("monaco",{staticClass:"test-output",attrs:{id:"testOutput",lang:"json",disabled:!0},model:{value:e.testOutPut,callback:function(t){e.testOutPut=t},expression:"testOutPut"}})],1)])],2):e._e()])],1)],1),n("el-col",{staticClass:"tips-form",attrs:{span:9}},[n("div",{staticClass:"tips-item"},[n("div",{staticStyle:{color:"#606266"}},[e._v("\n "+e._s(e.$t("RuleEngine.currentEventAvailableField"))+"\n "),n("transition",{attrs:{name:"el-fade-in-linear"}},[e.clipboardStatus?n("span",{staticClass:"copy-success"},[e._v(e._s(e.clipboardStatus))]):e._e()])],1),n("div",{staticClass:"tips-wrapper code"},e._l(e.availableFields,function(t){return n("span",{directives:[{name:"clipboard",rawName:"v-clipboard:cpoy",value:t,expression:"key",arg:"cpoy"},{name:"clipboard",rawName:"v-clipboard:success",value:e.copyAvailableFieldsSuccess,expression:"copyAvailableFieldsSuccess",arg:"success"}],key:t,staticClass:"available-fields"},[e._v("\n "+e._s(t)+"\n ")])}),0)]),n("div",{staticClass:"tips-item"},[n("div",{staticStyle:{color:"#606266"}},[e._v(e._s(e.$t("RuleEngine.exampleSql")))]),n("div",{staticClass:"tips-wrapper code"},[n("code",[e._v(e._s(e.selectEvent.sql_example))])])])])],1)],1),n("a-card",{staticClass:"emq-list-card"},[n("div",{staticClass:"emq-title"},[n("div",{staticClass:"title required-title"},[e._v("\n "+e._s(e.$t("RuleEngine.responseAction"))+"\n ")]),n("span",{staticClass:"sub-title"},[e._v("\n "+e._s(e.$t("RuleEngine.processingMessagesForHitRules"))+"\n ")])]),n("div",{staticClass:"rule-action-wrapper"},[n("rule-actions",{ref:"ruleAction",model:{value:e.record.actions,callback:function(t){e.$set(e.record,"actions",t)},expression:"record.actions"}})],1)]),n("div",{staticClass:"button-group__center"},[n("el-button",{attrs:{type:"default",size:"medium"},on:{click:function(t){return e.$router.push({path:"/rules"})}}},[e._v("\n "+e._s(e.$t("Base.cancel"))+"\n ")]),n("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.save}},[e._v("\n "+e._s(e.isEdit?e.$t("Base.confirm"):e.$t("Base.create"))+"\n ")])],1)],1)],1)},a=[],i=n("7618"),r=(n("4917"),n("3b2b"),n("28a5"),n("768b")),c=(n("7514"),n("96cf"),n("3b8d")),o=(n("ac6a"),n("456d"),n("6b54"),n("bd43")),l=n("1f75");function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{_limit:500,_page:1};return l["a"].get("/routes",e)}var d=n("90b9"),p=n("9146"),m=n("a495"),h=n("ad43"),v=n("12cb"),g=n("a47b"),f=g["a"].state.lang,b=v["default"][f],y=[{name:"clientid",documentation:b.RuleEngine.clientid_doc,type:"Field",default:"c_emqx",valueType:"string"},{name:"username",documentation:b.RuleEngine.username_doc,type:"Field",default:"u_emqx",valueType:"string"},{name:"event",documentation:b.RuleEngine.event_doc,type:"Field",default:"disconnect",valueType:"string"},{name:"id",documentation:b.RuleEngine.id_doc,type:"Field",default:"--",valueType:"string"},{name:"payload",documentation:b.RuleEngine.payload_doc,type:"Field",default:'{"msg": "hello"}',valueType:"string"},{name:"peername",documentation:b.RuleEngine.peername_doc,type:"Field",default:"127.0.0.1:63412",valueType:"string"},{name:"qos",documentation:b.RuleEngine.qos_doc,type:"Field",default:1,valueType:"integer"},{name:"timestamp",documentation:b.RuleEngine.timestamp_doc,type:"Field",default:1576549961086,valueType:"integer"},{name:"topic",documentation:b.RuleEngine.topic_doc,type:"Field",default:"t/a",valueType:"string"},{name:"node",documentation:b.RuleEngine.node_doc,type:"Field",default:"emqx@127.0.0.1",valueType:"string"},{name:'"$events/message_delivered"',documentation:b.RuleEngine.message_delivered,type:"Method"},{name:'"$events/message_acked"',documentation:b.RuleEngine.message_acked,type:"Method"},{name:'"$events/message_dropped"',documentation:b.RuleEngine.message_dropped,type:"Method"},{name:'"$events/client_connected"',documentation:b.RuleEngine.client_connected,type:"Method"},{name:'"$events/client_disconnected"',documentation:b.RuleEngine.client_disconnected,type:"Method"},{name:'"$events/session_subscribed"',documentation:b.RuleEngine.session_subscribed,type:"Method"},{name:'"$events/session_unsubscribed"',documentation:b.RuleEngine.session_unsubscribed,type:"Method"}],_={name:"RuleCrate",components:{RuleActions:h["a"],Monaco:p["a"],StretchHeight:m["a"]},props:{},data:function(){return{loadRuleEvents:o["m"],isEdit:!1,needCheckSql:!0,sqlEditorHeight:320,payloadEditorHeight:200,payloadType:"json",topics:[],events:[],testOutPut:"",selectEvent:{columns:["clientid","username","event","id","payload","peername","qos","timestamp","topic","node"],description:"$events/message_publish",event:"$events/message_publish",sql_example:'SELECT * FROM "t/#"',test_columns:{clientid:"c_emqx",username:"u_emqx",topic:"t/a",qos:1,payload:'{"msg": "hello"}'},title:"$events/message_publish"},timer:0,showTest:!1,clipboardContent:"",clipboardStatus:"",record:{rawsql:"SELECT * FROM",actions:[],description:"",ctx:{},id:"rule:".concat(Math.random().toString().slice(3,9))},rules:{rawsql:{required:!0,message:this.$t("RuleEngine.pleaseEnterTheSQL")},id:{required:!0,validator:d["q"]}}}},computed:{availableFields:function(){return this.selectEvent.columns},testField:function(){return Object.keys(this.selectEvent.test_columns)},sqlProvider:function(){return y},currentRule:function(){return this.$route.query.rule}},watch:{"record.rawsql":"handleSqlChanged"},created:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["m"])();case 2:return this.events=e.sent,this.selectEvent=this.events[0],e.next=6,u();case 6:t=e.sent,this.topics=t.items||[],this.currentRule?(this.isEdit=!0,this.loadRule()):this.initData("$events/message_publish");case 9:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),methods:{initData:function(e){this.selectEvent=this.events.find(function(t){return t.event===e});var t=this.selectEvent.sql_example;this.record.rawsql=Object(d["o"])(t),this.initTestFormItem();var n=this.$refs.ruleAction;n&&n.initData()},handleSqlChanged:function(e){if(this.triggerEventChange(e),this.needCheckSql){var t=Object(d["n"])(e);t&&this.sqlParse(e,t[0])}},sqlParse:function(e,t){var n=this;this.$confirm(this.$t("RuleEngine.parse_confirm"),this.$t("Base.warning"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(function(){n.record.rawsql=Object(d["o"])(Object(d["m"])(e,t))}).catch(function(){n.needCheckSql=!1})},triggerEventChange:function(e){var t=["events/message_delivered","events/message_acked","events/message_dropped","events/client_connected","events/client_disconnected","events/session_subscribed","events/session_unsubscribed"],n=null,s="";t.forEach(function(t){var s=t.split("/"),a=Object(r["a"])(s,2),i=a[0],c=a[1],o=new RegExp("\\$".concat(i,"\\/").concat(c),"gim");e.match(o)&&(n=e.match(o))}),s=n?n[0]:"$events/message_publish",s!==this.selectEvent.event&&(this.selectEvent=this.events.find(function(e){return e.event===s})||{columns:{},test_columns:{}},this.sqlPrimaryKey=this.events.columns,this.initTestFormItem())},initTestFormItem:function(){this.testOutPut="";var e={},t=this.selectEvent.test_columns;Object.keys(t).forEach(function(n){var s=t[n];"object"===Object(i["a"])(s)&&(s=JSON.stringify(s,null,2)),e[n]=s}),this.$set(this.record,"ctx",e)},beforeSqlValid:function(e){var t=Object(d["n"])(e);return!t||(this.sqlParse(e,t[0]),!1)},handleSQLTest:function(){var e=this;this.needCheckSql=!0,this.$refs.record.validate(function(){var t=Object(c["a"])(regeneratorRuntime.mark(function t(n){var s;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(n){t.next=6;break}if(!e.showTest||e.record.id){t.next=5;break}e.$refs.record.clearValidate("id"),t.next=6;break;case 5:return t.abrupt("return");case 6:if(e.beforeSqlValid(e.record.rawsql)){t.next=8;break}return t.abrupt("return");case 8:if(s=JSON.parse(JSON.stringify(e.record)),e.testOutPut="",s.ctx.payload)try{s.ctx.payload=JSON.stringify(JSON.parse(s.ctx.payload))}catch(a){console.log(a)}Object(o["a"])(s).then(function(t){e.testOutPut=JSON.stringify(t,null,2)}).catch(function(t){e.testOutPut="SQL Not Match"===t?e.$t("RuleEngine.resultIsEmpty"):"".concat(e.$t("RuleEngine.checkForErrors"),":\n\n").concat(t)});case 12:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())},copyAvailableFieldsSuccess:function(){var e=this;this.clipboardStatus=this.$t("Base.copied"),setTimeout(function(){e.clipboardStatus=""},2e3)},save:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,n,s,a,i,r,c,l=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$refs.record.validate();case 2:if(t=e.sent,t){e.next=5;break}return e.abrupt("return");case 5:if(0!==this.record.actions.length){e.next=8;break}return this.$message.error(this.$t("RuleEngine.pleaseAddAResponseAction")),e.abrupt("return");case 8:n=this.record,s=n.rawsql,a=n.actions,i=n.description,r=n.id,c={rawsql:s,actions:a,description:i,id:r},this.isEdit&&this.currentRule?Object(o["p"])(this.currentRule,c).then(function(){l.$message.success(l.$t("RuleEngine.editSuccess")),setTimeout(function(){l.$router.push({path:"/rules"})},600)}):Object(o["c"])(c).then(function(){l.$message.success(l.$t("RuleEngine.createSuccess")),setTimeout(function(){l.$router.push({path:"/rules"})},600)});case 11:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),loadRule:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,n=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["l"])(this.currentRule);case 2:t=e.sent,this.record=t,setTimeout(function(){n.$refs.ruleAction.loadActions()},500);case 5:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}},E=_,q=(n("b395"),n("2877")),$=Object(q["a"])(E,s,a,!1,null,null,null);t["default"]=$.exports}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-214e9a45.4c4953f7.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-214e9a45.4c4953f7.js new file mode 100644 index 000000000..e7459e03d --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-214e9a45.4c4953f7.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-214e9a45"],{"51ac":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"application"},[a("page-header",[a("div",{staticClass:"page-header-content-view"},[a("div",{staticClass:"content"},[a("p",{staticClass:"description"},[e._v("\n "+e._s(e.$t("General.applicationIsCalled"))+"\n ")]),a("div",{staticClass:"page-header-top-start"},[a("a",{staticClass:"link-item",attrs:{rel:"noopener",href:e.docs.restAPI,target:"_blank"}},[a("i",{staticClass:"icon el-icon-document"}),e._v("\n "+e._s(e.$t("General.productDocumentation"))+"\n ")])])])])]),a("div",{staticClass:"app-wrapper"},[a("a-card",{staticClass:"emq-list-card"},[a("div",{staticClass:"emq-table-header"},[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:function(t){return e.showDialog("create")}}},[e._v("\n "+e._s(e.$t("Base.create"))+"\n ")])],1),a("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[a("el-table-column",{attrs:{prop:"app_id",label:"AppID"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("span",{staticClass:"btn",on:{click:function(t){return e.showDialog("view",r)}}},[e._v("\n "+e._s(r.app_id)+"\n ")])]}}])}),a("el-table-column",{attrs:{prop:"name",label:e.$t("General.appName")}}),a("el-table-column",{attrs:{prop:"expired",formatter:e.formatterExpired,label:e.$t("General.expireAt")}}),a("el-table-column",{attrs:{prop:"desc",label:e.$t("General.remark")}}),a("el-table-column",{attrs:{label:e.$t("General.isEnabled")},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#d0d3e0"},on:{change:function(t){return e.updateApplication(r)}},model:{value:r.status,callback:function(t){e.$set(r,"status",t)},expression:"row.status"}})]}}])}),a("el-table-column",{scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.showDialog("edit",r)}}},[e._v("\n "+e._s(e.$t("General.edit"))+"\n ")]),a("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.deleteConfirm(r)}}},[e._v("\n "+e._s(e.$t("General.delete"))+"\n ")])]}}])})],1)],1)],1),a("el-dialog",{attrs:{width:"600px",title:"edit"===e.accessType?e.$t("General.editApp"):e.$t("General.createApp"),visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t},close:e.clearInput}},[a("el-form",{ref:"recordForm",attrs:{size:"small",model:e.record,rules:"view"===e.accessType?{}:e.rules}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"app_id",label:"AppID"}},[a("el-input",{attrs:{readonly:"create"!==e.accessType,disabled:"edit"===e.accessType},model:{value:e.record.app_id,callback:function(t){e.$set(e.record,"app_id",t)},expression:"record.app_id"}})],1)],1),"view"===e.accessType?a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"secret",label:e.$t("General.secret")}},[a("el-input",{attrs:{disabled:"edit"===e.accessType,readonly:"create"!==e.accessType},model:{value:e.record.secret,callback:function(t){e.$set(e.record,"secret",t)},expression:"record.secret"}})],1)],1):e._e(),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"name",label:e.$t("General.appName")}},[a("el-input",{attrs:{disabled:"edit"===e.accessType,readonly:"view"===e.accessType},model:{value:e.record.name,callback:function(t){e.$set(e.record,"name",t)},expression:"record.name"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"status",label:e.$t("General.isEnabled")}},[a("emq-select",{attrs:{field:{options:e.enableOption},disabled:"view"===e.accessType},model:{value:e.record.status,callback:function(t){e.$set(e.record,"status",t)},expression:"record.status"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"expired",label:e.$t("General.expireAt")}},[a("el-date-picker",{attrs:{type:"date",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",readonly:"view"===e.accessType},model:{value:e.record.expired,callback:function(t){e.$set(e.record,"expired",t)},expression:"record.expired"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"desc",label:e.$t("General.remark")}},[a("el-input",{attrs:{readonly:"view"===e.accessType},model:{value:e.record.desc,callback:function(t){e.$set(e.record,"desc",t)},expression:"record.desc"}})],1)],1)],1)],1),"view"!==e.accessType?a("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{plain:"",size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("Base.cancel")))]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Base.confirm")))])],1):e._e()],1)],1)},n=[],s=(a("6b54"),a("cebc")),i=(a("96cf"),a("3b8d")),c=a("c1df"),o=a.n(c),l=a("72db"),d=a("90b9"),p={name:"Application",components:{},props:{},data:function(){return{docs:{restAPI:Object(d["g"])("restAPI")},dialogVisible:!1,tableData:[],accessType:"",enableOption:[{label:this.$t("General.enabled"),value:!0},{label:this.$t("General.disabled"),value:!1}],record:{status:!0,desc:""},rules:{name:[{required:!0,message:this.$t("General.pleaseEnterAppName")}],app_id:[{required:!0,message:this.$t("General.pleaseEnterTheAppId")}],status:[{required:!0,message:this.$t("General.pleaseChoose")}]}}},created:function(){this.loadData()},methods:{formatterExpired:function(e){var t=e.expired;return t&&"number"===typeof t?o()(1e3*t).format("YYYY-MM-DD"):this.$t("General.neverExpire")},clearInput:function(){this.$refs.recordForm&&this.$refs.recordForm.resetFields()},loadData:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(l["h"])();case 2:this.tableData=e.sent;case 3:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),loadAppData:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(l["k"])(t);case 2:a=e.sent,a.expired&&"number"===typeof a.expired&&(a.expired=o()(1e3*a.expired).format("YYYY-MM-DD")),this.record=a;case 5:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),showDialog:function(e,t){if(this.accessType=e,"edit"===e){var a=Object(s["a"])({},t);a.expired&&"number"===typeof a.expired?a.expired=o()(1e3*a.expired).format("YYYY-MM-DD"):a.expired=void 0,this.record=a}else"view"===e?this.loadAppData(t.app_id):this.record={app_id:Math.random().toString(16).slice(3),status:!0,desc:""};this.dialogVisible=!0},updateApplication:function(e){var t=this;Object(l["l"])(e.app_id,e).then(function(){t.$message.success(t.$t("General.editorialSuccess"))})},save:function(){var e=this,t=this;this.$refs.recordForm.validate(function(a){if(a){var r=Object(s["a"])({},e.record);if(r.expired&&"string"===typeof r.expired)try{r.expired=Math.floor(new Date(r.expired).getTime()/1e3)}catch(i){r.expired=null}if("edit"===t.accessType){var n=t.record.app_id;Object(l["l"])(n,r).then(function(){t.$message.success(e.$t("General.editorialSuccess")),t.dialogVisible=!1,t.accessType="",t.loadData()})}else Object(l["b"])(r).then(function(){t.$message.success(e.$t("General.successfulAppCreation")),t.dialogVisible=!1,t.accessType="",t.loadData()})}})},deleteConfirm:function(e){var t=this,a=this;this.$msgbox.confirm(this.$t("General.confirmDelete"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(i["a"])(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){while(1)switch(r.prev=r.next){case 0:Object(l["f"])(e.app_id).then(function(){a.$message.success(t.$t("General.successfulDeletion")),a.loadData()});case 1:case"end":return r.stop()}},r)}))).catch(function(){})}}},u=p,f=(a("bc65"),a("2877")),m=Object(f["a"])(u,r,n,!1,null,null,null);t["default"]=m.exports},"72db":function(e,t,a){"use strict";a.d(t,"h",function(){return n}),a.d(t,"k",function(){return s}),a.d(t,"b",function(){return i}),a.d(t,"l",function(){return c}),a.d(t,"f",function(){return o}),a.d(t,"j",function(){return l}),a.d(t,"d",function(){return d}),a.d(t,"m",function(){return p}),a.d(t,"a",function(){return u}),a.d(t,"g",function(){return f}),a.d(t,"i",function(){return m}),a.d(t,"c",function(){return b}),a.d(t,"e",function(){return v});var r=a("1f75");function n(){return r["a"].get("/apps")}function s(e){return r["a"].get("/apps/".concat(e))}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["a"].post("/apps",e)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].put("/apps/".concat(e),t)}function o(e){return r["a"].delete("/apps/".concat(e))}function l(){return r["a"].get("/users")}function d(e){return r["a"].post("/users",e)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].put("/users/".concat(e),t)}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r["a"].put("/change_pwd/".concat(e),t)}function f(e){return r["a"].delete("/users/".concat(e))}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r["a"].get("/banned",{params:e})}function b(e){return r["a"].post("/banned",e)}function v(e){var t=e.who,a=e.as;return r["a"].delete("/banned/".concat(a,"/").concat(encodeURIComponent(t)))}},bc65:function(e,t,a){"use strict";var r=a("d240"),n=a.n(r);n.a},d240:function(e,t,a){}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2be77691.a1865558.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2be77691.a1865558.js new file mode 100644 index 000000000..d6d18f875 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2be77691.a1865558.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2be77691"],{"0ea8":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"blacklist"},[n("page-header",{attrs:{"back-title":e.$t("General.blacklist")}},[n("div",{staticClass:"page-header-content-view"},[n("div",{staticClass:"content"},[n("p",{staticClass:"description"},[e._v("\n "+e._s(e.$t("General.blacklistTips"))+"\n "),n("a",{attrs:{href:e.docs.tutorial,target:"_blank"}},[e._v("\n "+e._s(e.$t("General.authDocs"))+"\n ")])])])])]),n("div",{staticClass:"app-wrapper"},[n("a-card",{staticClass:"emq-list-card"},[n("div",{staticClass:"emq-table-header"},[n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:e.showDialog}},[e._v("\n "+e._s(e.$t("Base.create"))+"\n ")])],1),n("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[n("el-table-column",{attrs:{prop:"who","min-width":"120px",label:e.$t("General.who")}}),n("el-table-column",{attrs:{prop:"as","min-width":"120px",label:e.$t("General.as")}}),n("el-table-column",{attrs:{prop:"reason","min-width":"120px",label:e.$t("General.reason")}}),n("el-table-column",{attrs:{prop:"until","min-width":"120px",formatter:e.formatterUntil,label:e.$t("General.until")}}),n("el-table-column",{attrs:{prop:"oper",width:"120px",label:""},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.deleteConfirm(a)}}},[e._v(e._s(e.$t("General.delete"))+" ")])]}}])})],1),n("div",{staticClass:"emq-table-footer"},[n("el-pagination",{attrs:{"hide-on-single-page":"",background:"",layout:"total, sizes, prev, pager, next","page-sizes":[20,50,100,500],"page-size":e.params._limit,"current-page":e.params._page,total:e.count},on:{"update:pageSize":function(t){return e.$set(e.params,"_limit",t)},"update:page-size":function(t){return e.$set(e.params,"_limit",t)},"update:currentPage":function(t){return e.$set(e.params,"_page",t)},"update:current-page":function(t){return e.$set(e.params,"_page",t)},"size-change":e.handleSizeChange,"current-change":e.handleCurrentPageChange}})],1)],1)],1),n("el-dialog",{attrs:{width:"520px",title:e.$t("General.createBlacklist"),visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t},close:e.clearInput}},[n("el-form",{ref:"recordForm",attrs:{size:"small",model:e.record,rules:e.rules}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{prop:"as",label:e.$t("General.as")}},[n("emq-select",{attrs:{field:{options:e.asOptions}},model:{value:e.record.as,callback:function(t){e.$set(e.record,"as",t)},expression:"record.as"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{prop:"who",label:e.$t("General.who")}},[n("el-input",{model:{value:e.record.who,callback:function(t){e.$set(e.record,"who",t)},expression:"record.who"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{prop:"reason",label:e.$t("General.reason")}},[n("el-input",{model:{value:e.record.reason,callback:function(t){e.$set(e.record,"reason",t)},expression:"record.reason"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{prop:"until",label:e.$t("General.until")}},[n("el-date-picker",{attrs:{type:"datetime",format:"yyyy-MM-dd HH:mm:ss","value-format":"timestamp"},model:{value:e.record.until,callback:function(t){e.$set(e.record,"until",t)},expression:"record.until"}})],1)],1)],1)],1),n("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{plain:"",size:"small"},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Base.cancel")))]),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Base.confirm")))])],1)],1)],1)},r=[],s=n("cebc"),i=(n("96cf"),n("3b8d")),o=n("c1df"),l=n.n(o),c=n("72db"),u=n("90b9"),p={name:"Blacklist",components:{},props:{},data:function(){return{docs:{tutorial:Object(u["g"])("auth")},dialogVisible:!1,tableData:[],params:{_page:1,_limit:20},count:0,asOptions:[{label:"clientid",value:"clientid"},{label:"username",value:"username"},{label:"peerhost",value:"peerhost"}],record:{reason:""},rules:{as:[{required:!0,message:this.$t("General.enterAs")}],who:[{required:!0,message:this.$t("General.enterWho")}]}}},created:function(){this.loadData()},methods:{loadData:function(){this.listBlackList()},listBlackList:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(t){var n,a,r,i,o,l,u=arguments;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},t&&(this.params._page=1),e.next=4,Object(c["i"])(Object(s["a"])({},this.params,n));case 4:a=e.sent,r=a.items,i=void 0===r?[]:r,o=a.meta.count,l=void 0===o?0:o,this.tableData=i,this.count=l;case 8:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),handleSizeChange:function(){this.listBlackList(!0)},handleCurrentPageChange:function(){this.listBlackList()},clearInput:function(){this.$refs.recordForm&&this.$refs.recordForm.resetFields()},showDialog:function(){this.record={reason:""},this.dialogVisible=!0},closeDialog:function(){this.dialogVisible=!1},save:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.$refs.recordForm.validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(n){var a,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(a=Object(s["a"])({},t.record),a.until&&"number"===typeof a.until)try{a.until=Math.floor(a.until/1e3)}catch(i){a.until=null}return e.next=6,Object(c["c"])(a);case 6:r=e.sent,r&&(t.$message.success(t.$t("General.createBlacklistSuccess")),t.closeDialog(),t.listBlackList());case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),deleteConfirm:function(e){var t=this;this.$msgbox.confirm(this.$t("General.determineToDeleteTheBlacklist"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(i["a"])(regeneratorRuntime.mark(function n(){var a,r,s;return regeneratorRuntime.wrap(function(n){while(1)switch(n.prev=n.next){case 0:return a=e.who,r=e.as,n.next=3,Object(c["e"])({who:a,as:r});case 3:s=n.sent,s&&(t.$message.success(t.$t("General.successfulDeletion")),t.listBlackList(!0));case 5:case"end":return n.stop()}},n)}))).catch(function(){})},formatterUntil:function(e){var t=e.until;return t&&"number"===typeof t?l()(1e3*t).format("YYYY-MM-DD HH:mm:ss"):this.$t("General.neverExpire")}}},d=p,f=(n("dd12"),n("2877")),m=Object(f["a"])(d,a,r,!1,null,"170091b5",null);t["default"]=m.exports},"15aca":function(e,t,n){},"72db":function(e,t,n){"use strict";n.d(t,"h",function(){return r}),n.d(t,"k",function(){return s}),n.d(t,"b",function(){return i}),n.d(t,"l",function(){return o}),n.d(t,"f",function(){return l}),n.d(t,"j",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"m",function(){return p}),n.d(t,"a",function(){return d}),n.d(t,"g",function(){return f}),n.d(t,"i",function(){return m}),n.d(t,"c",function(){return h}),n.d(t,"e",function(){return b});var a=n("1f75");function r(){return a["a"].get("/apps")}function s(e){return a["a"].get("/apps/".concat(e))}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a["a"].post("/apps",e)}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a["a"].put("/apps/".concat(e),t)}function l(e){return a["a"].delete("/apps/".concat(e))}function c(){return a["a"].get("/users")}function u(e){return a["a"].post("/users",e)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a["a"].put("/users/".concat(e),t)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a["a"].put("/change_pwd/".concat(e),t)}function f(e){return a["a"].delete("/users/".concat(e))}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a["a"].get("/banned",{params:e})}function h(e){return a["a"].post("/banned",e)}function b(e){var t=e.who,n=e.as;return a["a"].delete("/banned/".concat(n,"/").concat(encodeURIComponent(t)))}},dd12:function(e,t,n){"use strict";var a=n("15aca"),r=n.n(a);r.a}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0ae937.443808f2.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0ae937.443808f2.js new file mode 100644 index 000000000..3f4d8999d --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0ae937.443808f2.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ae937"],{"0b3b":function(E,T,R){"use strict";R.r(T),R.d(T,"conf",function(){return A}),R.d(T,"language",function(){return I});var A={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},I={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ABORT_AFTER_WAIT","ABSENT","ABSOLUTE","ACCENT_SENSITIVITY","ACTION","ACTIVATION","ACTIVE","ADD","ADDRESS","ADMIN","AES","AES_128","AES_192","AES_256","AFFINITY","AFTER","AGGREGATE","ALGORITHM","ALL_CONSTRAINTS","ALL_ERRORMSGS","ALL_INDEXES","ALL_LEVELS","ALL_SPARSE_COLUMNS","ALLOW_CONNECTIONS","ALLOW_MULTIPLE_EVENT_LOSS","ALLOW_PAGE_LOCKS","ALLOW_ROW_LOCKS","ALLOW_SINGLE_EVENT_LOSS","ALLOW_SNAPSHOT_ISOLATION","ALLOWED","ALTER","ANONYMOUS","ANSI_DEFAULTS","ANSI_NULL_DEFAULT","ANSI_NULL_DFLT_OFF","ANSI_NULL_DFLT_ON","ANSI_NULLS","ANSI_PADDING","ANSI_WARNINGS","APPEND","APPLICATION","APPLICATION_LOG","ARITHABORT","ARITHIGNORE","AS","ASC","ASSEMBLY","ASYMMETRIC","ASYNCHRONOUS_COMMIT","AT","ATOMIC","ATTACH","ATTACH_REBUILD_LOG","AUDIT","AUDIT_GUID","AUTHENTICATION","AUTHORIZATION","AUTO","AUTO_CLEANUP","AUTO_CLOSE","AUTO_CREATE_STATISTICS","AUTO_SHRINK","AUTO_UPDATE_STATISTICS","AUTO_UPDATE_STATISTICS_ASYNC","AUTOMATED_BACKUP_PREFERENCE","AUTOMATIC","AVAILABILITY","AVAILABILITY_MODE","BACKUP","BACKUP_PRIORITY","BASE64","BATCHSIZE","BEGIN","BEGIN_DIALOG","BIGINT","BINARY","BINDING","BIT","BLOCKERS","BLOCKSIZE","BOUNDING_BOX","BREAK","BROKER","BROKER_INSTANCE","BROWSE","BUCKET_COUNT","BUFFER","BUFFERCOUNT","BULK","BULK_LOGGED","BY","CACHE","CALL","CALLED","CALLER","CAP_CPU_PERCENT","CASCADE","CASE","CATALOG","CATCH","CELLS_PER_OBJECT","CERTIFICATE","CHANGE_RETENTION","CHANGE_TRACKING","CHANGES","CHAR","CHARACTER","CHECK","CHECK_CONSTRAINTS","CHECK_EXPIRATION","CHECK_POLICY","CHECKALLOC","CHECKCATALOG","CHECKCONSTRAINTS","CHECKDB","CHECKFILEGROUP","CHECKIDENT","CHECKPOINT","CHECKTABLE","CLASSIFIER_FUNCTION","CLEANTABLE","CLEANUP","CLEAR","CLOSE","CLUSTER","CLUSTERED","CODEPAGE","COLLATE","COLLECTION","COLUMN","COLUMN_SET","COLUMNS","COLUMNSTORE","COLUMNSTORE_ARCHIVE","COMMIT","COMMITTED","COMPATIBILITY_LEVEL","COMPRESSION","COMPUTE","CONCAT","CONCAT_NULL_YIELDS_NULL","CONFIGURATION","CONNECT","CONSTRAINT","CONTAINMENT","CONTENT","CONTEXT","CONTINUE","CONTINUE_AFTER_ERROR","CONTRACT","CONTRACT_NAME","CONTROL","CONVERSATION","COOKIE","COPY_ONLY","COUNTER","CPU","CREATE","CREATE_NEW","CREATION_DISPOSITION","CREDENTIAL","CRYPTOGRAPHIC","CUBE","CURRENT","CURRENT_DATE","CURSOR","CURSOR_CLOSE_ON_COMMIT","CURSOR_DEFAULT","CYCLE","DATA","DATA_COMPRESSION","DATA_PURITY","DATABASE","DATABASE_DEFAULT","DATABASE_MIRRORING","DATABASE_SNAPSHOT","DATAFILETYPE","DATE","DATE_CORRELATION_OPTIMIZATION","DATEFIRST","DATEFORMAT","DATETIME","DATETIME2","DATETIMEOFFSET","DAY","DAYOFYEAR","DAYS","DB_CHAINING","DBCC","DBREINDEX","DDL_DATABASE_LEVEL_EVENTS","DEADLOCK_PRIORITY","DEALLOCATE","DEC","DECIMAL","DECLARE","DECRYPTION","DEFAULT","DEFAULT_DATABASE","DEFAULT_FULLTEXT_LANGUAGE","DEFAULT_LANGUAGE","DEFAULT_SCHEMA","DEFINITION","DELAY","DELAYED_DURABILITY","DELETE","DELETED","DENSITY_VECTOR","DENY","DEPENDENTS","DES","DESC","DESCRIPTION","DESX","DHCP","DIAGNOSTICS","DIALOG","DIFFERENTIAL","DIRECTORY_NAME","DISABLE","DISABLE_BROKER","DISABLED","DISK","DISTINCT","DISTRIBUTED","DOCUMENT","DOUBLE","DROP","DROP_EXISTING","DROPCLEANBUFFERS","DUMP","DURABILITY","DYNAMIC","EDITION","ELEMENTS","ELSE","EMERGENCY","EMPTY","EMPTYFILE","ENABLE","ENABLE_BROKER","ENABLED","ENCRYPTION","END","ENDPOINT","ENDPOINT_URL","ERRLVL","ERROR","ERROR_BROKER_CONVERSATIONS","ERRORFILE","ESCAPE","ESTIMATEONLY","EVENT","EVENT_RETENTION_MODE","EXEC","EXECUTABLE","EXECUTE","EXIT","EXPAND","EXPIREDATE","EXPIRY_DATE","EXPLICIT","EXTENDED_LOGICAL_CHECKS","EXTENSION","EXTERNAL","EXTERNAL_ACCESS","FAIL_OPERATION","FAILOVER","FAILOVER_MODE","FAILURE_CONDITION_LEVEL","FALSE","FAN_IN","FAST","FAST_FORWARD","FETCH","FIELDTERMINATOR","FILE","FILEGROUP","FILEGROWTH","FILELISTONLY","FILENAME","FILEPATH","FILESTREAM","FILESTREAM_ON","FILETABLE_COLLATE_FILENAME","FILETABLE_DIRECTORY","FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME","FILETABLE_NAMESPACE","FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME","FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME","FILLFACTOR","FILTERING","FIRE_TRIGGERS","FIRST","FIRSTROW","FLOAT","FMTONLY","FOLLOWING","FOR","FORCE","FORCE_FAILOVER_ALLOW_DATA_LOSS","FORCE_SERVICE_ALLOW_DATA_LOSS","FORCED","FORCEPLAN","FORCESCAN","FORCESEEK","FOREIGN","FORMATFILE","FORMSOF","FORWARD_ONLY","FREE","FREEPROCCACHE","FREESESSIONCACHE","FREESYSTEMCACHE","FROM","FULL","FULLSCAN","FULLTEXT","FUNCTION","GB","GEOGRAPHY_AUTO_GRID","GEOGRAPHY_GRID","GEOMETRY_AUTO_GRID","GEOMETRY_GRID","GET","GLOBAL","GO","GOTO","GOVERNOR","GRANT","GRIDS","GROUP","GROUP_MAX_REQUESTS","HADR","HASH","HASHED","HAVING","HEADERONLY","HEALTH_CHECK_TIMEOUT","HELP","HIERARCHYID","HIGH","HINT","HISTOGRAM","HOLDLOCK","HONOR_BROKER_PRIORITY","HOUR","HOURS","IDENTITY","IDENTITY_INSERT","IDENTITY_VALUE","IDENTITYCOL","IF","IGNORE_CONSTRAINTS","IGNORE_DUP_KEY","IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX","IGNORE_TRIGGERS","IMAGE","IMMEDIATE","IMPERSONATE","IMPLICIT_TRANSACTIONS","IMPORTANCE","INCLUDE","INCREMENT","INCREMENTAL","INDEX","INDEXDEFRAG","INFINITE","INFLECTIONAL","INIT","INITIATOR","INPUT","INPUTBUFFER","INSENSITIVE","INSERT","INSERTED","INSTEAD","INT","INTEGER","INTO","IO","IP","ISABOUT","ISOLATION","JOB","KB","KEEP","KEEP_CDC","KEEP_NULLS","KEEP_REPLICATION","KEEPDEFAULTS","KEEPFIXED","KEEPIDENTITY","KEEPNULLS","KERBEROS","KEY","KEY_SOURCE","KEYS","KEYSET","KILL","KILOBYTES_PER_BATCH","LABELONLY","LANGUAGE","LAST","LASTROW","LEVEL","LEVEL_1","LEVEL_2","LEVEL_3","LEVEL_4","LIFETIME","LIMIT","LINENO","LIST","LISTENER","LISTENER_IP","LISTENER_PORT","LOAD","LOADHISTORY","LOB_COMPACTION","LOCAL","LOCAL_SERVICE_NAME","LOCK_ESCALATION","LOCK_TIMEOUT","LOGIN","LOGSPACE","LOOP","LOW","MANUAL","MARK","MARK_IN_USE_FOR_REMOVAL","MASTER","MAX_CPU_PERCENT","MAX_DISPATCH_LATENCY","MAX_DOP","MAX_DURATION","MAX_EVENT_SIZE","MAX_FILES","MAX_IOPS_PER_VOLUME","MAX_MEMORY","MAX_MEMORY_PERCENT","MAX_QUEUE_READERS","MAX_ROLLOVER_FILES","MAX_SIZE","MAXDOP","MAXERRORS","MAXLENGTH","MAXRECURSION","MAXSIZE","MAXTRANSFERSIZE","MAXVALUE","MB","MEDIADESCRIPTION","MEDIANAME","MEDIAPASSWORD","MEDIUM","MEMBER","MEMORY_OPTIMIZED","MEMORY_OPTIMIZED_DATA","MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT","MEMORY_PARTITION_MODE","MERGE","MESSAGE","MESSAGE_FORWARD_SIZE","MESSAGE_FORWARDING","MICROSECOND","MILLISECOND","MIN_CPU_PERCENT","MIN_IOPS_PER_VOLUME","MIN_MEMORY_PERCENT","MINUTE","MINUTES","MINVALUE","MIRROR","MIRROR_ADDRESS","MODIFY","MONEY","MONTH","MOVE","MULTI_USER","MUST_CHANGE","NAME","NANOSECOND","NATIONAL","NATIVE_COMPILATION","NCHAR","NEGOTIATE","NESTED_TRIGGERS","NEW_ACCOUNT","NEW_BROKER","NEW_PASSWORD","NEWNAME","NEXT","NO","NO_BROWSETABLE","NO_CHECKSUM","NO_COMPRESSION","NO_EVENT_LOSS","NO_INFOMSGS","NO_TRUNCATE","NO_WAIT","NOCHECK","NOCOUNT","NOEXEC","NOEXPAND","NOFORMAT","NOINDEX","NOINIT","NOLOCK","NON","NON_TRANSACTED_ACCESS","NONCLUSTERED","NONE","NORECOMPUTE","NORECOVERY","NORESEED","NORESET","NOREWIND","NORMAL","NOSKIP","NOTIFICATION","NOTRUNCATE","NOUNLOAD","NOWAIT","NTEXT","NTLM","NUMANODE","NUMERIC","NUMERIC_ROUNDABORT","NVARCHAR","OBJECT","OF","OFF","OFFLINE","OFFSET","OFFSETS","OLD_ACCOUNT","OLD_PASSWORD","ON","ON_FAILURE","ONLINE","ONLY","OPEN","OPEN_EXISTING","OPENTRAN","OPTIMISTIC","OPTIMIZE","OPTION","ORDER","OUT","OUTPUT","OUTPUTBUFFER","OVER","OVERRIDE","OWNER","OWNERSHIP","PAD_INDEX","PAGE","PAGE_VERIFY","PAGECOUNT","PAGLOCK","PARAMETERIZATION","PARSEONLY","PARTIAL","PARTITION","PARTITIONS","PARTNER","PASSWORD","PATH","PER_CPU","PER_NODE","PERCENT","PERMISSION_SET","PERSISTED","PHYSICAL_ONLY","PLAN","POISON_MESSAGE_HANDLING","POOL","POPULATION","PORT","PRECEDING","PRECISION","PRIMARY","PRIMARY_ROLE","PRINT","PRIOR","PRIORITY","PRIORITY_LEVEL","PRIVATE","PRIVILEGES","PROC","PROCCACHE","PROCEDURE","PROCEDURE_NAME","PROCESS","PROFILE","PROPERTY","PROPERTY_DESCRIPTION","PROPERTY_INT_ID","PROPERTY_SET_GUID","PROVIDER","PROVIDER_KEY_NAME","PUBLIC","PUT","QUARTER","QUERY","QUERY_GOVERNOR_COST_LIMIT","QUEUE","QUEUE_DELAY","QUOTED_IDENTIFIER","RAISERROR","RANGE","RAW","RC2","RC4","RC4_128","READ","READ_COMMITTED_SNAPSHOT","READ_ONLY","READ_ONLY_ROUTING_LIST","READ_ONLY_ROUTING_URL","READ_WRITE","READ_WRITE_FILEGROUPS","READCOMMITTED","READCOMMITTEDLOCK","READONLY","READPAST","READTEXT","READUNCOMMITTED","READWRITE","REAL","REBUILD","RECEIVE","RECOMPILE","RECONFIGURE","RECOVERY","RECURSIVE","RECURSIVE_TRIGGERS","REFERENCES","REGENERATE","RELATED_CONVERSATION","RELATED_CONVERSATION_GROUP","RELATIVE","REMOTE","REMOTE_PROC_TRANSACTIONS","REMOTE_SERVICE_NAME","REMOVE","REORGANIZE","REPAIR_ALLOW_DATA_LOSS","REPAIR_FAST","REPAIR_REBUILD","REPEATABLE","REPEATABLEREAD","REPLICA","REPLICATION","REQUEST_MAX_CPU_TIME_SEC","REQUEST_MAX_MEMORY_GRANT_PERCENT","REQUEST_MEMORY_GRANT_TIMEOUT_SEC","REQUIRED","RESAMPLE","RESEED","RESERVE_DISK_SPACE","RESET","RESOURCE","RESTART","RESTORE","RESTRICT","RESTRICTED_USER","RESULT","RESUME","RETAINDAYS","RETENTION","RETURN","RETURNS","REVERT","REVOKE","REWIND","REWINDONLY","ROBUST","ROLE","ROLLBACK","ROLLUP","ROOT","ROUTE","ROW","ROWCOUNT","ROWGUIDCOL","ROWLOCK","ROWS","ROWS_PER_BATCH","ROWTERMINATOR","ROWVERSION","RSA_1024","RSA_2048","RSA_512","RULE","SAFE","SAFETY","SAMPLE","SAVE","SCHEDULER","SCHEMA","SCHEMA_AND_DATA","SCHEMA_ONLY","SCHEMABINDING","SCHEME","SCROLL","SCROLL_LOCKS","SEARCH","SECOND","SECONDARY","SECONDARY_ONLY","SECONDARY_ROLE","SECONDS","SECRET","SECURITY_LOG","SECURITYAUDIT","SELECT","SELECTIVE","SELF","SEND","SENT","SEQUENCE","SERIALIZABLE","SERVER","SERVICE","SERVICE_BROKER","SERVICE_NAME","SESSION","SESSION_TIMEOUT","SET","SETS","SETUSER","SHOW_STATISTICS","SHOWCONTIG","SHOWPLAN","SHOWPLAN_ALL","SHOWPLAN_TEXT","SHOWPLAN_XML","SHRINKDATABASE","SHRINKFILE","SHUTDOWN","SID","SIGNATURE","SIMPLE","SINGLE_BLOB","SINGLE_CLOB","SINGLE_NCLOB","SINGLE_USER","SINGLETON","SIZE","SKIP","SMALLDATETIME","SMALLINT","SMALLMONEY","SNAPSHOT","SORT_IN_TEMPDB","SOURCE","SPARSE","SPATIAL","SPATIAL_WINDOW_MAX_CELLS","SPECIFICATION","SPLIT","SQL","SQL_VARIANT","SQLPERF","STANDBY","START","START_DATE","STARTED","STARTUP_STATE","STAT_HEADER","STATE","STATEMENT","STATIC","STATISTICAL_SEMANTICS","STATISTICS","STATISTICS_INCREMENTAL","STATISTICS_NORECOMPUTE","STATS","STATS_STREAM","STATUS","STATUSONLY","STOP","STOP_ON_ERROR","STOPAT","STOPATMARK","STOPBEFOREMARK","STOPLIST","STOPPED","SUBJECT","SUBSCRIPTION","SUPPORTED","SUSPEND","SWITCH","SYMMETRIC","SYNCHRONOUS_COMMIT","SYNONYM","SYSNAME","SYSTEM","TABLE","TABLERESULTS","TABLESAMPLE","TABLOCK","TABLOCKX","TAKE","TAPE","TARGET","TARGET_RECOVERY_TIME","TB","TCP","TEXT","TEXTIMAGE_ON","TEXTSIZE","THEN","THESAURUS","THROW","TIES","TIME","TIMEOUT","TIMER","TIMESTAMP","TINYINT","TO","TOP","TORN_PAGE_DETECTION","TRACEOFF","TRACEON","TRACESTATUS","TRACK_CAUSALITY","TRACK_COLUMNS_UPDATED","TRAN","TRANSACTION","TRANSFER","TRANSFORM_NOISE_WORDS","TRIGGER","TRIPLE_DES","TRIPLE_DES_3KEY","TRUE","TRUNCATE","TRUNCATEONLY","TRUSTWORTHY","TRY","TSQL","TWO_DIGIT_YEAR_CUTOFF","TYPE","TYPE_WARNING","UNBOUNDED","UNCHECKED","UNCOMMITTED","UNDEFINED","UNIQUE","UNIQUEIDENTIFIER","UNKNOWN","UNLIMITED","UNLOAD","UNSAFE","UPDATE","UPDATETEXT","UPDATEUSAGE","UPDLOCK","URL","USE","USED","USER","USEROPTIONS","USING","VALID_XML","VALIDATION","VALUE","VALUES","VARBINARY","VARCHAR","VARYING","VERIFYONLY","VERSION","VIEW","VIEW_METADATA","VIEWS","VISIBILITY","WAIT_AT_LOW_PRIORITY","WAITFOR","WEEK","WEIGHT","WELL_FORMED_XML","WHEN","WHERE","WHILE","WINDOWS","WITH","WITHIN","WITHOUT","WITNESS","WORK","WORKLOAD","WRITETEXT","XACT_ABORT","XLOCK","XMAX","XMIN","XML","XMLDATA","XMLNAMESPACES","XMLSCHEMA","XQUERY","XSINIL","YEAR","YMAX","YMIN"],operators:["ALL","AND","ANY","BETWEEN","EXISTS","IN","LIKE","NOT","OR","SOME","EXCEPT","INTERSECT","UNION","APPLY","CROSS","FULL","INNER","JOIN","LEFT","OUTER","RIGHT","CONTAINS","FREETEXT","IS","NULL","PIVOT","UNPIVOT","MATCHED"],builtinFunctions:["AVG","CHECKSUM_AGG","COUNT","COUNT_BIG","GROUPING","GROUPING_ID","MAX","MIN","SUM","STDEV","STDEVP","VAR","VARP","CUME_DIST","FIRST_VALUE","LAG","LAST_VALUE","LEAD","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","COLLATE","COLLATIONPROPERTY","TERTIARY_WEIGHTS","FEDERATION_FILTERING_VALUE","CAST","CONVERT","PARSE","TRY_CAST","TRY_CONVERT","TRY_PARSE","ASYMKEY_ID","ASYMKEYPROPERTY","CERTPROPERTY","CERT_ID","CRYPT_GEN_RANDOM","DECRYPTBYASYMKEY","DECRYPTBYCERT","DECRYPTBYKEY","DECRYPTBYKEYAUTOASYMKEY","DECRYPTBYKEYAUTOCERT","DECRYPTBYPASSPHRASE","ENCRYPTBYASYMKEY","ENCRYPTBYCERT","ENCRYPTBYKEY","ENCRYPTBYPASSPHRASE","HASHBYTES","IS_OBJECTSIGNED","KEY_GUID","KEY_ID","KEY_NAME","SIGNBYASYMKEY","SIGNBYCERT","SYMKEYPROPERTY","VERIFYSIGNEDBYCERT","VERIFYSIGNEDBYASYMKEY","CURSOR_STATUS","DATALENGTH","IDENT_CURRENT","IDENT_INCR","IDENT_SEED","IDENTITY","SQL_VARIANT_PROPERTY","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","DATEFROMPARTS","DATENAME","DATEPART","DATETIME2FROMPARTS","DATETIMEFROMPARTS","DATETIMEOFFSETFROMPARTS","DAY","EOMONTH","GETDATE","GETUTCDATE","ISDATE","MONTH","SMALLDATETIMEFROMPARTS","SWITCHOFFSET","SYSDATETIME","SYSDATETIMEOFFSET","SYSUTCDATETIME","TIMEFROMPARTS","TODATETIMEOFFSET","YEAR","CHOOSE","COALESCE","IIF","NULLIF","ABS","ACOS","ASIN","ATAN","ATN2","CEILING","COS","COT","DEGREES","EXP","FLOOR","LOG","LOG10","PI","POWER","RADIANS","RAND","ROUND","SIGN","SIN","SQRT","SQUARE","TAN","APP_NAME","APPLOCK_MODE","APPLOCK_TEST","ASSEMBLYPROPERTY","COL_LENGTH","COL_NAME","COLUMNPROPERTY","DATABASE_PRINCIPAL_ID","DATABASEPROPERTYEX","DB_ID","DB_NAME","FILE_ID","FILE_IDEX","FILE_NAME","FILEGROUP_ID","FILEGROUP_NAME","FILEGROUPPROPERTY","FILEPROPERTY","FULLTEXTCATALOGPROPERTY","FULLTEXTSERVICEPROPERTY","INDEX_COL","INDEXKEY_PROPERTY","INDEXPROPERTY","OBJECT_DEFINITION","OBJECT_ID","OBJECT_NAME","OBJECT_SCHEMA_NAME","OBJECTPROPERTY","OBJECTPROPERTYEX","ORIGINAL_DB_NAME","PARSENAME","SCHEMA_ID","SCHEMA_NAME","SCOPE_IDENTITY","SERVERPROPERTY","STATS_DATE","TYPE_ID","TYPE_NAME","TYPEPROPERTY","DENSE_RANK","NTILE","RANK","ROW_NUMBER","PUBLISHINGSERVERNAME","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","CERTENCODED","CERTPRIVATEKEY","CURRENT_USER","HAS_DBACCESS","HAS_PERMS_BY_NAME","IS_MEMBER","IS_ROLEMEMBER","IS_SRVROLEMEMBER","LOGINPROPERTY","ORIGINAL_LOGIN","PERMISSIONS","PWDENCRYPT","PWDCOMPARE","SESSION_USER","SESSIONPROPERTY","SUSER_ID","SUSER_NAME","SUSER_SID","SUSER_SNAME","SYSTEM_USER","USER","USER_ID","USER_NAME","ASCII","CHAR","CHARINDEX","CONCAT","DIFFERENCE","FORMAT","LEFT","LEN","LOWER","LTRIM","NCHAR","PATINDEX","QUOTENAME","REPLACE","REPLICATE","REVERSE","RIGHT","RTRIM","SOUNDEX","SPACE","STR","STUFF","SUBSTRING","UNICODE","UPPER","BINARY_CHECKSUM","CHECKSUM","CONNECTIONPROPERTY","CONTEXT_INFO","CURRENT_REQUEST_ID","ERROR_LINE","ERROR_NUMBER","ERROR_MESSAGE","ERROR_PROCEDURE","ERROR_SEVERITY","ERROR_STATE","FORMATMESSAGE","GETANSINULL","GET_FILESTREAM_TRANSACTION_CONTEXT","HOST_ID","HOST_NAME","ISNULL","ISNUMERIC","MIN_ACTIVE_ROWVERSION","NEWID","NEWSEQUENTIALID","ROWCOUNT_BIG","XACT_STATE","TEXTPTR","TEXTVALID","COLUMNS_UPDATED","EVENTDATA","TRIGGER_NESTLEVEL","UPDATE","CHANGETABLE","CHANGE_TRACKING_CONTEXT","CHANGE_TRACKING_CURRENT_VERSION","CHANGE_TRACKING_IS_COLUMN_IN_MASK","CHANGE_TRACKING_MIN_VALID_VERSION","CONTAINSTABLE","FREETEXTTABLE","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","FILETABLEROOTPATH","GETFILENAMESPACEPATH","GETPATHLOCATOR","PATHNAME","GET_TRANSMISSION_STATUS"],builtinVariables:["@@DATEFIRST","@@DBTS","@@LANGID","@@LANGUAGE","@@LOCK_TIMEOUT","@@MAX_CONNECTIONS","@@MAX_PRECISION","@@NESTLEVEL","@@OPTIONS","@@REMSERVER","@@SERVERNAME","@@SERVICENAME","@@SPID","@@TEXTSIZE","@@VERSION","@@CURSOR_ROWS","@@FETCH_STATUS","@@DATEFIRST","@@PROCID","@@ERROR","@@IDENTITY","@@ROWCOUNT","@@TRANCOUNT","@@CONNECTIONS","@@CPU_BUSY","@@IDLE","@@IO_BUSY","@@PACKET_ERRORS","@@PACK_RECEIVED","@@PACK_SENT","@@TIMETICKS","@@TOTAL_ERRORS","@@TOTAL_READ","@@TOTAL_WRITE"],pseudoColumns:["$ACTION","$IDENTITY","$ROWGUID","$PARTITION"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i,"keyword"],[/BEGIN\s+TRY\b/i,{token:"keyword.try"}],[/END\s+TRY\b/i,{token:"keyword.try"}],[/BEGIN\s+CATCH\b/i,{token:"keyword.catch"}],[/END\s+CATCH\b/i,{token:"keyword.catch"}],[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}}}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0be333.63623404.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0be333.63623404.js new file mode 100644 index 000000000..9b4b0f279 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0be333.63623404.js @@ -0,0 +1,9 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0be333"],{"2ef0":function(n,t,r){(function(n,e){var u; +/** + * @license + * Lodash + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var i,o="4.17.11",a=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="__lodash_hash_undefined__",s=500,h="__lodash_placeholder__",p=1,v=2,_=4,g=1,y=2,d=1,w=2,b=4,m=8,x=16,j=32,A=64,k=128,O=256,I=512,R=30,z="...",E=800,S=16,W=1,L=2,C=3,U=1/0,B=9007199254740991,T=1.7976931348623157e308,$=NaN,D=4294967295,M=D-1,F=D>>>1,N=[["ary",k],["bind",d],["bindKey",w],["curry",m],["curryRight",x],["flip",I],["partial",j],["partialRight",A],["rearg",O]],P="[object Arguments]",q="[object Array]",Z="[object AsyncFunction]",K="[object Boolean]",V="[object Date]",G="[object DOMException]",J="[object Error]",H="[object Function]",Y="[object GeneratorFunction]",Q="[object Map]",X="[object Number]",nn="[object Null]",tn="[object Object]",rn="[object Promise]",en="[object Proxy]",un="[object RegExp]",on="[object Set]",an="[object String]",fn="[object Symbol]",cn="[object Undefined]",ln="[object WeakMap]",sn="[object WeakSet]",hn="[object ArrayBuffer]",pn="[object DataView]",vn="[object Float32Array]",_n="[object Float64Array]",gn="[object Int8Array]",yn="[object Int16Array]",dn="[object Int32Array]",wn="[object Uint8Array]",bn="[object Uint8ClampedArray]",mn="[object Uint16Array]",xn="[object Uint32Array]",jn=/\b__p \+= '';/g,An=/\b(__p \+=) '' \+/g,kn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,On=/&(?:amp|lt|gt|quot|#39);/g,In=/[&<>"']/g,Rn=RegExp(On.source),zn=RegExp(In.source),En=/<%-([\s\S]+?)%>/g,Sn=/<%([\s\S]+?)%>/g,Wn=/<%=([\s\S]+?)%>/g,Ln=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cn=/^\w*$/,Un=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bn=/[\\^$.*+?()[\]{}|]/g,Tn=RegExp(Bn.source),$n=/^\s+|\s+$/g,Dn=/^\s+/,Mn=/\s+$/,Fn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nn=/\{\n\/\* \[wrapped with (.+)\] \*/,Pn=/,? & /,qn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zn=/\\(\\)?/g,Kn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vn=/\w*$/,Gn=/^[-+]0x[0-9a-f]+$/i,Jn=/^0b[01]+$/i,Hn=/^\[object .+?Constructor\]$/,Yn=/^0o[0-7]+$/i,Qn=/^(?:0|[1-9]\d*)$/,Xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nt=/($^)/,tt=/['\n\r\u2028\u2029\\]/g,rt="\\ud800-\\udfff",et="\\u0300-\\u036f",ut="\\ufe20-\\ufe2f",it="\\u20d0-\\u20ff",ot=et+ut+it,at="\\u2700-\\u27bf",ft="a-z\\xdf-\\xf6\\xf8-\\xff",ct="\\xac\\xb1\\xd7\\xf7",lt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",st="\\u2000-\\u206f",ht=" \\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",pt="A-Z\\xc0-\\xd6\\xd8-\\xde",vt="\\ufe0e\\ufe0f",_t=ct+lt+st+ht,gt="['’]",yt="["+rt+"]",dt="["+_t+"]",wt="["+ot+"]",bt="\\d+",mt="["+at+"]",xt="["+ft+"]",jt="[^"+rt+_t+bt+at+ft+pt+"]",At="\\ud83c[\\udffb-\\udfff]",kt="(?:"+wt+"|"+At+")",Ot="[^"+rt+"]",It="(?:\\ud83c[\\udde6-\\uddff]){2}",Rt="[\\ud800-\\udbff][\\udc00-\\udfff]",zt="["+pt+"]",Et="\\u200d",St="(?:"+xt+"|"+jt+")",Wt="(?:"+zt+"|"+jt+")",Lt="(?:"+gt+"(?:d|ll|m|re|s|t|ve))?",Ct="(?:"+gt+"(?:D|LL|M|RE|S|T|VE))?",Ut=kt+"?",Bt="["+vt+"]?",Tt="(?:"+Et+"(?:"+[Ot,It,Rt].join("|")+")"+Bt+Ut+")*",$t="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mt=Bt+Ut+Tt,Ft="(?:"+[mt,It,Rt].join("|")+")"+Mt,Nt="(?:"+[Ot+wt+"?",wt,It,Rt,yt].join("|")+")",Pt=RegExp(gt,"g"),qt=RegExp(wt,"g"),Zt=RegExp(At+"(?="+At+")|"+Nt+Mt,"g"),Kt=RegExp([zt+"?"+xt+"+"+Lt+"(?="+[dt,zt,"$"].join("|")+")",Wt+"+"+Ct+"(?="+[dt,zt+St,"$"].join("|")+")",zt+"?"+St+"+"+Lt,zt+"+"+Ct,Dt,$t,bt,Ft].join("|"),"g"),Vt=RegExp("["+Et+rt+ot+vt+"]"),Gt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jt=["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"],Ht=-1,Yt={};Yt[vn]=Yt[_n]=Yt[gn]=Yt[yn]=Yt[dn]=Yt[wn]=Yt[bn]=Yt[mn]=Yt[xn]=!0,Yt[P]=Yt[q]=Yt[hn]=Yt[K]=Yt[pn]=Yt[V]=Yt[J]=Yt[H]=Yt[Q]=Yt[X]=Yt[tn]=Yt[un]=Yt[on]=Yt[an]=Yt[ln]=!1;var Qt={};Qt[P]=Qt[q]=Qt[hn]=Qt[pn]=Qt[K]=Qt[V]=Qt[vn]=Qt[_n]=Qt[gn]=Qt[yn]=Qt[dn]=Qt[Q]=Qt[X]=Qt[tn]=Qt[un]=Qt[on]=Qt[an]=Qt[fn]=Qt[wn]=Qt[bn]=Qt[mn]=Qt[xn]=!0,Qt[J]=Qt[H]=Qt[ln]=!1;var Xt={"À":"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"},nr={"&":"&","<":"<",">":">",'"':""","'":"'"},tr={"&":"&","<":"<",">":">",""":'"',"'":"'"},rr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},er=parseFloat,ur=parseInt,ir="object"==typeof n&&n&&n.Object===Object&&n,or="object"==typeof self&&self&&self.Object===Object&&self,ar=ir||or||Function("return this")(),fr=t&&!t.nodeType&&t,cr=fr&&"object"==typeof e&&e&&!e.nodeType&&e,lr=cr&&cr.exports===fr,sr=lr&&ir.process,hr=function(){try{var n=cr&&cr.require&&cr.require("util").types;return n||sr&&sr.binding&&sr.binding("util")}catch(t){}}(),pr=hr&&hr.isArrayBuffer,vr=hr&&hr.isDate,_r=hr&&hr.isMap,gr=hr&&hr.isRegExp,yr=hr&&hr.isSet,dr=hr&&hr.isTypedArray;function wr(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function br(n,t,r,e){var u=-1,i=null==n?0:n.length;while(++u-1}function Or(n,t,r){var e=-1,u=null==n?0:n.length;while(++e-1);return r}function Qr(n,t){var r=n.length;while(r--&&Tr(t,n[r],0)>-1);return r}function Xr(n,t){var r=n.length,e=0;while(r--)n[r]===t&&++e;return e}var ne=Nr(Xt),te=Nr(nr);function re(n){return"\\"+rr[n]}function ee(n,t){return null==n?i:n[t]}function ue(n){return Vt.test(n)}function ie(n){return Gt.test(n)}function oe(n){var t,r=[];while(!(t=n.next()).done)r.push(t.value);return r}function ae(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function fe(n,t){return function(r){return n(t(r))}}function ce(n,t){var r=-1,e=n.length,u=0,i=[];while(++r-1}function Me(n,t){var r=this.__data__,e=fu(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function Fe(n){var t=-1,r=null==n?0:n.length;this.clear();while(++t=t?n:t)),n}function _u(n,t,r,e,u,o){var a,f=t&p,c=t&v,l=t&_;if(r&&(a=u?r(n,e,u,o):r(n)),a!==i)return a;if(!jl(n))return n;var s=al(n);if(s){if(a=Xo(n),!f)return to(n,a)}else{var h=Jo(n),g=h==H||h==Y;if(hl(n))return Zi(n,f);if(h==tn||h==P||g&&!u){if(a=c||g?{}:na(n),!f)return c?uo(n,su(a,n)):eo(n,lu(a,n))}else{if(!Qt[h])return u?n:{};a=ta(n,h,f)}}o||(o=new He);var y=o.get(n);if(y)return y;if(o.set(n,a),Bl(n))return n.forEach(function(e){a.add(_u(e,t,r,e,n,o))}),a;if(kl(n))return n.forEach(function(e,u){a.set(u,_u(e,t,r,u,n,o))}),a;var d=l?c?$o:To:c?xs:ms,w=s?i:d(n);return mr(w||n,function(e,u){w&&(u=e,e=n[u]),au(a,u,_u(e,t,r,u,n,o))}),a}function gu(n){var t=ms(n);return function(r){return yu(r,n,t)}}function yu(n,t,r){var e=r.length;if(null==n)return!e;n=et(n);while(e--){var u=r[e],o=t[u],a=n[u];if(a===i&&!(u in n)||!o(a))return!1}return!0}function du(n,t,r){if("function"!=typeof n)throw new ot(c);return ja(function(){n.apply(i,r)},t)}function wu(n,t,r,e){var u=-1,i=kr,o=!0,f=n.length,c=[],l=t.length;if(!f)return c;r&&(t=Ir(t,Gr(r))),e?(i=Or,o=!1):t.length>=a&&(i=Hr,o=!1,t=new Ve(t));n:while(++uu?0:u+r),e=e===i||e>u?u:Vl(e),e<0&&(e+=u),e=r>e?0:Gl(e);while(r0&&r(a)?t>1?Ou(a,t-1,r,e,u):Rr(u,a):e||(u[u.length]=a)}return u}var Iu=fo(),Ru=fo(!0);function zu(n,t){return n&&Iu(n,t,ms)}function Eu(n,t){return n&&Ru(n,t,ms)}function Su(n,t){return Ar(t,function(t){return bl(n[t])})}function Wu(n,t){t=Fi(t,n);var r=0,e=t.length;while(null!=n&&rt}function Bu(n,t){return null!=n&&ht.call(n,t)}function Tu(n,t){return null!=n&&t in et(n)}function $u(n,t,r){return n>=Nt(t,r)&&n=120&&h.length>=120)?new Ve(f&&h):i}h=n[0];var p=-1,v=c[0];n:while(++p-1)a!==n&&Ot.call(a,f,1),Ot.call(n,f,1)}return n}function vi(n,t){var r=n?t.length:0,e=r-1;while(r--){var u=t[r];if(r==e||u!==i){var i=u;ua(u)?Ot.call(n,u,1):Li(n,u)}}return n}function _i(n,t){return n+Ut(Vt()*(t-n+1))}function gi(n,t,e,u){var i=-1,o=Ft(Ct((t-n)/(e||1)),0),a=r(o);while(o--)a[u?o:++i]=n,n+=e;return a}function yi(n,t){var r="";if(!n||t<1||t>B)return r;do{t%2&&(r+=n),t=Ut(t/2),t&&(n+=n)}while(t);return r}function di(n,t){return Aa(da(n,t,zh),n+"")}function wi(n){return eu(Ms(n))}function bi(n,t){var r=Ms(n);return Ia(r,vu(t,0,r.length))}function mi(n,t,r,e){if(!jl(n))return n;t=Fi(t,n);var u=-1,o=t.length,a=o-1,f=n;while(null!=f&&++ui?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;var o=r(i);while(++u>>1,o=n[i];null!==o&&!$l(o)&&(r?o<=t:o=a){var l=t?null:Io(n);if(l)return le(l);o=!1,u=Hr,c=new Ve}else c=t?[]:f;n:while(++e=e?n:ki(n,t,r)}var qi=St||function(n){return ar.clearTimeout(n)};function Zi(n,t){if(t)return n.slice();var r=n.length,e=xt?xt(r):new n.constructor(r);return n.copy(e),e}function Ki(n){var t=new n.constructor(n.byteLength);return new mt(t).set(new mt(n)),t}function Vi(n,t){var r=t?Ki(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function Gi(n){var t=new n.constructor(n.source,Vn.exec(n));return t.lastIndex=n.lastIndex,t}function Ji(n){return ye?et(ye.call(n)):{}}function Hi(n,t){var r=t?Ki(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Yi(n,t){if(n!==t){var r=n!==i,e=null===n,u=n===n,o=$l(n),a=t!==i,f=null===t,c=t===t,l=$l(t);if(!f&&!l&&!o&&n>t||o&&a&&c&&!f&&!l||e&&a&&c||!r&&c||!u)return 1;if(!e&&!o&&!l&&n=a)return f;var c=r[e];return f*("desc"==c?-1:1)}}return n.index-t.index}function Xi(n,t,e,u){var i=-1,o=n.length,a=e.length,f=-1,c=t.length,l=Ft(o-a,0),s=r(c+l),h=!u;while(++f1?r[u-1]:i,a=u>2?r[2]:i;o=n.length>3&&"function"==typeof o?(u--,o):i,a&&ia(r[0],r[1],a)&&(o=u<3?i:o,u=1),t=et(t);while(++e-1?u[o?t[a]:a]:i}}function _o(n){return Bo(function(t){var r=t.length,e=r,u=Ae.prototype.thru;n&&t.reverse();while(e--){var o=t[e];if("function"!=typeof o)throw new ot(c);if(u&&!a&&"wrapper"==Mo(o))var a=new Ae([],!0)}e=a?e:r;while(++e1&&d.reverse(),h&&lf))return!1;var l=o.get(n);if(l&&o.get(t))return l==t;var s=-1,h=!0,p=r&y?new Ve:i;o.set(n,t),o.set(t,n);while(++s1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Fn,"{\n/* [wrapped with "+t+"] */\n")}function ea(n){return al(n)||ol(n)||!!(It&&n&&n[It])}function ua(n,t){var r=typeof n;return t=null==t?B:t,!!t&&("number"==r||"symbol"!=r&&Qn.test(n))&&n>-1&&n%1==0&&n0){if(++t>=E)return arguments[0]}else t=0;return n.apply(i,arguments)}}function Ia(n,t){var r=-1,e=n.length,u=e-1;t=t===i?e:t;while(++r1?n[t-1]:i;return r="function"==typeof r?(n.pop(),r):i,Uf(n,r)});function qf(n){var t=be(n);return t.__chain__=!0,t}function Zf(n,t){return t(n),n}function Kf(n,t){return t(n)}var Vf=Bo(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return pu(t,n)};return!(t>1||this.__actions__.length)&&e instanceof ke&&ua(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:Kf,args:[u],thisArg:i}),new Ae(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(i),n})):this.thru(u)});function Gf(){return qf(this)}function Jf(){return new Ae(this.value(),this.__chain__)}function Hf(){this.__values__===i&&(this.__values__=Zl(this.value()));var n=this.__index__>=this.__values__.length,t=n?i:this.__values__[this.__index__++];return{done:n,value:t}}function Yf(){return this}function Qf(n){var t,r=this;while(r instanceof je){var e=Wa(r);e.__index__=0,e.__values__=i,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function Xf(){var n=this.__wrapped__;if(n instanceof ke){var t=n;return this.__actions__.length&&(t=new ke(this)),t=t.reverse(),t.__actions__.push({func:Kf,args:[pf],thisArg:i}),new Ae(t,this.__chain__)}return this.thru(pf)}function nc(){return Bi(this.__wrapped__,this.__actions__)}var tc=io(function(n,t,r){ht.call(n,r)?++n[r]:hu(n,r,1)});function rc(n,t,r){var e=al(n)?jr:xu;return r&&ia(n,t,r)&&(t=i),e(n,No(t,3))}function ec(n,t){var r=al(n)?Ar:ku;return r(n,No(t,3))}var uc=vo(qa),ic=vo(Za);function oc(n,t){return Ou(_c(n,t),1)}function ac(n,t){return Ou(_c(n,t),U)}function fc(n,t,r){return r=r===i?1:Vl(r),Ou(_c(n,t),r)}function cc(n,t){var r=al(n)?mr:bu;return r(n,No(t,3))}function lc(n,t){var r=al(n)?xr:mu;return r(n,No(t,3))}var sc=io(function(n,t,r){ht.call(n,r)?n[r].push(t):hu(n,r,[t])});function hc(n,t,r,e){n=cl(n)?n:Ms(n),r=r&&!e?Vl(r):0;var u=n.length;return r<0&&(r=Ft(u+r,0)),Tl(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&Tr(n,t,r)>-1}var pc=di(function(n,t,e){var u=-1,i="function"==typeof t,o=cl(n)?r(n.length):[];return bu(n,function(n){o[++u]=i?wr(t,n,e):Fu(n,t,e)}),o}),vc=io(function(n,t,r){hu(n,r,t)});function _c(n,t){var r=al(n)?Ir:ei;return r(n,No(t,3))}function gc(n,t,r,e){return null==n?[]:(al(t)||(t=null==t?[]:[t]),r=e?i:r,al(r)||(r=null==r?[]:[r]),ci(n,t,r))}var yc=io(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]});function dc(n,t,r){var e=al(n)?zr:Pr,u=arguments.length<3;return e(n,No(t,4),r,u,bu)}function wc(n,t,r){var e=al(n)?Er:Pr,u=arguments.length<3;return e(n,No(t,4),r,u,mu)}function bc(n,t){var r=al(n)?Ar:ku;return r(n,Mc(No(t,3)))}function mc(n){var t=al(n)?eu:wi;return t(n)}function xc(n,t,r){t=(r?ia(n,t,r):t===i)?1:Vl(t);var e=al(n)?uu:bi;return e(n,t)}function jc(n){var t=al(n)?iu:Ai;return t(n)}function Ac(n){if(null==n)return 0;if(cl(n))return Tl(n)?ve(n):n.length;var t=Jo(n);return t==Q||t==on?n.size:ni(n).length}function kc(n,t,r){var e=al(n)?Sr:Oi;return r&&ia(n,t,r)&&(t=i),e(n,No(t,3))}var Oc=di(function(n,t){if(null==n)return[];var r=t.length;return r>1&&ia(n,t[0],t[1])?t=[]:r>2&&ia(t[0],t[1],t[2])&&(t=[t[0]]),ci(n,Ou(t,1),[])}),Ic=Wt||function(){return ar.Date.now()};function Rc(n,t){if("function"!=typeof t)throw new ot(c);return n=Vl(n),function(){if(--n<1)return t.apply(this,arguments)}}function zc(n,t,r){return t=r?i:t,t=n&&null==t?n.length:t,zo(n,k,i,i,i,i,t)}function Ec(n,t){var r;if("function"!=typeof t)throw new ot(c);return n=Vl(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=i),r}}var Sc=di(function(n,t,r){var e=d;if(r.length){var u=ce(r,Fo(Sc));e|=j}return zo(n,e,t,r,u)}),Wc=di(function(n,t,r){var e=d|w;if(r.length){var u=ce(r,Fo(Wc));e|=j}return zo(t,e,n,r,u)});function Lc(n,t,r){t=r?i:t;var e=zo(n,m,i,i,i,i,i,t);return e.placeholder=Lc.placeholder,e}function Cc(n,t,r){t=r?i:t;var e=zo(n,x,i,i,i,i,i,t);return e.placeholder=Cc.placeholder,e}function Uc(n,t,r){var e,u,o,a,f,l,s=0,h=!1,p=!1,v=!0;if("function"!=typeof n)throw new ot(c);function _(t){var r=e,o=u;return e=u=i,s=t,a=n.apply(o,r),a}function g(n){return s=n,f=ja(w,t),h?_(n):a}function y(n){var r=n-l,e=n-s,u=t-r;return p?Nt(u,o-e):u}function d(n){var r=n-l,e=n-s;return l===i||r>=t||r<0||p&&e>=o}function w(){var n=Ic();if(d(n))return b(n);f=ja(w,y(n))}function b(n){return f=i,v&&e?_(n):(e=u=i,a)}function m(){f!==i&&qi(f),s=0,e=l=u=f=i}function x(){return f===i?a:b(Ic())}function j(){var n=Ic(),r=d(n);if(e=arguments,u=this,l=n,r){if(f===i)return g(l);if(p)return f=ja(w,t),_(l)}return f===i&&(f=ja(w,t)),a}return t=Jl(t)||0,jl(r)&&(h=!!r.leading,p="maxWait"in r,o=p?Ft(Jl(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),j.cancel=m,j.flush=x,j}var Bc=di(function(n,t){return du(n,1,t)}),Tc=di(function(n,t,r){return du(n,Jl(t)||0,r)});function $c(n){return zo(n,I)}function Dc(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new ot(c);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Dc.Cache||Fe),r}function Mc(n){if("function"!=typeof n)throw new ot(c);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Fc(n){return Ec(2,n)}Dc.Cache=Fe;var Nc=Ni(function(n,t){t=1==t.length&&al(t[0])?Ir(t[0],Gr(No())):Ir(Ou(t,1),Gr(No()));var r=t.length;return di(function(e){var u=-1,i=Nt(e.length,r);while(++u=t}),ol=Nu(function(){return arguments}())?Nu:function(n){return Al(n)&&ht.call(n,"callee")&&!kt.call(n,"callee")},al=r.isArray,fl=pr?Gr(pr):Pu;function cl(n){return null!=n&&xl(n.length)&&!bl(n)}function ll(n){return Al(n)&&cl(n)}function sl(n){return!0===n||!1===n||Al(n)&&Cu(n)==K}var hl=Tt||Vh,pl=vr?Gr(vr):qu;function vl(n){return Al(n)&&1===n.nodeType&&!Ll(n)}function _l(n){if(null==n)return!0;if(cl(n)&&(al(n)||"string"==typeof n||"function"==typeof n.splice||hl(n)||Dl(n)||ol(n)))return!n.length;var t=Jo(n);if(t==Q||t==on)return!n.size;if(sa(n))return!ni(n).length;for(var r in n)if(ht.call(n,r))return!1;return!0}function gl(n,t){return Zu(n,t)}function yl(n,t,r){r="function"==typeof r?r:i;var e=r?r(n,t):i;return e===i?Zu(n,t,i,r):!!e}function dl(n){if(!Al(n))return!1;var t=Cu(n);return t==J||t==G||"string"==typeof n.message&&"string"==typeof n.name&&!Ll(n)}function wl(n){return"number"==typeof n&&$t(n)}function bl(n){if(!jl(n))return!1;var t=Cu(n);return t==H||t==Y||t==Z||t==en}function ml(n){return"number"==typeof n&&n==Vl(n)}function xl(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=B}function jl(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function Al(n){return null!=n&&"object"==typeof n}var kl=_r?Gr(_r):Vu;function Ol(n,t){return n===t||Gu(n,t,qo(t))}function Il(n,t,r){return r="function"==typeof r?r:i,Gu(n,t,qo(t),r)}function Rl(n){return Wl(n)&&n!=+n}function zl(n){if(la(n))throw new u(f);return Ju(n)}function El(n){return null===n}function Sl(n){return null==n}function Wl(n){return"number"==typeof n||Al(n)&&Cu(n)==X}function Ll(n){if(!Al(n)||Cu(n)!=tn)return!1;var t=jt(n);if(null===t)return!0;var r=ht.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&st.call(r)==gt}var Cl=gr?Gr(gr):Hu;function Ul(n){return ml(n)&&n>=-B&&n<=B}var Bl=yr?Gr(yr):Yu;function Tl(n){return"string"==typeof n||!al(n)&&Al(n)&&Cu(n)==an}function $l(n){return"symbol"==typeof n||Al(n)&&Cu(n)==fn}var Dl=dr?Gr(dr):Qu;function Ml(n){return n===i}function Fl(n){return Al(n)&&Jo(n)==ln}function Nl(n){return Al(n)&&Cu(n)==sn}var Pl=Ao(ri),ql=Ao(function(n,t){return n<=t});function Zl(n){if(!n)return[];if(cl(n))return Tl(n)?_e(n):to(n);if(Rt&&n[Rt])return oe(n[Rt]());var t=Jo(n),r=t==Q?ae:t==on?le:Ms;return r(n)}function Kl(n){if(!n)return 0===n?n:0;if(n=Jl(n),n===U||n===-U){var t=n<0?-1:1;return t*T}return n===n?n:0}function Vl(n){var t=Kl(n),r=t%1;return t===t?r?t-r:t:0}function Gl(n){return n?vu(Vl(n),0,D):0}function Jl(n){if("number"==typeof n)return n;if($l(n))return $;if(jl(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=jl(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace($n,"");var r=Jn.test(n);return r||Yn.test(n)?ur(n.slice(2),r?2:8):Gn.test(n)?$:+n}function Hl(n){return ro(n,xs(n))}function Yl(n){return n?vu(Vl(n),-B,B):0===n?n:0}function Ql(n){return null==n?"":Si(n)}var Xl=oo(function(n,t){if(sa(t)||cl(t))ro(t,ms(t),n);else for(var r in t)ht.call(t,r)&&au(n,r,t[r])}),ns=oo(function(n,t){ro(t,xs(t),n)}),ts=oo(function(n,t,r,e){ro(t,xs(t),n,e)}),rs=oo(function(n,t,r,e){ro(t,ms(t),n,e)}),es=Bo(pu);function us(n,t){var r=xe(n);return null==t?r:lu(r,t)}var is=di(function(n,t){n=et(n);var r=-1,e=t.length,u=e>2?t[2]:i;u&&ia(t[0],t[1],u)&&(e=1);while(++r1),t}),ro(n,$o(n),r),e&&(r=_u(r,p|v|_,Wo));var u=t.length;while(u--)Li(r,t[u]);return r});function Rs(n,t){return Es(n,Mc(No(t)))}var zs=Bo(function(n,t){return null==n?{}:li(n,t)});function Es(n,t){if(null==n)return{};var r=Ir($o(n),function(n){return[n]});return t=No(t),si(n,r,function(n,r){return t(n,r[0])})}function Ss(n,t,r){t=Fi(t,n);var e=-1,u=t.length;u||(u=1,n=i);while(++et){var e=n;n=t,t=e}if(r||n%1||t%1){var u=Vt();return Nt(n+u*(t-n+er("1e-"+((u+"").length-1))),t)}return _i(n,t)}var Zs=so(function(n,t,r){return t=t.toLowerCase(),n+(r?Ks(t):t)});function Ks(n){return wh(Ql(n).toLowerCase())}function Vs(n){return n=Ql(n),n&&n.replace(Xn,ne).replace(qt,"")}function Gs(n,t,r){n=Ql(n),t=Si(t);var e=n.length;r=r===i?e:vu(Vl(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function Js(n){return n=Ql(n),n&&zn.test(n)?n.replace(In,te):n}function Hs(n){return n=Ql(n),n&&Tn.test(n)?n.replace(Bn,"\\$&"):n}var Ys=so(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Qs=so(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Xs=lo("toLowerCase");function nh(n,t,r){n=Ql(n),t=Vl(t);var e=t?ve(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return mo(Ut(u),r)+n+mo(Ct(u),r)}function th(n,t,r){n=Ql(n),t=Vl(t);var e=t?ve(n):0;return t&&e>>0,r?(n=Ql(n),n&&("string"==typeof t||null!=t&&!Cl(t))&&(t=Si(t),!t&&ue(n))?Pi(_e(n),0,r):n.split(t,r)):[]}var fh=so(function(n,t,r){return n+(r?" ":"")+wh(t)});function ch(n,t,r){return n=Ql(n),r=null==r?0:vu(Vl(r),0,n.length),t=Si(t),n.slice(r,r+t.length)==t}function lh(n,t,r){var e=be.templateSettings;r&&ia(n,t,r)&&(t=i),n=Ql(n),t=ts({},t,e,Eo);var u,o,a=ts({},t.imports,e.imports,Eo),f=ms(a),c=Jr(a,f),l=0,s=t.interpolate||nt,h="__p += '",p=ut((t.escape||nt).source+"|"+s.source+"|"+(s===Wn?Kn:nt).source+"|"+(t.evaluate||nt).source+"|$","g"),v="//# sourceURL="+("sourceURL"in t?t.sourceURL:"lodash.templateSources["+ ++Ht+"]")+"\n";n.replace(p,function(t,r,e,i,a,f){return e||(e=i),h+=n.slice(l,f).replace(tt,re),r&&(u=!0,h+="' +\n__e("+r+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),e&&(h+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),l=f+t.length,t}),h+="';\n";var _=t.variable;_||(h="with (obj) {\n"+h+"\n}\n"),h=(o?h.replace(jn,""):h).replace(An,"$1").replace(kn,"$1;"),h="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=mh(function(){return qn(f,v+"return "+h).apply(i,c)});if(g.source=h,dl(g))throw g;return g}function sh(n){return Ql(n).toLowerCase()}function hh(n){return Ql(n).toUpperCase()}function ph(n,t,r){if(n=Ql(n),n&&(r||t===i))return n.replace($n,"");if(!n||!(t=Si(t)))return n;var e=_e(n),u=_e(t),o=Yr(e,u),a=Qr(e,u)+1;return Pi(e,o,a).join("")}function vh(n,t,r){if(n=Ql(n),n&&(r||t===i))return n.replace(Mn,"");if(!n||!(t=Si(t)))return n;var e=_e(n),u=Qr(e,_e(t))+1;return Pi(e,0,u).join("")}function _h(n,t,r){if(n=Ql(n),n&&(r||t===i))return n.replace(Dn,"");if(!n||!(t=Si(t)))return n;var e=_e(n),u=Yr(e,_e(t));return Pi(e,u).join("")}function gh(n,t){var r=R,e=z;if(jl(t)){var u="separator"in t?t.separator:u;r="length"in t?Vl(t.length):r,e="omission"in t?Si(t.omission):e}n=Ql(n);var o=n.length;if(ue(n)){var a=_e(n);o=a.length}if(r>=o)return n;var f=r-ve(e);if(f<1)return e;var c=a?Pi(a,0,f).join(""):n.slice(0,f);if(u===i)return c+e;if(a&&(f+=c.length-f),Cl(u)){if(n.slice(f).search(u)){var l,s=c;u.global||(u=ut(u.source,Ql(Vn.exec(u))+"g")),u.lastIndex=0;while(l=u.exec(s))var h=l.index;c=c.slice(0,h===i?f:h)}}else if(n.indexOf(Si(u),f)!=f){var p=c.lastIndexOf(u);p>-1&&(c=c.slice(0,p))}return c+e}function yh(n){return n=Ql(n),n&&Rn.test(n)?n.replace(On,ge):n}var dh=so(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),wh=lo("toUpperCase");function bh(n,t,r){return n=Ql(n),t=r?i:t,t===i?ie(n)?we(n):Cr(n):n.match(t)||[]}var mh=di(function(n,t){try{return wr(n,i,t)}catch(r){return dl(r)?r:new u(r)}}),xh=Bo(function(n,t){return mr(t,function(t){t=za(t),hu(n,t,Sc(n[t],n))}),n});function jh(n){var t=null==n?0:n.length,r=No();return n=t?Ir(n,function(n){if("function"!=typeof n[1])throw new ot(c);return[r(n[0]),n[1]]}):[],di(function(r){var e=-1;while(++eB)return[];var r=D,e=Nt(n,D);t=No(t),n-=D;var u=Kr(e,t);while(++r0||t<0)?new ke(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==i&&(t=Vl(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},ke.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ke.prototype.toArray=function(){return this.take(D)},zu(ke.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=be[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(be.prototype[t]=function(){var t=this.__wrapped__,a=e?[1]:arguments,f=t instanceof ke,c=a[0],l=f||al(t),s=function(n){var t=u.apply(be,Rr([n],a));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=f&&!p;if(!o&&l){t=_?t:new ke(this);var g=n.apply(t,a);return g.__actions__.push({func:Kf,args:[s],thisArg:i}),new Ae(g,h)}return v&&_?n.apply(this,a):(g=this.thru(s),v?e?g.value()[0]:g.value():g)})}),mr(["pop","push","shift","sort","splice","unshift"],function(n){var t=at[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);be.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(al(u)?u:[],n)}return this[r](function(r){return t.apply(al(r)?r:[],n)})}}),zu(ke.prototype,function(n,t){var r=be[t];if(r){var e=r.name+"",u=cr[e]||(cr[e]=[]);u.push({name:t,func:r})}}),cr[go(i,w).name]=[{name:"wrapper",func:i}],ke.prototype.clone=Oe,ke.prototype.reverse=Ie,ke.prototype.value=Re,be.prototype.at=Vf,be.prototype.chain=Gf,be.prototype.commit=Jf,be.prototype.next=Hf,be.prototype.plant=Qf,be.prototype.reverse=Xf,be.prototype.toJSON=be.prototype.valueOf=be.prototype.value=nc,be.prototype.first=be.prototype.head,Rt&&(be.prototype[Rt]=Yf),be},me=be();ar._=me,u=function(){return me}.call(t,r,t,e),u===i||(e.exports=u)}).call(this)}).call(this,r("c8ba"),r("62e4")(n))}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0c1ed0.e71f291f.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0c1ed0.e71f291f.js new file mode 100644 index 000000000..79627dce2 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d0c1ed0.e71f291f.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1ed0"],{"47b9":function(e,n,t){"use strict";t.r(n);var r,i,o,a,s,u,c,d,f,l,g,h,p,m,v,b,k,w,C,y=12e4,_=function(){function e(e){var n=this;this._defaults=e,this._worker=null,this._idleCheckInterval=setInterval(function(){return n._checkIfIdle()},3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return n._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){if(this._worker){var e=Date.now()-this._lastUsedTime;e>y&&this._stopWorker()}},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/json/jsonWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,n=this,t=[],r=0;r0&&(i.arguments=t),i}function t(e){var n=e;return X.defined(n)&&X.string(n.title)&&X.string(n.command)}e.create=n,e.is=t}(p||(p={})),function(e){function n(e,n){return{range:e,newText:n}}function t(e,n){return{range:{start:e,end:e},newText:n}}function r(e){return{range:e,newText:""}}function o(e){var n=e;return X.objectLiteral(n)&&X.string(n.newText)&&i.is(n.range)}e.replace=n,e.insert=t,e.del=r,e.is=o}(m||(m={})),function(e){function n(e,n){return{textDocument:e,edits:n}}function t(e){var n=e;return X.defined(n)&&x.is(n.textDocument)&&Array.isArray(n.edits)}e.create=n,e.is=t}(v||(v={})),function(e){function n(e,n){var t={kind:"create",uri:e};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(t.options=n),t}function t(e){var n=e;return n&&"create"===n.kind&&X.string(n.uri)&&(void 0===n.options||(void 0===n.options.overwrite||X.boolean(n.options.overwrite))&&(void 0===n.options.ignoreIfExists||X.boolean(n.options.ignoreIfExists)))}e.create=n,e.is=t}(b||(b={})),function(e){function n(e,n,t){var r={kind:"rename",oldUri:e,newUri:n};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),r}function t(e){var n=e;return n&&"rename"===n.kind&&X.string(n.oldUri)&&X.string(n.newUri)&&(void 0===n.options||(void 0===n.options.overwrite||X.boolean(n.options.overwrite))&&(void 0===n.options.ignoreIfExists||X.boolean(n.options.ignoreIfExists)))}e.create=n,e.is=t}(k||(k={})),function(e){function n(e,n){var t={kind:"delete",uri:e};return void 0===n||void 0===n.recursive&&void 0===n.ignoreIfNotExists||(t.options=n),t}function t(e){var n=e;return n&&"delete"===n.kind&&X.string(n.uri)&&(void 0===n.options||(void 0===n.options.recursive||X.boolean(n.options.recursive))&&(void 0===n.options.ignoreIfNotExists||X.boolean(n.options.ignoreIfNotExists)))}e.create=n,e.is=t}(w||(w={})),function(e){function n(e){var n=e;return n&&(void 0!==n.changes||void 0!==n.documentChanges)&&(void 0===n.documentChanges||n.documentChanges.every(function(e){return X.string(e.kind)?b.is(e)||k.is(e)||w.is(e):v.is(e)}))}e.is=n}(C||(C={}));var E,x,S,I,A,T,M,P,R,F,j,D,L,O,W,N,U,V=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,n){this.edits.push(m.insert(e,n))},e.prototype.replace=function(e,n){this.edits.push(m.replace(e,n))},e.prototype.delete=function(e){this.edits.push(m.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();(function(){function e(e){var n=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(e){if(v.is(e)){var t=new V(e.edits);n._textEditChanges[e.textDocument.uri]=t}}):e.changes&&Object.keys(e.changes).forEach(function(t){var r=new V(e.changes[t]);n._textEditChanges[t]=r}))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(x.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n=e,t=this._textEditChanges[n.uri];if(!t){var r=[],i={textDocument:n,edits:r};this._workspaceEdit.documentChanges.push(i),t=new V(r),this._textEditChanges[n.uri]=t}return t}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");t=this._textEditChanges[e];if(!t){r=[];this._workspaceEdit.changes[e]=r,t=new V(r),this._textEditChanges[e]=t}return t},e.prototype.createFile=function(e,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(b.create(e,n))},e.prototype.renameFile=function(e,n,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(k.create(e,n,t))},e.prototype.deleteFile=function(e,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(w.create(e,n))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")}})();(function(e){function n(e){return{uri:e}}function t(e){var n=e;return X.defined(n)&&X.string(n.uri)}e.create=n,e.is=t})(E||(E={})),function(e){function n(e,n){return{uri:e,version:n}}function t(e){var n=e;return X.defined(n)&&X.string(n.uri)&&(null===n.version||X.number(n.version))}e.create=n,e.is=t}(x||(x={})),function(e){function n(e,n,t,r){return{uri:e,languageId:n,version:t,text:r}}function t(e){var n=e;return X.defined(n)&&X.string(n.uri)&&X.string(n.languageId)&&X.number(n.version)&&X.string(n.text)}e.create=n,e.is=t}(S||(S={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(I||(I={})),function(e){function n(n){var t=n;return t===e.PlainText||t===e.Markdown}e.is=n}(I||(I={})),function(e){function n(e){var n=e;return X.objectLiteral(e)&&I.is(n.kind)&&X.string(n.value)}e.is=n}(A||(A={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(T||(T={})),function(e){e.PlainText=1,e.Snippet=2}(M||(M={})),function(e){function n(e){return{label:e}}e.create=n}(P||(P={})),function(e){function n(e,n){return{items:e||[],isIncomplete:!!n}}e.create=n}(R||(R={})),function(e){function n(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function t(e){var n=e;return X.string(n)||X.objectLiteral(n)&&X.string(n.language)&&X.string(n.value)}e.fromPlainText=n,e.is=t}(F||(F={})),function(e){function n(e){var n=e;return!!n&&X.objectLiteral(n)&&(A.is(n.contents)||F.is(n.contents)||X.typedArray(n.contents,F.is))&&(void 0===e.range||i.is(e.range))}e.is=n}(j||(j={})),function(e){function n(e,n){return n?{label:e,documentation:n}:{label:e}}e.create=n}(D||(D={})),function(e){function n(e,n){for(var t=[],r=2;r=0;a--){var s=r[a],u=e.offsetAt(s.range.start),c=e.offsetAt(s.range.end);if(!(c<=o))throw new Error("Overlapping edit");t=t.substring(0,u)+s.newText+t.substring(c,t.length),o=u}return t}function i(e,n){if(e.length<=1)return e;var t=e.length/2|0,r=e.slice(0,t),o=e.slice(t);i(r,n),i(o,n);var a=0,s=0,u=0;while(a0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var n=this.getLineOffsets(),t=0,i=n.length;if(0===i)return r.create(0,e);while(te?i=o:t=o+1}var a=t-1;return r.create(a,e-n[a])},e.prototype.offsetAt=function(e){var n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;var t=n[e.line],r=e.line+1=48&&a<=57)o=16*o+a-48;else if(a>=65&&a<=70)o=16*o+a-65+10;else{if(!(a>=97&&a<=102))break;o=16*o+a-97+10}t++,i++}return i=r){n+=e.substring(i,t),f=2;break}var o=e.charCodeAt(t);if(34===o){n+=e.substring(i,t),t++;break}if(92!==o){if(o>=0&&o<=31){if(Ee(o)){n+=e.substring(i,t),f=2;break}f=6}t++}else{if(n+=e.substring(i,t),t++,t>=r){f=2;break}switch(o=e.charCodeAt(t++),o){case 34:n+='"';break;case 92:n+="\\";break;case 47:n+="/";break;case 98:n+="\b";break;case 102:n+="\f";break;case 110:n+="\n";break;case 114:n+="\r";break;case 116:n+="\t";break;case 117:var a=l(4,!0);a>=0?n+=String.fromCharCode(a):f=4;break;default:f=5}i=t}}return n}function m(){if(i="",f=0,o=t,u=s,d=c,t>=r)return o=r,a=17;var n=e.charCodeAt(t);if(_e(n)){do{t++,i+=String.fromCharCode(n),n=e.charCodeAt(t)}while(_e(n));return a=15}if(Ee(n))return t++,i+=String.fromCharCode(n),13===n&&10===e.charCodeAt(t)&&(t++,i+="\n"),s++,c=t,a=14;switch(n){case 123:return t++,a=1;case 125:return t++,a=2;case 91:return t++,a=3;case 93:return t++,a=4;case 58:return t++,a=6;case 44:return t++,a=5;case 34:return t++,i=p(),a=10;case 47:var l=t-1;if(47===e.charCodeAt(t+1)){t+=2;while(t=12&&e<=15);return e}return{setPosition:g,getPosition:function(){return t},scan:n?b:m,getToken:function(){return a},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return t-o},getTokenStartLine:function(){return u},getTokenStartCharacter:function(){return o-d},getTokenError:function(){return f}}}function _e(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function Ee(e){return 10===e||13===e||8232===e||8233===e}function xe(e){return e>=48&&e<=57}(function(e){e.DEFAULT={allowTrailingComma:!1}})(me||(me={}));var Se=ye;function Ie(e){return{getInitialState:function(){return new Ne(null,null,!1)},tokenize:function(n,t,r,i){return Ue(e,n,t,r,i)}}}var Ae="delimiter.bracket.json",Te="delimiter.array.json",Me="delimiter.colon.json",Pe="delimiter.comma.json",Re="keyword.json",Fe="keyword.json",je="string.value.json",De="number.json",Le="string.key.json",Oe="comment.block.json",We="comment.line.json",Ne=function(){function e(e,n,t){this._state=e,this.scanError=n,this.lastWasColon=t}return e.prototype.clone=function(){return new e(this._state,this.scanError,this.lastWasColon)},e.prototype.equals=function(n){return n===this||!!(n&&n instanceof e)&&(this.scanError===n.scanError&&this.lastWasColon===n.lastWasColon)},e.prototype.getStateData=function(){return this._state},e.prototype.setStateData=function(e){this._state=e},e}();function Ue(e,n,t,r,i){void 0===r&&(r=0);var o=0,a=!1;switch(t.scanError){case 2:n='"'+n,o=1;break;case 1:n="/*"+n,o=2;break}var s,u,c=Se(n),d=t.lastWasColon;u={tokens:[],endState:t.clone()};while(1){var f=r+c.getPosition(),l="";if(s=c.scan(),17===s)break;if(f===r+c.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+n.substr(c.getPosition(),3));switch(a&&(f-=o),a=o>0,s){case 1:l=Ae,d=!1;break;case 2:l=Ae,d=!1;break;case 3:l=Te,d=!1;break;case 4:l=Te,d=!1;break;case 6:l=Me,d=!0;break;case 5:l=Pe,d=!1;break;case 8:case 9:l=Re,d=!1;break;case 7:l=Fe,d=!1;break;case 10:l=d?je:Le,d=!1;break;case 11:l=De,d=!1;break}if(e)switch(s){case 12:l=We;break;case 13:l=Oe;break}u.endState=new Ne(t.getStateData(),c.getTokenError(),d),u.tokens.push({startIndex:f,scopes:l})}return u}function Ve(e){var n=[],t=[],r=new _(e);n.push(r);var i=function(){for(var e=[],n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return c["a"].get("/routes",{params:e})},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return c["a"].get("/routes/".concat(encodeURIComponent(e)))},u={name:"Topics",data:function(){return{listLoading:!0,tableData:[],searchValue:"",params:{_page:1,_limit:20},count:0,resetIcon:"el-icon-refresh"}},created:function(){this.loadData()},methods:{resetSearch:function(){this.resetIcon="el-icon-loading";var e=!1;this.searchValue&&(e=!0),this.searchValue="",this.loadTopics(e)},handleSearch:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=this.searchValue.trim(),t){e.next=4;break}return this.loadTopics(),e.abrupt("return");case 4:return this.params._page=1,this.count=0,e.next=8,l(t);case 8:this.tableData=e.sent;case 9:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleSizeChange:function(){this.loadTopics(!0)},handleCurrentPageChange:function(){this.loadTopics()},loadData:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.loadTopics();case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),loadTopics:function(){var e=Object(i["a"])(regeneratorRuntime.mark(function e(t){var a,n,r,i,c,l,u=arguments;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=u.length>1&&void 0!==u[1]?u[1]:{},t&&(this.params._page=1),e.next=4,o(Object(s["a"])({},this.params,a));case 4:n=e.sent,r=n.items,i=void 0===r?[]:r,c=n.meta.count,l=void 0===c?0:c,this.listLoading=!1,this.tableData=i,this.count=l,this.resetIcon="el-icon-refresh";case 10:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()}},p=u,h=a("2877"),d=Object(h["a"])(p,n,r,!1,null,null,null);t["default"]=d.exports}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d2134e7.15b56ca9.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d2134e7.15b56ca9.js new file mode 100644 index 000000000..1fc6465fe --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-2d2134e7.15b56ca9.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2134e7"],{abb2:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"log-trace"},[a("page-header",[a("div",{staticClass:"page-header-content-view"},[a("div",{staticClass:"content"},[e._v("\n "+e._s(e.$t("LogTrace.logTraceDescription"))+"\n ")])])]),a("div",{staticClass:"app-wrapper"},[a("a-card",{staticClass:"emq-list-card"},[a("div",{staticClass:"emq-table-header"},[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:function(t){return e.handleDialogOpen("create")}}},[e._v("\n "+e._s(e.$t("LogTrace.createTrace"))+"\n ")])],1),a("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[a("el-table-column",{attrs:{prop:"name",label:e.$t("LogTrace.filter")}}),a("el-table-column",{attrs:{prop:"type",label:e.$t("LogTrace.type")}}),a("el-table-column",{attrs:{prop:"level",label:e.$t("LogTrace.level")}}),a("el-table-column",{attrs:{width:"250px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.handleDialogOpen("view",n)}}},[e._v(e._s(e.$t("Overview.view"))+"\n ")]),a("el-button",{attrs:{type:"dashed",size:"mini"},on:{click:function(t){return e.handleDownload(n)}}},[e._v("\n "+e._s(e.$t("Backup.download"))+"\n ")]),a("el-button",{attrs:{type:"dashed danger",loading:"deleteBtn"===e.btnLoading,size:"mini"},on:{click:function(t){return e.deleteConfirm(n)}}},[e._v("\n "+e._s(e.$t("General.delete"))+"\n ")])]}}])})],1)],1)],1),a("el-dialog",{attrs:{width:"520px",title:"view"===e.accessType?e.$t("LogTrace.viewTrace"):e.$t("LogTrace.createTrace"),visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t},close:e.clearInput}},[a("el-form",{ref:"recordForm",attrs:{size:"small",model:e.record,rules:"view"===e.accessType?{}:e.rules}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"type",label:e.$t("LogTrace.type")}},[a("emq-select",{attrs:{field:{options:e.typeOptions},disabled:"create"!==e.accessType},model:{value:e.record.type,callback:function(t){e.$set(e.record,"type",t)},expression:"record.type"}},[e._v(">\n ")])],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"level",label:e.$t("LogTrace.level")}},[a("emq-select",{attrs:{field:{list:e.levelOptions},disabled:"create"!==e.accessType},model:{value:e.record.level,callback:function(t){e.$set(e.record,"level",t)},expression:"record.level"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"name",label:e.$t("LogTrace.filter")}},[a("el-input",{attrs:{readonly:"create"!==e.accessType},model:{value:e.record.name,callback:function(t){e.$set(e.record,"name",t)},expression:"record.name"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"file",label:e.$t("LogTrace.logPath")}},[a("el-input",{attrs:{readonly:"create"!==e.accessType},model:{value:e.record.file,callback:function(t){e.$set(e.record,"file",t)},expression:"record.file"}})],1)],1)],1)],1),"create"===e.accessType?a("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{plain:"",size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("Base.cancel")))]),a("el-button",{attrs:{loading:"createBtn"===e.btnLoading,type:"primary",size:"small"},on:{click:e.handleCreateTrace}},[e._v("\n "+e._s(e.$t("Base.confirm"))+"\n ")])],1):e._e()],1)],1)},r=[],l=(a("7f7f"),a("cebc")),c=(a("96cf"),a("3b8d")),s=a("1f75");function i(){return s["a"].get("/log/trace")}function o(e){return s["a"].post("/log/trace",e)}function d(e,t){return s["a"].delete("/log/trace/".concat(e,"/").concat(t))}var u={name:"LogTrace",data:function(){return{tableData:[],dialogVisible:!1,accessType:"",record:{},rules:{type:[{required:!0,message:this.$t("General.pleaseChoose")}],name:[{required:!0,message:this.$t("General.pleaseEnter")}],level:[{required:!0,message:this.$t("General.pleaseChoose")}]},typeOptions:[{label:this.$t("Clients.clientId"),value:"clientid"},{label:this.$t("Subs.topic"),value:"topic"}],levelOptions:["debug","info","notice","warning","error","critical","alert","emergency"],btnLoading:void 0}},methods:{loadList:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,i();case 2:this.tableData=e.sent;case 3:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleDialogOpen:function(e,t){this.accessType=e,this.dialogVisible=!0,"view"===e&&(this.record=Object(l["a"])({},t))},clearInput:function(){this.$refs.recordForm&&this.$refs.recordForm.resetFields()},handleSuccess:function(){this.btnLoading=void 0,this.loadList()},handleCreateTrace:function(){var e=this;this.$refs.recordForm.validate(function(t){if(t){e.btnLoading="createBtn";var a=Object.assign({},e.record);o(a).then(function(){e.$message.success(e.$t("Base.createSuccess")),e.dialogVisible=!1,e.handleSuccess()}).catch(function(){e.btnLoading=void 0})}})},deleteConfirm:function(e){var t=this;this.$confirm(this.$t("Modules.confirmDelete"),this.$t("Base.warning"),{type:"warning",cancelButtonText:this.$t("Base.cancel"),confirmButtonText:this.$t("Base.confirm")}).then(function(){t.btnLoading="deleteBtn";var a=e.type,n=e.name;d(a,n).then(function(){t.$message.success(t.$t("Base.deleteSuccess")),t.handleSuccess()})}).catch(function(){t.btnLoading=void 0})},handleDownload:function(e){var t=e.type,a=e.name,n=document.createElement("a");n.download="".concat(t,"/").concat(a),n.href="/api/v4/log/trace/download/".concat(t,"/").concat(a),n.setAttribute("type","hidden"),document.body.appendChild(n),n.click(),n.remove()}},created:function(){this.loadList()}},p=u,f=a("2877"),m=Object(f["a"])(p,n,r,!1,null,null,null);t["default"]=m.exports}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-3208fb9c.7c668dc0.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-3208fb9c.7c668dc0.js new file mode 100644 index 000000000..aa4502635 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-3208fb9c.7c668dc0.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3208fb9c"],{"01c8":function(e,t,a){"use strict";a.d(t,"a",function(){return r});var i=a("178b"),s=a("3953"),n=a("1df6");function r(e){return Object(i["a"])(e)||Object(s["a"])(e)||Object(n["a"])()}},4964:function(e,t,a){"use strict";var i=a("61e3"),s=a.n(i);s.a},5118:function(e,t,a){(function(e){var i="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,s=Function.prototype.apply;function n(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new n(s.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new n(s.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},a("6017"),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a("c8ba"))},5713:function(e,t,a){"use strict";var i=a("ebce"),s=a.n(i);s.a},6017:function(e,t,a){(function(e,t){(function(e,a){"use strict";if(!e.setImmediate){var i,s=1,n={},r=!1,c=e.document,o=Object.getPrototypeOf&&Object.getPrototypeOf(e);o=o&&o.setTimeout?o:e,"[object process]"==={}.toString.call(e.process)?f():m()?h():e.MessageChannel?v():c&&"onreadystatechange"in c.createElement("script")?g():b(),o.setImmediate=l,o.clearImmediate=u}function l(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),a=0;a18?a("div",{staticClass:"action-description"},[e._v("\n "+e._s(e.selectedAction.description)+"\n ")]):e._e(),e.selectedAction.params.$resource?a("el-form-item",{attrs:{prop:"params.$resource",label:""}},[a("span",{attrs:{slot:"label"},slot:"label"},[e._v("\n "+e._s(e.$t("RuleEngine.useOfResources"))+"\n "),a("el-popover",{attrs:{trigger:"hover",width:"220",placement:"top"}},[a("div",{staticClass:"emq-popover-content",domProps:{innerHTML:e._s(e.$t("RuleEngine.resourceSelectTip"))}}),a("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1),a("emq-select",{staticClass:"reset-width",staticStyle:{width:"403px"},attrs:{field:{options:e.availableResources},"field-name":{label:"id",value:"id"}},on:{"visible-change":e.checkResource},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.item;return a("div",{staticClass:"custom-option",attrs:{title:i.description}},[a("span",{staticClass:"key"},[e._v(e._s(i.description||i.id))]),a("span",{staticClass:"value"},[e._v(e._s(i.config.title))])])}}],null,!1,3965597931),model:{value:e.record.params.$resource,callback:function(t){e.$set(e.record.params,"$resource",t)},expression:"record.params.$resource"}}),a("span",{staticClass:"tips btn",attrs:{icon:"el-icon-plus"},on:{click:e.toCreateResource}},[e._v("\n "+e._s(e.$t("RuleEngine.createNew"))+"\n ")])],1):e._e(),e.selectedAction.params.$resource?a("div",{staticClass:"line"}):e._e(),e.paramsLoading||e.paramsList.length>0?a("el-row",{staticClass:"params-item-wrapper",attrs:{gutter:50}},[e.paramsLoading?a("div",{staticClass:"params-loading-wrapper"},[a("a-skeleton",{attrs:{active:""}})],1):e._l(e.paramsList,function(t,i){return a("el-col",{key:i,attrs:{span:"textarea"===t.type||"object"===t.type?24:12}},[a("el-form-item",e._b({class:"sql"===t.key?"code-editor__item":""},"el-form-item",t.formItemAttributes,!1),[t.formItemAttributes.description?a("template",{slot:"label"},[e._v("\n "+e._s(t.formItemAttributes.label)+"\n "),a("el-popover",{attrs:{trigger:"hover",width:"220",placement:"top"}},[a("div",{staticClass:"emq-popover-content",domProps:{innerHTML:e._s(t.formItemAttributes.description)}}),a("i",{staticClass:"el-icon-question",attrs:{slot:"reference"},slot:"reference"})])],1):e._e(),"object"===t.elType?[a("key-and-value-editor",{model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,a)},expression:"record.params[item.key]"}})]:"cfgselect"===t.elType?[a("config-select",e._b({staticClass:"reset-width",attrs:{extraConfigs:t.extraConfigs},on:{updateConfig:e.addConfigAccordingType},model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,a)},expression:"record.params[item.key]"}},"config-select",t.bindAttributes,!1))]:"select"!==t.elType?["number"===t.type?a("el-input",e._b({model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,e._n(a))},expression:"record.params[item.key]"}},"el-input",t.bindAttributes,!1)):"password"===t.type?a("el-input",e._b({attrs:{"show-password":""},model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,a)},expression:"record.params[item.key]"}},"el-input",t.bindAttributes,!1)):"sql"===t.key?a("div",{staticClass:"monaco-container monaco-action__sql"},[a("monaco",{attrs:{id:e.record.name+"-sql"+Math.random().toString(16).slice(3),lang:"sql"},model:{value:e.record.params.sql,callback:function(t){e.$set(e.record.params,"sql",t)},expression:"record.params.sql"}})],1):a("el-input",e._b({model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,a)},expression:"record.params[item.key]"}},"el-input",t.bindAttributes,!1))]:["number"===t.type?a("emq-select",e._b({model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,e._n(a))},expression:"record.params[item.key]"}},"emq-select",t.bindAttributes,!1)):a("emq-select",e._b({model:{value:e.record.params[t.key],callback:function(a){e.$set(e.record.params,t.key,a)},expression:"record.params[item.key]"}},"emq-select",t.bindAttributes,!1))]],2)],1)})],2):e._e()],1),a("div",{staticClass:"dialog-align-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.handleCancel}},[e._v("\n "+e._s(e.$t("Base.cancel"))+"\n ")]),a("el-button",{staticClass:"dialog-primary-btn",attrs:{type:"primary",size:"small"},on:{click:e.handleCreate}},[e._v("\n "+e._s(e.$t("Base.confirm"))+"\n ")])],1)],1),a("resource-dialog",{ref:"resource",on:{created:e.confirmResource,cache:function(t){return e.confirmResource(null)}}})],2)},s=[],n=a("768b"),r=(a("ffc1"),a("6b54"),a("01c8")),c=a("cebc"),o=(a("456d"),a("96cf"),a("3b8d")),l=(a("7f7f"),a("ac6a"),a("5df3"),a("4f7f"),a("75fc")),u=(a("6762"),a("2fdb"),a("55dd"),a("2ef0")),d=a.n(u),p=a("bd43"),f=a("90b9"),m=a("7d5c"),h=a("9146"),v=a("5118"),g=a("caba"),b=a("6985"),_={name:"RuleActions",components:{ResourceDialog:m["a"],Monaco:h["a"],KeyAndValueEditor:g["a"],ConfigSelect:b["a"]},props:{value:{type:Array,required:!0},disabled:{type:Boolean,default:!1},event:{type:String,default:"message.publish"}},data:function(){return{actionDialogTitle:this.$t("RuleEngine.addActions"),actionDialogVisible:!1,isFallbacks:!1,setRefresh:!1,actionsMap:{},paramsList:[],paramsLoading:!1,currentEditIndex:0,currentOper:"",currentAction:{},actionCategory:"",actionCategoryOptions:[],originParamsList:[],originRules:{name:{required:!0,message:this.$t("RuleEngine.pleaseChoose")},params:{$resource:{required:!0,message:this.$t("RuleEngine.pleaseChoose")}}},originRecord:{name:"",params:{$resource:""},fallbacks:[]},record:{name:"",params:{$resource:""},fallbacks:[]},rules:{name:{required:!0,message:this.$t("RuleEngine.pleaseChoose")},params:{$resource:{required:!0,message:this.$t("RuleEngine.pleaseChoose")}}},selectedAction:{title:"",description:"",params:{$resource:""},fallbacks:[]},actions:[],resources:[]}},computed:{rawValue:{get:function(){return this.value},set:function(e){this.$emit("update:value",e)}},availableActions:function(){var e=this,t=this.actions.filter(function(t){return["$any",e.event].includes(t.for)}).sort(function(e,t){return e.title.localeCompare(t.title)}),a=function(e){return Object(l["a"])(new Set(e))};this.actionCategoryOptions=a(t.map(function(e){return e.category}));var i={};return this.actionCategoryOptions.forEach(function(e){var a=[];t.forEach(function(t){t.category===e&&(a.push(t),i[e]=a)})}),!this.record.name&&t[0]&&(this.record.name=t[0].name,this.actionTypeChange(this.record.name),this.actionCategory=this.actionCategoryOptions[0]),i},availableResources:function(){var e=this.selectedAction.types;return e?this.resources.filter(function(t){return e.includes(t.type)}):[]}},watch:{actionDialogVisible:function(e){e||(this.initData(),this.isFallbacks=!1)}},created:function(){this.loadActions()},methods:{initData:function(){this.record={name:"",params:{$resource:""},fallbacks:[]},this.originRecord={name:"",params:{$resource:""},fallbacks:[]},this.currentAction={}},toggleShowMetrics:function(e){var t=e.showList,a=void 0!==t&&t;this.$set(e,"showList",!a)},atDialogClose:function(){var e=this;Object(v["setTimeout"])(function(){e.$refs.record.clearValidate()},10)},handleCreate:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,a,i=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.initRecordEnableBatch(),e.next=3,this.$refs.record.validate();case 3:if(t=e.sent,t){e.next=6;break}return e.abrupt("return");case 6:this.record.params&&Object.keys(this.record.params).forEach(function(e){var t=i.record.params[e];"true"!==t&&"false"!==t||(i.record.params[e]=JSON.parse(t))}),a={},this.isFallbacks?(a=Object(c["a"])({},this.record),"edit"===this.currentOper&&(this.currentAction.fallbacks=[]),this.currentAction.fallbacks.push(a),this.rawValue.splice(this.currentEditIndex,1,this.currentAction)):(a=Object(c["a"])({},this.record),"edit"===this.currentOper?this.rawValue.splice(this.currentEditIndex,1,a):"add"===this.currentOper&&this.rawValue.push(a)),a.params&&!a.params.$resource&&delete a.params.$resource,this.fillRawValue(),this.actionDialogVisible=!1,this.atDialogClose();case 13:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),handleCancel:function(){this.actionDialogVisible=!1,this.atDialogClose()},checkResource:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&0===this.availableResources.length&&this.loadResourceData()},toCreateResource:function(){var e=this.selectedAction.types,t=void 0===e?[]:e;this.$refs.resource.setup({types:t,action:"create"}),this.actionDialogVisible=!1,sessionStorage.setItem("currentAction",JSON.stringify({record:this.record,paramsList:this.paramsList,originRecord:this.originRecord,originParamsList:this.originParamsList,actionCategory:this.actionCategory,actionCategoryOptions:this.actionCategoryOptions,types:t,isFallbacks:this.isFallbacks,action:this.currentAction}))},confirmResource:function(e){var t=this;Object(v["setTimeout"])(function(){t.$refs.record&&t.$refs.record.clearValidate()},10),this.actionDialogVisible=!0;var a=sessionStorage.getItem("currentAction");if(a){var i=JSON.parse(a),s=i.record,n=i.paramsList,r=i.types,c=i.actionCategoryOptions,o=i.actionCategory,l=i.originParamsList,u=i.originRecord,d=i.isFallbacks,p=i.action;this.record=s,this.originRecord=u,this.originParamsList=l,this.paramsList=n,this.selectedAction.types=r,this.actionCategory=o,this.actionCategoryOptions=c,this.isFallbacks=d,this.currentAction=p,sessionStorage.removeItem("currentAction")}e&&(this.record.params.$resource=e),this.loadResourceData(),this.currentOper=this.actionDialogTitle===this.$t("RuleEngine.editActions")?"edit":"add"},loadResourceData:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(p["i"])();case 2:this.resources=e.sent;case 3:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),loadParamsList:function(e){var t=this;this.currentOper=e;var a=this.selectedAction.params,i=Object(f["l"])(a,"params"),s=i.form,n=i.rules;this.storeOriginData(i,e),"add"===e&&(this.record.params={},s.forEach(function(e){var a=e.key,i=e.value,s=a,n=i;"sql"===s&&void 0===n&&(n=""),t.$set(t.record.params,s,n)}),this.$set(this.record.params,"$resource",""),this.$refs.record&&Object(v["setTimeout"])(this.$refs.record.clearValidate,0)),this.paramsList=s,this.rules.params=Object(c["a"])({$resource:{required:!0,message:this.$t("RuleEngine.pleaseChoose")}},n),this.paramsLoading=!1},assignRecordParams:function(e){var t=this,a={};return e.forEach(function(e){var i=e.key,s=e.value,n=i,r=s;"sql"===n&&void 0===r&&(r=""),t.$set(a,n,r)}),a},storeOriginData:function(e,t){var a=e.form,i=e.rules;if(this.originParamsList=a,this.originRules.params=Object(c["a"])({$resource:{required:!0,message:this.$t("RuleEngine.pleaseChoose")}},i),"add"===t){var s=this.assignRecordParams(a),n=Object.assign({},s);this.originRecord.params=n}},addConfigAccordingType:function(e,t,a){var i="true"===t?"false":"true",s=a[i];this.deleteHideItems(s);var n=this.record.params.$resource,c=Object(r["a"])(this.originParamsList),o=c.slice(0),l=Object.assign({},this.originRules.params),u=Object.assign({},this.originRecord.params);if(Object.assign(u,{$resource:n}),Object.keys(e).length){var d=Object(f["l"])(e,"params"),p=d.form,m=d.rules;this.paramsList=o.concat(p),this.rules.params=Object.assign(l,m);var h=this.assignRecordParams(p),g=Object.assign({},h),b=g;this.record.params=Object.assign(u,b)}else this.paramsList=o,this.rules.params=l,this.record.params=u;this.paramsList.sort(function(e,t){return e.order-t.order}),this.record.params.enable_batch=t,this.$refs.record&&Object(v["setTimeout"])(this.$refs.record.clearValidate,10)},deleteHideItems:function(e){var t=this,a=Object.keys(e);a.forEach(function(e){delete t.originRecord.params[e]})},actionTypeChange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"add";this.selectedAction=JSON.parse(JSON.stringify(this.actionsMap[e])),this.actionCategory=this.selectedAction.category,this.paramsList=[],this.paramsLoading=!0,Object(v["setTimeout"])(this.loadParamsList(t),200),this.loadResourceData()},actionCategoryChange:function(e){var t=this.availableActions[e];t[0]&&(this.record.name=t[0].name,this.actionTypeChange(this.record.name))},addAction:function(){this.actionDialogTitle=this.$t("RuleEngine.addActions"),this.actionTypeChange(this.record.name,"add"),this.actionDialogVisible=!0},editAction:function(e,t){var a=d.a.cloneDeep(e);this.actionDialogTitle=this.$t("RuleEngine.editActions"),this.currentEditIndex=t,this.actionTypeChange(a.name,"edit"),this.initEnableBatch(a),this.record=Object(c["a"])({},a),this.originRecord=Object(c["a"])({},a),this.actionDialogVisible=!0},initEnableBatch:function(e){var t=Object(c["a"])({},e),a=t._config,i=t.params,s=i.enable_batch;if(void 0!==s){var n=a.params.enable_batch.items,r=s.toString(),o=n,l=o[r];this.addConfigAccordingType(l,r,o)}},initRecordEnableBatch:function(){void 0!==this.record.params.enable_batch&&(this.record.params.enable_batch=this.record.params.enable_batch.toString())},removeAction:function(e){this.rawValue.splice(e,1)},loadActions:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(p["h"])();case 2:t=e.sent,this.actions=t,t.forEach(function(e){var t=e.name;a.actionsMap[t]=e}),this.fillRawValue();case 6:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),fillRawValue:function(){var e=this,t=function(t){t.forEach(function(t){t._config=e.actionsMap[t.name];var a=t.params,i=t._config.params,s=t.fallbacks;t._value=Object.entries(a).map(function(e){var t=Object(n["a"])(e,2),a=t[0],r=t[1];return{label:(i[a]||{}).title,value:r,key:a,fallbacks:s}})})},a=this.rawValue;t(a),a.forEach(function(e){t(e.fallbacks)})},handleAddFallbacks:function(e){this.isFallbacks=!0,this.actionDialogTitle=this.$t("RuleEngine.addActions"),this.actionDialogVisible=!0,this.currentAction=e},editFallback:function(e,t,a){var i=d.a.cloneDeep(t);this.actionDialogTitle=this.$t("RuleEngine.editActions"),this.currentEditIndex=a,this.currentAction=e,this.isFallbacks=!0,this.actionTypeChange(i.name,"edit"),this.initEnableBatch(i),this.record=Object(c["a"])({},i),this.originRecord=Object(c["a"])({},i),this.actionDialogVisible=!0},removeFallback:function(e){e.fallbacks=[]},showFallbacksMtrics:function(e,t){var a=e.metrics,i=0,s=0;return a.forEach(function(e){i+=e.success,s+=e.failed}),"success"===t?i:s}}},C=_,y=(a("5713"),a("2877")),k=Object(y["a"])(C,i,s,!1,null,null,null);t["a"]=k.exports},ebce:function(e,t,a){}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-32291c05.fa1e09f6.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-32291c05.fa1e09f6.js new file mode 100644 index 000000000..cc4f8509e --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-32291c05.fa1e09f6.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-32291c05"],{"2e41":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"modules modules-select"},[s("div",{staticClass:"header-box"},[s("div",{staticClass:"inner-box"},[s("div",{staticClass:"content",style:t.contentStyle},[s("div",{staticClass:"content-left"},[s("span",{staticClass:"content-title"},[t._v(t._s(t.$t("components.selectModules")))]),s("span",{staticClass:"modules-num"},[t._v(t._s(t.canAddCount))]),t._l(t.classList,function(e){return s("div",{key:e.id,class:["module-class",e.id===t.activeNavId?"active-nav":""],on:{click:function(s){return t.changeNav(e.id)}}},[t._v("\n "+t._s(e.name)+"\n ")])})],2),s("el-col",{attrs:{span:6}},[s("el-input",{staticClass:"search-input",attrs:{type:"text",size:"small",clearable:"",placeholder:t.$t("Modules.searchTip")},on:{input:t.searchModule,clear:t.loadData},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}},[t.searchLoading?s("i",{staticClass:"el-icon-loading",attrs:{slot:"prefix"},slot:"prefix"}):s("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},slot:"prefix"})])],1)],1)])]),s("div",{staticClass:"content-box app-wrapper"},[t.searchVal?[t.searchModuleInfo.length?s("el-row",{attrs:{gutter:20}},t._l(t.searchModuleInfo,function(e,a){return s("el-col",{key:a,attrs:{span:12}},[s("div",{staticClass:"item-box"},[s("span",{directives:[{name:"show",rawName:"v-show",value:e.id&&"{}"===JSON.stringify(e.params),expression:"one.id && JSON.stringify(one.params) === '{}'"}],staticClass:"delete-icon",on:{click:function(s){return t.deleteModule(e,t.searchModuleInfo)}}}),s("el-card",{attrs:{shadow:"hover"}},[s("div",{staticClass:"module-item",on:{click:function(s){return t.toModuleDetail(e,t.searchModuleInfo)}}},[s("div",{staticClass:"left-box"},[s("img",{staticClass:"item-img",attrs:{src:e.img,alt:"module-logo"}}),s("div",{staticClass:"item-content"},[s("div",{staticClass:"item-title"},[t._v(t._s(e.title[t.lang]))]),s("div",{staticClass:"item-des"},[t._v("\n "+t._s(e.description[t.lang])+"\n ")])])]),s("div",{staticClass:"item-handle"},["unadd"===e.status?s("el-button",{staticClass:"select-btn",attrs:{type:"dashed",size:"mini"}},[t._v("\n "+t._s(t.$t("Modules.select"))+"\n ")]):s("el-button",{staticClass:"start-btn",attrs:{plain:"",size:"mini"}},[t._v("\n "+t._s(t.$t("Modules.added"))+"\n ")]),s("a",{staticClass:"know-more",attrs:{href:"javascript:;"},on:{click:function(s){return s.stopPropagation(),t.toReadMore(e.name)}}},[t._v("\n "+t._s(t.$t("Modules.readMore"))+"\n ")])],1)])])],1)])}),1):s("a-card",{staticClass:"null-modules"},[s("p",[t._v(t._s(t.$t("Modules.listNull")))])])]:t._l(t.classList,function(e){return s("div",{key:e.id,staticClass:"link-content",attrs:{id:e.id}},[s("p",{class:["class-title",e.id===t.activeNavId?"active-title":""]},[t._v("\n "+t._s(e.name)+"\n ")]),t.allFeatures[e.id]?s("el-row",{attrs:{gutter:20}},t._l(t.allFeatures[e.id],function(a,n){return s("el-col",{key:n,attrs:{span:12}},[s("div",{staticClass:"item-box"},[s("span",{directives:[{name:"show",rawName:"v-show",value:a.id&&"{}"===JSON.stringify(a.params),expression:"one.id && JSON.stringify(one.params) === '{}'"}],staticClass:"delete-icon",on:{click:function(s){return t.deleteModule(a,t.allFeatures[e.id])}}}),s("el-card",{attrs:{shadow:"hover"}},[s("div",{staticClass:"module-item",on:{click:function(s){return t.toModuleDetail(a,t.allFeatures[e.id])}}},[s("div",{staticClass:"left-box"},[s("img",{staticClass:"item-img",attrs:{src:a.img,alt:"module-logo"}}),s("div",{staticClass:"item-content"},[s("div",{staticClass:"item-title"},[t._v(t._s(a.title[t.lang]))]),s("div",{staticClass:"item-des"},[t._v("\n "+t._s(a.description[t.lang])+"\n ")])])]),s("div",{staticClass:"item-handle"},["unadd"===a.status?s("el-button",{staticClass:"select-btn",attrs:{type:"dashed",size:"mini"}},[t._v("\n "+t._s(t.$t("Modules.select"))+"\n ")]):s("el-button",{staticClass:"start-btn",attrs:{plain:"",size:"mini"}},[t._v("\n "+t._s(t.$t("Modules.added"))+"\n ")]),s("a",{staticClass:"know-more",attrs:{href:"javascript:;"},on:{click:function(e){return e.stopPropagation(),t.toReadMore(a.name)}}},[t._v("\n "+t._s(t.$t("Modules.readMore"))+"\n ")])],1)])])],1)])}),1):t._e()],1)})],2)])},n=[],i=(s("6762"),s("2fdb"),s("8615"),s("ac6a"),s("456d"),s("cebc")),o=s("a8db"),l=(s("7f7f"),s("96cf"),s("3b8d")),r=s("943d"),c=s("90b9"),d=s("a47b"),u={name:"ModuleAdd",data:function(){return{searchLoading:!1,searchVal:"",canAddCount:0,classList:[{name:this.$t("Modules.authentication"),id:"auth"},{name:this.$t("Modules.protocols"),id:"protocol"},{name:this.$t("Modules.messagePublish"),id:"message"},{name:this.$t("Modules.extension"),id:"extension"},{name:this.$t("Modules.monitor"),id:"devops"},{name:this.$t("Modules.localModules"),id:"module"}],activeNavId:"auth",allFeatures:{},selectedModule:{},allModuleList:[],searchModuleInfo:[],oper:"add",scrollTop:0,scrolling:!1,addedModules:JSON.parse(localStorage.getItem("addedModules"))||{}}},computed:{lang:function(){return d["a"].state.lang},contentStyle:function(){return{marginLeft:this.$store.state.leftBarCollapse?"80px":"200px"}}},created:function(){this.loadData()},mounted:function(){window.addEventListener("scroll",this.scrollToTop),this.returnPosition()},destroyed:function(){window.removeEventListener("scroll",this.scrollToTop)},methods:{deleteModule:function(t,e){var s=this,a=e.indexOf(t);this.$msgbox.confirm(this.$t("Modules.thisActionWillDeleteTheModule"),{confirmButtonText:this.$t("Base.confirm"),cancelButtonText:this.$t("Base.cancel"),type:"warning"}).then(Object(l["a"])(regeneratorRuntime.mark(function n(){var i,l;return regeneratorRuntime.wrap(function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(r["i"])(t.id);case 2:s.$message.success(s.$t("Base.deleteSuccess")),i=JSON.parse(localStorage.getItem("addedModules"))||{},delete i[t.name],delete s.addedModules[t.name],localStorage.setItem("addedModules",JSON.stringify(i)),t.id,l=Object(o["a"])(t,["id"]),l.status="unadd",e.splice(a,1,l);case 10:case"end":return n.stop()}},n)}))).catch(function(){})},returnPosition:function(){var t=this,e=this.$route.query,s=e.id,a=e.top;s&&setTimeout(function(){document.documentElement.scrollTop=a,document.body.scrollTop=a,t.activeNavId=s},50)},searchModule:function(){var t=this;if(this.searchLoading=!0,""===this.searchVal)return this.searchLoading=!1,this.searchModuleInfo=[],void(this.activeNavId="auth");setTimeout(Object(l["a"])(regeneratorRuntime.mark(function e(){var s;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["k"])(t.allModuleList,"localTitle",t.searchVal);case 2:s=e.sent,s?(t.searchModuleInfo=s,t.searchLoading=!1):t.searchLoading=!1,t.activeNavId="";case 5:case"end":return e.stop()}},e)})),500)},parseI18n:function(t){var e=Object(c["c"])(t,["title","description"]).map(function(t){return t.params=Object(c["c"])(t.params,!0),t});return e},toModuleDetail:function(){var t=Object(l["a"])(regeneratorRuntime.mark(function t(e,s){var a,n,o,l,c,d,u,h,p=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(a=s.indexOf(e),n="unadd"===e.status?"add":"edit",this.oper=n,this.selectedModule={},"add"!==n){t.next=26;break}if(o=Object(i["a"])({},e),this.parseI18n([o]),l=o.params,Object.keys(l).length){t.next=22;break}return c={type:e.name,config:{}},t.next=12,Object(r["d"])(c);case 12:return d=t.sent,u=JSON.parse(localStorage.getItem("addedModules"))||{},u[d.type]=d.id,this.addedModules=u,localStorage.setItem("addedModules",JSON.stringify(u)),this.$message.success(this.$t("Modules.moduleAddSuccess")),e.status="added",e.id=d.id,s.splice(a,1,e),t.abrupt("return");case 22:this.selectedModule={paramsData:l,type:e.name,oper:n,title:e.title,description:e.description},this.$store.dispatch("UPDATE_MODULE",this.selectedModule),t.next=31;break;case 26:if(Object.keys(e.params).length){t.next=29;break}return this.$message.info(this.$t("Modules.noNeedAddConfigTip")),t.abrupt("return");case 29:h=this.addedModules[e.name],this.getAddedModuleInfo(h).then(function(t){p.selectedModule=t,p.selectedModule.oper=n,p.selectedModule.title=e.title,p.selectedModule.description=e.description,p.$store.dispatch("UPDATE_MODULE",p.selectedModule)}).catch();case 31:this.$router.push("/modules/detail?id=".concat(this.activeNavId,"&top=").concat(this.scrollTop));case 32:case"end":return t.stop()}},t,this)}));function e(e,s){return t.apply(this,arguments)}return e}(),getAddedModuleInfo:function(){var t=Object(l["a"])(regeneratorRuntime.mark(function t(e){var s;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(r["s"])(e);case 2:return s=t.sent,t.abrupt("return",s);case 4:case"end":return t.stop()}},t)}));function e(e){return t.apply(this,arguments)}return e}(),changeNav:function(t){var e=this;if(!this.scrolling){this.searchModuleInfo=[],this.searchVal="",this.activeNavId=t;var s=this.$el.querySelector("#".concat(t)),a=s.offsetTop;setTimeout(function(){"auth"===t?e.backTo(0):e.backTo(a)},5)}},loadData:function(){var t=Object(l["a"])(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.allModuleList=[],this.allFeatures=[],this.canAddCount=0,t.next=5,Object(r["o"])();case 5:this.allFeatures=t.sent,this.getImgs(),Object.values(this.allFeatures).forEach(function(t){e.allModuleList=e.allModuleList.concat(t)}),this.allModuleList.forEach(function(t){t.localTitle=t.title[e.lang],Object.keys(e.addedModules).includes(t.name)?(t.status="added",t.id=e.addedModules[t.name]):(t.status="unadd",e.canAddCount+=1)});case 9:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),getImgs:function(){var t=this;this.classList.forEach(function(e){var a=e.id;t.allFeatures[a].forEach(function(t){try{t.img=s("1775")("./".concat(t.name,".png"))}catch(e){console.log(e)}})})},backTo:function(t){var e=this,s=setInterval(function(){var a=Math.floor((t-e.scrollTop)/6);Math.abs(e.scrollTop-t)>=Math.abs(a)?e.scrollTop+=a:e.scrollTop=t,document.documentElement.scrollTop=e.scrollTop,document.body.scrollTop=e.scrollTop,e.scrolling=!0,e.scrollTop!==t&&0!==a||(clearInterval(s),e.scrolling=!1)},20)},scrollToTop:function(){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;this.scrollTop=t},toReadMore:function(t){var e="zh"===this.lang?"cn/cn/":"io/en/",s="https://docs.emqx.".concat(e,"enterprise/latest/modules/").concat(t,".html"),a=window.open(s);a.opener=null}}},h=u,p=(s("b13c"),s("2877")),m=Object(p["a"])(h,a,n,!1,null,"839f236e",null);e["default"]=m.exports},"9b44":function(t,e,s){},a8db:function(t,e,s){"use strict";var a=s("e265"),n=s.n(a),i=s("a4bb"),o=s.n(i);function l(t,e){if(null==t)return{};var s,a,n={},i=o()(t);for(a=0;a=0||(n[s]=t[s]);return n}function r(t,e){if(null==t)return{};var s,a,i=l(t,e);if(n.a){var o=n()(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,s)&&(i[s]=t[s])}return i}s.d(e,"a",function(){return r})},b13c:function(t,e,s){"use strict";var a=s("9b44"),n=s.n(a);n.a}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-39509ba9.bfd064ab.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-39509ba9.bfd064ab.js new file mode 100644 index 000000000..2254a86f4 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-39509ba9.bfd064ab.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-39509ba9"],{"4a36":function(e,t,r){"use strict";r.d(t,"c",function(){return o}),r.d(t,"d",function(){return p}),r.d(t,"b",function(){return l}),r.d(t,"a",function(){return d});r("7f7f"),r("96cf");var a=r("3b8d"),n=r("1f75"),s="3rd-party",c="HTTP",u="TCP",i="Resources",o=function(){return n["a"].get("/schemas")},p=function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(t){var r,a,s,o,p,l;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n["a"].get("/schemas/".concat(t));case 3:return r=e.sent,a=r,s=a.parser_addr,s&&(o=s.url,p=s.host,l=s.port,o?a.third_party_type=c:p&&l?(a.third_party_type=u,a.parser_addr.server="".concat(p,":").concat(l)):a.third_party_type=i),e.abrupt("return",a);case 10:return e.prev=10,e.t0=e["catch"](0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}},e,null,[[0,10]])}));return function(t){return e.apply(this,arguments)}}(),l=function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n["a"].delete("/schemas/".concat(t));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e["catch"](0),console.error(e.t0),e.abrupt("return",!1);case 10:case"end":return e.stop()}},e,null,[[0,6]])}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return r={name:t.name,description:t.description,parser_type:t.parser_type},t.parser_type===s?(r.parser_addr={},r.parser_opts=t.parser_opts,t.third_party_type===c?r.parser_addr.url=t.parser_addr.url:t.third_party_type===u?r.parser_addr.server=t.parser_addr.server:t.third_party_type===i&&(r.parser_addr.resource_id=t.parser_addr.resource_id)):r.schema=t.schema,e.prev=2,e.next=5,n["a"].post("/schemas",r);case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e["catch"](2),console.error(e.t0),e.abrupt("return",!1);case 12:case"end":return e.stop()}},e,null,[[2,8]])}));return function(t){return e.apply(this,arguments)}}()},c993:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"schemas"},[r("page-header",[r("div",{staticClass:"page-header-content-view"},[r("div",{staticClass:"content"},[r("p",{staticClass:"description"},[e._v("\n "+e._s(e.$t("Schemas.schemaDesc"))+"\n ")]),r("div",{staticClass:"page-header-top-start"},[r("a",{staticClass:"link-item",attrs:{rel:"noopener",href:e.docs.tutorial,target:"_blank"}},[r("i",{staticClass:"icon el-icon-position"}),e._v("\n "+e._s(e.$t("Schemas.quickStart"))+"\n ")])])])])]),r("div",{staticClass:"app-wrapper"},[r("a-card",{staticClass:"emq-list-card"},[r("div",{staticClass:"emq-table-header"},[r("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:function(t){return e.$router.push({path:"/schemas/0",query:{oper:"create"}})}}},[e._v("\n "+e._s(e.$t("Base.create"))+"\n ")])],1),r("el-table",{staticClass:"data-list",attrs:{data:e.tableData}},[r("el-table-column",{attrs:{prop:"name",label:e.$t("Schemas.name")},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[r("a",{attrs:{href:"javascript:;"},on:{click:function(t){return e.$router.push({path:"/schemas/"+a.name,query:{oper:"view"}})}}},[e._v("\n "+e._s(a.name)+"\n ")])]}}])}),r("el-table-column",{attrs:{prop:"parser_type",label:e.$t("Schemas.parser_type"),filters:e.parserTypes,"filter-method":e.parserTypesColumnFilter,"filter-placement":"bottom"}}),r("el-table-column",{attrs:{prop:"descr","show-overflow-tooltip":"",label:e.$t("Schemas.description")}}),r("el-table-column",{attrs:{width:"80px"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[r("el-button",{attrs:{type:"dashed danger",size:"mini"},on:{click:function(t){return e.deleteData(a)}}},[e._v("\n "+e._s(e.$t("RuleEngine.delete"))+"\n ")])]}}])})],1)],1)],1)],1)},n=[],s=(r("7f7f"),r("96cf"),r("3b8d")),c=r("4a36"),u=r("90b9"),i={name:"Schemas",data:function(){return{docs:{tutorial:Object(u["g"])("schemaTutorial")},tableData:[],parserTypes:[{text:"avro",value:"avro"},{text:"protobuf",value:"protobuf"},{text:"3rd-party",value:"3rd-party"}]}},created:function(){this.loadData()},methods:{loadData:function(){var e=Object(s["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["c"])();case 2:t=e.sent,t&&(this.tableData=t);case 4:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),deleteData:function(e){var t=this;this.$confirm(this.$t("Schemas.confirmDelete"),{type:"warning"}).then(Object(s["a"])(regeneratorRuntime.mark(function r(){var a;return regeneratorRuntime.wrap(function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(c["b"])(e.name);case 2:a=r.sent,a&&(t.loadData(),t.$message.success(t.$t("Base.deleteSuccess")));case 4:case"end":return r.stop()}},r)}))).catch(function(){})},parserTypesColumnFilter:function(e,t){return e===t.parser_type}}},o=i,p=r("2877"),l=Object(p["a"])(o,a,n,!1,null,null,null);t["default"]=l.exports}}]); \ No newline at end of file diff --git a/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-3adcb268.16eb5205.js b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-3adcb268.16eb5205.js new file mode 100644 index 000000000..ce7736d34 --- /dev/null +++ b/apps/emqx_enterprise_dashboard/priv/www/static/js/chunk-3adcb268.16eb5205.js @@ -0,0 +1,6 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3adcb268"],{"00a3":function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return u});var i=n("11f7"),o=n("e757"),r=n("5d28"),s=n("a666");function a(e,t){var n=new r["b"](t);return n.preventDefault(),{leftButton:n.leftButton,posx:n.posx,posy:n.posy}}var u=function(){function e(){this.hooks=new s["b"],this.mouseMoveEventMerger=null,this.mouseMoveCallback=null,this.onStopCallback=null}return e.prototype.dispose=function(){this.stopMonitoring(!1),this.hooks.dispose()},e.prototype.stopMonitoring=function(e){if(this.isMonitoring()){this.hooks.clear(),this.mouseMoveEventMerger=null,this.mouseMoveCallback=null;var t=this.onStopCallback;this.onStopCallback=null,e&&t&&t()}},e.prototype.isMonitoring=function(){return!!this.mouseMoveEventMerger},e.prototype.startMonitoring=function(e,t,n){var s=this;if(!this.isMonitoring()){this.mouseMoveEventMerger=e,this.mouseMoveCallback=t,this.onStopCallback=n;for(var a=o["a"].getSameOriginWindowChain(),u=0,l=a;u1?i["r"](d["b"].gotoLineLabelValidLineAndColumn,t.lineNumber,t.column):i["r"](d["b"].gotoLineLabelValidLine,t.lineNumber):t.lineNumber<1||t.lineNumber>(n?n.getLineCount():0)?i["r"](d["b"].gotoLineLabelEmptyWithLineLimit,n?n.getLineCount():0):i["r"](d["b"].gotoLineLabelEmptyWithLineAndColumnLimit,n?n.getLineMaxColumn(t.lineNumber):0),{position:t,isValid:l,label:u}},t.prototype.getLabel=function(){return this.parseResult.label},t.prototype.getAriaLabel=function(){var e=this.editor.getPosition(),t=e?e.lineNumber:0;return i["r"](d["b"].gotoLineAriaLabel,t,this.parseResult.label)},t.prototype.run=function(e,t){return 1===e?this.runOpen():this.runPreview()},t.prototype.runOpen=function(){if(!this.parseResult.isValid)return!1;var e=this.toSelection();return this.editor.setSelection(e),this.editor.revealRangeInCenter(e,0),this.editor.focus(),!0},t.prototype.runPreview=function(){if(!this.parseResult.isValid)return this.decorator.clearDecorations(),!1;var e=this.toSelection();return this.editor.revealRangeInCenter(e,0),this.decorator.decorateLine(e,this.editor),!1},t.prototype.toSelection=function(){return new u["a"](this.parseResult.position.lineNumber,this.parseResult.position.column,this.parseResult.position.lineNumber,this.parseResult.position.column)},t}(o["a"]),f=function(e){function t(){return e.call(this,d["b"].gotoLineActionInput,{id:"editor.action.gotoLine",label:d["b"].gotoLineActionLabel,alias:"Go to Line...",precondition:void 0,kbOpts:{kbExpr:l["a"].focus,primary:2085,mac:{primary:293},weight:100}})||this}return h(t,e),t.prototype.run=function(e,t){var n=this;this._show(this.getController(t),{getModel:function(e){return new o["c"]([new p(e,t,n.getController(t))])},getAutoFocus:function(e){return{autoFocusFirstEntry:e.length>0}}})},t}(c["a"]);Object(s["f"])(f)},"03d9":function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return r}),n.d(t,"d",function(){return s}),n.d(t,"e",function(){return a}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"f",function(){return c});var i,o,r,s,a,u,l,c,d=n("dff7");(function(e){e.noSelection=d["a"]("noSelection","No selection"),e.singleSelectionRange=d["a"]("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),e.singleSelection=d["a"]("singleSelection","Line {0}, Column {1}"),e.multiSelectionRange=d["a"]("multiSelectionRange","{0} selections ({1} characters selected)"),e.multiSelection=d["a"]("multiSelection","{0} selections"),e.emergencyConfOn=d["a"]("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),e.openingDocs=d["a"]("openingDocs","Now opening the Editor Accessibility documentation page."),e.readonlyDiffEditor=d["a"]("readonlyDiffEditor"," in a read-only pane of a diff editor."),e.editableDiffEditor=d["a"]("editableDiffEditor"," in a pane of a diff editor."),e.readonlyEditor=d["a"]("readonlyEditor"," in a read-only code editor"),e.editableEditor=d["a"]("editableEditor"," in a code editor"),e.changeConfigToOnMac=d["a"]("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),e.changeConfigToOnWinLinux=d["a"]("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),e.auto_on=d["a"]("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),e.auto_off=d["a"]("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),e.tabFocusModeOnMsg=d["a"]("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),e.tabFocusModeOnMsgNoKb=d["a"]("tabFocusModeOnMsgNoKb","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),e.tabFocusModeOffMsg=d["a"]("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),e.tabFocusModeOffMsgNoKb=d["a"]("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),e.openDocMac=d["a"]("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),e.openDocWinLinux=d["a"]("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),e.outroMsg=d["a"]("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),e.showAccessibilityHelpAction=d["a"]("showAccessibilityHelpAction","Show Accessibility Help")})(i||(i={})),function(e){e.inspectTokensAction=d["a"]("inspectTokens","Developer: Inspect Tokens")}(o||(o={})),function(e){e.gotoLineLabelValidLineAndColumn=d["a"]("gotoLineLabelValidLineAndColumn","Go to line {0} and character {1}"),e.gotoLineLabelValidLine=d["a"]("gotoLineLabelValidLine","Go to line {0}"),e.gotoLineLabelEmptyWithLineLimit=d["a"]("gotoLineLabelEmptyWithLineLimit","Type a line number between 1 and {0} to navigate to"),e.gotoLineLabelEmptyWithLineAndColumnLimit=d["a"]("gotoLineLabelEmptyWithLineAndColumnLimit","Type a character between 1 and {0} to navigate to"),e.gotoLineAriaLabel=d["a"]("gotoLineAriaLabel","Current Line: {0}. Go to line {1}."),e.gotoLineActionInput=d["a"]("gotoLineActionInput","Type a line number, followed by an optional colon and a character number to navigate to"),e.gotoLineActionLabel=d["a"]("gotoLineActionLabel","Go to Line...")}(r||(r={})),function(e){e.ariaLabelEntryWithKey=d["a"]("ariaLabelEntryWithKey","{0}, {1}, commands"),e.ariaLabelEntry=d["a"]("ariaLabelEntry","{0}, commands"),e.quickCommandActionInput=d["a"]("quickCommandActionInput","Type the name of an action you want to execute"),e.quickCommandActionLabel=d["a"]("quickCommandActionLabel","Command Palette")}(s||(s={})),function(e){e.entryAriaLabel=d["a"]("entryAriaLabel","{0}, symbols"),e.quickOutlineActionInput=d["a"]("quickOutlineActionInput","Type the name of an identifier you wish to navigate to"),e.quickOutlineActionLabel=d["a"]("quickOutlineActionLabel","Go to Symbol..."),e._symbols_=d["a"]("symbols","symbols ({0})"),e._modules_=d["a"]("modules","modules ({0})"),e._class_=d["a"]("class","classes ({0})"),e._interface_=d["a"]("interface","interfaces ({0})"),e._method_=d["a"]("method","methods ({0})"),e._function_=d["a"]("function","functions ({0})"),e._property_=d["a"]("property","properties ({0})"),e._variable_=d["a"]("variable","variables ({0})"),e._variable2_=d["a"]("variable2","variables ({0})"),e._constructor_=d["a"]("_constructor","constructors ({0})"),e._call_=d["a"]("call","calls ({0})")}(a||(a={})),function(e){e.editorViewAccessibleLabel=d["a"]("editorViewAccessibleLabel","Editor content"),e.accessibilityHelpMessageIE=d["a"]("accessibilityHelpMessageIE","Press Ctrl+F1 for Accessibility Options."),e.accessibilityHelpMessage=d["a"]("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")}(u||(u={})),function(e){e.toggleHighContrast=d["a"]("toggleHighContrast","Toggle High Contrast Theme")}(l||(l={})),function(e){e.bulkEditServiceSummary=d["a"]("bulkEditServiceSummary","Made {0} edits in {1} files")}(c||(c={}))},"03e8":function(e,t,n){"use strict";n.d(t,"a",function(){return l}),n.d(t,"c",function(){return i}),n.d(t,"b",function(){return c});var i,o=n("0a0f"),r=n("308f"),s=n("a666"),a=n("ef8e"),u=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l=Object(o["c"])("storageService");(function(e){e[e["NONE"]=0]="NONE",e[e["SHUTDOWN"]=1]="SHUTDOWN"})(i||(i={}));var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._serviceBrand=null,t._onDidChangeStorage=t._register(new r["a"]),t.onDidChangeStorage=t._onDidChangeStorage.event,t.onWillSaveState=r["b"].None,t.globalCache=new Map,t.workspaceCache=new Map,t}return u(t,e),t.prototype.getCache=function(e){return 0===e?this.globalCache:this.workspaceCache},t.prototype.get=function(e,t,n){var i=this.getCache(t).get(e);return Object(a["k"])(i)?n:i},t.prototype.getBoolean=function(e,t,n){var i=this.getCache(t).get(e);return Object(a["k"])(i)?n:"true"===i},t.prototype.store=function(e,t,n){if(Object(a["k"])(t))return this.remove(e,n);var i=String(t),o=this.getCache(n).get(e);return o===i?Promise.resolve():(this.getCache(n).set(e,i),this._onDidChangeStorage.fire({scope:n,key:e}),Promise.resolve())},t.prototype.remove=function(e,t){var n=this.getCache(t).delete(e);return n?(this._onDidChangeStorage.fire({scope:t,key:e}),Promise.resolve()):Promise.resolve()},t}(s["a"])},"041a":function(e,t,n){"use strict";n.d(t,"a",function(){return p});n("c4d7");var i=n("0f70"),o=n("a666"),r=n("308f"),s=n("30db"),a=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function u(e,t){return!!e[t]}var l=function(){function e(e,t){this.target=e.target,this.hasTriggerModifier=u(e.event,t.triggerModifier),this.hasSideBySideModifier=u(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=i["j"]||e.event.detail<=1}return e}(),c=function(){function e(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=u(e,t.triggerModifier)}return e}(),d=function(){function e(e,t,n,i){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=i}return e.prototype.equals=function(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier},e}();function h(e){return"altKey"===e?s["d"]?new d(57,"metaKey",6,"altKey"):new d(5,"ctrlKey",6,"altKey"):s["d"]?new d(6,"altKey",57,"metaKey"):new d(6,"altKey",5,"ctrlKey")}var p=function(e){function t(t){var n=e.call(this)||this;return n._onMouseMoveOrRelevantKeyDown=n._register(new r["a"]),n.onMouseMoveOrRelevantKeyDown=n._onMouseMoveOrRelevantKeyDown.event,n._onExecute=n._register(new r["a"]),n.onExecute=n._onExecute.event,n._onCancel=n._register(new r["a"]),n.onCancel=n._onCancel.event,n._editor=t,n._opts=h(n._editor.getConfiguration().multiCursorModifier),n.lastMouseMoveEvent=null,n.hasTriggerKeyOnMouseDown=!1,n._register(n._editor.onDidChangeConfiguration(function(e){if(e.multiCursorModifier){var t=h(n._editor.getConfiguration().multiCursorModifier);if(n._opts.equals(t))return;n._opts=t,n.lastMouseMoveEvent=null,n.hasTriggerKeyOnMouseDown=!1,n._onCancel.fire()}})),n._register(n._editor.onMouseMove(function(e){return n.onEditorMouseMove(new l(e,n._opts))})),n._register(n._editor.onMouseDown(function(e){return n.onEditorMouseDown(new l(e,n._opts))})),n._register(n._editor.onMouseUp(function(e){return n.onEditorMouseUp(new l(e,n._opts))})),n._register(n._editor.onKeyDown(function(e){return n.onEditorKeyDown(new c(e,n._opts))})),n._register(n._editor.onKeyUp(function(e){return n.onEditorKeyUp(new c(e,n._opts))})),n._register(n._editor.onMouseDrag(function(){return n.resetHandler()})),n._register(n._editor.onDidChangeCursorSelection(function(e){return n.onDidChangeCursorSelection(e)})),n._register(n._editor.onDidChangeModel(function(e){return n.resetHandler()})),n._register(n._editor.onDidChangeModelContent(function(){return n.resetHandler()})),n._register(n._editor.onDidScrollChange(function(e){(e.scrollTopChanged||e.scrollLeftChanged)&&n.resetHandler()})),n}return a(t,e),t.prototype.onDidChangeCursorSelection=function(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this.resetHandler()},t.prototype.onEditorMouseMove=function(e){this.lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])},t.prototype.onEditorMouseDown=function(e){this.hasTriggerKeyOnMouseDown=e.hasTriggerModifier},t.prototype.onEditorMouseUp=function(e){this.hasTriggerKeyOnMouseDown&&this._onExecute.fire(e)},t.prototype.onEditorKeyDown=function(e){this.lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this.lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()},t.prototype.onEditorKeyUp=function(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()},t.prototype.resetHandler=function(){this.lastMouseMoveEvent=null,this.hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()},t}(o["a"])},"045b":function(e,t,n){"use strict";function i(e,t){var n=e.getCount(),i=e.findTokenIndexAtOffset(t),r=e.getLanguageId(i),s=i;while(s+10&&e.getLanguageId(a-1)===r)a--;return new o(e,r,a,s+1,e.getStartOffset(a),e.getEndOffset(s))}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var o=function(){function e(e,t,n,i,o,r){this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=i,this.firstCharOffset=o,this._lastCharOffset=r}return e.prototype.getLineContent=function(){var e=this._actual.getLineContent();return e.substring(this.firstCharOffset,this._lastCharOffset)},e.prototype.getTokenCount=function(){return this._lastTokenIndex-this._firstTokenIndex},e.prototype.findTokenIndexAtOffset=function(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex},e.prototype.getStandardTokenType=function(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)},e}();function r(e){return 0!==(7&e)}},"0632":function(e,t,n){},"0829":function(e,t,n){},"0876":function(e,t,n){},"0910":function(e,t,n){"use strict";n.d(t,"a",function(){return l}),n.d(t,"b",function(){return C});var i=n("dff7"),o=n("308f"),r=n("89cd"),s=n("ef8e"),a=n("3742"),u=n("dd1b"),l={Configuration:"base.contributions.configuration"},c={properties:{},patternProperties:{}},d={properties:{},patternProperties:{}},h={properties:{},patternProperties:{}},p={properties:{},patternProperties:{}},f={properties:{},patternProperties:{}},g={properties:{},patternProperties:{}},m="vscode://schemas/settings/editor",v=r["a"].as(u["a"].JSONContribution),_=function(){function e(){this.overrideIdentifiers=[],this._onDidSchemaChange=new o["a"],this._onDidUpdateConfiguration=new o["a"],this.defaultOverridesConfigurationNode={id:"defaultOverrides",title:i["a"]("defaultConfigurations.title","Default Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultOverridesConfigurationNode],this.editorConfigurationSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowsTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},this.computeOverridePropertyPattern(),v.registerSchema(m,this.editorConfigurationSchema)}return e.prototype.registerConfiguration=function(e,t){void 0===t&&(t=!0),this.registerConfigurations([e],t)},e.prototype.registerConfigurations=function(e,t){var n=this;void 0===t&&(t=!0);var i=[];e.forEach(function(e){i.push.apply(i,n.validateAndRegisterProperties(e,t)),n.configurationContributors.push(e),n.registerJSONConfiguration(e),n.updateSchemaForOverrideSettingsConfiguration(e)}),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)},e.prototype.registerOverrideIdentifiers=function(e){var t;(t=this.overrideIdentifiers).push.apply(t,e),this.updateOverridePropertyPatternKey()},e.prototype.validateAndRegisterProperties=function(e,t,n,i){void 0===t&&(t=!0),void 0===n&&(n=3),void 0===i&&(i=!1),n=s["k"](e.scope)?n:e.scope,i=e.overridable||i;var o=[],r=e.properties;if(r)for(var a in r){var u=void 0;if(t&&(u=O(a)))console.warn(u),delete r[a];else{var l=r[a],c=l.default;s["j"](c)&&(l.default=S(l.type)),i&&(l.overridable=!0),C.test(a)?l.scope=void 0:l.scope=s["k"](l.scope)?n:l.scope,!r[a].hasOwnProperty("included")||r[a].included?(this.configurationProperties[a]=r[a],o.push(a)):(this.excludedConfigurationProperties[a]=r[a],delete r[a])}}var d=e.allOf;if(d)for(var h=0,p=d;h, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"},e.readFromTextArea=function(t){return new e(t.getValue(),t.getSelectionStart(),t.getSelectionEnd(),null,null)},e.prototype.collapseSelection=function(){return new e(this.value,this.value.length,this.value.length,null,null)},e.prototype.writeToTextArea=function(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)},e.prototype.deduceEditorPosition=function(e){if(e<=this.selectionStart){var t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}var n=this.value.substring(this.selectionStart,e);if(-1===n.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,n,1);var i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)},e.prototype._finishDeduceEditorPosition=function(e,t,n){var i=0,o=-1;while(-1!==(o=t.indexOf("\n",o+1)))i++;return[e,n*t.length,i]},e.selectedText=function(t){return new e(t,0,t.length,null,null)},e.deduceInput=function(e,t,n,o){if(!e)return{text:"",replaceCharCnt:0};var r=e.value,s=e.selectionStart,a=e.selectionEnd,u=t.value,l=t.selectionStart,c=t.selectionEnd;o&&r.length>0&&s===a&&l===c&&!i["J"](u,r)&&i["m"](u,r)&&(s=0,a=0);var d=r.substring(a),h=u.substring(c),p=i["c"](d,h);u=u.substring(0,u.length-p),r=r.substring(0,r.length-p);var f=r.substring(0,s),g=u.substring(0,l),m=i["b"](f,g);if(u=u.substring(m),r=r.substring(m),l-=m,s-=m,c-=m,a-=m,n&&l===c&&r.length>0){var v=null;if(l===u.length?i["J"](u,r)&&(v=u.substring(r.length)):i["m"](u,r)&&(v=u.substring(0,u.length-r.length)),null!==v&&v.length>0&&(/\uFE0F/.test(v)||i["f"](v)))return{text:v,replaceCharCnt:0}}if(l===c){if(r===u&&0===s&&a===r.length&&l===u.length&&-1===u.indexOf("\n")&&i["g"](u))return{text:"",replaceCharCnt:0};var _=f.length-m;return{text:u,replaceCharCnt:_}}var b=a-s;return{text:u,replaceCharCnt:b}},e.EMPTY=new e("",0,0,null,null),e}(),a=function(){function e(){}return e._getPageOfLine=function(t){return Math.floor((t-1)/e._LINES_PER_PAGE)},e._getRangeForPage=function(t){var n=t*e._LINES_PER_PAGE,i=n+1,o=n+e._LINES_PER_PAGE;return new r["a"](i,1,o+1,1)},e.fromEditorSelection=function(t,n,i,a){var u,l=e._getPageOfLine(i.startLineNumber),c=e._getRangeForPage(l),d=e._getPageOfLine(i.endLineNumber),h=e._getRangeForPage(d),p=c.intersectRanges(new r["a"](1,1,i.startLineNumber,i.startColumn)),f=n.getValueInRange(p,1),g=n.getLineCount(),m=n.getLineMaxColumn(g),v=h.intersectRanges(new r["a"](i.endLineNumber,i.endColumn,g,m)),_=n.getValueInRange(v,1);if(l===d||l+1===d)u=n.getValueInRange(i,1);else{var b=c.intersectRanges(i),y=h.intersectRanges(i);u=n.getValueInRange(b,1)+String.fromCharCode(8230)+n.getValueInRange(y,1)}if(a){var w=500;f.length>w&&(f=f.substring(f.length-w,f.length)),_.length>w&&(_=_.substring(0,w)),u.length>2*w&&(u=u.substring(0,w)+String.fromCharCode(8230)+u.substring(u.length-w,u.length))}return new s(f+u+_,f.length,f.length+u.length,new o["a"](i.startLineNumber,i.startColumn),new o["a"](i.endLineNumber,i.endColumn))},e._LINES_PER_PAGE=10,e}()},"0b11":function(e,t,n){"use strict";n.r(t);var i=n("b2cc"),o=n("0b54");Object(i["h"])(o["f"]),Object(i["f"])(o["e"]),Object(i["f"])(o["g"]),Object(i["f"])(o["h"]),Object(i["f"])(o["d"]),Object(i["f"])(o["a"]),Object(i["f"])(o["c"]),Object(i["g"])(new o["b"])},"0b54":function(e,t,n){"use strict";var i,o=n("a666"),r=n("3742"),s=n("b2cc"),a=n("c7f5"),u=n("c101"),l=n("fdcc"),c=n("351f"),d=n("533b"),h=n("6dec"),p=n("11f7"),f=n("f070"),g=n("7061"),m=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),v=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},_=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},x=function(e,t){return function(n,i){t(n,i,e)}};(function(e){e.Hidden=new(function(){function e(){this.type=0}return e}());var t=function(){function e(e,t,n){this.actions=e,this.editorPosition=t,this.widgetPosition=n,this.type=1}return e}();e.Showing=t})(i||(i={}));var N,D=function(e){function t(t,n,o){var r=e.call(this)||this;return r._editor=t,r._quickFixActionId=n,r._keybindingService=o,r._onClick=r._register(new w["a"]),r.onClick=r._onClick.event,r._state=i.Hidden,r._domNode=document.createElement("div"),r._domNode.className="lightbulb-glyph",r._editor.addContentWidget(r),r._register(r._editor.onDidChangeModelContent(function(e){var t=r._editor.getModel();(1!==r._state.type||!t||r._state.editorPosition.lineNumber>=t.getLineCount())&&r.hide()})),r._register(p["k"](r._domNode,"mousedown",function(e){if(1===r._state.type){r._editor.focus(),e.preventDefault();var t=p["x"](r._domNode),n=t.top,i=t.height,o=r._editor.getConfiguration().lineHeight,s=Math.floor(o/3);null!==r._state.widgetPosition.position&&r._state.widgetPosition.position.lineNumber22,f=function(e){return e>2&&o._editor.getTopForLineNumber(e)===o._editor.getTopForLineNumber(e-1)},g=s;if(!h)if(s>1&&!f(s-1))g-=1;else if(f(s+1)){if(a*r.fontInfo.spaceWidth<22)return this.hide()}else g+=1;this._state=new i.Showing(e,n,{position:{lineNumber:g,column:1},preference:t._posPref}),p["R"](this._domNode,"autofixable",e.hasAutoFix),this._editor.layoutContentWidget(this)},Object.defineProperty(t.prototype,"title",{set:function(e){this._domNode.title=e},enumerable:!0,configurable:!0}),t.prototype.hide=function(){this._state=i.Hidden,this._editor.layoutContentWidget(this)},t.prototype._updateLightBulbTitle=function(){var e,t=this._keybindingService.lookupKeybinding(this._quickFixActionId);e=t?S["a"]("quickFixWithKb","Show Fixes ({0})",t.getLabel()):S["a"]("quickFix","Show Fixes"),this.title=e},t._posPref=[0],t=O([x(2,h["a"])],t),t}(o["a"]),k=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),I=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},E=function(e,t){return function(n,i){t(n,i,e)}},M=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},T=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0))return[3,9];if(1!==e.trigger.autoApply&&(0!==e.trigger.autoApply||1!==t.actions.length))return[3,9];i.label=5;case 5:return i.trys.push([5,,7,8]),[4,this.delegate.applyCodeAction(t.actions[0],!1)];case 6:return i.sent(),[3,8];case 7:return t.dispose(),[7];case 8:return[2];case 9:return this._activeCodeActions.value=t,this._codeActionWidget.show(t,e.position),[3,11];case 10:this._codeActionWidget.isVisible?t.dispose():this._activeCodeActions.value=t,i.label=11;case 11:return[2]}})})},t.prototype.showCodeActionList=function(e,t){return M(this,void 0,void 0,function(){return T(this,function(n){return this._codeActionWidget.show(e,t),[2]})})},t.prototype._handleLightBulbSelect=function(e){this._codeActionWidget.show(e.actions,e)},t=I([E(3,d["a"]),E(4,h["a"])],t),t}(o["a"]),R=n("9e74"),A=n("4fc3"),F=n("b400"),j=n("b539"),W=n("5fe7"),V=n("6a89"),B=n("b707"),H=n("8495"),z=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),U=new A["d"]("supportedCodeAction",""),K=function(e){function t(t,n,i,o){void 0===o&&(o=250);var r=e.call(this)||this;return r._editor=t,r._markerService=n,r._signalChange=i,r._delay=o,r._autoTriggerTimer=r._register(new W["e"]),r._register(r._markerService.onMarkerChanged(function(e){return r._onMarkerChanges(e)})),r._register(r._editor.onDidChangeCursorPosition(function(){return r._onCursorChange()})),r}return z(t,e),t.prototype.trigger=function(e){var t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)},t.prototype._onMarkerChanges=function(e){var t=this,n=this._editor.getModel();n&&e.some(function(e){return e.toString()===n.uri.toString()})&&this._autoTriggerTimer.cancelAndSet(function(){t.trigger({type:"auto"})},this._delay)},t.prototype._onCursorChange=function(){var e=this;this._autoTriggerTimer.cancelAndSet(function(){e.trigger({type:"auto"})},this._delay)},t.prototype._getRangeOfMarker=function(e){var t=this._editor.getModel();if(t)for(var n=0,i=this._markerService.read({resource:t.uri});n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},X=function(e,t){return function(n,i){t(n,i,e)}},$=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},Q=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0,d=l.indexOf("Edge/")>=0,h=c||d,p=l.indexOf("Firefox")>=0,f=l.indexOf("AppleWebKit")>=0,g=l.indexOf("Chrome")>=0,m=!g&&l.indexOf("Safari")>=0,v=!g&&!m&&f,_=l.indexOf("iPad")>=0,b=d&&l.indexOf("WebView/")>=0;function y(){if(c)return!1;if(d){var e=l.indexOf("Edge/"),t=parseInt(l.substring(e+5,l.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0}},1080:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return g});var i=n("3742"),o=n("6a89"),r=function(){function e(e,t,n,i,o){this.languageIdentifier=e,this.open=t,this.close=n,this.forwardRegex=i,this.reversedRegex=o}return e}(),s=function(){function e(e,t){var n=this;this.brackets=t.map(function(t){return new r(e,t[0],t[1],u({open:t[0],close:t[1]}),l({open:t[0],close:t[1]}))}),this.forwardRegex=c(this.brackets),this.reversedRegex=d(this.brackets),this.textIsBracket={},this.textIsOpenBracket={};var i=0;this.brackets.forEach(function(e){n.textIsBracket[e.open.toLowerCase()]=e,n.textIsBracket[e.close.toLowerCase()]=e,n.textIsOpenBracket[e.open.toLowerCase()]=!0,n.textIsOpenBracket[e.close.toLowerCase()]=!1,i=Math.max(i,e.open.length),i=Math.max(i,e.close.length)}),this.maxBracketLength=i}return e}();function a(e,t){var n={};return function(i){var o=e(i);return n.hasOwnProperty(o)||(n[o]=t(i)),n[o]}}var u=a(function(e){return e.open+";"+e.close},function(e){return p([e.open,e.close])}),l=a(function(e){return e.open+";"+e.close},function(e){return p([f(e.open),f(e.close)])}),c=a(function(e){return e.map(function(e){return e.open+";"+e.close}).join(";")},function(e){var t=[];return e.forEach(function(e){t.push(e.open),t.push(e.close)}),p(t)}),d=a(function(e){return e.map(function(e){return e.open+";"+e.close}).join(";")},function(e){var t=[];return e.forEach(function(e){t.push(f(e.open)),t.push(f(e.close))}),p(t)});function h(e){var t=/^[\w]+$/.test(e);return e=i["p"](e),t?"\\b"+e+"\\b":e}function p(e){var t="("+e.map(h).join(")|(")+")";return i["k"](t,!0)}var f=function(){function e(e){for(var t="",n=e.length-1;n>=0;n--)t+=e.charAt(n);return t}var t=null,n=null;return function(i){return t!==i&&(t=i,n=e(t)),n}}(),g=function(){function e(){}return e._findPrevBracketInText=function(e,t,n,i){var r=n.match(e);if(!r)return null;var s=n.length-(r.index||0),a=r[0].length,u=i+s;return new o["a"](t,u-a+1,t,u+1)},e.findPrevBracketInToken=function(e,t,n,i,o){var r=f(n),s=r.substring(n.length-o,n.length-i);return this._findPrevBracketInText(e,t,s,i)},e.findNextBracketInText=function(e,t,n,i){var r=n.match(e);if(!r)return null;var s=r.index||0,a=r[0].length;if(0===a)return null;var u=i+s;return new o["a"](t,u+1,t,u+1+a)},e.findNextBracketInToken=function(e,t,n,i,o){var r=n.substring(i,o);return this.findNextBracketInText(e,t,r,i)},e}()},"10f4":function(e,t,n){},1165:function(e,t,n){"use strict";n.d(t,"a",function(){return l}),n.d(t,"b",function(){return c});var i,o,r=n("6d8e"),s=n("82c9"),a=n("0a0f"),u=n("4035"),l=Object(a["c"])("contextService");(function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id&&Array.isArray(e.folders)}e.isIWorkspace=t})(i||(i={})),function(e){function t(e){return e&&"object"===typeof e&&r["a"].isUri(e.uri)&&"string"===typeof e.name&&"function"===typeof e.toResource}e.isIWorkspaceFolder=t}(o||(o={}));(function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=null),this._id=e,this._configuration=n,this._foldersMap=u["c"].forPaths(),this.folders=t}Object.defineProperty(e.prototype,"folders",{get:function(){return this._folders},set:function(e){this._folders=e,this.updateFoldersMap()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configuration},set:function(e){this._configuration=e},enumerable:!0,configurable:!0}),e.prototype.getFolder=function(e){return e&&this._foldersMap.findSubstr(e.with({scheme:e.scheme,authority:e.authority,path:e.path}).toString())||null},e.prototype.updateFoldersMap=function(){this._foldersMap=u["c"].forPaths();for(var e=0,t=this.folders;e=0){if(r=s+o,(0===s||32===n.charCodeAt(s-1))&&32===n.charCodeAt(r))return this._lastStart=s,void(this._lastEnd=r+1);if(s>0&&32===n.charCodeAt(s-1)&&r===i)return this._lastStart=s-1,void(this._lastEnd=r);if(0===s&&r===i)return this._lastStart=0,void(this._lastEnd=r)}this._lastStart=-1}else this._lastStart=-1}else this._lastStart=-1},e.prototype.hasClass=function(e,t){return this._findClassName(e,t),-1!==this._lastStart},e.prototype.addClasses=function(e){for(var t=this,n=[],i=1;i0){t.sort(j.sort);var o=t.shift();o.execute()}i=!1};R=function(t,i){void 0===i&&(i=0);var r=new j(t,i);return e.push(r),n||(n=!0,F(o)),r},P=function(e,n){if(i){var o=new j(e,n);return t.push(o),o}return R(e,n)}})();var W=16,V=function(e,t){return t},B=function(e){function t(t,n,i,o,r){void 0===o&&(o=V),void 0===r&&(r=W);var s=e.call(this)||this,u=null,l=0,c=s._register(new a["e"]),d=function(){l=(new Date).getTime(),i(u),u=null};return s._register(k(t,n,function(e){u=o(u,e);var t=(new Date).getTime()-l;t>=r?(c.cancel(),d()):c.setIfNotSet(d,r-t)})),s}return f(t,e),t}(c["a"]);function H(e,t,n,i,o){return new B(e,t,n,i,o)}function z(e){return document.defaultView.getComputedStyle(e,null)}var U=function(){function e(){}return e.convertToPixels=function(e,t){return parseFloat(t)||0},e.getDimension=function(t,n,i){var o=z(t),r="0";return o&&(r=o.getPropertyValue?o.getPropertyValue(n):o.getAttribute(i)),e.convertToPixels(t,r)},e.getBorderLeftWidth=function(t){return e.getDimension(t,"border-left-width","borderLeftWidth")},e.getBorderRightWidth=function(t){return e.getDimension(t,"border-right-width","borderRightWidth")},e.getBorderTopWidth=function(t){return e.getDimension(t,"border-top-width","borderTopWidth")},e.getBorderBottomWidth=function(t){return e.getDimension(t,"border-bottom-width","borderBottomWidth")},e.getPaddingLeft=function(t){return e.getDimension(t,"padding-left","paddingLeft")},e.getPaddingRight=function(t){return e.getDimension(t,"padding-right","paddingRight")},e.getPaddingTop=function(t){return e.getDimension(t,"padding-top","paddingTop")},e.getPaddingBottom=function(t){return e.getDimension(t,"padding-bottom","paddingBottom")},e.getMarginLeft=function(t){return e.getDimension(t,"margin-left","marginLeft")},e.getMarginTop=function(t){return e.getDimension(t,"margin-top","marginTop")},e.getMarginRight=function(t){return e.getDimension(t,"margin-right","marginRight")},e.getMarginBottom=function(t){return e.getDimension(t,"margin-bottom","marginBottom")},e}(),K=function(){function e(e,t){this.width=e,this.height=t}return e}();function q(e){var t=e.offsetParent,n=e.offsetTop,i=e.offsetLeft;while(null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement){n-=e.scrollTop;var o=z(e);o&&(i-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(i+=U.getBorderLeftWidth(e),n+=U.getBorderTopWidth(e),n+=e.offsetTop,i+=e.offsetLeft,t=e.offsetParent)}return{left:i,top:n}}function G(e){var t=e.getBoundingClientRect();return{left:t.left+Z.scrollX,top:t.top+Z.scrollY,width:t.width,height:t.height}}var Z=new(function(){function e(){}return Object.defineProperty(e.prototype,"scrollX",{get:function(){return"number"===typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollY",{get:function(){return"number"===typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop},enumerable:!0,configurable:!0}),e}());function Y(e){var t=U.getMarginLeft(e)+U.getMarginRight(e);return e.offsetWidth+t}function X(e){var t=U.getBorderLeftWidth(e)+U.getBorderRightWidth(e),n=U.getPaddingLeft(e)+U.getPaddingRight(e);return e.offsetWidth-t-n}function $(e){var t=U.getBorderTopWidth(e)+U.getBorderBottomWidth(e),n=U.getPaddingTop(e)+U.getPaddingBottom(e);return e.offsetHeight-t-n}function Q(e){var t=U.getMarginTop(e)+U.getMarginBottom(e);return e.offsetHeight+t}function J(e,t){while(e){if(e===t)return!0;e=e.parentNode}return!1}function ee(e,t,n){while(e){if(C(e,t))return e;if(n)if("string"===typeof n){if(C(e,n))return null}else if(e===n)return null;e=e.parentNode}return null}function te(e){void 0===e&&(e=document.getElementsByTagName("head")[0]);var t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}var ne=null;function ie(){return ne||(ne=te()),ne}function oe(e){return e&&e.sheet&&e.sheet.rules?e.sheet.rules:e&&e.sheet&&e.sheet.cssRules?e.sheet.cssRules:[]}function re(e,t,n){void 0===n&&(n=ie()),n&&t&&n.sheet.insertRule(e+"{"+t+"}",0)}function se(e,t){if(void 0===t&&(t=ie()),t){for(var n=oe(t),i=[],o=0;o=0;o--)t.sheet.deleteRule(i[o])}}function ae(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:e&&"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName}var ue={CLICK:"click",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",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:i["m"]?"webkitAnimationStart":"animationstart",ANIMATION_END:i["m"]?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:i["m"]?"webkitAnimationIteration":"animationiteration"},le={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function ce(e){for(var t=[],n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)t[n]=e.scrollTop,e=e.parentNode;return t}function de(e,t){for(var n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)e.scrollTop!==t[n]&&(e.scrollTop=t[n]),e=e.parentNode}var he=function(e){function t(t){var n=e.call(this)||this;n._onDidFocus=n._register(new l["a"]),n.onDidFocus=n._onDidFocus.event,n._onDidBlur=n._register(new l["a"]),n.onDidBlur=n._onDidBlur.event;var i=J(document.activeElement,t),r=!1,s=function(){r=!1,i||(i=!0,n._onDidFocus.fire())},a=function(){i&&(r=!0,window.setTimeout(function(){r&&(r=!1,i=!1,n._onDidBlur.fire())},0))};return n._register(Object(o["a"])(t,ue.FOCUS,!0)(s)),n._register(Object(o["a"])(t,ue.BLUR,!0)(a)),n}return f(t,e),t}(c["a"]);function pe(e){return new he(e)}function fe(e){for(var t=[],n=1;n_)n._setDesiredScrollPositionNow(r.getScrollPosition());else{var a=n._sliderMousePosition(e),u=a-i;n._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))}},function(){n.slider.toggleClassName("active",!1),n._host.onDragEnd(),t()}),this._host.onDragStart()},t.prototype._setDesiredScrollPositionNow=function(e){var t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)},t}(u["a"]),y=20,w=function(){function e(e,t,n){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=0,this._scrollSize=0,this._scrollPosition=0,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}return e.prototype.clone=function(){var t=new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize);return t.setVisibleSize(this._visibleSize),t.setScrollSize(this._scrollSize),t.setScrollPosition(this._scrollPosition),t},e.prototype.setVisibleSize=function(e){var t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollSize=function(e){var t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollPosition=function(e){var t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)},e._computeValues=function(e,t,n,i,o){var r=Math.max(0,n-e),s=Math.max(0,r-2*t),a=i>0&&i>n;if(!a)return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(s),computedSliderRatio:0,computedSliderPosition:0};var u=Math.round(Math.max(y,Math.floor(n*s/i))),l=(s-u)/(i-n),c=o*l;return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:l,computedSliderPosition:Math.round(c)}},e.prototype._refreshComputedValues=function(){var t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition},e.prototype.getArrowSize=function(){return this._arrowSize},e.prototype.getScrollPosition=function(){return this._scrollPosition},e.prototype.getRectangleLargeSize=function(){return this._computedAvailableSize},e.prototype.getRectangleSmallSize=function(){return this._scrollbarSize},e.prototype.isNeeded=function(){return this._computedIsNeeded},e.prototype.getSliderSize=function(){return this._computedSliderSize},e.prototype.getSliderPosition=function(){return this._computedSliderPosition},e.prototype.getDesiredScrollPositionFromOffset=function(e){if(!this._computedIsNeeded)return 0;var t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)},e.prototype.getDesiredScrollPositionFromDelta=function(e){if(!this._computedIsNeeded)return 0;var t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)},e}(),C=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),S=function(e){function t(t,n,i){var o=e.call(this,{lazyRender:n.lazyRender,host:i,scrollbarState:new w(n.horizontalHasArrows?n.arrowSize:0,2===n.horizontal?0:n.horizontalScrollbarSize,2===n.vertical?0:n.verticalScrollbarSize),visibility:n.horizontal,extraScrollbarClassName:"horizontal",scrollable:t})||this;if(n.horizontalHasArrows){var r=(n.arrowSize-d)/2,a=(n.horizontalScrollbarSize-d)/2;o._createArrow({className:"left-arrow",top:a,left:r,bottom:void 0,right:void 0,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return o._host.onMouseWheel(new s["c"](null,1,0))}}),o._createArrow({className:"right-arrow",top:a,left:void 0,bottom:void 0,right:r,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return o._host.onMouseWheel(new s["c"](null,-1,0))}})}return o._createSlider(Math.floor((n.horizontalScrollbarSize-n.horizontalSliderSize)/2),0,void 0,n.horizontalSliderSize),o}return C(t,e),t.prototype._updateSlider=function(e,t){this.slider.setWidth(e),this.slider.setLeft(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)},t.prototype.onDidScroll=function(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},t.prototype._mouseDownRelativePosition=function(e,t){return e},t.prototype._sliderMousePosition=function(e){return e.posx},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posy},t.prototype.writeScrollPosition=function(e,t){e.scrollLeft=t},t}(b),L=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),O=function(e){function t(t,n,i){var o=e.call(this,{lazyRender:n.lazyRender,host:i,scrollbarState:new w(n.verticalHasArrows?n.arrowSize:0,2===n.vertical?0:n.verticalScrollbarSize,0),visibility:n.vertical,extraScrollbarClassName:"vertical",scrollable:t})||this;if(n.verticalHasArrows){var r=(n.arrowSize-d)/2,a=(n.verticalScrollbarSize-d)/2;o._createArrow({className:"up-arrow",top:r,left:a,bottom:void 0,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return o._host.onMouseWheel(new s["c"](null,0,1))}}),o._createArrow({className:"down-arrow",top:void 0,left:a,bottom:r,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return o._host.onMouseWheel(new s["c"](null,0,-1))}})}return o._createSlider(0,Math.floor((n.verticalScrollbarSize-n.verticalSliderSize)/2),n.verticalSliderSize,void 0),o}return L(t,e),t.prototype._updateSlider=function(e,t){this.slider.setHeight(e),this.slider.setTop(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)},t.prototype.onDidScroll=function(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},t.prototype._mouseDownRelativePosition=function(e,t){return t},t.prototype._sliderMousePosition=function(e){return e.posy},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posx},t.prototype.writeScrollPosition=function(e,t){e.scrollTop=t},t}(b),x=n("308f"),N=n("42e3");n.d(t,"b",function(){return R}),n.d(t,"c",function(){return A}),n.d(t,"a",function(){return F});var D=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),k=500,I=50,E=!0,M=function(){function e(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}return e}(),T=function(){function e(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}return e.prototype.isPhysicalMouseWheel=function(){if(-1===this._front&&-1===this._rear)return!1;var e=1,t=0,n=1,i=this._rear;do{var o=i===this._front?e:Math.pow(2,-n);if(e-=o,t+=this._memory[i].score*o,i===this._front)break;i=(this._capacity+i-1)%this._capacity,n++}while(1);return t<=.5},e.prototype.accept=function(e,t,n){var i=new M(e,t,n);i.score=this._computeScore(i),-1===this._front&&-1===this._rear?(this._memory[0]=i,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i)},e.prototype._computeScore=function(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;var t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return(Math.abs(e.deltaX-Math.round(e.deltaX))>0||Math.abs(e.deltaY-Math.round(e.deltaY))>0)&&(t+=.25),Math.min(Math.max(t,0),1)},e.INSTANCE=new e,e}(),P=function(e){function t(t,n,i){var o=e.call(this)||this;o._onScroll=o._register(new x["a"]),o.onScroll=o._onScroll.event,t.style.overflow="hidden",o._options=j(n),o._scrollable=i,o._register(o._scrollable.onScroll(function(e){o._onDidScroll(e),o._onScroll.fire(e)}));var s={onMouseWheel:function(e){return o._onMouseWheel(e)},onDragStart:function(){return o._onDragStart()},onDragEnd:function(){return o._onDragEnd()}};return o._verticalScrollbar=o._register(new O(o._scrollable,o._options,s)),o._horizontalScrollbar=o._register(new S(o._scrollable,o._options,s)),o._domNode=document.createElement("div"),o._domNode.className="monaco-scrollable-element "+o._options.className,o._domNode.setAttribute("role","presentation"),o._domNode.style.position="relative",o._domNode.style.overflow="hidden",o._domNode.appendChild(t),o._domNode.appendChild(o._horizontalScrollbar.domNode.domNode),o._domNode.appendChild(o._verticalScrollbar.domNode.domNode),o._options.useShadows?(o._leftShadowDomNode=Object(r["b"])(document.createElement("div")),o._leftShadowDomNode.setClassName("shadow"),o._domNode.appendChild(o._leftShadowDomNode.domNode),o._topShadowDomNode=Object(r["b"])(document.createElement("div")),o._topShadowDomNode.setClassName("shadow"),o._domNode.appendChild(o._topShadowDomNode.domNode),o._topLeftShadowDomNode=Object(r["b"])(document.createElement("div")),o._topLeftShadowDomNode.setClassName("shadow top-left-corner"),o._domNode.appendChild(o._topLeftShadowDomNode.domNode)):(o._leftShadowDomNode=null,o._topShadowDomNode=null,o._topLeftShadowDomNode=null),o._listenOnDomNode=o._options.listenOnDomNode||o._domNode,o._mouseWheelToDispose=[],o._setListeningToMouseWheel(o._options.handleMouseWheel),o.onmouseover(o._listenOnDomNode,function(e){return o._onMouseOver(e)}),o.onnonbubblingmouseout(o._listenOnDomNode,function(e){return o._onMouseOut(e)}),o._hideTimeout=o._register(new l["e"]),o._isDragging=!1,o._mouseIsOver=!1,o._shouldRender=!0,o._revealOnScroll=!0,o}return D(t,e),t.prototype.dispose=function(){this._mouseWheelToDispose=Object(p["f"])(this._mouseWheelToDispose),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getOverviewRulerLayoutInfo=function(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this._verticalScrollbar.delegateMouseDown(e)},t.prototype.getScrollDimensions=function(){return this._scrollable.getScrollDimensions()},t.prototype.setScrollDimensions=function(e){this._scrollable.setScrollDimensions(e)},t.prototype.updateClassName=function(e){this._options.className=e,m["d"]&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className},t.prototype.updateOptions=function(e){var t=j(e);this._options.handleMouseWheel=t.handleMouseWheel,this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity,this._options.fastScrollSensitivity=t.fastScrollSensitivity,this._setListeningToMouseWheel(this._options.handleMouseWheel),this._options.lazyRender||this._render()},t.prototype._setListeningToMouseWheel=function(e){var t=this,n=this._mouseWheelToDispose.length>0;if(n!==e&&(this._mouseWheelToDispose=Object(p["f"])(this._mouseWheelToDispose),e)){var r=function(e){t._onMouseWheel(new s["c"](e))};this._mouseWheelToDispose.push(o["h"](this._listenOnDomNode,i["g"]?"mousewheel":"wheel",r))}},t.prototype._onMouseWheel=function(e){var t,n=T.INSTANCE;if(E&&n.accept(Date.now(),e.deltaX,e.deltaY),e.deltaY||e.deltaX){var i=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.flipAxes&&(t=[o,i],i=t[0],o=t[1]);var r=!m["d"]&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!r||o||(o=i,i=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,i*=this._options.fastScrollSensitivity);var s=this._scrollable.getFutureScrollPosition(),a={};if(i){var u=s.scrollTop-I*i;this._verticalScrollbar.writeScrollPosition(a,u)}if(o){var l=s.scrollLeft-I*o;this._horizontalScrollbar.writeScrollPosition(a,l)}if(a=this._scrollable.validateScrollPosition(a),s.scrollLeft!==a.scrollLeft||s.scrollTop!==a.scrollTop){var c=E&&this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel();c?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),this._shouldRender=!0}}(this._options.alwaysConsumeMouseWheel||this._shouldRender)&&(e.preventDefault(),e.stopPropagation())},t.prototype._onDidScroll=function(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()},t.prototype.renderNow=function(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()},t.prototype._render=function(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){var e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0;this._leftShadowDomNode.setClassName("shadow"+(n?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(n?" left":""))}},t.prototype._onDragStart=function(){this._isDragging=!0,this._reveal()},t.prototype._onDragEnd=function(){this._isDragging=!1,this._hide()},t.prototype._onMouseOut=function(e){this._mouseIsOver=!1,this._hide()},t.prototype._onMouseOver=function(e){this._mouseIsOver=!0,this._reveal()},t.prototype._reveal=function(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()},t.prototype._hide=function(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())},t.prototype._scheduleHide=function(){var e=this;this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(function(){return e._hide()},k)},t}(u["a"]),R=function(e){function t(t,n){var i=this;n=n||{},n.mouseWheelSmoothScroll=!1;var r=new N["a"](0,function(e){return o["P"](e)});return i=e.call(this,t,n,r)||this,i._register(r),i}return D(t,e),t.prototype.setScrollPosition=function(e){this._scrollable.setScrollPositionNow(e)},t.prototype.getScrollPosition=function(){return this._scrollable.getCurrentScrollPosition()},t}(P),A=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return D(t,e),t}(P),F=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i._element=t,i.onScroll(function(e){e.scrollTopChanged&&(i._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(i._element.scrollLeft=e.scrollLeft)}),i.scanDomNode(),i}return D(t,e),t.prototype.scanDomNode=function(){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})},t}(R);function j(e){var t={lazyRender:"undefined"!==typeof e.lazyRender&&e.lazyRender,className:"undefined"!==typeof e.className?e.className:"",useShadows:"undefined"===typeof e.useShadows||e.useShadows,handleMouseWheel:"undefined"===typeof e.handleMouseWheel||e.handleMouseWheel,flipAxes:"undefined"!==typeof e.flipAxes&&e.flipAxes,alwaysConsumeMouseWheel:"undefined"!==typeof e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:"undefined"!==typeof e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:"undefined"!==typeof e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:"undefined"!==typeof e.fastScrollSensitivity?e.fastScrollSensitivity:5,mouseWheelSmoothScroll:"undefined"===typeof e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:"undefined"!==typeof e.arrowSize?e.arrowSize:11,listenOnDomNode:"undefined"!==typeof e.listenOnDomNode?e.listenOnDomNode:null,horizontal:"undefined"!==typeof e.horizontal?e.horizontal:1,horizontalScrollbarSize:"undefined"!==typeof e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:"undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:"undefined"!==typeof e.horizontalHasArrows&&e.horizontalHasArrows,vertical:"undefined"!==typeof e.vertical?e.vertical:1,verticalScrollbarSize:"undefined"!==typeof e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:"undefined"!==typeof e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:"undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:0};return t.horizontalSliderSize="undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize="undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,m["d"]&&(t.className+=" mac"),t}},"191f":function(e,t,n){"use strict";var i=n("fdcc"),o=n("3742"),r=n("2c29"),s=n("ccde"),a=n("6a89"),u=n("8025"),l=function(){function e(e,t,n){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=n}return e.prototype.getEditOperations=function(e,t){t.addTrackedEditOperation(new a["a"](this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new a["a"](this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations(),i=n[0].range,o=n[1].range;return new u["a"](i.endLineNumber,i.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)},e}(),c=n("2e5d"),d=n("e6ff"),h=n("2837"),p=n("70cb");n.d(t,"a",function(){return g}),n.d(t,"b",function(){return m});var f=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),g=function(){function e(){}return e.indent=function(e,t,n){if(null===t||null===n)return[];for(var i=[],o=0,r=n.length;o1){var l=void 0;for(l=i-1;l>=1;l--){var c=n.getLineContent(l),d=o["A"](c);if(d>=0)break}if(l<1)return null;var f=n.getLineMaxColumn(l),g=p["a"].getEnterAction(n,new a["a"](l,f,l,f));g&&(s=g.indentation,r=g.enterAction,r&&(s+=r.appendText))}return r&&(r===h["a"].Indent&&(s=e.shiftIndent(t,s)),r===h["a"].Outdent&&(s=e.unshiftIndent(t,s)),s=t.normalizeIndentation(s)),s||null},e._replaceJumpToNextIndent=function(e,t,n,i){var o="",s=n.getStartPosition();if(e.insertSpaces)for(var a=c["a"].visibleColumnFromColumn2(e,t,s),u=e.indentSize,l=u-a%u,d=0;d=0?s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,k+1)):s.setEndPosition(s.endLineNumber,n.getLineMaxColumn(s.endLineNumber)),i)return new r["d"](s,N+t.normalizeIndentation(C.afterEnter),!0);var I=0;return x<=k+1&&(t.insertSpaces||(O=Math.ceil(O/t.indentSize)),I=Math.min(O+1-t.normalizeIndentation(C.afterEnter).length-1,0)),new r["c"](s,N+t.normalizeIndentation(C.afterEnter),0,I,!0)}return e._typeCommand(s,"\n"+t.normalizeIndentation(L),i)},e._isAutoIndentType=function(e,t,n){if(!e.autoIndent)return!1;for(var i=0,o=n.length;ir.open.length){for(var c=!0,d=0,h=n;dv.column-1){var b=_.charAt(v.column-1),y=e._isBeforeClosingBrace(t,l,b);if(!y&&!h(b))return null}if(!n.isCheapToTokenize(v.lineNumber))return null;if(1===l.open.length&&a&&"always"!==u){var w=Object(d["a"])(t.wordSeparators);if(s&&v.column>1&&0===w.get(_.charCodeAt(v.column-2)))return null;if(!s&&v.column>2&&0===w.get(_.charCodeAt(v.column-3)))return null}n.forceTokenization(v.lineNumber);var C=n.getLineTokens(v.lineNumber),S=!1;try{S=p["a"].shouldAutoClosePair(l,C,s?v.column:v.column-1)}catch(L){Object(i["e"])(L)}if(!S)return null}return l},e._runAutoClosingOpenCharType=function(e,t,n,i,o,r,s){for(var a=[],u=0,l=i.length;u=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},_=function(e,t){return function(n,i){t(n,i,e)}},b=function(){function e(e,t){this.decorationIds=[],this.editor=e,this.editorWorkerService=t}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.dispose=function(){},e.prototype.getId=function(){return e.ID},e.prototype.run=function(t,n){var i=this;this.currentRequest&&this.currentRequest.cancel();var s=this.editor.getSelection(),a=this.editor.getModel();if(a&&s){var u=s;if(u.startLineNumber===u.endLineNumber){var d=new c["a"](this.editor,5),h=a.uri;return this.editorWorkerService.canNavigateValueSet(h)?(this.currentRequest=Object(f["f"])(function(e){return i.editorWorkerService.navigateValueSet(h,u,n)}),this.currentRequest.then(function(n){if(n&&n.range&&n.value&&d.validate(i.editor)){var s=o["a"].lift(n.range),a=n.range,c=n.value.length-(u.endColumn-u.startColumn);a={startLineNumber:a.startLineNumber,startColumn:a.startColumn,endLineNumber:a.endLineNumber,endColumn:a.startColumn+n.value.length},c>1&&(u=new r["a"](u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn+c-1));var h=new l(s,u,n.value);i.editor.pushUndoStop(),i.editor.executeCommand(t,h),i.editor.pushUndoStop(),i.decorationIds=i.editor.deltaDecorations(i.decorationIds,[{range:a,options:e.DECORATION}]),i.decorationRemover&&i.decorationRemover.cancel(),i.decorationRemover=Object(f["l"])(350),i.decorationRemover.then(function(){return i.decorationIds=i.editor.deltaDecorations(i.decorationIds,[])}).catch(g["e"])}}).catch(g["e"])):Promise.resolve(void 0)}}},e.ID="editor.contrib.inPlaceReplaceController",e.DECORATION=p["a"].register({className:"valueSetReplacement"}),e=v([_(1,u["a"])],e),e}(),y=function(e){function t(){return e.call(this,{id:"editor.action.inPlaceReplace.up",label:i["a"]("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:s["a"].writable,kbOpts:{kbExpr:s["a"].editorTextFocus,primary:3154,weight:100}})||this}return m(t,e),t.prototype.run=function(e,t){var n=b.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)},t}(a["b"]),w=function(e){function t(){return e.call(this,{id:"editor.action.inPlaceReplace.down",label:i["a"]("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:s["a"].writable,kbOpts:{kbExpr:s["a"].editorTextFocus,primary:3156,weight:100}})||this}return m(t,e),t.prototype.run=function(e,t){var n=b.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)},t}(a["b"]);Object(a["h"])(b),Object(a["f"])(y),Object(a["f"])(w),Object(d["f"])(function(e,t){var n=e.getColor(h["d"]);n&&t.addRule(".monaco-editor.vs .valueSetReplacement { outline: solid 2px "+n+"; }")})},"1b0e":function(e,t,n){"use strict";var i=function(){function e(e,t,n,i){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=i}return e.prototype.getOriginalEnd=function(){return this.originalStart+this.originalLength},e.prototype.getModifiedEnd=function(){return this.modifiedStart+this.modifiedLength},e}();function o(e){return{getLength:function(){return e.length},getElementAtIndex:function(t){return e.charCodeAt(t)}}}function r(e,t,n){return new c(o(e),o(t)).ComputeDiff(n)}n.d(t,"b",function(){return r}),n.d(t,"a",function(){return c});var s=function(){function e(){}return e.Assert=function(e,t){if(!e)throw new Error(t)},e}(),a=function(){function e(){}return e.Copy=function(e,t,n,i,o){for(var r=0;r0||this.m_modifiedCount>0)&&this.m_changes.push(new i(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),c=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,i,o){var r=[!1],s=this.ComputeDiffRecursive(e,t,n,i,r);return o?this.PrettifyChanges(s):s},e.prototype.ComputeDiffRecursive=function(e,t,n,o,r){r[0]=!1;while(e<=t&&n<=o&&this.ElementsAreEqual(e,n))e++,n++;while(t>=e&&o>=n&&this.ElementsAreEqual(t,o))t--,o--;if(e>t||n>o){var a=void 0;return n<=o?(s.Assert(e===t+1,"originalStart should only be one more than originalEnd"),a=[new i(e,0,n,o-n+1)]):e<=t?(s.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),a=[new i(e,t-e+1,n,0)]):(s.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s.Assert(n===o+1,"modifiedStart should only be one more than modifiedEnd"),a=[]),a}var u=[0],l=[0],c=this.ComputeRecursionPoint(e,t,n,o,u,l,r),d=u[0],h=l[0];if(null!==c)return c;if(!r[0]){var p=this.ComputeDiffRecursive(e,d,n,h,r),f=[];return f=r[0]?[new i(d+1,t-(d+1)+1,h+1,o-(h+1)+1)]:this.ComputeDiffRecursive(d+1,t,h+1,o,r),this.ConcatenateChanges(p,f)}return[new i(e,t-e+1,n,o-n+1)]},e.prototype.WALKTRACE=function(e,t,n,o,r,s,a,u,c,d,h,p,f,g,m,v,_,b){var y,w=null,C=null,S=new l,L=t,O=n,x=f[0]-v[0]-o,N=Number.MIN_VALUE,D=this.m_forwardHistory.length-1;do{y=x+e,y===L||y=0&&(c=this.m_forwardHistory[D],e=c[0],L=1,O=c.length-1)}while(--D>=-1);if(w=S.getReverseChanges(),b[0]){var k=f[0]+1,I=v[0]+1;if(null!==w&&w.length>0){var E=w[w.length-1];k=Math.max(k,E.getOriginalEnd()),I=Math.max(I,E.getModifiedEnd())}C=[new i(k,p-k+1,I,m-I+1)]}else{S=new l,L=s,O=a,x=f[0]-v[0]-u,N=Number.MAX_VALUE,D=_?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{y=x+r,y===L||y=d[y+1]?(h=d[y+1]-1,g=h-x-u,h>N&&S.MarkNextChange(),N=h+1,S.AddOriginalElement(h+1,g+1),x=y+1-r):(h=d[y-1],g=h-x-u,h>N&&S.MarkNextChange(),N=h,S.AddModifiedElement(h+1,g+1),x=y-1-r),D>=0&&(d=this.m_reverseHistory[D],r=d[0],L=1,O=d.length-1)}while(--D>=-1);C=S.getChanges()}return this.ConcatenateChanges(w,C)},e.prototype.ComputeRecursionPoint=function(e,t,n,o,r,s,l){var c,d=0,h=0,p=0,f=0,g=0,m=0;e--,n--,r[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var v,_,b=t-e+(o-n),y=b+1,w=new Array(y),C=new Array(y),S=o-n,L=t-e,O=e-n,x=t-o,N=L-S,D=N%2===0;for(w[S]=e,C[L]=t,l[0]=!1,c=1;c<=b/2+1;c++){var k=0,I=0;for(p=this.ClipDiagonalBound(S-c,c,S,y),f=this.ClipDiagonalBound(S+c,c,S,y),v=p;v<=f;v+=2){d=v===p||vk+I&&(k=d,I=h),!D&&Math.abs(v-L)<=c-1&&d>=C[v])return r[0]=d,s[0]=h,_<=C[v]&&u>0&&c<=u+1?this.WALKTRACE(S,p,f,O,L,g,m,x,w,C,d,t,r,h,o,s,D,l):null}var E=(k-e+(I-n)-c)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(k,this.OriginalSequence,E))return l[0]=!0,r[0]=k,s[0]=I,E>0&&u>0&&c<=u+1?this.WALKTRACE(S,p,f,O,L,g,m,x,w,C,d,t,r,h,o,s,D,l):(e++,n++,[new i(e,t-e+1,n,o-n+1)]);for(g=this.ClipDiagonalBound(L-c,c,L,y),m=this.ClipDiagonalBound(L+c,c,L,y),v=g;v<=m;v+=2){d=v===g||v=C[v+1]?C[v+1]-1:C[v-1],h=d-(v-L)-x,_=d;while(d>e&&h>n&&this.ElementsAreEqual(d,h))d--,h--;if(C[v]=d,D&&Math.abs(v-S)<=c&&d<=w[v])return r[0]=d,s[0]=h,_>=w[v]&&u>0&&c<=u+1?this.WALKTRACE(S,p,f,O,L,g,m,x,w,C,d,t,r,h,o,s,D,l):null}if(c<=u){var M=new Array(f-p+2);M[0]=S-p+1,a.Copy(w,p,M,1,f-p+1),this.m_forwardHistory.push(M),M=new Array(m-g+2),M[0]=L-g+1,a.Copy(C,g,M,1,m-g+1),this.m_reverseHistory.push(M)}}return this.WALKTRACE(S,p,f,O,L,g,m,x,w,C,d,t,r,h,o,s,D,l)},e.prototype.PrettifyChanges=function(e){for(var t=0;t0,s=n.modifiedLength>0;while(n.originalStart+n.originalLength=0;t--){n=e[t],i=0,o=0;if(t>0){var u=e[t-1];u.originalLength>0&&(i=u.originalStart+u.originalLength),u.modifiedLength>0&&(o=u.modifiedStart+u.modifiedLength)}r=n.originalLength>0,s=n.modifiedLength>0;for(var l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),d=1;;d++){var h=n.originalStart-d,p=n.modifiedStart-d;if(hc&&(c=f,l=d)}n.originalStart-=l,n.modifiedStart-=l}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"===typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,i){var o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(n,i)?1:0;return o+r},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var i=new Array(e.length+t.length-1);return a.Copy(e,0,i,0,e.length-1),i[e.length-1]=n[0],a.Copy(t,1,i,e.length,t.length-1),i}i=new Array(e.length+t.length);return a.Copy(e,0,i,0,e.length),a.Copy(t,0,i,e.length,t.length),i},e.prototype.ChangesOverlap=function(e,t,n){if(s.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),s.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){var o=e.originalStart,r=e.originalLength,a=e.modifiedStart,u=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(u=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new i(o,r,a,u),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,i){if(e>=0&&e.001){C=!1;break}}var N=!0;C&&y.width!==S&&(N=!1),y.width>b.width&&(N=!1);var D=i["b"]()>2e3;return new p["b"]({zoomLevel:i["c"](),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:C,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:N,spaceWidth:s.width,maxDigitWidth:w},D)},t.INSTANCE=new t,t}(r["a"]),_=function(e){function t(t,n,o,r){void 0===o&&(o=null);var s=e.call(this,t,n)||this;return s.accessibilityService=r,s._elementSizeObserver=s._register(new d(o,function(){return s._onReferenceDomElementSizeChanged()})),s._register(v.INSTANCE.onDidChange(function(){return s._onCSSBasedConfigurationChanged()})),s._validatedOptions.automaticLayout&&s._elementSizeObserver.startObserving(),s._register(i["o"](function(e){return s._recomputeOptions()})),s._register(s.accessibilityService.onDidChangeAccessibilitySupport(function(){return s._recomputeOptions()})),s._recomputeOptions(),s}return f(t,e),t.applyFontInfoSlow=function(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"},t.applyFontInfo=function(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)},t.prototype._onReferenceDomElementSizeChanged=function(){this._recomputeOptions()},t.prototype._onCSSBasedConfigurationChanged=function(){this._recomputeOptions()},t.prototype.observeReferenceElement=function(e){this._elementSizeObserver.observe(e)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getExtraEditorClassName=function(){var e="";return i["l"]||i["n"]||(e+="no-user-select "),s["d"]&&(e+="mac "),e},t.prototype._getEnvConfiguration=function(){return{extraEditorClassName:this._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:i["m"]||i["i"],pixelRatio:i["a"](),zoomLevel:i["c"](),accessibilitySupport:this.accessibilityService.getAccessibilitySupport()}},t.prototype.readConfiguration=function(e){return v.INSTANCE.readConfiguration(e)},t}(h["a"])},"1f26":function(e,t,n){},2504:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a});var i,o=n("308f"),r=Object.freeze(function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}});(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof s||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o["b"].None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r})})(i||(i={}));var s=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?r:(this._emitter||(this._emitter=new o["a"]),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),a=function(){function e(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new s),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof s&&this._token.cancel():this._token=i.Cancelled},e.prototype.dispose=function(){this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof s&&this._token.dispose():this._token=i.None},e}()},"258a":function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"f",function(){return s}),n.d(t,"a",function(){return a}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return l});var i,o=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r={done:!0,value:void 0};function s(e){return Array.isArray(e)?i.fromArray(e):e}(function(e){var t={next:function(){return r}};function n(){return t}function i(e){var t=!1;return{next:function(){return t?r:(t=!0,{done:!1,value:e})}}}function o(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.length),{next:function(){return t>=n?r:{done:!1,value:e[t++]}}}}function s(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()}function a(e,t){return{next:function(){var n=e.next();return n.done?r:{done:!1,value:t(n.value)}}}}function u(e,t){return{next:function(){while(1){var n=e.next();if(n.done)return r;if(t(n.value))return{done:!1,value:n.value}}}}}function l(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)}function c(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY);var n=[];if(0===t)return n;for(var i=0,o=e.next();!o.done;o=e.next())if(n.push(o.value),++i>=t)break;return n}function d(){for(var e=[],t=0;t=e.length)return r;var t=e[n],i=t.next();return i.done?(n++,this.next()):i}}}e.empty=n,e.single=i,e.fromArray=o,e.from=s,e.map=a,e.filter=u,e.forEach=l,e.collect=c,e.concat=d})(i||(i={}));var a=function(){function e(e,t,n,i){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===i&&(i=t-1),this.items=e,this.start=t,this.end=n,this.index=i}return e.prototype.first=function(){return this.index=this.start,this.current()},e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}(),u=function(e){function t(t,n,i,o){return void 0===n&&(n=0),void 0===i&&(i=t.length),void 0===o&&(o=n-1),e.call(this,t,n,i,o)||this}return o(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null},t}(a),l=function(){function e(e,t){this.iterator=e,this.fn=t}return e.prototype.next=function(){return this.fn(this.iterator.next())},e}()},"27e6":function(e,t,n){},2837:function(e,t,n){"use strict";var i;n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o}),function(e){e[e["None"]=0]="None",e[e["Indent"]=1]="Indent",e[e["IndentOutdent"]=2]="IndentOutdent",e[e["Outdent"]=3]="Outdent"}(i||(i={}));var o=function(){function e(e){if(this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(var t=0,n=e.notIn.length;t=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.changeValue=function(e,t){return e=Object(i["b"])(e),t=Object(i["b"])(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;var r=n.length-e;return t>=r&&(t=r),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},e.prototype.getAccumulatedValue=function(e){return e<0?0:(e=Object(i["b"])(e),this._getAccumulatedValue(e))},e.prototype._getAccumulatedValue=function(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];var t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(var 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]},e.prototype.getIndexOf=function(e){e=Math.floor(e),this.getTotalValue();var t=0,n=this.values.length-1,i=0,r=0,s=0;while(t<=n)if(i=t+(n-t)/2|0,r=this.prefixSum[i],s=r-this.values[i],e=r))break;t=i+1}return new o(i,e-s)},e}(),s=function(){function e(e){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new r(e),this._bustCache()}return e.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},e.prototype.insertValues=function(e,t){this._actual.insertValues(e,t)&&this._bustCache()},e.prototype.changeValue=function(e,t){this._actual.changeValue(e,t)&&this._bustCache()},e.prototype.removeValues=function(e,t){this._actual.removeValues(e,t)&&this._bustCache()},e.prototype.getTotalValue=function(){return this._actual.getTotalValue()},e.prototype.getAccumulatedValue=function(e){return this._actual.getAccumulatedValue(e)},e.prototype.getIndexOf=function(e){if(e=Math.floor(e),null!==this._cache){var t=e-this._cacheAccumulatedValueStart;if(t>=0&&t=i.length)&&o["x"](i.charCodeAt(n))},e.isHighSurrogate=function(e,t,n){var i=e.getLineContent(t);return!(n<0||n>=i.length)&&o["w"](i.charCodeAt(n))},e.isInsideSurrogatePair=function(e,t,n){return this.isHighSurrogate(e,t,n-2)},e.visibleColumnFromColumn=function(e,t,n){var i=e.length;i>t-1&&(i=t-1);for(var r=0,s=0;s=t){var l=t-r,c=u-t;return cs?s:o},e.nextRenderTabStop=function(e,t){return e+t-e%t},e.nextIndentTabStop=function(e,t){return e+t-e%t},e.prevRenderTabStop=function(e,t){return e-1-(e-1)%t},e.prevIndentTabStop=function(e,t){return e-1-(e-1)%t},e}();function C(e){return"'"===e||'"'===e||"`"===e}},"303e":function(e,t,n){"use strict";n.d(t,"a",function(){return l}),n.d(t,"Kb",function(){return h}),n.d(t,"T",function(){return p}),n.d(t,"R",function(){return f}),n.d(t,"S",function(){return g}),n.d(t,"e",function(){return m}),n.d(t,"b",function(){return v}),n.d(t,"Ub",function(){return _}),n.d(t,"Tb",function(){return b}),n.d(t,"Wb",function(){return y}),n.d(t,"W",function(){return w}),n.d(t,"Y",function(){return C}),n.d(t,"X",function(){return S}),n.d(t,"V",function(){return L}),n.d(t,"U",function(){return O}),n.d(t,"cb",function(){return x}),n.d(t,"eb",function(){return N}),n.d(t,"db",function(){return D}),n.d(t,"fb",function(){return k}),n.d(t,"hb",function(){return I}),n.d(t,"gb",function(){return E}),n.d(t,"Z",function(){return M}),n.d(t,"bb",function(){return T}),n.d(t,"ab",function(){return P}),n.d(t,"ob",function(){return F}),n.d(t,"pb",function(){return j}),n.d(t,"ib",function(){return W}),n.d(t,"jb",function(){return V}),n.d(t,"ub",function(){return B}),n.d(t,"vb",function(){return H}),n.d(t,"tb",function(){return z}),n.d(t,"rb",function(){return U}),n.d(t,"sb",function(){return K}),n.d(t,"kb",function(){return q}),n.d(t,"qb",function(){return G}),n.d(t,"lb",function(){return Z}),n.d(t,"nb",function(){return Y}),n.d(t,"mb",function(){return X}),n.d(t,"Vb",function(){return $}),n.d(t,"Ib",function(){return Q}),n.d(t,"Hb",function(){return J}),n.d(t,"c",function(){return ee}),n.d(t,"d",function(){return te}),n.d(t,"Lb",function(){return ne}),n.d(t,"Nb",function(){return ie}),n.d(t,"Ob",function(){return oe}),n.d(t,"Mb",function(){return re}),n.d(t,"Jb",function(){return se}),n.d(t,"xb",function(){return ae}),n.d(t,"yb",function(){return ue}),n.d(t,"wb",function(){return le}),n.d(t,"Bb",function(){return ce}),n.d(t,"zb",function(){return de}),n.d(t,"Ab",function(){return he}),n.d(t,"Cb",function(){return pe}),n.d(t,"q",function(){return fe}),n.d(t,"p",function(){return ge}),n.d(t,"M",function(){return me}),n.d(t,"L",function(){return ve}),n.d(t,"G",function(){return _e}),n.d(t,"F",function(){return be}),n.d(t,"z",function(){return ye}),n.d(t,"y",function(){return we}),n.d(t,"o",function(){return Ce}),n.d(t,"x",function(){return Se}),n.d(t,"N",function(){return Le}),n.d(t,"P",function(){return Oe}),n.d(t,"O",function(){return xe}),n.d(t,"Q",function(){return Ne}),n.d(t,"H",function(){return De}),n.d(t,"I",function(){return ke}),n.d(t,"E",function(){return Ie}),n.d(t,"J",function(){return Ee}),n.d(t,"K",function(){return Me}),n.d(t,"r",function(){return Te}),n.d(t,"t",function(){return Pe}),n.d(t,"v",function(){return Re}),n.d(t,"s",function(){return Ae}),n.d(t,"u",function(){return Fe}),n.d(t,"w",function(){return je}),n.d(t,"C",function(){return We}),n.d(t,"A",function(){return Ve}),n.d(t,"B",function(){return Be}),n.d(t,"D",function(){return He}),n.d(t,"n",function(){return ze}),n.d(t,"g",function(){return Ue}),n.d(t,"h",function(){return Ke}),n.d(t,"j",function(){return qe}),n.d(t,"l",function(){return Ge}),n.d(t,"k",function(){return Ze}),n.d(t,"m",function(){return Ye}),n.d(t,"i",function(){return Xe}),n.d(t,"Rb",function(){return $e}),n.d(t,"Sb",function(){return Qe}),n.d(t,"Pb",function(){return Je}),n.d(t,"Qb",function(){return et}),n.d(t,"Fb",function(){return tt}),n.d(t,"Gb",function(){return nt}),n.d(t,"Db",function(){return it}),n.d(t,"f",function(){return ot}),n.d(t,"Eb",function(){return at});var i=n("89cd"),o=n("ceb8"),r=n("308f"),s=n("dff7"),a=n("dd1b"),u=n("5fe7"),l={ColorContribution:"base.contributions.colors"},c=function(){function e(){this._onDidChangeSchema=new r["a"],this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}return e.prototype.registerColor=function(e,t,n,i,o){void 0===i&&(i=!1);var r={id:e,description:n,defaults:t,needsTransparency:i,deprecationMessage:o};this.colorsById[e]=r;var s={type:"string",description:n,format:"color-hex",default:"#ff0000"};return o&&(s.deprecationMessage=o),this.colorSchema.properties[e]=s,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e},e.prototype.resolveDefaultColor=function(e,t){var n=this.colorsById[e];if(n&&n.defaults){var i=n.defaults[t.type];return lt(i,t)}},e.prototype.getColorSchema=function(){return this.colorSchema},e.prototype.toString=function(){var e=this,t=function(e,t){var n=-1===e.indexOf(".")?0:1,i=-1===t.indexOf(".")?0:1;return n!==i?n-i:e.localeCompare(t)};return Object.keys(this.colorsById).sort(t).map(function(t){return"- `"+t+"`: "+e.colorsById[t].description}).join("\n")},e}(),d=new c;function h(e,t,n,i,o){return d.registerColor(e,t,n,i,o)}i["a"].add(l.ColorContribution,d);var p=h("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},s["a"]("foreground","Overall foreground color. This color is only used if not overridden by a component.")),f=h("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},s["a"]("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),g=h("focusBorder",{dark:o["a"].fromHex("#0E639C").transparent(.8),light:o["a"].fromHex("#007ACC").transparent(.4),hc:"#F38518"},s["a"]("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),m=h("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},s["a"]("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),v=h("contrastActiveBorder",{light:null,dark:null,hc:g},s["a"]("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),_=h("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},s["a"]("textLinkForeground","Foreground color for links in text.")),b=h("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:o["a"].black},s["a"]("textCodeBlockBackground","Background color for code blocks in text.")),y=h("widget.shadow",{dark:"#000000",light:"#A8A8A8",hc:null},s["a"]("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),w=h("input.background",{dark:"#3C3C3C",light:o["a"].white,hc:o["a"].black},s["a"]("inputBoxBackground","Input box background.")),C=h("input.foreground",{dark:p,light:p,hc:p},s["a"]("inputBoxForeground","Input box foreground.")),S=h("input.border",{dark:null,light:null,hc:m},s["a"]("inputBoxBorder","Input box border.")),L=h("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:m},s["a"]("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),O=h("inputOption.activeBackground",{dark:st(g,.5),light:st(g,.3),hc:null},s["a"]("inputOption.activeBackground","Background color of activated options in input fields.")),x=h("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:o["a"].black},s["a"]("inputValidationInfoBackground","Input validation background color for information severity.")),N=h("inputValidation.infoForeground",{dark:null,light:null,hc:null},s["a"]("inputValidationInfoForeground","Input validation foreground color for information severity.")),D=h("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:m},s["a"]("inputValidationInfoBorder","Input validation border color for information severity.")),k=h("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:o["a"].black},s["a"]("inputValidationWarningBackground","Input validation background color for warning severity.")),I=h("inputValidation.warningForeground",{dark:null,light:null,hc:null},s["a"]("inputValidationWarningForeground","Input validation foreground color for warning severity.")),E=h("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:m},s["a"]("inputValidationWarningBorder","Input validation border color for warning severity.")),M=h("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:o["a"].black},s["a"]("inputValidationErrorBackground","Input validation background color for error severity.")),T=h("inputValidation.errorForeground",{dark:null,light:null,hc:null},s["a"]("inputValidationErrorForeground","Input validation foreground color for error severity.")),P=h("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:m},s["a"]("inputValidationErrorBorder","Input validation border color for error severity.")),R=h("dropdown.background",{dark:"#3C3C3C",light:o["a"].white,hc:o["a"].black},s["a"]("dropdownBackground","Dropdown background.")),A=h("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:o["a"].white},s["a"]("dropdownForeground","Dropdown foreground.")),F=h("list.focusBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},s["a"]("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),j=h("list.focusForeground",{dark:null,light:null,hc:null},s["a"]("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),W=h("list.activeSelectionBackground",{dark:"#094771",light:"#0074E8",hc:null},s["a"]("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),V=h("list.activeSelectionForeground",{dark:o["a"].white,light:o["a"].white,hc:null},s["a"]("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),B=h("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},s["a"]("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),H=h("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},s["a"]("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),z=h("list.inactiveFocusBackground",{dark:null,light:null,hc:null},s["a"]("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),U=h("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},s["a"]("listHoverBackground","List/Tree background when hovering over items using the mouse.")),K=h("list.hoverForeground",{dark:null,light:null,hc:null},s["a"]("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),q=h("list.dropBackground",{dark:F,light:F,hc:null},s["a"]("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),G=h("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:g},s["a"]("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),Z=h("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:o["a"].black},s["a"]("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Y=h("listFilterWidget.outline",{dark:o["a"].transparent,light:o["a"].transparent,hc:"#f38518"},s["a"]("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),X=h("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:m},s["a"]("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),$=h("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},s["a"]("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Q=h("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:o["a"].white},s["a"]("pickerGroupForeground","Quick picker color for grouping labels.")),J=h("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:o["a"].white},s["a"]("pickerGroupBorder","Quick picker color for grouping borders.")),ee=h("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:o["a"].black},s["a"]("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),te=h("badge.foreground",{dark:o["a"].white,light:"#333",hc:o["a"].white},s["a"]("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),ne=h("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},s["a"]("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),ie=h("scrollbarSlider.background",{dark:o["a"].fromHex("#797979").transparent(.4),light:o["a"].fromHex("#646464").transparent(.4),hc:st(m,.6)},s["a"]("scrollbarSliderBackground","Scrollbar slider background color.")),oe=h("scrollbarSlider.hoverBackground",{dark:o["a"].fromHex("#646464").transparent(.7),light:o["a"].fromHex("#646464").transparent(.7),hc:st(m,.8)},s["a"]("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),re=h("scrollbarSlider.activeBackground",{dark:o["a"].fromHex("#BFBFBF").transparent(.4),light:o["a"].fromHex("#000000").transparent(.6),hc:m},s["a"]("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),se=h("progressBar.background",{dark:o["a"].fromHex("#0E70C0"),light:o["a"].fromHex("#0E70C0"),hc:m},s["a"]("progressBarBackground","Background color of the progress bar that can show for long running operations.")),ae=h("menu.border",{dark:null,light:null,hc:m},s["a"]("menuBorder","Border color of menus.")),ue=h("menu.foreground",{dark:A,light:p,hc:A},s["a"]("menuForeground","Foreground color of menu items.")),le=h("menu.background",{dark:R,light:R,hc:R},s["a"]("menuBackground","Background color of menu items.")),ce=h("menu.selectionForeground",{dark:V,light:V,hc:V},s["a"]("menuSelectionForeground","Foreground color of the selected menu item in menus.")),de=h("menu.selectionBackground",{dark:W,light:W,hc:W},s["a"]("menuSelectionBackground","Background color of the selected menu item in menus.")),he=h("menu.selectionBorder",{dark:null,light:null,hc:v},s["a"]("menuSelectionBorder","Border color of the selected menu item in menus.")),pe=h("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:m},s["a"]("menuSeparatorBackground","Color of a separator menu item in menus.")),fe=h("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},s["a"]("editorError.foreground","Foreground color of error squigglies in the editor.")),ge=h("editorError.border",{dark:null,light:null,hc:o["a"].fromHex("#E47777").transparent(.8)},s["a"]("errorBorder","Border color of error boxes in the editor.")),me=h("editorWarning.foreground",{dark:"#CCA700",light:"#E9A700",hc:null},s["a"]("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),ve=h("editorWarning.border",{dark:null,light:null,hc:o["a"].fromHex("#FFCC00").transparent(.8)},s["a"]("warningBorder","Border color of warning boxes in the editor.")),_e=h("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},s["a"]("editorInfo.foreground","Foreground color of info squigglies in the editor.")),be=h("editorInfo.border",{dark:null,light:null,hc:o["a"].fromHex("#75BEFF").transparent(.8)},s["a"]("infoBorder","Border color of info boxes in the editor.")),ye=h("editorHint.foreground",{dark:o["a"].fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},s["a"]("editorHint.foreground","Foreground color of hint squigglies in the editor.")),we=h("editorHint.border",{dark:null,light:null,hc:o["a"].fromHex("#eeeeee").transparent(.8)},s["a"]("hintBorder","Border color of hint boxes in the editor.")),Ce=h("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:o["a"].black},s["a"]("editorBackground","Editor background color.")),Se=h("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:o["a"].white},s["a"]("editorForeground","Editor default foreground color.")),Le=h("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},s["a"]("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Oe=h("editorWidget.foreground",{dark:p,light:p,hc:p},s["a"]("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),xe=h("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:m},s["a"]("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),Ne=h("editorWidget.resizeBorder",{light:null,dark:null,hc:null},s["a"]("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),De=h("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},s["a"]("editorSelectionBackground","Color of the editor selection.")),ke=h("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},s["a"]("editorSelectionForeground","Color of the selected text for high contrast.")),Ie=h("editor.inactiveSelectionBackground",{light:st(De,.5),dark:st(De,.5),hc:st(De,.5)},s["a"]("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Ee=h("editor.selectionHighlightBackground",{light:ut(De,Ce,.3,.6),dark:ut(De,Ce,.3,.6),hc:null},s["a"]("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),Me=h("editor.selectionHighlightBorder",{light:null,dark:null,hc:v},s["a"]("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),Te=h("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},s["a"]("editorFindMatch","Color of the current search match.")),Pe=h("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},s["a"]("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Re=h("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},s["a"]("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Ae=h("editor.findMatchBorder",{light:null,dark:null,hc:v},s["a"]("editorFindMatchBorder","Border color of the current search match.")),Fe=h("editor.findMatchHighlightBorder",{light:null,dark:null,hc:v},s["a"]("findMatchHighlightBorder","Border color of the other search matches.")),je=h("editor.findRangeHighlightBorder",{dark:null,light:null,hc:st(v,.4)},s["a"]("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),We=h("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},s["a"]("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Ve=h("editorHoverWidget.background",{light:Le,dark:Le,hc:Le},s["a"]("hoverBackground","Background color of the editor hover.")),Be=h("editorHoverWidget.border",{light:xe,dark:xe,hc:xe},s["a"]("hoverBorder","Border color of the editor hover.")),He=h("editorHoverWidget.statusBarBackground",{dark:rt(Ve,.2),light:ot(Ve,.05),hc:Le},s["a"]("statusBarBackground","Background color of the editor hover status bar.")),ze=h("editorLink.activeForeground",{dark:"#4E94CE",light:o["a"].blue,hc:o["a"].cyan},s["a"]("activeLinkForeground","Color of active links.")),Ue=new o["a"](new o["c"](155,185,85,.2)),Ke=new o["a"](new o["c"](255,0,0,.2)),qe=h("diffEditor.insertedTextBackground",{dark:Ue,light:Ue,hc:null},s["a"]("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Ge=h("diffEditor.removedTextBackground",{dark:Ke,light:Ke,hc:null},s["a"]("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Ze=h("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},s["a"]("diffEditorInsertedOutline","Outline color for the text that got inserted.")),Ye=h("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},s["a"]("diffEditorRemovedOutline","Outline color for text that got removed.")),Xe=h("diffEditor.border",{dark:null,light:null,hc:m},s["a"]("diffEditorBorder","Border color between the two text editors.")),$e=h("editor.snippetTabstopHighlightBackground",{dark:new o["a"](new o["c"](124,124,124,.3)),light:new o["a"](new o["c"](10,50,100,.2)),hc:new o["a"](new o["c"](124,124,124,.3))},s["a"]("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),Qe=h("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},s["a"]("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),Je=h("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},s["a"]("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),et=h("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new o["a"](new o["c"](10,50,100,.5)),hc:"#525252"},s["a"]("snippetFinalTabstopHighlightBorder","Highlight border color of the final stabstop of a snippet.")),tt=h("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},s["a"]("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),nt=h("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},s["a"]("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),it=h("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},s["a"]("minimapFindMatchHighlight","Minimap marker color for find matches."),!0);function ot(e,t){return function(n){var i=lt(e,n);if(i)return i.darken(t)}}function rt(e,t){return function(n){var i=lt(e,n);if(i)return i.lighten(t)}}function st(e,t){return function(n){var i=lt(e,n);if(i)return i.transparent(t)}}function at(){for(var e=[],t=0;t1)&&l.fire(e),u=0},n)})},onLastListenerRemove:function(){r.dispose()}});return l.event}function h(e){var i=(new Date).getTime();return n(t(e),function(e){return(new Date).getTime()-i})}function p(e){var t,n=!0;return o(e,function(e){var i=n||e!==t;return n=!1,t=e,i})}function f(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=[]);var i=n.slice(),o=e(function(e){i?i.push(e):s.fire(e)}),r=function(){i&&i.forEach(function(e){return s.fire(e)}),i=null},s=new d({onFirstListenerAdd:function(){o||(o=e(function(e){return s.fire(e)}))},onFirstListenerDidAdd:function(){i&&(t?setTimeout(r):r())},onLastListenerRemove:function(){o&&o.dispose(),o=null}});return s.event}e.None=function(){return s["a"].None},e.once=t,e.map=n,e.forEach=i,e.filter=o,e.signal=r,e.any=a,e.reduce=u,e.snapshot=l,e.debounce=c,e.stopwatch=h,e.latch=p,e.buffer=f;var g=function(){function e(e){this.event=e}return e.prototype.map=function(t){return new e(n(this.event,t))},e.prototype.forEach=function(t){return new e(i(this.event,t))},e.prototype.filter=function(t){return new e(o(this.event,t))},e.prototype.reduce=function(t,n){return new e(u(this.event,t,n))},e.prototype.latch=function(){return new e(p(this.event))},e.prototype.on=function(e,t,n){return this.event(e,t,n)},e.prototype.once=function(e,n,i){return t(this.event)(e,n,i)},e}();function m(e){return new g(e)}function v(e,t,n){void 0===n&&(n=function(e){return e});var i=function(){for(var e=[],t=0;t0?new c(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,i,o){t._listeners||(t._listeners=new a["a"]);var r=t._listeners.isEmpty();r&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var u,l,c=t._listeners.push(i?[n,i]:n);return r&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,i),t._leakageMon&&(u=t._leakageMon.check(t._listeners.size)),l={dispose:function(){if(u&&u(),l.dispose=e._noop,!t._disposed&&(c(),t._options&&t._options.onLastListenerRemove)){var n=t._listeners&&!t._listeners.isEmpty();n||t._options.onLastListenerRemove(t)}}},o instanceof s["b"]?o.add(l):Array.isArray(o)&&o.push(l),l}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new a["a"]);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);while(this._deliveryQueue.size>0){var i=this._deliveryQueue.shift(),r=i[0],s=i[1];try{"function"===typeof r?r.call(void 0,s):r[0].call(r[1],s)}catch(n){Object(o["e"])(n)}}}},e.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},e._noop=function(){},e}(),h=function(e){function t(t){var n=e.call(this,t)||this;return n._isPaused=0,n._eventQueue=new a["a"],n._mergeFn=t&&t.merge,n}return u(t,e),t.prototype.pause=function(){this._isPaused++},t.prototype.resume=function(){if(0!==this._isPaused&&0===--this._isPaused)if(this._mergeFn){var t=this._eventQueue.toArray();this._eventQueue.clear(),e.prototype.fire.call(this,this._mergeFn(t))}else while(!this._isPaused&&0!==this._eventQueue.size)e.prototype.fire.call(this,this._eventQueue.shift())},t.prototype.fire=function(t){this._listeners&&(0!==this._isPaused?this._eventQueue.push(t):e.prototype.fire.call(this,t))},t}(d),p=function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new d({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}return Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);var i=function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)};return Object(s["h"])(Object(r["a"])(i))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach(function(t){return e.hook(t)})},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach(function(t){return e.unhook(t)})},e.prototype.hook=function(e){var t=this;e.listener=e.event(function(e){return t.emitter.fire(e)})},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()},e}(),f=function(){function e(){this.buffers=[]}return e.prototype.wrapEvent=function(e){var t=this;return function(n,i,o){return e(function(e){var o=t.buffers[t.buffers.length-1];o?o.push(function(){return n.call(i,e)}):n.call(i,e)},void 0,o)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach(function(e){return e()}),n},e}(),g=function(){function e(){var e=this;this.listening=!1,this.inputEvent=i.None,this.inputEventListener=s["a"].None,this.emitter=new d({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},e}()},"30d5":function(e,t,n){},"30db":function(e,t,n){"use strict";(function(e,i){n.d(t,"g",function(){return m}),n.d(t,"d",function(){return v}),n.d(t,"c",function(){return _}),n.d(t,"e",function(){return b}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return C}),n.d(t,"h",function(){return L}),n.d(t,"a",function(){return O});var o="en",r=!1,s=!1,a=!1,u=!1,l=!1,c=void 0,d=void 0,h="undefined"!==typeof e&&"undefined"!==typeof e.versions&&"undefined"!==typeof e.versions.electron&&"renderer"===e.type;if("object"!==typeof navigator||h){if("object"===typeof e){r="win32"===e.platform,s="darwin"===e.platform,a="linux"===e.platform,c=o,o;var p=Object({VUE_APP_BUILD_ENV:"emqx",NODE_ENV:"production",BASE_URL:"/"})["VSCODE_NLS_CONFIG"];if(p)try{var f=JSON.parse(p),g=f.availableLanguages["*"];c=f.locale,g||o,f._translationsConfigFile}catch(x){}u=!0}}else d=navigator.userAgent,r=d.indexOf("Windows")>=0,s=d.indexOf("Macintosh")>=0,a=d.indexOf("Linux")>=0,l=!0,c=navigator.language,c;var m=r,v=s,_=a,b=u,y=l,w="object"===typeof self?self:"object"===typeof i?i:{},C=w,S=null;function L(t){return null===S&&(S=C.setImmediate?C.setImmediate.bind(C):"undefined"!==typeof e&&"function"===typeof e.nextTick?e.nextTick.bind(e):C.setTimeout.bind(C)),S(t)}var O=s?2:r?1:3}).call(this,n("f28c"),n("c8ba"))},3170:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r});var i=n("507c"),o=function(){function e(t){var n=Object(i["d"])(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}return e._createAsciiMap=function(e){for(var t=new Uint8Array(256),n=0;n<256;n++)t[n]=e;return t},e.prototype.set=function(e,t){var n=Object(i["d"])(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)},e.prototype.get=function(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue},e}(),r=function(){function e(){this._actual=new o(0)}return e.prototype.add=function(e){this._actual.set(e,1)},e.prototype.has=function(e){return 1===this._actual.get(e)},e}()},"31df":function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"b",function(){return r}),n.d(t,"a",function(){return s});var i=n("11f7");function o(e,t){void 0===t&&(t={});var n=s(t);return n.textContent=e,n}function r(e,t){void 0===t&&(t={});var n=s(t);return u(n,l(e),t.actionHandler),n}function s(e){var t=e.inline?"span":"div",n=document.createElement(t);return e.className&&(n.className=e.className),n}var a=function(){function e(e){this.source=e,this.index=0}return e.prototype.eos=function(){return this.index>=this.source.length},e.prototype.next=function(){var e=this.peek();return this.advance(),e},e.prototype.peek=function(){return this.source[this.index]},e.prototype.advance=function(){this.index++},e}();function u(e,t,n){var o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(5===t.type&&n){var r=document.createElement("a");r.href="#",n.disposeables.add(i["k"](r,"click",function(e){n.callback(String(t.index),e)})),o=r}else 7===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach(function(e){u(o,e,n)})}function l(e){var t={type:1,children:[]},n=0,i=t,o=[],r=new a(e);while(!r.eos()){var s=r.next(),u="\\"===s&&0!==d(r.peek());if(u&&(s=r.next()),!u&&c(s)&&s===r.peek()){r.advance(),2===i.type&&(i=o.pop());var l=d(s);if(i.type===l||5===i.type&&6===l)i=o.pop();else{var h={type:l,children:[]};5===l&&(h.index=n,n++),i.children.push(h),o.push(i),i=h}}else if("\n"===s)2===i.type&&(i=o.pop()),i.children.push({type:7});else if(2!==i.type){var p={type:2,content:s};i.children.push(p),o.push(i),i=p}else i.content+=s}return 2===i.type&&(i=o.pop()),o.length,t}function c(e){return 0!==d(e)}function d(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}},"32a4":function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return h});var i=n("dff7"),o=n("308f"),r=n("b707"),s=n("70cb"),a=n("89cd"),u={ModesRegistry:"editor.modesRegistry"},l=function(){function e(){this._onDidChangeLanguages=new o["a"],this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}return e.prototype.registerLanguage=function(e){this._languages.push(e),this._onDidChangeLanguages.fire(void 0)},e.prototype.getLanguages=function(){return[].concat(this._languages).concat(this._dynamicLanguages)},e}(),c=new l;a["a"].add(u.ModesRegistry,c);var d="plaintext",h=new r["p"](d,1);c.registerLanguage({id:d,extensions:[".txt",".gitignore"],aliases:[i["a"]("plainText.alias","Plain Text"),"text"],mimetypes:["text/plain"]}),s["a"].register(h,{brackets:[["(",")"],["[","]"],["{","}"]]})},"32b8":function(e,t,n){"use strict";n.r(t),n.d(t,"win32",function(){return w}),n.d(t,"posix",function(){return C}),n.d(t,"normalize",function(){return S}),n.d(t,"join",function(){return L}),n.d(t,"relative",function(){return O}),n.d(t,"dirname",function(){return x}),n.d(t,"basename",function(){return N}),n.d(t,"extname",function(){return D}),n.d(t,"sep",function(){return k});var i=n("c317"),o=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=65,s=97,a=90,u=122,l=46,c=47,d=92,h=58,p=63,f=function(e){function t(t,n,i){var o,r=this;"string"===typeof n&&0===n.indexOf("not ")?(o="must not be",n=n.replace(/^not /,"")):o="must be";var s=-1!==t.indexOf(".")?"property":"argument",a='The "'+t+'" '+s+" "+o+" of type "+n;return a+=". Received type "+typeof i,r=e.call(this,a)||this,r.code="ERR_INVALID_ARG_TYPE",r}return o(t,e),t}(Error);function g(e,t){if("string"!==typeof e)throw new f(t,"string",e)}function m(e){return e===c||e===d}function v(e){return e===c}function _(e){return e>=r&&e<=a||e>=s&&e<=u}function b(e,t,n,i){for(var o,r="",s=0,a=-1,u=0,d=0;d<=e.length;++d){if(d2){var h=r.lastIndexOf(n);-1===h?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf(n)),a=d,u=0;continue}if(2===r.length||1===r.length){r="",s=0,a=d,u=0;continue}}t&&(r.length>0?r+=n+"..":r="..",s=2)}else r.length>0?r+=n+e.slice(a+1,d):r=e.slice(a+1,d),s=d-a-1;a=d,u=0}else o===l&&-1!==u?++u:u=-1}return r}function y(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}var w={resolve:function(){for(var e=[],t=0;t=-1;s--){var a=void 0;if(s>=0?a=e[s]:n?(a=i["b"]["="+n]||i["a"](),void 0!==a&&a.slice(0,3).toLowerCase()===n.toLowerCase()+"\\"||(a=n+"\\")):a=i["a"](),g(a,"path"),0!==a.length){var u=a.length,l=0,c="",d=!1,p=a.charCodeAt(0);if(u>1)if(m(p))if(d=!0,m(a.charCodeAt(1))){for(var f=2,v=f;f2&&m(a.charCodeAt(2))&&(d=!0,l=3));else m(p)&&(l=1,d=!0);if(!(c.length>0&&n.length>0&&c.toLowerCase()!==n.toLowerCase())&&(0===n.length&&c.length>0&&(n=c),r||(o=a.slice(l)+"\\"+o,r=d),n.length>0&&r))break}}return o=b(o,!r,"\\",m),n+(r?"\\":"")+o||"."},normalize:function(e){g(e,"path");var t=e.length;if(0===t)return".";var n,i,o=0,r=!1,s=e.charCodeAt(0);if(t>1)if(m(s))if(r=!0,m(e.charCodeAt(1))){for(var a=2,u=a;a2&&m(e.charCodeAt(2))&&(r=!0,o=3));else if(m(s))return"\\";return i=o0&&m(e.charCodeAt(t-1))&&(i+="\\"),void 0===n?r?i.length>0?"\\"+i:"\\":i.length>0?i:"":r?i.length>0?n+"\\"+i:n+"\\":i.length>0?n+i:n},isAbsolute:function(e){g(e,"path");var t=e.length;if(0===t)return!1;var n=e.charCodeAt(0);return!!m(n)||!!(_(n)&&t>2&&e.charCodeAt(1)===h&&m(e.charCodeAt(2)))},join:function(){for(var e,t,n=[],i=0;i0&&(void 0===e?e=t=r:e+="\\"+r)}if(void 0===e)return".";var s=!0,a=0;if("string"===typeof t&&m(t.charCodeAt(0))){++a;var u=t.length;u>1&&m(t.charCodeAt(1))&&(++a,u>2&&(m(t.charCodeAt(2))?++a:s=!1))}if(s){for(;a=2&&(e="\\"+e.slice(a))}return w.normalize(e)},relative:function(e,t){if(g(e,"from"),g(t,"to"),e===t)return"";var n=w.resolve(e),i=w.resolve(t);if(n===i)return"";if(e=n.toLowerCase(),t=i.toLowerCase(),e===t)return"";for(var o=0;oo;--r)if(e.charCodeAt(r-1)!==d)break;for(var s=r-o,a=0;aa;--u)if(t.charCodeAt(u-1)!==d)break;for(var l=u-a,c=sc){if(t.charCodeAt(a+p)===d)return i.slice(a+p+1);if(2===p)return i.slice(a+p)}s>c&&(e.charCodeAt(o+p)===d?h=p:2===p&&(h=3));break}var f=e.charCodeAt(o+p),m=t.charCodeAt(a+p);if(f!==m)break;f===d&&(h=p)}if(p!==c&&-1===h)return i;var v="";for(-1===h&&(h=0),p=o+h+1;p<=r;++p)p!==r&&e.charCodeAt(p)!==d||(0===v.length?v+="..":v+="\\..");return v.length>0?v+i.slice(a+h,u):(a+=h,i.charCodeAt(a)===d&&++a,i.slice(a,u))},toNamespacedPath:function(e){if("string"!==typeof e)return e;if(0===e.length)return"";var t=w.resolve(e);if(t.length>=3)if(t.charCodeAt(0)===d){if(t.charCodeAt(1)===d){var n=t.charCodeAt(2);if(n!==p&&n!==l)return"\\\\?\\UNC\\"+t.slice(2)}}else if(_(t.charCodeAt(0))&&t.charCodeAt(1)===h&&t.charCodeAt(2)===d)return"\\\\?\\"+t;return e},dirname:function(e){g(e,"path");var t=e.length;if(0===t)return".";var n=-1,i=-1,o=!0,r=0,s=e.charCodeAt(0);if(t>1)if(m(s)){if(n=r=1,m(e.charCodeAt(1))){for(var a=2,u=a;a2&&m(e.charCodeAt(2))&&(n=r=3));else if(m(s))return e;for(var l=t-1;l>=r;--l)if(m(e.charCodeAt(l))){if(!o){i=l;break}}else o=!1;if(-1===i){if(-1===n)return".";i=n}return e.slice(0,i)},basename:function(e,t){void 0!==t&&g(t,"ext"),g(e,"path");var n,i=0,o=-1,r=!0;if(e.length>=2){var s=e.charCodeAt(0);_(s)&&e.charCodeAt(1)===h&&(i=2)}if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,u=-1;for(n=e.length-1;n>=i;--n){var l=e.charCodeAt(n);if(m(l)){if(!r){i=n+1;break}}else-1===u&&(r=!1,u=n+1),a>=0&&(l===t.charCodeAt(a)?-1===--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=i;--n)if(m(e.charCodeAt(n))){if(!r){i=n+1;break}}else-1===o&&(r=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){g(e,"path");var t=0,n=-1,i=0,o=-1,r=!0,s=0;e.length>=2&&e.charCodeAt(1)===h&&_(e.charCodeAt(0))&&(t=i=2);for(var a=e.length-1;a>=t;--a){var u=e.charCodeAt(a);if(m(u)){if(!r){i=a+1;break}}else-1===o&&(r=!1,o=a+1),u===l?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1)}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===i+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!==typeof e)throw new f("pathObject","Object",e);return y("\\",e)},parse:function(e){g(e,"path");var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n=e.length,i=0,o=e.charCodeAt(0);if(n>1){if(m(o)){if(i=1,m(e.charCodeAt(1))){for(var r=2,s=r;r2))return t.root=t.dir=e,t;if(m(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t;i=3}}}else if(m(o))return t.root=t.dir=e,t;i>0&&(t.root=e.slice(0,i));for(var a=-1,u=i,c=-1,d=!0,p=e.length-1,f=0;p>=i;--p)if(o=e.charCodeAt(p),m(o)){if(!d){u=p+1;break}}else-1===c&&(d=!1,c=p+1),o===l?-1===a?a=p:1!==f&&(f=1):-1!==a&&(f=-1);return-1===a||-1===c||0===f||1===f&&a===c-1&&a===u+1?-1!==c&&(t.base=t.name=e.slice(u,c)):(t.name=e.slice(u,a),t.base=e.slice(u,c),t.ext=e.slice(a,c)),t.dir=u>0&&u!==i?e.slice(0,u-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},C={resolve:function(){for(var e=[],t=0;t=-1&&!o;r--){var s=void 0;s=r>=0?e[r]:i["a"](),g(s,"path"),0!==s.length&&(n=s+"/"+n,o=s.charCodeAt(0)===c)}return n=b(n,!o,"/",v),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(g(e,"path"),0===e.length)return".";var t=e.charCodeAt(0)===c,n=e.charCodeAt(e.length-1)===c;return e=b(e,!t,"/",v),0!==e.length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return g(e,"path"),e.length>0&&e.charCodeAt(0)===c},join:function(){for(var e,t=[],n=0;n0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":C.normalize(e)},relative:function(e,t){if(g(e,"from"),g(t,"to"),e===t)return"";if(e=C.resolve(e),t=C.resolve(t),e===t)return"";for(var n=1;nu){if(t.charCodeAt(r+d)===c)return t.slice(r+d+1);if(0===d)return t.slice(r+d)}else o>u&&(e.charCodeAt(n+d)===c?l=d:0===d&&(l=0));break}var h=e.charCodeAt(n+d),p=t.charCodeAt(r+d);if(h!==p)break;h===c&&(l=d)}var f="";for(d=n+l+1;d<=i;++d)d!==i&&e.charCodeAt(d)!==c||(0===f.length?f+="..":f+="/..");return f.length>0?f+t.slice(r+l):(r+=l,t.charCodeAt(r)===c&&++r,t.slice(r))},toNamespacedPath:function(e){return e},dirname:function(e){if(g(e,"path"),0===e.length)return".";for(var t=e.charCodeAt(0)===c,n=-1,i=!0,o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===c){if(!i){n=o;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename:function(e,t){void 0!==t&&g(t,"ext"),g(e,"path");var n,i=0,o=-1,r=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(u===c){if(!r){i=n+1;break}}else-1===a&&(r=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1===--s&&(o=n):(s=-1,o=a))}return i===o?o=a:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===c){if(!r){i=n+1;break}}else-1===o&&(r=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){g(e,"path");for(var t=-1,n=0,i=-1,o=!0,r=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(a!==c)-1===i&&(o=!1,i=s+1),a===l?-1===t?t=s:1!==r&&(r=1):-1!==t&&(r=-1);else if(!o){n=s+1;break}}return-1===t||-1===i||0===r||1===r&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!==typeof e)throw new f("pathObject","Object",e);return y("/",e)},parse:function(e){g(e,"path");var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0)===c;i?(t.root="/",n=1):n=0;for(var o=-1,r=0,s=-1,a=!0,u=e.length-1,d=0;u>=n;--u){var h=e.charCodeAt(u);if(h!==c)-1===s&&(a=!1,s=u+1),h===l?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!a){r=u+1;break}}return-1===o||-1===s||0===d||1===d&&o===s-1&&o===r+1?-1!==s&&(t.base=t.name=0===r&&i?e.slice(1,s):e.slice(r,s)):(0===r&&i?(t.name=e.slice(1,o),t.base=e.slice(1,s)):(t.name=e.slice(r,o),t.base=e.slice(r,s)),t.ext=e.slice(o,s)),r>0?t.dir=e.slice(0,r-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};C.win32=w.win32=w,C.posix=w.posix=C;var S="win32"===i["c"]?w.normalize:C.normalize,L="win32"===i["c"]?w.join:C.join,O="win32"===i["c"]?w.relative:C.relative,x="win32"===i["c"]?w.dirname:C.dirname,N="win32"===i["c"]?w.basename:C.basename,D="win32"===i["c"]?w.extname:C.extname,k="win32"===i["c"]?w.sep:C.sep},"32f2":function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r});var i=function(){function e(e,t,n){this.from=0|e,this.to=0|t,this.colorId=0|n}return e.compare=function(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId},e}(),o=function(){function e(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.color=n,this._colorZone=null}return e.compare=function(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colorn&&(f=n-g);var m=c.color,v=this._color2Id[m];v||(v=++this._lastAssignedId,this._color2Id[m]=v,this._id2Color[v]=m);var _=new i(f-g,f+g,v);c.setColorZone(_),a.push(_)}return this._colorZonesInvalid=!1,a.sort(i.compare),a},e}()},3352:function(e,t,n){"use strict";var i,o;n.d(t,"d",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"e",function(){return r}),n.d(t,"b",function(){return s}),n.d(t,"a",function(){return a}),function(e){e[e["Left"]=1]="Left",e[e["Center"]=2]="Center",e[e["Right"]=4]="Right",e[e["Full"]=7]="Full"}(i||(i={})),function(e){e[e["Inline"]=1]="Inline"}(o||(o={}));var r=function(){function e(e){this.tabSize=0|e.tabSize,this.indentSize=0|e.tabSize,this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace)}return e.prototype.equals=function(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace},e.prototype.createChangeEvent=function(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}},e}(),s=function(){function e(e,t){this.range=e,this.matches=t}return e}(),a=function(){function e(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}return e}()},3359:function(e,t,n){},"33f9":function(e,t,n){self["MonacoEnvironment"]=function(e){function t(e){return e.replace(/\/$/,"")}return{getWorkerUrl:function(n,i){var o="string"===typeof window.__webpack_public_path__?window.__webpack_public_path__:"/";return(o?t(o)+"/":"")+e[i]}}}({editorWorkerService:"static/editor.worker.js",json:"static/json.worker.js"}),n("4816"),n("6e4e"),n("2935"),n("c36f"),n("0b11"),n("77a4"),n("92a6"),n("9f4d"),n("7c3e"),n("d585"),n("e516"),n("fd11"),n("a106"),n("7605"),n("6df4"),n("7082"),n("9f72"),n("821d"),n("958f"),n("0210"),n("aee8"),n("1af3"),n("8090"),n("a222"),n("747f"),n("d844"),n("f17c"),n("5b02"),n("bfe0"),n("5900"),n("4c2d"),n("e2c2"),n("43ad"),n("d741"),n("b574"),n("7a9e"),n("bd50"),n("93ba"),n("6daf"),n("5ed2"),n("b3b2"),n("2d47"),e.exports=n("f33e"),n("a79b"),n("c3d4")},"351f":function(e,t,n){"use strict";n.d(t,"a",function(){return g});n("b329");var i=n("dff7"),o=n("5fe7"),r=n("a666"),s=n("3813"),a=n("6a89"),u=n("b2cc"),l=n("4fc3"),c=n("b7d0"),d=n("303e"),h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},f=function(e,t){return function(n,i){t(n,i,e)}},g=function(e){function t(n,i){var o=e.call(this)||this;return o.closeTimeout=3e3,o._messageWidget=o._register(new r["d"]),o._messageListeners=o._register(new r["b"]),o._editor=n,o._visible=t.MESSAGE_VISIBLE.bindTo(i),o._register(o._editor.onDidAttemptReadOnlyEdit(function(){return o._onDidAttemptReadOnlyEdit()})),o}return h(t,e),t.get=function(e){return e.getContribution(t._id)},t.prototype.getId=function(){return t._id},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._visible.reset()},t.prototype.showMessage=function(e,t){var n,i=this;Object(s["a"])(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new v(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(function(){return i.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(function(){return i.closeMessage()})),this._messageListeners.add(this._editor.onDidDispose(function(){return i.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeModel(function(){return i.closeMessage()})),this._messageListeners.add(new o["e"](function(){return i.closeMessage()},this.closeTimeout)),this._messageListeners.add(this._editor.onMouseMove(function(e){e.target.position&&(n?n.containsPosition(e.target.position)||i.closeMessage():n=new a["a"](t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))},t.prototype.closeMessage=function(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(v.fadeOut(this._messageWidget.value))},t.prototype._onDidAttemptReadOnlyEdit=function(){this._editor.hasModel()&&this.showMessage(i["a"]("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())},t._id="editor.contrib.messageController",t.MESSAGE_VISIBLE=new l["d"]("messageVisible",!1),t=p([f(1,l["c"])],t),t}(r["a"]),m=u["c"].bindToContribution(g.get);Object(u["g"])(new m({id:"leaveEditorMessage",precondition:g.MESSAGE_VISIBLE,handler:function(e){return e.closeMessage()},kbOpts:{weight:130,primary:9}}));var v=function(){function e(e,t,n){var i=t.lineNumber,o=t.column;this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(i,i,0),this._position={lineNumber:i,column:o-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");var r=document.createElement("div");r.classList.add("message"),r.textContent=n,this._domNode.appendChild(r);var s=document.createElement("div");s.classList.add("anchor"),this._domNode.appendChild(s),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}return e.fadeOut=function(e){var t,n=function(){e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",n)};return t=setTimeout(n,110),e.getDomNode().addEventListener("animationend",n),e.getDomNode().classList.add("fadeOut"),{dispose:n}},e.prototype.dispose=function(){this._editor.removeContentWidget(this)},e.prototype.getId=function(){return"messageoverlay"},e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return{position:this._position,preference:[1]}},e}();Object(u["h"])(g),Object(c["f"])(function(e,t){var n=e.getColor(d["db"]);if(n){var i=e.type===c["b"]?2:1;t.addRule(".monaco-editor .monaco-editor-overlaymessage .anchor { border-top-color: "+n+"; }"),t.addRule(".monaco-editor .monaco-editor-overlaymessage .message { border: "+i+"px solid "+n+"; }")}var o=e.getColor(d["cb"]);o&&t.addRule(".monaco-editor .monaco-editor-overlaymessage .message { background-color: "+o+"; }");var r=e.getColor(d["eb"]);r&&t.addRule(".monaco-editor .monaco-editor-overlaymessage .message { color: "+r+"; }")})},3742:function(e,t,n){"use strict";n.d(t,"l",function(){return i}),n.d(t,"u",function(){return o}),n.d(t,"C",function(){return r}),n.d(t,"r",function(){return a}),n.d(t,"o",function(){return u}),n.d(t,"p",function(){return l}),n.d(t,"M",function(){return c}),n.d(t,"B",function(){return d}),n.d(t,"G",function(){return h}),n.d(t,"j",function(){return p}),n.d(t,"J",function(){return f}),n.d(t,"m",function(){return g}),n.d(t,"k",function(){return m}),n.d(t,"E",function(){return v}),n.d(t,"D",function(){return _}),n.d(t,"q",function(){return b}),n.d(t,"s",function(){return y}),n.d(t,"A",function(){return w}),n.d(t,"d",function(){return C}),n.d(t,"e",function(){return S}),n.d(t,"y",function(){return L}),n.d(t,"z",function(){return O}),n.d(t,"n",function(){return N}),n.d(t,"K",function(){return k}),n.d(t,"b",function(){return I}),n.d(t,"c",function(){return E}),n.d(t,"w",function(){return M}),n.d(t,"x",function(){return T}),n.d(t,"h",function(){return R}),n.d(t,"f",function(){return F}),n.d(t,"t",function(){return W}),n.d(t,"g",function(){return V}),n.d(t,"v",function(){return B}),n.d(t,"a",function(){return H}),n.d(t,"L",function(){return z}),n.d(t,"H",function(){return U}),n.d(t,"F",function(){return K}),n.d(t,"i",function(){return q}),n.d(t,"I",function(){return G});var i="";function o(e){return!e||"string"!==typeof e||0===e.trim().length}function r(e,t,n){void 0===n&&(n="0");for(var i=""+e,o=[i],r=i.length;r=t.length?e:t[i]})}function u(e){return e.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function l(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g,"\\$&")}function c(e,t){void 0===t&&(t=" ");var n=d(e,t);return h(n,t)}function d(e,t){if(!e||!t)return e;var n=t.length;if(0===n||0===e.length)return e;var i=0;while(e.indexOf(t,i)===i)i+=n;return e.substring(i)}function h(e,t){if(!e||!t)return e;var n=t.length,i=e.length;if(0===n||0===i)return e;var o=i,r=-1;while(1){if(r=e.lastIndexOf(t,o-1),-1===r||r+n!==o)break;if(0===r)return"";o=r}return e.substring(0,o)}function p(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function f(e,t){if(e.length0?e.indexOf(t,n)===n:0===n&&e===t}function m(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("Cannot create regex from empty string");t||(e=l(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));var i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),n.unicode&&(i+="u"),new RegExp(e,i)}function v(e){if("^"===e.source||"^$"===e.source||"$"===e.source||"^\\s*$"===e.source)return!1;var t=e.exec("");return!(!t||0!==e.lastIndex)}function _(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function b(e){for(var t=0,n=e.length;t=0;n--){var i=e.charCodeAt(n);if(32!==i&&9!==i)return n}return-1}function C(e,t){return et?1:0}function S(e,t){for(var n=Math.min(e.length,t.length),i=0;it.length?1:0}function L(e){return e>=97&&e<=122}function O(e){return e>=65&&e<=90}function x(e){return L(e)||O(e)}function N(e,t){var n=e?e.length:0,i=t?t.length:0;return n===i&&D(e,t)}function D(e,t,n){if(void 0===n&&(n=e.length),"string"!==typeof e||"string"!==typeof t)return!1;for(var i=0;ie.length)&&D(e,t,n)}function I(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}var H=String.fromCharCode(65279);function z(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function U(e){return btoa(encodeURIComponent(e))}function K(e,t){for(var n="",i=0;i0?(i=t?(i+1)%o:(i+o-1)%o,n.children[i]):(i=n.parent.groups.indexOf(n),t?(i=(i+1)%r,n.parent.groups[i].children[0]):(i=(i+r-1)%r,n.parent.groups[i].children[n.parent.groups[i].children.length-1]))},e.prototype.nearestReference=function(e,t){var n=this.references.map(function(n,i){return{idx:i,prefixLen:a["b"](n.uri.toString(),e.toString()),offsetDist:100*Math.abs(n.range.startLineNumber-t.lineNumber)+Math.abs(n.range.startColumn-t.column)}}).sort(function(e,t){return e.prefixLen>t.prefixLen?-1:e.prefixLent.offsetDist?1:0})[0];if(n)return this.references[n.idx]},e.prototype.firstReference=function(){for(var e=0,t=this.references;ei?1:l["a"].compareRangesUsingStarts(e.range,t.range)},e}()},"3d37":function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"a",function(){return s}),n.d(t,"b",function(){return a});var i=n("3742"),o=n("32b8");function r(e){return e.replace(/[\\/]/g,o["posix"].sep)}function s(e,t,n,r){if(void 0===r&&(r=o["sep"]),e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(n){var s=Object(i["K"])(e,t);if(!s)return!1;if(t.length===e.length)return!0;var a=t.length;return t.charAt(t.length-1)===r&&a--,e.charAt(a)===r}return t.charAt(t.length-1)!==r&&(t+=r),0===e.indexOf(t)}function a(e){return e>=65&&e<=90||e>=97&&e<=122}},4035:function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return c}),n.d(t,"a",function(){return h});var i=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function o(e){var t=[];return e.forEach(function(e){return t.push(e)}),t}function r(e){var t=[];return e.forEach(function(e,n){return t.push(n)}),t}var s=function(){function e(){this._value="",this._pos=0}return e.prototype.reset=function(e){return this._value=e,this._pos=0,this},e.prototype.next=function(){return this._pos+=1,this},e.prototype.hasNext=function(){return this._pos0)n.left||(n.left=new u,n.left.segment=i.value()),n=n.left;else if(o<0)n.right||(n.right=new u,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new u,n.mid.segment=i.value()),n=n.mid}}var r=n.value;return n.value=t,n.key=e,r},e.prototype.get=function(e){var t=this._iter.reset(e),n=this._root;while(n){var i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else{if(!t.hasNext())break;t.next(),n=n.mid}}return n?n.value:void 0},e.prototype.findSubstr=function(e){var t=this._iter.reset(e),n=this._root,i=void 0;while(n){var o=t.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i},e.prototype.forEach=function(e){this._forEach(this._root,e)},e.prototype._forEach=function(e,t){e&&(this._forEach(e.left,t),e.value&&t(e.value,e.key),this._forEach(e.mid,t),this._forEach(e.right,t))},e}(),c=function(){function e(){this.map=new Map,this.ignoreCase=!1}return e.prototype.set=function(e,t){this.map.set(this.toKey(e),t)},e.prototype.get=function(e){return this.map.get(this.toKey(e))},e.prototype.toKey=function(e){var t=e.toString();return this.ignoreCase&&(t=t.toLowerCase()),t},e}(),d=function(){function e(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return e.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.get=function(e,t){void 0===t&&(t=0);var n=this._map.get(e);if(n)return 0!==t&&this.touch(n,t),n.value},e.prototype.set=function(e,t,n){void 0===n&&(n=0);var i=this._map.get(e);if(i)i.value=t,0!==n&&this.touch(i,n);else{switch(i={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}},e.prototype.delete=function(e){return!!this.remove(e)},e.prototype.remove=function(e){var t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value},e.prototype.forEach=function(e,t){var n=this._head;while(n)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next},e.prototype.trimOld=function(e){if(!(e>=this.size))if(0!==e){var t=this._head,n=this.size;while(t&&n>e)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0)}else this.clear()},e.prototype.addItemFirst=function(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e},e.prototype.addItemLast=function(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e},e.prototype.removeItem=function(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{var 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},e.prototype.touch=function(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;var n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(2===t){if(e===this._tail)return;n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}},e.prototype.toJSON=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),e},e}(),h=function(e){function t(t,n){void 0===n&&(n=1);var i=e.call(this)||this;return i._limit=t,i._ratio=Math.min(Math.max(0,n),1),i}return i(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t,2)},t.prototype.peek=function(t){return e.prototype.get.call(this,t,0)},t.prototype.set=function(t,n){e.prototype.set.call(this,t,n,2),this.checkTrim()},t.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},t}(d)},4153:function(e,t,n){"use strict";n.d(t,"b",function(){return v}),n.d(t,"a",function(){return b}),n.d(t,"c",function(){return y}),n.d(t,"e",function(){return w}),n.d(t,"d",function(){return x}),n.d(t,"f",function(){return D});var i,o=n("5fe7"),r=n("aa3d"),s=n("fdcc"),a=n("b2cc"),u=n("b707"),l=n("4fc3"),c=n("2504"),d=n("6a89"),h=n("7e93"),p=n("a666"),f=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},g=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0)||n.providerFilter.has(o))return Promise.resolve(o.provideCompletionItems(e,t,r,a)).then(function(r){var s=g.length;if(r){for(var a=0,u=r.suggestions||[];at.sortTextLow)return 1}return e.completion.labelt.completion.label?1:e.completion.kind-t.completion.kind}function S(e,t){if(e.completion.kind!==t.completion.kind){if(25===e.completion.kind)return-1;if(25===t.completion.kind)return 1}return C(e,t)}function L(e,t){if(e.completion.kind!==t.completion.kind){if(25===e.completion.kind)return 1;if(25===t.completion.kind)return-1}return C(e,t)}var O=new Map;function x(e){return O.get(e)}O.set(0,S),O.set(2,L),O.set(1,C),Object(a["e"])("_executeCompletionItemProvider",function(e,t,n){return f(m,void 0,void 0,function(){var i,o,r,s,a,u,l,d;return g(this,function(h){switch(h.label){case 0:return i={incomplete:!1,suggestions:[]},o=new p["b"],r=[],s=n["maxItemsToResolve"]||0,[4,w(e,t)];case 1:for(a=h.sent(),u=0,l=a;ut&&(n=t-e),n<0&&(n=0),i<0&&(i=0),r+i>o&&(r=o-i),r<0&&(r=0),this.width=e,this.scrollWidth=t,this.scrollLeft=n,this.height=i,this.scrollHeight=o,this.scrollTop=r}return e.prototype.equals=function(e){return this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop},e.prototype.withScrollDimensions=function(t){return new e("undefined"!==typeof t.width?t.width:this.width,"undefined"!==typeof t.scrollWidth?t.scrollWidth:this.scrollWidth,this.scrollLeft,"undefined"!==typeof t.height?t.height:this.height,"undefined"!==typeof t.scrollHeight?t.scrollHeight:this.scrollHeight,this.scrollTop)},e.prototype.withScrollPosition=function(t){return new e(this.width,this.scrollWidth,"undefined"!==typeof t.scrollLeft?t.scrollLeft:this.scrollLeft,this.height,this.scrollHeight,"undefined"!==typeof t.scrollTop?t.scrollTop:this.scrollTop)},e.prototype.createScrollEvent=function(e){var t=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:t,scrollWidthChanged:n,scrollLeftChanged:i,heightChanged:o,scrollHeightChanged:r,scrollTopChanged:s}},e}(),a=function(e){function t(t,n){var o=e.call(this)||this;return o._onScroll=o._register(new i["a"]),o.onScroll=o._onScroll.event,o._smoothScrollDuration=t,o._scheduleAtNextAnimationFrame=n,o._state=new s(0,0,0,0,0,0),o._smoothScrolling=null,o}return r(t,e),t.prototype.dispose=function(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),e.prototype.dispose.call(this)},t.prototype.setSmoothScrollDuration=function(e){this._smoothScrollDuration=e},t.prototype.validateScrollPosition=function(e){return this._state.withScrollPosition(e)},t.prototype.getScrollDimensions=function(){return this._state},t.prototype.setScrollDimensions=function(e){var t=this._state.withScrollDimensions(e);this._setState(t),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)},t.prototype.getFutureScrollPosition=function(){return this._smoothScrolling?this._smoothScrolling.to:this._state},t.prototype.getCurrentScrollPosition=function(){return this._state},t.prototype.setScrollPositionNow=function(e){var t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t)},t.prototype.setScrollPositionSmooth=function(e){var t=this;if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:"undefined"===typeof e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:"undefined"===typeof e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};var n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;var i=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration);this._smoothScrolling.dispose(),this._smoothScrolling=i}else{n=this._state.withScrollPosition(e);this._smoothScrolling=d.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(function(){t._smoothScrolling&&(t._smoothScrolling.animationFrameDisposable=null,t._performSmoothScrolling())})},t.prototype._performSmoothScrolling=function(){var e=this;if(this._smoothScrolling){var t=this._smoothScrolling.tick(),n=this._state.withScrollPosition(t);if(this._setState(n),t.isDone)return this._smoothScrolling.dispose(),void(this._smoothScrolling=null);this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(function(){e._smoothScrolling&&(e._smoothScrolling.animationFrameDisposable=null,e._performSmoothScrolling())})}},t.prototype._setState=function(e){var t=this._state;t.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(t)))},t}(o["a"]),u=function(){function e(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}return e}();function l(e,t){var n=t-e;return function(t){return e+n*p(t)}}function c(e,t,n){return function(i){return i2.5*n){var o=void 0,r=void 0;return e200)return e;if("object"===typeof e){switch(e.$mid){case 1:return i["a"].revive(e);case 2:return new RegExp(e.source,e.flags)}for(var n in e)Object.hasOwnProperty.call(e,n)&&(e[n]=r(e[n],t+1))}return e}},"43ad":function(e,t,n){"use strict";n.r(t);var i=n("dff7"),o=n("fdcc"),r=n("4fc3"),s=n("b539"),a=n("b2cc"),u=n("c101"),l=(n("0632"),n("a666")),c=n("7061"),d=n("6a89"),h=n("303e"),p=new r["d"]("renameInputVisible",!1),f=function(){function e(e,t,n){var i=this;this.themeService=t,this._disposables=new l["b"],this.allowEditorOverflow=!0,this._currentAcceptInput=null,this._currentCancelInput=null,this._visibleContextKey=p.bindTo(n),this._editor=e,this._editor.addContentWidget(this),this._disposables.add(e.onDidChangeConfiguration(function(e){e.fontInfo&&i.updateFont()})),this._disposables.add(t.onThemeChange(function(e){return i.onThemeChange(e)}))}return e.prototype.onThemeChange=function(e){this.updateStyles(e)},e.prototype.dispose=function(){this._disposables.dispose(),this._editor.removeContentWidget(this)},e.prototype.getId=function(){return"__renameInputWidget"},e.prototype.getDomNode=function(){return this._domNode||(this._inputField=document.createElement("input"),this._inputField.className="rename-input",this._inputField.type="text",this._inputField.setAttribute("aria-label",Object(i["a"])("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode=document.createElement("div"),this._domNode.style.height=this._editor.getConfiguration().lineHeight+"px",this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputField),this.updateFont(),this.updateStyles(this.themeService.getTheme())),this._domNode},e.prototype.updateStyles=function(e){if(this._inputField){var t=e.getColor(h["W"]),n=e.getColor(h["Y"]),i=e.getColor(h["Wb"]),o=e.getColor(h["X"]);this._inputField.style.backgroundColor=t?t.toString():null,this._inputField.style.color=n?n.toString():null,this._inputField.style.borderWidth=o?"1px":"0px",this._inputField.style.borderStyle=o?"solid":"none",this._inputField.style.borderColor=o?o.toString():"none",this._domNode.style.boxShadow=i?" 0 2px 8px "+i:null}},e.prototype.updateFont=function(){if(this._inputField){var e=this._editor.getConfiguration().fontInfo;this._inputField.style.fontFamily=e.fontFamily,this._inputField.style.fontWeight=e.fontWeight,this._inputField.style.fontSize=e.fontSize+"px"}},e.prototype.getPosition=function(){return this._visible?{position:this._position,preference:[2,1]}:null},e.prototype.acceptInput=function(){this._currentAcceptInput&&this._currentAcceptInput()},e.prototype.cancelInput=function(e){this._currentCancelInput&&this._currentCancelInput(e)},e.prototype.getInput=function(e,t,n,i){var o=this;this._position=new c["a"](e.startLineNumber,e.startColumn),this._inputField.value=t,this._inputField.setAttribute("selectionStart",n.toString()),this._inputField.setAttribute("selectionEnd",i.toString()),this._inputField.size=Math.max(1.1*(e.endColumn-e.startColumn),20);var r=new l["b"],s=function(){r.dispose(),o._hide()};return new Promise(function(n){o._currentCancelInput=function(e){return o._currentAcceptInput=null,o._currentCancelInput=null,n(e),!0},o._currentAcceptInput=function(){0!==o._inputField.value.trim().length&&o._inputField.value!==t?(o._currentAcceptInput=null,o._currentCancelInput=null,n(o._inputField.value)):o.cancelInput(!0)};var i=function(){var t=o._editor.getPosition();t&&d["a"].containsPosition(e,t)||o.cancelInput(!0)};r.add(o._editor.onDidChangeCursorSelection(i)),r.add(o._editor.onDidBlurEditorWidget(function(){return o.cancelInput(!1)})),o._show()}).then(function(e){return s(),e},function(e){return s(),Promise.reject(e)})},e.prototype._show=function(){var e=this;this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(function(){e._inputField.focus(),e._inputField.setSelectionRange(parseInt(e._inputField.getAttribute("selectionStart")),parseInt(e._inputField.getAttribute("selectionEnd")))},100)},e.prototype._hide=function(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)},e}(),g=n("b7d0"),m=n("b707"),v=n("3813"),_=n("351f"),b=n("bc04"),y=n("b0cd"),w=n("c7f5"),C=n("6d8e"),S=n("5717"),L=n("2504"),O=n("5fe7");n.d(t,"rename",function(){return M}),n.d(t,"RenameAction",function(){return P});var x=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),N=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},D=function(e,t){return function(n,i){t(n,i,e)}},k=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},I=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0},e.prototype.resolveRenameLocation=function(e){return k(this,void 0,void 0,function(){var t,n,i;return I(this,function(o){switch(o.label){case 0:return t=this._providers[0],t?t.resolveRenameLocation?[4,t.resolveRenameLocation(this.model,this.position,e)]:[3,2]:[2,void 0];case 1:n=o.sent(),o.label=2;case 2:return!n&&(i=this.model.getWordAtPosition(this.position),i)?[2,{range:new d["a"](this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word}]:[2,n]}})})},e.prototype.provideRenameEdits=function(e,t,n,o){return k(this,void 0,void 0,function(){var r,s;return I(this,function(a){switch(a.label){case 0:return r=this._providers[t],r?[4,r.provideRenameEdits(this.model,this.position,e,o)]:[2,{edits:[],rejectReason:n.join("\n")}];case 1:return s=a.sent(),s?s.rejectReason?[2,this.provideRenameEdits(e,t+1,n.concat(s.rejectReason),o)]:[2,s]:[2,this.provideRenameEdits(e,t+1,n.concat(i["a"]("no result","No result.")),o)]}})})},e}();function M(e,t,n){return k(this,void 0,void 0,function(){return I(this,function(i){return[2,new E(e,t).provideRenameEdits(n,0,[],L["a"].None)]})})}var T=function(e){function t(t,n,i,o,r,s){var a=e.call(this)||this;return a.editor=t,a._notificationService=n,a._bulkEditService=i,a._progressService=o,a._contextKeyService=r,a._themeService=s,a._renameOperationIdPool=1,a._register(a.editor.onDidChangeModel(function(){return a.onModelChanged()})),a._register(a.editor.onDidChangeModelLanguage(function(){return a.onModelChanged()})),a._register(a.editor.onDidChangeCursorSelection(function(){return a.onModelChanged()})),a}return x(t,e),t.get=function(e){return e.getContribution(t.ID)},Object.defineProperty(t.prototype,"renameInputField",{get:function(){return this._renameInputField||(this._renameInputField=this._register(new f(this.editor,this._themeService,this._contextKeyService))),this._renameInputField},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return t.ID},t.prototype.run=function(){return k(this,void 0,void 0,function(){var e,t=this;return I(this,function(n){return this._activeRename&&this._activeRename.operation.cancel(),e=this._renameOperationIdPool++,this._activeRename={id:e,operation:Object(O["f"])(function(n){return t.doRename(n,e)})},[2,this._activeRename.operation]})})},t.prototype.doRename=function(e,t){return k(this,void 0,void 0,function(){var n,o,r,s,a,u,l,c,h=this;return I(this,function(p){switch(p.label){case 0:if(!this.editor.hasModel())return[2,void 0];if(n=this.editor.getPosition(),o=new E(this.editor.getModel(),n),!o.hasProvider())return[2,void 0];p.label=1;case 1:return p.trys.push([1,3,,4]),s=o.resolveRenameLocation(e),this._progressService.showWhile(s,250),[4,s];case 2:return r=p.sent(),[3,4];case 3:return a=p.sent(),_["a"].get(this.editor).showMessage(a||i["a"]("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n),[2,void 0];case 4:return r?r.rejectReason?(_["a"].get(this.editor).showMessage(r.rejectReason,n),[2,void 0]):this._activeRename&&this._activeRename.id===t?(u=this.editor.getSelection(),l=0,c=r.text.length,d["a"].isEmpty(u)||d["a"].spansMultipleLines(u)||!d["a"].containsRange(r.range,u)||(l=Math.max(0,u.startColumn-r.range.startColumn),c=Math.min(r.range.endColumn,u.endColumn)-r.range.startColumn),[2,this.renameInputField.getInput(r.range,r.text,l,c).then(function(t){if("boolean"!==typeof t){h.editor.focus();var n=new b["a"](h.editor,15),s=Promise.resolve(o.provideRenameEdits(t,0,[],e).then(function(e){if(h.editor.hasModel()){if(!e.rejectReason)return h._bulkEditService.apply(e,{editor:h.editor}).then(function(e){e.ariaSummary&&Object(v["a"])(i["a"]("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,t,e.ariaSummary))});n.validate(h.editor)?_["a"].get(h.editor).showMessage(e.rejectReason,h.editor.getPosition()):h._notificationService.info(e.rejectReason)}},function(e){return h._notificationService.error(i["a"]("rename.failed","Rename failed to execute.")),Promise.reject(e)}));return h._progressService.showWhile(s,250),s}t&&h.editor.focus()})]):[2,void 0]:[2,void 0]}})})},t.prototype.acceptRenameInput=function(){this._renameInputField&&this._renameInputField.acceptInput()},t.prototype.cancelRenameInput=function(){this._renameInputField&&this._renameInputField.cancelInput(!0)},t.prototype.onModelChanged=function(){this._activeRename&&(this._activeRename.operation.cancel(),this._activeRename=void 0)},t.ID="editor.contrib.renameController",t=N([D(1,y["a"]),D(2,w["a"]),D(3,s["a"]),D(4,r["c"]),D(5,g["c"])],t),t}(l["a"]),P=function(e){function t(){return e.call(this,{id:"editor.action.rename",label:i["a"]("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:r["a"].and(u["a"].writable,u["a"].hasRenameProvider),kbOpts:{kbExpr:u["a"].editorTextFocus,primary:60,weight:100},menuOpts:{group:"1_modification",order:1.1}})||this}return x(t,e),t.prototype.runCommand=function(t,n){var i=this,r=t.get(S["a"]),s=Array.isArray(n)&&n||[void 0,void 0],a=s[0],u=s[1];return C["a"].isUri(a)&&c["a"].isIPosition(u)?r.openCodeEditor({resource:a},r.getActiveCodeEditor()).then(function(e){e&&(e.setPosition(u),e.invokeWithinContext(function(t){return i.reportTelemetry(t,e),i.run(t,e)}))},o["e"]):e.prototype.runCommand.call(this,t,n)},t.prototype.run=function(e,t){var n=T.get(t);return n?n.run():Promise.resolve()},t}(a["b"]);Object(a["h"])(T),Object(a["f"])(P);var R=a["c"].bindToContribution(T.get);Object(a["g"])(new R({id:"acceptRenameInput",precondition:p,handler:function(e){return e.acceptRenameInput()},kbOpts:{weight:199,kbExpr:u["a"].focus,primary:3}})),Object(a["g"])(new R({id:"cancelRenameInput",precondition:p,handler:function(e){return e.cancelRenameInput()},kbOpts:{weight:199,kbExpr:u["a"].focus,primary:9,secondary:[1033]}})),Object(a["e"])("_executeDocumentRenameProvider",function(e,t,n){var i=n.newName;if("string"!==typeof i)throw Object(o["b"])("newName");return M(e,t,i)})},"44c7":function(e,t,n){},"469c":function(e,t,n){"use strict";var i=n("dff7"),o=n("ef8e"),r=n("c4e3"),s=n("5aa5"),a=n("ee56"),u=n("11f7"),l=(n("abf2"),n("aa3d")),c=n("8b4e"),d=u["a"],h=function(){function e(e,t,n){this.os=t,this.options=n,this.domNode=u["m"](e,d(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}return e.prototype.set=function(t,n){this.didEverRender&&this.keybinding===t&&e.areSame(this.matches,n)||(this.keybinding=t,this.matches=n,this.render())},e.prototype.render=function(){if(u["p"](this.domNode),this.keybinding){var e=this.keybinding.getParts(),t=e[0],n=e[1];t&&this.renderPart(this.domNode,t,this.matches?this.matches.firstPart:null),n&&(u["m"](this.domNode,d("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderPart(this.domNode,n,this.matches?this.matches.chordPart:null)),this.domNode.title=this.keybinding.getAriaLabel()||""}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0},e.prototype.renderPart=function(e,t,n){var i=c["b"].modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,i.ctrlKey,Boolean(n&&n.ctrlKey),i.separator),t.shiftKey&&this.renderKey(e,i.shiftKey,Boolean(n&&n.shiftKey),i.separator),t.altKey&&this.renderKey(e,i.altKey,Boolean(n&&n.altKey),i.separator),t.metaKey&&this.renderKey(e,i.metaKey,Boolean(n&&n.metaKey),i.separator);var o=t.keyLabel;o&&this.renderKey(e,o,Boolean(n&&n.keyCode),"")},e.prototype.renderKey=function(e,t,n,i){u["m"](e,d("span.monaco-keybinding-key"+(n?".highlight":""),void 0,t)),i&&u["m"](e,d("span.monaco-keybinding-key-separator",void 0,i))},e.prototype.renderUnbound=function(e){u["m"](e,d("span.monaco-keybinding-key",void 0,Object(i["a"])("unbound","Unbound")))},e.areSame=function(e,t){return e===t||!e&&!t||!!e&&!!t&&Object(l["e"])(e.firstPart,t.firstPart)&&Object(l["e"])(e.chordPart,t.chordPart)},e}(),p=n("30db"),f=n("e8e3");n.d(t,"a",function(){return v}),n.d(t,"b",function(){return _}),n.d(t,"c",function(){return S});var g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),m=0,v=function(){function e(e){void 0===e&&(e=[]),this.id=(m++).toString(),this.labelHighlights=e,this.descriptionHighlights=[]}return e.prototype.getId=function(){return this.id},e.prototype.getLabel=function(){},e.prototype.getLabelOptions=function(){},e.prototype.getAriaLabel=function(){return Object(f["d"])([this.getLabel(),this.getDescription(),this.getDetail()]).join(", ")},e.prototype.getDetail=function(){},e.prototype.getIcon=function(){},e.prototype.getDescription=function(){},e.prototype.getTooltip=function(){},e.prototype.getDescriptionTooltip=function(){},e.prototype.getKeybinding=function(){},e.prototype.isHidden=function(){return!!this.hidden},e.prototype.setHighlights=function(e,t,n){this.labelHighlights=e,this.descriptionHighlights=t,this.detailHighlights=n},e.prototype.getHighlights=function(){return[this.labelHighlights,this.descriptionHighlights,this.detailHighlights]},e.prototype.run=function(e,t){return!1},e}(),_=function(e){function t(t,n,i){var o=e.call(this)||this;return o.entry=t,o.groupLabel=n,o.withBorder=i,o}return g(t,e),t.prototype.getGroupLabel=function(){return this.groupLabel},t.prototype.setGroupLabel=function(e){this.groupLabel=e},t.prototype.showBorder=function(){return!!this.withBorder},t.prototype.setShowBorder=function(e){this.withBorder=e},t.prototype.getLabel=function(){return this.entry?this.entry.getLabel():e.prototype.getLabel.call(this)},t.prototype.getLabelOptions=function(){return this.entry?this.entry.getLabelOptions():e.prototype.getLabelOptions.call(this)},t.prototype.getAriaLabel=function(){return this.entry?this.entry.getAriaLabel():e.prototype.getAriaLabel.call(this)},t.prototype.getDetail=function(){return this.entry?this.entry.getDetail():e.prototype.getDetail.call(this)},t.prototype.getIcon=function(){return this.entry?this.entry.getIcon():e.prototype.getIcon.call(this)},t.prototype.getDescription=function(){return this.entry?this.entry.getDescription():e.prototype.getDescription.call(this)},t.prototype.getHighlights=function(){return this.entry?this.entry.getHighlights():e.prototype.getHighlights.call(this)},t.prototype.isHidden=function(){return this.entry?this.entry.isHidden():e.prototype.isHidden.call(this)},t.prototype.setHighlights=function(t,n,i){this.entry?this.entry.setHighlights(t,n,i):e.prototype.setHighlights.call(this,t,n,i)},t.prototype.run=function(t,n){return this.entry?this.entry.run(t,n):e.prototype.run.call(this,t,n)},t}(v),b=function(){function e(){}return e.prototype.hasActions=function(e,t){return!1},e.prototype.getActions=function(e,t){return null},e}(),y="quickOpenEntry",w="quickOpenEntryGroup",C=function(){function e(e,t){void 0===e&&(e=new b),this.actionProvider=e,this.actionRunner=t}return e.prototype.getHeight=function(e){return e.getDetail()?44:22},e.prototype.getTemplateId=function(e){return e instanceof _?w:y},e.prototype.renderTemplate=function(e,t,n){var i=document.createElement("div");u["f"](i,"sub-content"),t.appendChild(i);var o=u["a"](".quick-open-row"),l=u["a"](".quick-open-row"),c=u["a"](".quick-open-entry",void 0,o,l);i.appendChild(c);var d=document.createElement("span");o.appendChild(d);var f=new r["a"](o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportOcticons:!0}),g=document.createElement("span");o.appendChild(g),u["f"](g,"quick-open-entry-keybinding");var m=new h(g,p["a"]),v=document.createElement("div");l.appendChild(v),u["f"](v,"quick-open-entry-meta");var _,b=new a["a"](v,!0);e===w&&(_=document.createElement("div"),u["f"](_,"results-group"),t.appendChild(_)),u["f"](t,"actions");var y=document.createElement("div");u["f"](y,"primary-action-bar"),t.appendChild(y);var C=new s["a"](y,{actionRunner:this.actionRunner});return{container:t,entry:c,icon:d,label:f,detail:b,keybinding:m,group:_,actionBar:C}},e.prototype.renderElement=function(e,t,n,i){this.actionProvider.hasActions(null,e)?u["f"](n.container,"has-actions"):u["I"](n.container,"has-actions"),n.actionBar.context=e;var r=this.actionProvider.getActions(null,e);if(n.actionBar.isEmpty()&&r&&r.length>0?n.actionBar.push(r,{icon:!0,label:!1}):n.actionBar.isEmpty()||r&&0!==r.length||n.actionBar.clear(),e instanceof _&&e.getGroupLabel()?u["f"](n.container,"has-group-label"):u["I"](n.container,"has-group-label"),e instanceof _){var s=e,a=n;s.showBorder()?(u["f"](a.container,"results-group-separator"),i.pickerGroupBorder&&(a.container.style.borderTopColor=i.pickerGroupBorder.toString())):(u["I"](a.container,"results-group-separator"),a.container.style.borderTopColor=null);var l=s.getGroupLabel()||"";a.group&&(a.group.textContent=l,i.pickerGroupForeground&&(a.group.style.color=i.pickerGroupForeground.toString()))}if(e instanceof v){var c=e.getHighlights(),d=c[0],h=c[1],p=c[2],f=e.getIcon()?"quick-open-entry-icon "+e.getIcon():"";n.icon.className=f;var g=e.getLabelOptions()||Object.create(null);g.matches=d||[],g.title=e.getTooltip(),g.descriptionTitle=e.getDescriptionTooltip()||e.getDescription(),g.descriptionMatches=h||[],n.label.setLabel(o["m"](e.getLabel()),e.getDescription(),g),n.detail.set(e.getDetail(),p),n.keybinding.set(e.getKeybinding())}},e.prototype.disposeTemplate=function(e,t){t.actionBar.dispose(),t.actionBar=null,t.container=null,t.entry=null,t.keybinding=null,t.detail=null,t.group=null,t.icon=null,t.label.dispose(),t.label=null},e}(),S=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=new b),this._entries=e,this._dataSource=this,this._renderer=new C(t),this._filter=this,this._runner=this,this._accessibilityProvider=this}return Object.defineProperty(e.prototype,"entries",{get:function(){return this._entries},set:function(e){this._entries=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this._renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"runner",{get:function(){return this._runner},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"accessibilityProvider",{get:function(){return this._accessibilityProvider},enumerable:!0,configurable:!0}),e.prototype.getId=function(e){return e.getId()},e.prototype.getLabel=function(e){return o["n"](e.getLabel())},e.prototype.getAriaLabel=function(e){var t=e.getAriaLabel();return t?i["a"]("quickOpenAriaLabelEntry","{0}, picker",e.getAriaLabel()):i["a"]("quickOpenAriaLabel","picker")},e.prototype.isVisible=function(e){return!e.isHidden()},e.prototype.run=function(e,t,n){return e.run(t,n)},e}()},4779:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return s});var i=n("0a0f"),o=n("4fc3"),r=Object(i["c"])("accessibilityService"),s=new o["d"]("accessibilityModeEnabled",!1)},"47cb":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("0a0f"),o="label",r=Object(i["c"])(o)},4816:function(e,t,n){"use strict";n.r(t);n("41a01");var i=n("0f70"),o=n("11f7"),r=n("6653"),s=n("31df"),a=n("3813"),u=n("1b7d"),l=n("a666"),c=n("30db"),d=n("3742"),h=n("6d8e"),p=n("b2cc"),f=n("c101"),g=n("93ba"),m=n("4fc3"),v=n("0a0f"),_=n("6dec"),b=n("5bd7"),y=n("303e"),w=n("b7d0"),C=n("03d9"),S=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),L=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},O=function(e,t){return function(n,i){t(n,i,e)}},x=new m["d"]("accessibilityHelpWidgetVisible",!1),N=function(e){function t(t,n){var i=e.call(this)||this;return i._editor=t,i._widget=i._register(n.createInstance(k,i._editor)),i}return S(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.getId=function(){return t.ID},t.prototype.show=function(){this._widget.show()},t.prototype.hide=function(){this._widget.hide()},t.ID="editor.contrib.accessibilityHelpController",t=L([O(1,v["a"])],t),t}(l["a"]);function D(e,t){return e&&0!==e.length?1===e.length?t?d["r"](C["a"].singleSelectionRange,e[0].positionLineNumber,e[0].positionColumn,t):d["r"](C["a"].singleSelection,e[0].positionLineNumber,e[0].positionColumn):t?d["r"](C["a"].multiSelectionRange,e.length,t):e.length>0?d["r"](C["a"].multiSelection,e.length):"":C["a"].noSelection}var k=function(e){function t(t,n,i,s){var u=e.call(this)||this;return u._contextKeyService=n,u._keybindingService=i,u._openerService=s,u._editor=t,u._isVisibleKey=x.bindTo(u._contextKeyService),u._domNode=Object(r["b"])(document.createElement("div")),u._domNode.setClassName("accessibilityHelpWidget"),u._domNode.setDisplay("none"),u._domNode.setAttribute("role","dialog"),u._domNode.setAttribute("aria-hidden","true"),u._contentDomNode=Object(r["b"])(document.createElement("div")),u._contentDomNode.setAttribute("role","document"),u._domNode.appendChild(u._contentDomNode),u._isVisible=!1,u._register(u._editor.onDidLayoutChange(function(){u._isVisible&&u._layout()})),u._register(o["k"](u._contentDomNode.domNode,"keydown",function(e){if(u._isVisible&&(e.equals(2083)&&(Object(a["a"])(C["a"].emergencyConfOn),u._editor.updateOptions({accessibilitySupport:"on"}),o["p"](u._contentDomNode.domNode),u._buildContent(),u._contentDomNode.domNode.focus(),e.preventDefault(),e.stopPropagation()),e.equals(2086))){Object(a["a"])(C["a"].openingDocs);var t=u._editor.getRawConfiguration().accessibilityHelpUrl;"undefined"===typeof t&&(t="https://go.microsoft.com/fwlink/?linkid=852450"),u._openerService.open(h["a"].parse(t)),e.preventDefault(),e.stopPropagation()}})),u.onblur(u._contentDomNode.domNode,function(){u.hide()}),u._editor.addOverlayWidget(u),u}return S(t,e),t.prototype.dispose=function(){this._editor.removeOverlayWidget(this),e.prototype.dispose.call(this)},t.prototype.getId=function(){return t.ID},t.prototype.getDomNode=function(){return this._domNode.domNode},t.prototype.getPosition=function(){return{preference:null}},t.prototype.show=function(){this._isVisible||(this._isVisible=!0,this._isVisibleKey.set(!0),this._layout(),this._domNode.setDisplay("block"),this._domNode.setAttribute("aria-hidden","false"),this._contentDomNode.domNode.tabIndex=0,this._buildContent(),this._contentDomNode.domNode.focus())},t.prototype._descriptionForCommand=function(e,t,n){var i=this._keybindingService.lookupKeybinding(e);return i?d["r"](t,i.getAriaLabel()):d["r"](n,e)},t.prototype._buildContent=function(){var e=this._editor.getConfiguration(),t=this._editor.getSelections(),n=0;if(t){var i=this._editor.getModel();i&&t.forEach(function(e){n+=i.getValueLengthInRange(e)})}var o=D(t,n);e.wrappingInfo.inDiffEditor?e.readOnly?o+=C["a"].readonlyDiffEditor:o+=C["a"].editableDiffEditor:e.readOnly?o+=C["a"].readonlyEditor:o+=C["a"].editableEditor;var r=c["d"]?C["a"].changeConfigToOnMac:C["a"].changeConfigToOnWinLinux;switch(e.accessibilitySupport){case 0:o+="\n\n - "+r;break;case 2:o+="\n\n - "+C["a"].auto_on;break;case 1:o+="\n\n - "+C["a"].auto_off,o+=" "+r;break}e.tabFocusMode?o+="\n\n - "+this._descriptionForCommand(g["ToggleTabFocusModeAction"].ID,C["a"].tabFocusModeOnMsg,C["a"].tabFocusModeOnMsgNoKb):o+="\n\n - "+this._descriptionForCommand(g["ToggleTabFocusModeAction"].ID,C["a"].tabFocusModeOffMsg,C["a"].tabFocusModeOffMsgNoKb);var a=c["d"]?C["a"].openDocMac:C["a"].openDocWinLinux;o+="\n\n - "+a,o+="\n\n"+C["a"].outroMsg,this._contentDomNode.domNode.appendChild(Object(s["b"])(o)),this._contentDomNode.domNode.setAttribute("aria-label",o)},t.prototype.hide=function(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,o["p"](this._contentDomNode.domNode),this._editor.focus())},t.prototype._layout=function(){var e=this._editor.getLayoutInfo(),n=Math.max(5,Math.min(t.WIDTH,e.width-40)),i=Math.max(5,Math.min(t.HEIGHT,e.height-40));this._domNode.setWidth(n),this._domNode.setHeight(i);var o=Math.round((e.height-i)/2);this._domNode.setTop(o);var r=Math.round((e.width-n)/2);this._domNode.setLeft(r)},t.ID="editor.contrib.accessibilityHelpWidget",t.WIDTH=500,t.HEIGHT=300,t=L([O(1,m["c"]),O(2,_["a"]),O(3,b["a"])],t),t}(u["a"]),I=function(e){function t(){return e.call(this,{id:"editor.action.showAccessibilityHelp",label:C["a"].showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{kbExpr:f["a"].focus,primary:i["j"]?2107:571,weight:100}})||this}return S(t,e),t.prototype.run=function(e,t){var n=N.get(t);n&&n.show()},t}(p["b"]);Object(p["h"])(N),Object(p["f"])(I);var E=p["c"].bindToContribution(N.get);Object(p["g"])(new E({id:"closeAccessibilityHelp",precondition:x,handler:function(e){return e.hide()},kbOpts:{weight:200,kbExpr:f["a"].focus,primary:9,secondary:[1033]}})),Object(w["f"])(function(e,t){var n=e.getColor(y["N"]);n&&t.addRule(".monaco-editor .accessibilityHelpWidget { background-color: "+n+"; }");var i=e.getColor(y["P"]);i&&t.addRule(".monaco-editor .accessibilityHelpWidget { color: "+i+"; }");var o=e.getColor(y["Wb"]);o&&t.addRule(".monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px "+o+"; }");var r=e.getColor(y["e"]);r&&t.addRule(".monaco-editor .accessibilityHelpWidget { border: 2px solid "+r+"; }")})},"49d9":function(e,t,n){"use strict";function i(e,t,n){return Math.min(Math.max(e,t),n)}n.d(t,"a",function(){return i})},"4b76":function(e,t,n){"use strict";var i,o=n("dff7"),r=n("3742");(function(e){e[e["Ignore"]=0]="Ignore",e[e["Info"]=1]="Info",e[e["Warning"]=2]="Warning",e[e["Error"]=3]="Error"})(i||(i={})),function(e){var t="error",n="warning",i="warn",s="info",a=Object.create(null);function u(o){return o?r["n"](t,o)?e.Error:r["n"](n,o)||r["n"](i,o)?e.Warning:r["n"](s,o)?e.Info:e.Ignore:e.Ignore}a[e.Error]=o["a"]("sev.error","Error"),a[e.Warning]=o["a"]("sev.warning","Warning"),a[e.Info]=o["a"]("sev.info","Info"),e.fromValue=u}(i||(i={})),t["a"]=i},"4c2d":function(e,t,n){"use strict";n.r(t),n.d(t,"defaultReferenceSearchOptions",function(){return D}),n.d(t,"ReferenceController",function(){return k}),n.d(t,"ReferenceAction",function(){return I}),n.d(t,"provideReferences",function(){return A});var i=n("dff7"),o=n("4fc3"),r=n("9eb8"),s=n("7061"),a=n("b2cc"),u=n("b707"),l=n("6a89"),c=n("e5aa"),d=n("aa43"),h=n("3a57"),p=n("5fe7"),f=n("fdcc"),g=n("c101"),m=n("d379"),v=n("b055"),_=n("93d9"),b=n("7121"),y=n("9e74"),w=n("6d8e"),C=n("5717"),S=n("2504"),L=n("e8e3"),O=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),x=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},N=function(e,t){return function(n,i){t(n,i,e)}},D={getMetaTitle:function(e){return e.references.length>1?i["a"]("meta.titleReference"," – {0} references",e.references.length):""}},k=function(){function e(e,t){e instanceof m["a"]&&c["b"].inPeekEditor.bindTo(t)}return e.prototype.dispose=function(){},e.prototype.getId=function(){return e.ID},e.ID="editor.contrib.referenceController",e=x([N(1,o["c"])],e),e}(),I=function(e){function t(){return e.call(this,{id:"editor.action.referenceSearch.trigger",label:i["a"]("references.action.label","Peek References"),alias:"Peek References",precondition:o["a"].and(g["a"].hasReferenceProvider,c["b"].notInPeekEditor,g["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:g["a"].editorTextFocus,primary:1094,weight:100},menuOpts:{group:"navigation",order:1.5}})||this}return O(t,e),t.prototype.run=function(e,t){var n=d["a"].get(t);if(n&&t.hasModel()){var i=t.getSelection(),o=t.getModel(),r=Object(p["f"])(function(e){return A(o,i.getStartPosition(),e).then(function(e){return new h["c"](e)})});n.toggleWidget(i,r,D)}},t}(a["b"]);Object(a["h"])(k),Object(a["f"])(I);var E=function(e,t,n){if(!(t instanceof w["a"]))throw new Error("illegal argument, uri");if(!n)throw new Error("illegal argument, position");var i=e.get(C["a"]);return i.openCodeEditor({resource:t},i.getFocusedCodeEditor()).then(function(e){if(Object(v["a"])(e)&&e.hasModel()){var t=d["a"].get(e);if(t){var i=Object(p["f"])(function(t){return A(e.getModel(),s["a"].lift(n),t).then(function(e){return new h["c"](e)})}),o=new l["a"](n.lineNumber,n.column,n.lineNumber,n.column);return Promise.resolve(t.toggleWidget(o,i,D))}}})},M=function(e,t,n,i){if(!(t instanceof w["a"]))throw new Error("illegal argument, uri expected");if(!i)throw new Error("missing references");var o=e.get(C["a"]);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then(function(e){if(Object(v["a"])(e)){var t=d["a"].get(e);if(t)return t.toggleWidget(new l["a"](n.lineNumber,n.column,n.lineNumber,n.column),Object(p["f"])(function(e){return Promise.resolve(new h["c"](i))}),D)}})};function T(e,t){R(e,function(e){return e.closeWidget()})}function P(e,t){var n=e.get(_["a"]),i=n.lastFocusedList&&n.lastFocusedList.getFocus();i instanceof h["b"]&&R(e,function(e){return e.openReference(i,!0)})}function R(e,t){var n=Object(c["d"])(e);if(n){var i=d["a"].get(n);i&&t(i)}}function A(e,t,n){var i=u["s"].ordered(e).map(function(i){return Promise.resolve(i.provideReferences(e,t,{includeDeclaration:!0},n)).then(function(e){if(Array.isArray(e))return e},function(e){Object(f["f"])(e)})});return Promise.all(i).then(function(e){return Object(L["k"])(Object(L["d"])(e))})}y["a"].registerCommand({id:"editor.action.findReferences",handler:E}),y["a"].registerCommand({id:"editor.action.showReferences",handler:M,description:{description:"Show references at a position in a file",args:[{name:"uri",description:"The text document in which to show references",constraint:w["a"]},{name:"position",description:"The position at which to show",constraint:s["a"].isIPosition},{name:"locations",description:"An array of locations.",constraint:Array}]}}),r["a"].registerCommandAndKeybindingRule({id:"goToNextReference",weight:250,primary:62,when:d["b"],handler:function(e){R(e,function(e){e.goToNextOrPreviousReference(!0)})}}),r["a"].registerCommandAndKeybindingRule({id:"goToNextReferenceFromEmbeddedEditor",weight:150,primary:62,when:c["b"].inPeekEditor,handler:function(e){R(e,function(e){e.goToNextOrPreviousReference(!0)})}}),r["a"].registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:250,primary:1086,when:d["b"],handler:function(e){R(e,function(e){e.goToNextOrPreviousReference(!1)})}}),r["a"].registerCommandAndKeybindingRule({id:"goToPreviousReferenceFromEmbeddedEditor",weight:150,primary:1086,when:c["b"].inPeekEditor,handler:function(e){R(e,function(e){e.goToNextOrPreviousReference(!1)})}}),r["a"].registerCommandAndKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:o["a"].and(d["b"],o["a"].not("config.editor.stablePeek")),handler:T}),r["a"].registerCommandAndKeybindingRule({id:"closeReferenceSearchEditor",weight:-1,primary:9,secondary:[1033],when:o["a"].and(c["b"].inPeekEditor,o["a"].not("config.editor.stablePeek")),handler:T}),r["a"].registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:o["a"].and(d["b"],b["c"]),handler:P}),Object(a["e"])("_executeReferenceProvider",function(e,t){return A(e,t,S["a"].None)})},"4d05":function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return u});var i=n("3742"),o=n("e1b5"),r=n("8bf1"),s={getInitialState:function(){return r["c"]},tokenize2:function(e,t,n){return Object(r["e"])(0,e,t,n)}};function a(e,t){return void 0===t&&(t=s),l(e,t||s)}function u(e,t,n,i,o,r){for(var s="
",a=i,u=0,l=0,c=t.getCount();l0)h+=" ",f--;break;case 60:h+="<";break;case 62:h+=">";break;case 38:h+="&";break;case 0:h+="�";break;case 65279:case 8232:h+="�";break;case 13:h+="​";break;case 32:h+=" ";break;default:h+=String.fromCharCode(p)}}if(s+=''+h+"",d>o||a>=o)break}}return s+="
",s}function l(e,t){for(var n='
',r=e.split(/\r\n|\r|\n/),s=t.getInitialState(),a=0,u=r.length;a0&&(n+="
");var c=t.tokenize2(l,s,0);o["a"].convertToEndOffset(c.tokens,l.length);for(var d=new o["a"](c.tokens,l),h=d.inflate(),p=0,f=0,g=h.getCount();f'+i["o"](l.substring(p,v))+"",p=v}s=c.endState}return n+="
",n}},"4d3d":function(e,t,n){},"4dc7":function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return r});var i=function(){function e(e,t,n){this.offset=0|e,this.type=t,this.language=n}return e.prototype.toString=function(){return"("+this.offset+", "+this.type+")"},e}(),o=function(){function e(e,t){this.tokens=e,this.endState=t}return e}(),r=function(){function e(e,t){this.tokens=e,this.endState=t}return e}()},"4e7d":function(e,t,n){},"4fc3":function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return g}),n.d(t,"d",function(){return m}),n.d(t,"c",function(){return v}),n.d(t,"e",function(){return _});var i=n("3742"),o=n("0a0f"),r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),s=function(){function e(){}return e.has=function(e){return u.create(e)},e.equals=function(e,t){return l.create(e,t)},e.regex=function(e,t){return h.create(e,t)},e.not=function(e){return d.create(e)},e.and=function(){for(var e=[],t=0;t=0){var n=e.split("!=");return c.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("==")>=0){n=e.split("==");return l.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("=~")>=0){n=e.split("=~");return h.create(n[0].trim(),this._deserializeRegexValue(n[1],t))}return/^\!\s*/.test(e)?d.create(e.substr(1).trim()):u.create(e)},e._deserializeValue=function(e,t){if(e=e.trim(),"true"===e)return!0;if("false"===e)return!1;var n=/^'([^']*)'$/.exec(e);return n?n[1].trim():e},e._deserializeRegexValue=function(e,t){if(Object(i["u"])(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var n=e.indexOf("/"),o=e.lastIndexOf("/");if(n===o||n<0){if(t)throw new Error("bad regexp-value '"+e+"', missing /-enclosure");return console.warn("bad regexp-value '"+e+"', missing /-enclosure"),null}var r=e.slice(n+1,o),s="i"===e[o+1]?"i":"";try{return new RegExp(r,s)}catch(a){if(t)throw new Error("bad regexp-value '"+e+"', parse error: "+a);return console.warn("bad regexp-value '"+e+"', parse error: "+a),null}},e}();function a(e,t){var n=e.getType(),i=t.getType();if(n!==i)return n-i;switch(n){case 1:return e.cmp(t);case 2:return e.cmp(t);case 3:return e.cmp(t);case 4:return e.cmp(t);case 6:return e.cmp(t);case 7:return e.cmp(t);case 5:return e.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var u=function(){function e(e){this.key=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 1},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!!e.getValue(this.key)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return d.create(this.key)},e}(),l=function(){function e(e,t){this.key=e,this.value=t}return e.create=function(t,n){return"boolean"===typeof n?n?u.create(t):d.create(t):new e(t,n)},e.prototype.getType=function(){return 3},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)==this.value},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return c.create(this.key,this.value)},e}(),c=function(){function e(e,t){this.key=e,this.value=t}return e.create=function(t,n){return"boolean"===typeof n?n?d.create(t):u.create(t):new e(t,n)},e.prototype.getType=function(){return 4},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)!=this.value},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return l.create(this.key,this.value)},e}(),d=function(){function e(e){this.key=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 2},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!e.getValue(this.key)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return u.create(this.key)},e}(),h=function(){function e(e,t){this.key=e,this.regexp=t}return e.create=function(t,n){return new e(t,n)},e.prototype.getType=function(){return 6},e.prototype.cmp=function(e){if(this.keye.key)return 1;var t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0},e.prototype.equals=function(t){if(t instanceof e){var n=this.regexp?this.regexp.source:"",i=t.regexp?t.regexp.source:"";return this.key===t.key&&n===i}return!1},e.prototype.evaluate=function(e){var t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return p.create(this)},e}(),p=function(){function e(e){this._actual=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 7},e.prototype.cmp=function(e){return this._actual.cmp(e._actual)},e.prototype.equals=function(t){return t instanceof e&&this._actual.equals(t._actual)},e.prototype.evaluate=function(e){return!this._actual.evaluate(e)},e.prototype.keys=function(){return this._actual.keys()},e.prototype.negate=function(){return this._actual},e}(),f=function(){function e(e){this.expr=e}return e.create=function(t){var n=e._normalizeArr(t);if(0!==n.length)return 1===n.length?n[0]:new e(n)},e.prototype.getType=function(){return 5},e.prototype.cmp=function(e){if(this.expr.lengthe.expr.length)return 1;for(var t=0,n=this.expr.length;t1){for(var a=t.shift(),u=t.shift(),l=[],c=0,d=r(a);c255?255:0|e}function r(e){return e<0?0:e>4294967295?4294967295:0|e}function s(e){for(var t=e.length,n=new Uint32Array(t),i=0;i0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&0===n.indexOf(M)){for(var g=null,m=null,v=0,_=0;_0)):v++}m&&m.setGroupLabel(this.typeToLabel(g||"",v))}else s.length>0&&s[0].setGroupLabel(r["r"](I["e"]._symbols_,s.length));return s},t.prototype.typeToLabel=function(e,t){switch(e){case"module":return r["r"](I["e"]._modules_,t);case"class":return r["r"](I["e"]._class_,t);case"interface":return r["r"](I["e"]._interface_,t);case"method":return r["r"](I["e"]._method_,t);case"function":return r["r"](I["e"]._function_,t);case"property":return r["r"](I["e"]._property_,t);case"variable":return r["r"](I["e"]._variable_,t);case"var":return r["r"](I["e"]._variable2_,t);case"constructor":return r["r"](I["e"]._constructor_,t);case"call":return r["r"](I["e"]._call_,t)}return e},t.prototype.sortNormal=function(e,t,n){var i=t.getLabel().toLowerCase(),o=n.getLabel().toLowerCase(),r=i.localeCompare(o);if(0!==r)return r;var s=t.getRange(),a=n.getRange();return s.startLineNumber-a.startLineNumber},t.prototype.sortScoped=function(e,t,n){e=e.substr(M.length);var i=t.getType(),o=n.getType(),r=i.localeCompare(o);if(0!==r)return r;if(e){var s=t.getLabel().toLowerCase(),a=n.getLabel().toLowerCase(),u=s.localeCompare(a);if(0!==u)return u}var l=t.getRange(),c=n.getRange();return l.startLineNumber-c.startLineNumber},t}(k["a"]);Object(a["f"])(P)},"5aa5":function(e,t,n){"use strict";n.d(t,"c",function(){return p}),n.d(t,"d",function(){return f}),n.d(t,"b",function(){return g}),n.d(t,"a",function(){return v});n("c84a");var i=n("30db"),o=n("dff7"),r=n("a666"),s=n("f070"),a=n("11f7"),u=n("ef8e"),l=n("a60f"),c=n("b835"),d=n("308f"),h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(e){function t(t,n,i){var o=e.call(this)||this;return o.options=i,o._context=t||o,o._action=n,n instanceof s["a"]&&o._register(n.onDidChange(function(e){o.element&&o.handleActionChangeEvent(e)})),o}return h(t,e),t.prototype.handleActionChangeEvent=function(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()},Object.defineProperty(t.prototype,"actionRunner",{get:function(){return this._actionRunner},set:function(e){this._actionRunner=e},enumerable:!0,configurable:!0}),t.prototype.getAction=function(){return this._action},t.prototype.isEnabled=function(){return this._action.enabled},t.prototype.setActionContext=function(e){this._context=e},t.prototype.render=function(e){var t=this;this.element=e,l["b"].addTarget(e);var n=this.options&&this.options.draggable;n&&(e.draggable=!0),this._register(a["h"](this.element,l["a"].Tap,function(e){return t.onClick(e)})),this._register(a["h"](this.element,a["d"].MOUSE_DOWN,function(e){n||a["c"].stop(e,!0),t._action.enabled&&0===e.button&&t.element&&a["f"](t.element,"active")})),this._register(a["h"](this.element,a["d"].CLICK,function(e){a["c"].stop(e,!0),t.options&&t.options.isMenu?t.onClick(e):i["h"](function(){return t.onClick(e)})})),this._register(a["h"](this.element,a["d"].DBLCLICK,function(e){a["c"].stop(e,!0)})),[a["d"].MOUSE_UP,a["d"].MOUSE_OUT].forEach(function(e){t._register(a["h"](t.element,e,function(e){a["c"].stop(e),a["I"](t.element,"active")}))})},t.prototype.onClick=function(e){var t;a["c"].stop(e,!0),u["k"](this._context)?t=e:(t=this._context,u["h"](t)&&(t.event=e)),this._actionRunner.run(this._action,t)},t.prototype.focus=function(){this.element&&(this.element.focus(),a["f"](this.element,"focused"))},t.prototype.blur=function(){this.element&&(this.element.blur(),a["I"](this.element,"focused"))},t.prototype.updateEnabled=function(){},t.prototype.updateLabel=function(){},t.prototype.updateTooltip=function(){},t.prototype.updateClass=function(){},t.prototype.updateChecked=function(){},t.prototype.dispose=function(){this.element&&(a["K"](this.element),this.element=void 0),e.prototype.dispose.call(this)},t}(r["a"]),f=function(e){function t(n){var i=e.call(this,t.ID,n,n?"separator text":"separator")||this;return i.checked=!1,i.radio=!1,i.enabled=!1,i}return h(t,e),t.ID="vs.actions.separator",t}(s["a"]),g=function(e){function t(t,n,i){void 0===i&&(i={});var o=e.call(this,t,n,i)||this;return o.options=i,o.options.icon=void 0!==i.icon&&i.icon,o.options.label=void 0===i.label||i.label,o.cssClass="",o}return h(t,e),t.prototype.render=function(t){e.prototype.render.call(this,t),this.element&&(this.label=a["m"](this.element,a["a"]("a.action-label"))),this._action.id===f.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button"),this.options.label&&this.options.keybinding&&this.element&&(a["m"](this.element,a["a"]("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()},t.prototype.focus=function(){e.prototype.focus.call(this),this.label.focus()},t.prototype.updateLabel=function(){this.options.label&&(this.label.textContent=this.getAction().label)},t.prototype.updateTooltip=function(){var e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=o["a"]({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&(this.label.title=e)},t.prototype.updateClass=function(){this.cssClass&&a["J"](this.label,this.cssClass),this.options.icon?(this.cssClass=this.getAction().class,a["f"](this.label,"icon"),this.cssClass&&a["g"](this.label,this.cssClass),this.updateEnabled()):a["I"](this.label,"icon")},t.prototype.updateEnabled=function(){this.getAction().enabled?(this.label.removeAttribute("aria-disabled"),this.element&&a["I"](this.element,"disabled"),a["I"](this.label,"disabled"),this.label.tabIndex=0):(this.label.setAttribute("aria-disabled","true"),this.element&&a["f"](this.element,"disabled"),a["f"](this.label,"disabled"),a["L"](this.label))},t.prototype.updateChecked=function(){this.getAction().checked?a["f"](this.label,"checked"):a["I"](this.label,"checked")},t}(p),m={orientation:0,context:null,triggerKeys:{keys:[3,10],keyDown:!1}},v=function(e){function t(t,n){void 0===n&&(n=m);var i,o,r=e.call(this)||this;switch(r._onDidBlur=r._register(new d["a"]),r.onDidBlur=r._onDidBlur.event,r._onDidCancel=r._register(new d["a"]),r.onDidCancel=r._onDidCancel.event,r._onDidRun=r._register(new d["a"]),r.onDidRun=r._onDidRun.event,r._onDidBeforeRun=r._register(new d["a"]),r.onDidBeforeRun=r._onDidBeforeRun.event,r.options=n,r._context=n.context,r.options.triggerKeys||(r.options.triggerKeys=m.triggerKeys),r.options.actionRunner?r._actionRunner=r.options.actionRunner:(r._actionRunner=new s["b"],r._register(r._actionRunner)),r._register(r._actionRunner.onDidRun(function(e){return r._onDidRun.fire(e)})),r._register(r._actionRunner.onDidBeforeRun(function(e){return r._onDidBeforeRun.fire(e)})),r.viewItems=[],r.focusedItem=void 0,r.domNode=document.createElement("div"),r.domNode.className="monaco-action-bar",!1!==n.animated&&a["f"](r.domNode,"animated"),r.options.orientation){case 0:i=15,o=17;break;case 1:i=17,o=15,r.domNode.className+=" reverse";break;case 2:i=16,o=18,r.domNode.className+=" vertical";break;case 3:i=18,o=16,r.domNode.className+=" vertical reverse";break}return r._register(a["h"](r.domNode,a["d"].KEY_DOWN,function(e){var t=new c["a"](e),n=!0;t.equals(i)?r.focusPrevious():t.equals(o)?r.focusNext():t.equals(9)?r.cancel():r.isTriggerKeyEvent(t)?r.options.triggerKeys&&r.options.triggerKeys.keyDown&&r.doTrigger(t):n=!1,n&&(t.preventDefault(),t.stopPropagation())})),r._register(a["h"](r.domNode,a["d"].KEY_UP,function(e){var t=new c["a"](e);r.isTriggerKeyEvent(t)?(r.options.triggerKeys&&!r.options.triggerKeys.keyDown&&r.doTrigger(t),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&r.updateFocusedItem()})),r.focusTracker=r._register(a["S"](r.domNode)),r._register(r.focusTracker.onDidBlur(function(){document.activeElement!==r.domNode&&a["E"](document.activeElement,r.domNode)||(r._onDidBlur.fire(),r.focusedItem=void 0)})),r._register(r.focusTracker.onDidFocus(function(){return r.updateFocusedItem()})),r.actionsList=document.createElement("ul"),r.actionsList.className="actions-container",r.actionsList.setAttribute("role","toolbar"),r.options.ariaLabel&&r.actionsList.setAttribute("aria-label",r.options.ariaLabel),r.domNode.appendChild(r.actionsList),t.appendChild(r.domNode),r}return h(t,e),t.prototype.isTriggerKeyEvent=function(e){var t=!1;return this.options.triggerKeys&&this.options.triggerKeys.keys.forEach(function(n){t=t||e.equals(n)}),t},t.prototype.updateFocusedItem=function(){for(var e=0;e=n.actionsList.children.length?(n.actionsList.appendChild(r),n.viewItems.push(i)):(n.actionsList.insertBefore(r,n.actionsList.children[o]),n.viewItems.splice(o,0,i),o++)})},t.prototype.clear=function(){this.viewItems=Object(r["f"])(this.viewItems),a["p"](this.actionsList)},t.prototype.isEmpty=function(){return 0===this.viewItems.length},t.prototype.focus=function(e){var t=!1,n=void 0;void 0===e?t=!0:"number"===typeof e?n=e:"boolean"===typeof e&&(t=e),t&&"undefined"===typeof this.focusedItem?(this.focusedItem=this.viewItems.length-1,this.focusNext()):(void 0!==n&&(this.focusedItem=n),this.updateFocus())},t.prototype.focusNext=function(){"undefined"===typeof this.focusedItem&&(this.focusedItem=this.viewItems.length-1);var e,t=this.focusedItem;do{this.focusedItem=(this.focusedItem+1)%this.viewItems.length,e=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus()},t.prototype.focusPrevious=function(){"undefined"===typeof this.focusedItem&&(this.focusedItem=0);var e,t=this.focusedItem;do{this.focusedItem=this.focusedItem-1,this.focusedItem<0&&(this.focusedItem=this.viewItems.length-1),e=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0)},t.prototype.updateFocus=function(e){"undefined"===typeof this.focusedItem&&this.actionsList.focus();for(var t=0;t0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},R=function(e,t){return function(n,i){t(n,i,e)}},A=l["a"],F=function(e){function t(t,n,i,r){var s=e.call(this)||this;return s.editor=t,s.renderDisposeables=s._register(new o["b"]),s.model=s._register(new o["d"]),s.allowEditorOverflow=!0,s.markdownRenderer=s._register(new g["a"](t,r,i)),s.model.value=new M(t),s.keyVisible=S.Visible.bindTo(n),s.keyMultipleSignatures=S.MultipleSignatures.bindTo(n),s.visible=!1,s._register(s.model.value.onChangedHints(function(e){e?(s.show(),s.render(e)):s.hide()})),s}return T(t,e),t.prototype.createParamaterHintDOMNodes=function(){var e=this;this.element=A(".editor-widget.parameter-hints-widget");var t=l["m"](this.element,A(".wrapper"));t.tabIndex=-1;var n=l["m"](t,A(".buttons")),i=l["m"](n,A(".button.previous")),o=l["m"](n,A(".button.next")),r=Object(c["b"])(Object(c["a"])(i,"click"));this._register(r(this.previous,this));var s=Object(c["b"])(Object(c["a"])(o,"click"));this._register(s(this.next,this)),this.overloads=l["m"](t,A(".overloads"));var a=A(".body");this.scrollbar=new h["a"](a,{}),this._register(this.scrollbar),t.appendChild(this.scrollbar.getDomNode()),this.signature=l["m"](a,A(".signature")),this.docs=l["m"](a,A(".docs")),this.editor.addContentWidget(this),this.hide(),this.element.style.userSelect="text",this._register(this.editor.onDidChangeCursorSelection(function(t){e.visible&&e.editor.layoutContentWidget(e)}));var u=function(){var t=e.editor.getConfiguration().fontInfo;e.element.style.fontSize=t.fontSize+"px"};u(),this._register(p["b"].chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(function(e){return e.fontInfo}).on(u,null)),this._register(this.editor.onDidLayoutChange(function(t){return e.updateMaxHeight()})),this.updateMaxHeight()},t.prototype.show=function(){var e=this;this.model&&!this.visible&&(this.element||this.createParamaterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(function(){return l["f"](e.element,"visible")},100),this.editor.layoutContentWidget(this))},t.prototype.hide=function(){this.model&&this.visible&&(this.element||this.createParamaterHintDOMNodes(),this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,l["I"](this.element,"visible"),this.editor.layoutContentWidget(this))},t.prototype.getPosition=function(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null},t.prototype.render=function(e){var t=e.signatures.length>1;l["R"](this.element,"multiple",t),this.keyMultipleSignatures.set(t),this.signature.innerHTML="",this.docs.innerHTML="";var n=e.signatures[e.activeSignature];if(n){var o=l["m"](this.signature,A(".code")),r=n.parameters.length>0,s=this.editor.getConfiguration().fontInfo;if(o.style.fontSize=s.fontSize+"px",o.style.fontFamily=s.fontFamily,r)this.renderParameters(o,n,e.activeParameter);else{var a=l["m"](o,A("span"));a.textContent=n.label}this.renderDisposeables.clear();var u=n.parameters[e.activeParameter];if(u&&u.documentation){var c=A("span.documentation");if("string"===typeof u.documentation)c.textContent=u.documentation;else{var h=this.markdownRenderer.render(u.documentation);l["f"](h.element,"markdown-docs"),this.renderDisposeables.add(h),c.appendChild(h.element)}l["m"](this.docs,A("p",{},c))}if(void 0===n.documentation);else if("string"===typeof n.documentation)l["m"](this.docs,A("p",{},n.documentation));else{h=this.markdownRenderer.render(n.documentation);l["f"](h.element,"markdown-docs"),this.renderDisposeables.add(h),l["m"](this.docs,h.element)}var p=!1;u&&"string"===typeof u.documentation&&u.documentation.length>0&&(p=!0),u&&"object"===typeof u.documentation&&u.documentation.value.length>0&&(p=!0),"string"===typeof n.documentation&&n.documentation.length>0&&(p=!0),"object"===typeof n.documentation&&n.documentation.value.length>0&&(p=!0),l["R"](this.signature,"has-docs",p),l["R"](this.docs,"empty",!p);var f=String(e.activeSignature+1);if(e.signatures.length<10&&(f+="/"+e.signatures.length),this.overloads.textContent=f,u){var g=this.getParameterLabel(n,e.activeParameter);this.announcedLabel!==g&&(d["a"](i["a"]("hint","{0}, hint",g)),this.announcedLabel=g)}this.editor.layoutContentWidget(this),this.scrollbar.scanDomNode()}},t.prototype.renderParameters=function(e,t,n){var i=this.getParameterLabelOffsets(t,n),o=i[0],r=i[1],s=document.createElement("span");s.textContent=t.label.substring(0,o);var a=document.createElement("span");a.textContent=t.label.substring(o,r),a.className="parameter active";var u=document.createElement("span");u.textContent=t.label.substring(r),l["m"](e,s,a,u)},t.prototype.getParameterLabel=function(e,t){var n=e.parameters[t];return"string"===typeof n.label?n.label:e.label.substring(n.label[0],n.label[1])},t.prototype.getParameterLabelOffsets=function(e,t){var n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;var i=e.label.lastIndexOf(n.label);return i>=0?[i,i+n.label.length]:[0,0]}return[0,0]},t.prototype.next=function(){this.model.value&&(this.editor.focus(),this.model.value.next())},t.prototype.previous=function(){this.model.value&&(this.editor.focus(),this.model.value.previous())},t.prototype.cancel=function(){this.model.value&&this.model.value.cancel()},t.prototype.getDomNode=function(){return this.element},t.prototype.getId=function(){return t.ID},t.prototype.trigger=function(e){this.model.value&&this.model.value.trigger(e,0)},t.prototype.updateMaxHeight=function(){var e=Math.max(this.editor.getLayoutInfo().height/4,250);this.element.style.maxHeight=e+"px"},t.ID="editor.widget.parameterHintsWidget",t=P([R(1,a["c"]),R(2,x["a"]),R(3,f["a"])],t),t}(o["a"]);Object(D["f"])(function(e,t){var n=e.getColor(N["B"]);if(n){var i=e.type===D["b"]?2:1;t.addRule(".monaco-editor .parameter-hints-widget { border: "+i+"px solid "+n+"; }"),t.addRule(".monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid "+n.transparent(.5)+"; }"),t.addRule(".monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid "+n.transparent(.5)+"; }")}var o=e.getColor(N["A"]);o&&t.addRule(".monaco-editor .parameter-hints-widget { background-color: "+o+"; }");var r=e.getColor(N["Ub"]);r&&t.addRule(".monaco-editor .parameter-hints-widget a { color: "+r+"; }");var s=e.getColor(N["Tb"]);s&&t.addRule(".monaco-editor .parameter-hints-widget code { background-color: "+s+"; }")}),n.d(t,"TriggerParameterHintsAction",function(){return H});var j=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),W=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},V=function(e,t){return function(n,i){t(n,i,e)}},B=function(e){function t(t,n){var i=e.call(this)||this;return i.editor=t,i.widget=i._register(n.createInstance(F,i.editor)),i}return j(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.getId=function(){return t.ID},t.prototype.cancel=function(){this.widget.cancel()},t.prototype.previous=function(){this.widget.previous()},t.prototype.next=function(){this.widget.next()},t.prototype.trigger=function(e){this.widget.trigger(e)},t.ID="editor.controller.parameterHints",t=W([V(1,r["a"])],t),t}(o["a"]),H=function(e){function t(){return e.call(this,{id:"editor.action.triggerParameterHints",label:i["a"]("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:s["a"].hasSignatureHelpProvider,kbOpts:{kbExpr:s["a"].editorTextFocus,primary:3082,weight:100}})||this}return j(t,e),t.prototype.run=function(e,t){var n=B.get(t);n&&n.trigger({triggerKind:_["w"].Invoke})},t}(u["b"]);Object(u["h"])(B),Object(u["f"])(H);var z=175,U=u["c"].bindToContribution(B.get);Object(u["g"])(new U({id:"closeParameterHints",precondition:S.Visible,handler:function(e){return e.cancel()},kbOpts:{weight:z,kbExpr:s["a"].focus,primary:9,secondary:[1033]}})),Object(u["g"])(new U({id:"showPrevParameterHint",precondition:a["a"].and(S.Visible,S.MultipleSignatures),handler:function(e){return e.previous()},kbOpts:{weight:z,kbExpr:s["a"].focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),Object(u["g"])(new U({id:"showNextParameterHint",precondition:a["a"].and(S.Visible,S.MultipleSignatures),handler:function(e){return e.next()},kbOpts:{weight:z,kbExpr:s["a"].focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}))},"5bd7":function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r});var i=n("0a0f"),o=Object(i["c"])("openerService"),r=Object.freeze({_serviceBrand:void 0,registerOpener:function(){return{dispose:function(){}}},registerValidator:function(){return{dispose:function(){}}},open:function(){return Promise.resolve(!1)}})},"5d28":function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return l});var i=n("0f70"),o=n("e757"),r=n("30db"),s=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),a=function(){function e(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"===typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);var t=o["a"].getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}return e.prototype.preventDefault=function(){this.browserEvent.preventDefault&&this.browserEvent.preventDefault()},e.prototype.stopPropagation=function(){this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()},e}(),u=function(e){function t(t){var n=e.call(this,t)||this;return n.dataTransfer=t.dataTransfer,n}return s(t,e),t}(a),l=function(){function e(e,t,n){if(void 0===t&&(t=0),void 0===n&&(n=0),this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t,e)if("wheel"===e.type){var o=e;o.deltaMode===o.DOM_DELTA_LINE?(this.deltaY=-e.deltaY,this.deltaX=-e.deltaX):(this.deltaY=-e.deltaY/40,this.deltaX=-e.deltaX/40)}else{var s=e,a=e;"undefined"!==typeof s.wheelDeltaY?this.deltaY=s.wheelDeltaY/120:"undefined"!==typeof a.VERTICAL_AXIS&&a.axis===a.VERTICAL_AXIS&&(this.deltaY=-a.detail/3),"undefined"!==typeof s.wheelDeltaX?i["l"]&&r["g"]?this.deltaX=-s.wheelDeltaX/120:this.deltaX=s.wheelDeltaX/120:"undefined"!==typeof a.HORIZONTAL_AXIS&&a.axis===a.HORIZONTAL_AXIS&&(this.deltaX=-e.detail/3),0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}return e.prototype.preventDefault=function(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()},e.prototype.stopPropagation=function(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()},e}()},"5d70":function(e,t,n){},"5d75":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("0a0f"),o=Object(i["c"])("telemetryService")},"5ed2":function(e,t,n){"use strict";n.r(t),n.d(t,"editorWordHighlight",function(){return w}),n.d(t,"editorWordHighlightStrong",function(){return C}),n.d(t,"editorWordHighlightBorder",function(){return S}),n.d(t,"editorWordHighlightStrongBorder",function(){return L}),n.d(t,"overviewRulerWordHighlightForeground",function(){return O}),n.d(t,"overviewRulerWordHighlightStrongForeground",function(){return x}),n.d(t,"ctxHasWordHighlights",function(){return N}),n.d(t,"getOccurrencesAtPosition",function(){return D});var i=n("dff7"),o=n("e8e3"),r=n("5fe7"),s=n("2504"),a=n("fdcc"),u=n("a666"),l=n("b2cc"),c=n("6a89"),d=n("c101"),h=n("3352"),p=n("b57f"),f=n("b707"),g=n("4fc3"),m=n("303e"),v=n("b7d0"),_=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},y=function(e,t){return function(n,i){t(n,i,e)}},w=Object(m["Kb"])("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hc:null},i["a"]("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0),C=Object(m["Kb"])("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hc:null},i["a"]("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),S=Object(m["Kb"])("editor.wordHighlightBorder",{light:null,dark:null,hc:m["b"]},i["a"]("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),L=Object(m["Kb"])("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:m["b"]},i["a"]("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),O=Object(m["Kb"])("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},i["a"]("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),x=Object(m["Kb"])("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hc:"#C0A0C0CC"},i["a"]("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),N=new g["d"]("hasWordHighlights",!1);function D(e,t,n){var i=f["i"].ordered(e);return Object(r["h"])(i.map(function(i){return function(){return Promise.resolve(i.provideDocumentHighlights(e,t,n)).then(void 0,a["f"])}}),o["n"])}var k=function(){function e(e,t,n){var i=this;this._wordRange=this._getCurrentWordRange(e,t),this.result=Object(r["f"])(function(o){return i._compute(e,t,n,o)})}return e.prototype._getCurrentWordRange=function(e,t){var n=e.getWordAtPosition(t.getPosition());return n?new c["a"](t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null},e.prototype.isValid=function(e,t,n){for(var i=t.startLineNumber,o=t.startColumn,r=t.endColumn,s=this._getCurrentWordRange(e,t),a=Boolean(this._wordRange&&this._wordRange.equalsRange(s)),u=0,l=n.length;!a&&u=r&&(a=!0)}return a},e.prototype.cancel=function(){this.result.cancel()},e}(),I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t.prototype._compute=function(e,t,n,i){return D(e,t.getPosition(),i).then(function(e){return e||[]})},t}(k),E=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o._selectionIsEmpty=n.isEmpty(),o}return _(t,e),t.prototype._compute=function(e,t,n,i){return Object(r["l"])(250,i).then(function(){if(!t.isEmpty())return[];var i=e.getWordAtPosition(t.getPosition());if(!i)return[];var o=e.findMatches(i.word,!0,!1,!0,n,!1);return o.map(function(e){return{range:e.range,kind:f["h"].Text}})})},t.prototype.isValid=function(t,n,i){var o=n.isEmpty();return this._selectionIsEmpty===o&&e.prototype.isValid.call(this,t,n,i)},t}(k);function M(e,t,n){return f["i"].has(e)?new I(e,t,n):new E(e,t,n)}Object(l["e"])("_executeDocumentHighlights",function(e,t){return D(e,t,s["a"].None)});var T=function(){function e(e,t){var n=this;this.toUnhook=new u["b"],this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this._hasWordHighlights=N.bindTo(t),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getConfiguration().contribInfo.occurrencesHighlight,this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(function(e){n._ignorePositionChangeEvent||n.occurrencesHighlight&&n._onPositionChanged(e)})),this.toUnhook.add(e.onDidChangeModelContent(function(e){n._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(function(e){var t=n.editor.getConfiguration().contribInfo.occurrencesHighlight;n.occurrencesHighlight!==t&&(n.occurrencesHighlight=t,n._stopAll())})),this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}return e.prototype.hasDecorations=function(){return this._decorationIds.length>0},e.prototype.restore=function(){this.occurrencesHighlight&&this._run()},e.prototype._getSortedHighlights=function(){var e=this;return o["d"](this._decorationIds.map(function(t){return e.model.getDecorationRange(t)}).sort(c["a"].compareRangesUsingStarts))},e.prototype.moveNext=function(){var e=this,t=this._getSortedHighlights(),n=o["j"](t,function(t){return t.containsPosition(e.editor.getPosition())}),i=(n+1)%t.length,r=t[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r)}finally{this._ignorePositionChangeEvent=!1}},e.prototype.moveBack=function(){var e=this,t=this._getSortedHighlights(),n=o["j"](t,function(t){return t.containsPosition(e.editor.getPosition())}),i=(n-1+t.length)%t.length,r=t[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r)}finally{this._ignorePositionChangeEvent=!1}},e.prototype._removeDecorations=function(){this._decorationIds.length>0&&(this._decorationIds=this.editor.deltaDecorations(this._decorationIds,[]),this._hasWordHighlights.set(!1))},e.prototype._stopAll=function(){this._removeDecorations(),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)},e.prototype._onPositionChanged=function(e){this.occurrencesHighlight&&3===e.reason?this._run():this._stopAll()},e.prototype._run=function(){var e=this,t=this.editor.getSelection();if(t.startLineNumber===t.endLineNumber){var n=t.startLineNumber,i=t.startColumn,o=t.endColumn,r=this.model.getWordAtPosition({lineNumber:n,column:i});if(!r||r.startColumn>i||r.endColumn=n?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(function(){e.renderDecorations()},n-t)},e.prototype.renderDecorations=function(){this.renderDecorationsTimer=-1;for(var t=[],n=0,i=this.workerRequestValue.length;n=o)return Promise.resolve(n);var s=e[i++],a=Promise.resolve(s());return a.then(function(e){return t(e)?Promise.resolve(e):r()})};return r()}var p,f=function(){function e(e,t){this._token=-1,"function"===typeof e&&"number"===typeof t&&this.setIfNotSet(e,t)}return e.prototype.dispose=function(){this.cancel()},e.prototype.cancel=function(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)},e.prototype.cancelAndSet=function(e,t){var n=this;this.cancel(),this._token=setTimeout(function(){n._token=-1,e()},t)},e.prototype.setIfNotSet=function(e,t){var n=this;-1===this._token&&(this._token=setTimeout(function(){n._token=-1,e()},t))},e}(),g=function(){function e(){this._token=-1}return e.prototype.dispose=function(){this.cancel()},e.prototype.cancel=function(){-1!==this._token&&(clearInterval(this._token),this._token=-1)},e.prototype.cancelAndSet=function(e,t){this.cancel(),this._token=setInterval(function(){e()},t)},e}(),m=function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}return e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.schedule=function(e){void 0===e&&(e=this.timeout),this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)},e.prototype.isScheduled=function(){return-1!==this.timeoutToken},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.doRun()},e.prototype.doRun=function(){this.runner&&this.runner()},e}();(function(){if("function"!==typeof requestIdleCallback||"function"!==typeof cancelIdleCallback){var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});p=function(t){var n=setTimeout(function(){return t(e)}),i=!1;return{dispose:function(){i||(i=!0,clearTimeout(n))}}}}else p=function(e,t){var n=requestIdleCallback(e,"number"===typeof t?{timeout:t}:void 0),i=!1;return{dispose:function(){i||(i=!0,cancelIdleCallback(n))}}}})();var v=function(){function e(e){var t=this;this._didRun=!1,this._executor=function(){try{t._value=e()}catch(n){t._error=n}finally{t._didRun=!0}},this._handle=p(function(){return t._executor()})}return e.prototype.dispose=function(){this._handle.dispose()},e.prototype.getValue=function(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value},e}()},"607c":function(e,t,n){},"62bd":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("308f"),o=new(function(){function e(){this._zoomLevel=0,this._onDidChangeZoomLevel=new i["a"],this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}return e.prototype.getZoomLevel=function(){return this._zoomLevel},e.prototype.setZoomLevel=function(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))},e}())},6424:function(e,t,n){"use strict";function i(e,t,n){var i=null,o=null;if("function"===typeof n.value?(i="value",o=n.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"===typeof n.get&&(i="get",o=n.get),!o)throw new Error("not supported");var r="$memoize$"+t;n[i]=function(){for(var e=[],t=0;t0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=e._maxRounds){t();break}if(!o){t();break}var l=i.findNextBracket(o);if(!l){t();break}var c=Date.now()-u;if(c>e._maxDuration){setTimeout(function(){return e._bracketsRightYield(t,n+1,i,o,s)});break}var d=l.close;if(l.isOpen){var h=a.has(d)?a.get(d):0;a.set(d,h+1)}else{h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){var p=s.get(d);p||(p=new r["a"],s.set(d,p)),p.push(l.range)}}o=l.range.getEndPosition()}},e._bracketsLeftYield=function(t,n,i,r,s,a){var u=new Map,l=Date.now();while(1){if(n>=e._maxRounds&&0===s.size){t();break}if(!r){t();break}var c=i.findPrevBracket(r);if(!c){t();break}var d=Date.now()-l;if(d>e._maxDuration){setTimeout(function(){return e._bracketsLeftYield(t,n+1,i,r,s,a)});break}var h=c.close;if(c.isOpen){v=u.has(h)?u.get(h):0;if(v-=1,u.set(h,Math.max(0,v)),v<0){var p=s.get(h);if(p){var f=p.shift();0===p.size&&s.delete(h);var g=o["a"].fromPositions(c.range.getEndPosition(),f.getStartPosition()),m=o["a"].fromPositions(c.range.getStartPosition(),f.getEndPosition());a.push({range:g}),a.push({range:m}),e._addBracketLeading(i,m,a)}}}else{var v=u.has(h)?u.get(h):0;u.set(h,v+1)}r=c.range.getStartPosition()}},e._addBracketLeading=function(e,t,n){if(t.startLineNumber!==t.endLineNumber){var r=t.startLineNumber,s=e.getLineFirstNonWhitespaceColumn(r);0!==s&&s!==t.startColumn&&(n.push({range:o["a"].fromPositions(new i["a"](r,s),t.getEndPosition())}),n.push({range:o["a"].fromPositions(new i["a"](r,1),t.getEndPosition())}));var a=r-1;if(a>0){var u=e.getLineFirstNonWhitespaceColumn(a);u===t.startColumn&&u!==e.getLineLastNonWhitespaceColumn(a)&&(n.push({range:o["a"].fromPositions(new i["a"](a,u),t.getEndPosition())}),n.push({range:o["a"].fromPositions(new i["a"](a,1),t.getEndPosition())}))}}},e._maxDuration=30,e._maxRounds=2,e}()},"6a89":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("7061"),o=function(){function e(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(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)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var i,o,r,s;return n.startLineNumbert.endLineNumber?(r=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(r=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(r=t.endLineNumber,s=t.endColumn),new e(i,o,r,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var i=t.startLineNumber,o=t.startColumn,r=t.endLineNumber,s=t.endColumn,a=n.startLineNumber,u=n.startColumn,l=n.endLineNumber,c=n.endColumn;return il?(r=l,s=c):r===l&&(s=Math.min(s,c)),i>r?null:i===r&&o>s?null:new e(i,o,r,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return new i["a"](this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new i["a"](this.startLineNumber,this.startColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.lift=function(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null},e.isIRange=function(e){return e&&"number"===typeof e.startLineNumber&&"number"===typeof e.startColumn&&"number"===typeof e.endLineNumber&&"number"===typeof e.endColumn},e.areIntersectingOrTouching=function(e,t){return!(e.endLineNumbere.startLineNumber},e}()},"6d8e":function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i,o=n("30db"),r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),s=/^\w[\w\d+.-]*$/,a=/^\//,u=/^\/\//,l=!0;function c(e,t){if(!e.scheme){if(t||l)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');console.warn('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}')}if(e.scheme&&!s.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!a.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}function d(e,t){return t||l?e||p:(e||(console.trace("BAD uri lacks scheme, falling back to file-scheme."),e="file"),e)}function h(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==f&&(t=f+t):t=f;break}return t}var p="",f="/",g=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,m=function(){function e(e,t,n,i,o,r){void 0===r&&(r=!1),"object"===typeof e?(this.scheme=e.scheme||p,this.authority=e.authority||p,this.path=e.path||p,this.query=e.query||p,this.fragment=e.fragment||p):(this.scheme=d(e,r),this.authority=t||p,this.path=h(this.scheme,n||p),this.query=i||p,this.fragment=o||p,c(this,r))}return e.isUri=function(t){return t instanceof e||!!t&&("string"===typeof t.authority&&"string"===typeof t.fragment&&"string"===typeof t.path&&"string"===typeof t.query&&"string"===typeof t.scheme&&"function"===typeof t.fsPath&&"function"===typeof t.with&&"function"===typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return C(this)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,i=e.path,o=e.query,r=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=p),void 0===n?n=this.authority:null===n&&(n=p),void 0===i?i=this.path:null===i&&(i=p),void 0===o?o=this.query:null===o&&(o=p),void 0===r?r=this.fragment:null===r&&(r=p),t===this.scheme&&n===this.authority&&i===this.path&&o===this.query&&r===this.fragment?this:new _(t,n,i,o,r)},e.parse=function(e,t){void 0===t&&(t=!1);var n=g.exec(e);return n?new _(n[2]||p,decodeURIComponent(n[4]||p),decodeURIComponent(n[5]||p),decodeURIComponent(n[7]||p),decodeURIComponent(n[9]||p),t):new _(p,p,p,p,p)},e.file=function(e){var t=p;if(o["g"]&&(e=e.replace(/\\/g,f)),e[0]===f&&e[1]===f){var n=e.indexOf(f,2);-1===n?(t=e.substring(2),e=f):(t=e.substring(2,n),e=e.substring(n)||f)}return new _("file",t,e,p,p)},e.from=function(e){return new _(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),S(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new _(t);return n._formatted=t.external,n._fsPath=t._sep===v?t.fsPath:null,n}return t},e}(),v=o["g"]?1:void 0,_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return r(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=C(this)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=v),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},t}(m),b=(i={},i[58]="%3A",i[47]="%2F",i[63]="%3F",i[35]="%23",i[91]="%5B",i[93]="%5D",i[64]="%40",i[33]="%21",i[36]="%24",i[38]="%26",i[39]="%27",i[40]="%28",i[41]="%29",i[42]="%2A",i[43]="%2B",i[44]="%2C",i[59]="%3B",i[61]="%3D",i[32]="%20",i);function y(e,t){for(var n=void 0,i=-1,o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r)-1!==i&&(n+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=b[r];void 0!==s?(-1!==i&&(n+=encodeURIComponent(e.substring(i,o)),i=-1),n+=s):-1===i&&(i=o)}}return-1!==i&&(n+=encodeURIComponent(e.substring(i))),void 0!==n?n:e}function w(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,o["g"]&&(t=t.replace(/\//g,"\\")),t}function S(e,t){var n=t?w:y,i="",o=e.scheme,r=e.authority,s=e.path,a=e.query,u=e.fragment;if(o&&(i+=o,i+=":"),(r||"file"===o)&&(i+=f,i+=f),r){var l=r.indexOf("@");if(-1!==l){var c=r.substr(0,l);r=r.substr(l+1),l=c.indexOf(":"),-1===l?i+=n(c,!1):(i+=n(c.substr(0,l),!1),i+=":",i+=n(c.substr(l+1),!1)),i+="@"}r=r.toLowerCase(),l=r.indexOf(":"),-1===l?i+=n(r,!1):(i+=n(r.substr(0,l),!1),i+=r.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){var d=s.charCodeAt(1);d>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3))}else if(s.length>=2&&58===s.charCodeAt(1)){d=s.charCodeAt(0);d>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}i+=n(s,!0)}return a&&(i+="?",i+=n(a,!1)),u&&(i+="#",i+=t?u:y(u,!1)),i}},"6da2":function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"d",function(){return d}),n.d(t,"e",function(){return p});var i=n("3742"),o=n("7ab3"),r=n("7416"),s=function(){function e(e,t){this.endIndex=e,this.type=t}return e}(),a=function(){function e(e,t){this.startOffset=e,this.endOffset=t}return e.prototype.equals=function(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset},e}(),u=function(){function e(e,t,n,i,o,r,s,a,u,l,c,d,h,p,f,g){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=i,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=s,this.lineTokens=a,this.lineDecorations=u,this.tabSize=l,this.spaceWidth=c,this.stopRenderingLineAfter=d,this.renderWhitespace="all"===h?3:"boundary"===h?1:"selection"===h?2:0,this.renderControlCharacters=p,this.fontLigatures=f,this.selectionsOnLine=g&&g.sort(function(e,t){return e.startOffset>>16},e.getCharIndex=function(e){return(65535&e)>>>0},e.prototype.setPartData=function(e,t,n,i){var o=(t<<16|n<<0)>>>0;this._data[e]=o,this._absoluteOffsets[e]=i+n},e.prototype.getAbsoluteOffsets=function(){return this._absoluteOffsets},e.prototype.charOffsetToPartData=function(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]},e.prototype.partDataToCharOffset=function(t,n,i){if(0===this.length)return 0;var o=(t<<16|i<<0)>>>0,r=0,s=this.length-1;while(r+1>>1,u=this._data[a];if(u===o)return a;u>o?s=a:r=a}if(r===s)return r;var l=this._data[r],c=this._data[s];if(l===o)return r;if(c===o)return s;var d,h=e.getPartIndex(l),p=e.getCharIndex(l),f=e.getPartIndex(c);d=h!==f?n:e.getCharIndex(c);var g=i-p,m=d-i;return g<=m?r:s},e}(),c=function(){function e(e,t,n){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}return e}();function d(e,t){if(0===e.lineContent.length){var n=0,i=" ";if(e.lineDecorations.length>0){for(var o=[],r=0,s=e.lineDecorations.length;r')}return t.appendASCIIString(i),new c(new l(0,0),!1,n)}return y(g(e),t)}var h=function(){function e(e,t,n,i){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=i}return e}();function p(e){var t=Object(o["a"])(1e4),n=d(e,t);return new h(n.characterMapping,t.build(),n.containsRTL,n.containsForeignElements)}var f=function(){function e(e,t,n,i,o,r,s,a,u,l,c,d){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=i,this.isOverflowing=o,this.parts=r,this.containsForeignElements=s,this.tabSize=a,this.containsRTL=u,this.spaceWidth=l,this.renderWhitespace=c,this.renderControlCharacters=d}return e}();function g(e){var t,n,i=e.useMonospaceOptimizations,o=e.lineContent;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0){for(var a=0,u=e.lineDecorations.length;a0&&(i[o++]=new s(t,""));for(var r=0,a=e.getCount();r=n){i[o++]=new s(n,l);break}i[o++]=new s(u,l)}}return i}function v(e,t,n){var i=0,o=[],r=0;if(n)for(var a=0,u=t.length;a=50&&(o[r++]=new s(h+1,d),p=h+1,h=-1);p!==c&&(o[r++]=new s(c,d))}else o[r++]=l;i=c}else for(a=0,u=t.length;a50){d=l.type;var m=Math.ceil(g/50);for(f=1;f=L.endOffset&&(S++,L=l&&l[S]);var O=void 0;if(y<_||y>d)O=!0;else if(9===w)O=!0;else if(32===w)if(c)if(C)O=!0;else{var x=y+1y),C?(!O||!u&&b>=a)&&(h[p++]=new s(y,"vs-whitespace"),b%=a):(y===m||O&&y>r)&&(h[p++]=new s(y,g),b%=a),9===w?b=a:i["v"](w)?b+=2:b++,C=O,y===m&&(f++,f0?e.charCodeAt(t-1):0,k=t>1?e.charCodeAt(t-2):0,I=32===D&&32!==k&&9!==k;I||(N=!0)}else N=!0;return h[p++]=new s(t,N?"vs-whitespace":g),h}function b(e,t,n,i){i.sort(r["a"].compare);for(var o=r["b"].normalize(e,i),a=o.length,u=0,l=[],c=0,d=0,h=0,p=n.length;hd&&(d=v.startOffset,l[c++]=new s(d,m)),!(v.endOffset+1<=g)){d=g,l[c++]=new s(d,m+" "+v.className);break}d=v.endOffset+1,l[c++]=new s(d,m+" "+v.className),u++}g>d&&(d=g,l[c++]=new s(d,m))}var _=n[n.length-1].endIndex;if(u");for(var S=0,L=d.length;S=0;if(y=0,t.appendASCIIString('0&&(!o||T>1?t.write1(8594):t.write1(65515),T--);while(T>0)t.write1(160),T--}else t.write1(183);y++}w=k}else{k=0;for(p&&t.appendASCIIString(' dir="ltr"'),t.appendASCII(62);_0)t.write1(160),k++,T--;break;case 32:t.write1(160),k++;break;case 60:t.appendASCIIString("<"),k++;break;case 62:t.appendASCIIString(">"),k++;break;case 38:t.appendASCIIString("&"),k++;break;case 0:t.appendASCIIString("�"),k++;break;case 65279:case 8232:t.write1(65533),k++;break;default:i["v"](M)&&b++,m&&M<32?(t.write1(9216+M),k++):(t.write1(M),k++)}y++}w=k}t.appendASCIIString("")}return v.setPartData(a,d.length-1,y,C),u&&t.appendASCIIString(""),t.appendASCIIString(""),new c(v,p,r)}},"6daf":function(e,t,n){"use strict";n.r(t);var i=n("dff7"),o=n("3742"),r=n("b2cc"),s=n("2c29"),a=n("7061"),u=n("6a89"),l=n("c101"),c=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),d=function(e){function t(){return e.call(this,{id:"editor.action.transposeLetters",label:i["a"]("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:l["a"].writable,kbOpts:{kbExpr:l["a"].textInputFocus,primary:0,mac:{primary:306},weight:100}})||this}return c(t,e),t.prototype.positionLeftOf=function(e,t){var n=e.column,i=e.lineNumber;return n>t.getLineMinColumn(i)?Object(o["x"])(t.getLineContent(i).charCodeAt(n-2))?n-=2:n-=1:i>1&&(i-=1,n=t.getLineMaxColumn(i)),new a["a"](i,n)},t.prototype.positionRightOf=function(e,t){var n=e.column,i=e.lineNumber;return n0&&(t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop())}},t}(r["b"]);Object(r["f"])(d)},"6dec":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("0a0f"),o=Object(i["c"])("keybindingService")},"6df4":function(e,t,n){"use strict";n.r(t);var i=n("dff7"),o=n("b2cc"),r=n("62bd"),s=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),a=function(e){function t(){return e.call(this,{id:"editor.action.fontZoomIn",label:i["a"]("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})||this}return s(t,e),t.prototype.run=function(e,t){r["a"].setZoomLevel(r["a"].getZoomLevel()+1)},t}(o["b"]),u=function(e){function t(){return e.call(this,{id:"editor.action.fontZoomOut",label:i["a"]("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})||this}return s(t,e),t.prototype.run=function(e,t){r["a"].setZoomLevel(r["a"].getZoomLevel()-1)},t}(o["b"]),l=function(e){function t(){return e.call(this,{id:"editor.action.fontZoomReset",label:i["a"]("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})||this}return s(t,e),t.prototype.run=function(e,t){r["a"].setZoomLevel(0)},t}(o["b"]);Object(o["f"])(a),Object(o["f"])(u),Object(o["f"])(l)},"6e4e":function(e,t,n){"use strict";n.r(t),n.d(t,"BracketMatchingController",function(){return w});n("f004");var i=n("dff7"),o=n("5fe7"),r=n("a666"),s=n("b2cc"),a=n("7061"),u=n("8025"),l=n("c101"),c=n("3352"),d=n("b57f"),h=n("918c"),p=n("303e"),f=n("b7d0"),g=n("7e32"),m=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),v=Object(p["Kb"])("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},i["a"]("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets.")),_=function(e){function t(){return e.call(this,{id:"editor.action.jumpToBracket",label:i["a"]("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:l["a"].editorTextFocus,primary:3160,weight:100}})||this}return m(t,e),t.prototype.run=function(e,t){var n=w.get(t);n&&n.jumpToBracket()},t}(s["b"]),b=function(e){function t(){return e.call(this,{id:"editor.action.selectToBracket",label:i["a"]("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0})||this}return m(t,e),t.prototype.run=function(e,t){var n=w.get(t);n&&n.selectToBracket()},t}(s["b"]),y=function(){function e(e,t){this.position=e,this.brackets=t}return e}(),w=function(e){function t(t){var n=e.call(this)||this;return n._editor=t,n._lastBracketsData=[],n._lastVersionId=0,n._decorations=[],n._updateBracketsSoon=n._register(new o["d"](function(){return n._updateBrackets()},50)),n._matchBrackets=n._editor.getConfiguration().contribInfo.matchBrackets,n._updateBracketsSoon.schedule(),n._register(t.onDidChangeCursorPosition(function(e){n._matchBrackets&&n._updateBracketsSoon.schedule()})),n._register(t.onDidChangeModelContent(function(e){n._updateBracketsSoon.schedule()})),n._register(t.onDidChangeModel(function(e){n._lastBracketsData=[],n._decorations=[],n._updateBracketsSoon.schedule()})),n._register(t.onDidChangeModelLanguageConfiguration(function(e){n._lastBracketsData=[],n._updateBracketsSoon.schedule()})),n._register(t.onDidChangeConfiguration(function(e){n._matchBrackets=n._editor.getConfiguration().contribInfo.matchBrackets,!n._matchBrackets&&n._decorations.length>0&&(n._decorations=n._editor.deltaDecorations(n._decorations,[])),n._updateBracketsSoon.schedule()})),n}return m(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.getId=function(){return t.ID},t.prototype.jumpToBracket=function(){if(this._editor.hasModel()){var e=this._editor.getModel(),t=this._editor.getSelections().map(function(t){var n=t.getStartPosition(),i=e.matchBracket(n),o=null;if(i)i[0].containsPosition(n)?o=i[1].getStartPosition():i[1].containsPosition(n)&&(o=i[0].getStartPosition());else{var r=e.findNextBracket(n);r&&r.range&&(o=r.range.getStartPosition())}return o?new u["a"](o.lineNumber,o.column,o.lineNumber,o.column):new u["a"](n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}},t.prototype.selectToBracket=function(){if(this._editor.hasModel()){var e=this._editor.getModel(),t=[];this._editor.getSelections().forEach(function(n){var i=n.getStartPosition(),o=e.matchBracket(i),r=null,s=null;if(!o){var a=e.findNextBracket(i);a&&a.range&&(o=e.matchBracket(a.range.getStartPosition()))}o&&(o[0].startLineNumber===o[1].startLineNumber?(r=o[1].startColumn0&&(this._editor.setSelections(t),this._editor.revealRange(t[0]))}},t.prototype._updateBrackets=function(){if(this._matchBrackets){this._recomputeBrackets();for(var e=[],n=0,i=0,o=this._lastBracketsData.length;i1&&o.sort(a["a"].compare);var c=[],d=0,h=0,p=n.length;for(s=0,u=o.length;s0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},U=function(e,t){return function(n,i){t(n,i,e)}},K=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},q=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]1)){var n=this._editor.getModel(),o=this._editor.getPosition(),r=!1,s=this._editor.onDidChangeModelContent(function(e){if(e.isFlush)return r=!0,void s.dispose();for(var t=0,n=e.changes.length;t1||this._instantiationService.invokeFunction(T,this.editor,e,2,o["a"].None).catch(g["e"]))},e.ID="editor.contrib.formatOnPaste",e=z([U(1,x["a"])],e),e}(),X=function(e){function t(){return e.call(this,{id:"editor.action.formatDocument",label:L["a"]("formatDocument.label","Format Document"),alias:"Format Document",precondition:B["a"].and(d["a"].writable,d["a"].hasDocumentFormattingProvider),kbOpts:{kbExpr:B["a"].and(d["a"].editorTextFocus,d["a"].hasDocumentFormattingProvider),primary:1572,linux:{primary:3111},weight:100},menuOpts:{when:d["a"].hasDocumentFormattingProvider,group:"1_modification",order:1.3}})||this}return H(t,e),t.prototype.run=function(e,t){return K(this,void 0,void 0,function(){var n;return q(this,function(i){switch(i.label){case 0:return t.hasModel()?(n=e.get(x["a"]),[4,n.invokeFunction(R,t,1,o["a"].None)]):[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},t}(a["b"]),$=function(e){function t(){return e.call(this,{id:"editor.action.formatSelection",label:L["a"]("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:B["a"].and(d["a"].writable,d["a"].hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:B["a"].and(d["a"].editorTextFocus,d["a"].hasDocumentSelectionFormattingProvider),primary:Object(r["a"])(2089,2084),weight:100},menuOpts:{when:B["a"].and(d["a"].hasDocumentSelectionFormattingProvider,d["a"].hasNonEmptySelection),group:"1_modification",order:1.31}})||this}return H(t,e),t.prototype.run=function(e,t){return K(this,void 0,void 0,function(){var n,i,r;return q(this,function(s){switch(s.label){case 0:return t.hasModel()?(n=e.get(x["a"]),i=t.getModel(),r=t.getSelection(),r.isEmpty()&&(r=new c["a"](r.startLineNumber,1,r.startLineNumber,i.getLineMaxColumn(r.startLineNumber))),[4,n.invokeFunction(T,t,r,1,o["a"].None)]):[2];case 1:return s.sent(),[2]}})})},t}(a["b"]);Object(a["h"])(Z),Object(a["h"])(Y),Object(a["f"])(X),Object(a["f"])($),V["a"].registerCommand("editor.action.format",function(e){return K(G,void 0,void 0,function(){var t,n;return q(this,function(i){switch(i.label){case 0:return t=e.get(u["a"]).getFocusedCodeEditor(),t&&t.hasModel()?(n=e.get(V["b"]),t.getSelection().isEmpty()?[4,n.executeCommand("editor.action.formatDocument")]:[3,2]):[2];case 1:return i.sent(),[3,4];case 2:return[4,n.executeCommand("editor.action.formatSelection")];case 3:i.sent(),i.label=4;case 4:return[2]}})})})},"70c3":function(e,t,n){"use strict";n.d(t,"a",function(){return f});n("ba77");var i=n("a666"),o=n("0f70"),r=n("30db"),s=n("ef8e"),a=n("a60f"),u=n("5d28"),l=n("308f"),c=n("11f7"),d=n("e32d"),h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=!1,f=function(e){function t(t,n,s){void 0===s&&(s={});var u=e.call(this)||this;return u._state=3,u._onDidEnablementChange=u._register(new l["a"]),u.onDidEnablementChange=u._onDidEnablementChange.event,u._onDidStart=u._register(new l["a"]),u.onDidStart=u._onDidStart.event,u._onDidChange=u._register(new l["a"]),u.onDidChange=u._onDidChange.event,u._onDidReset=u._register(new l["a"]),u.onDidReset=u._onDidReset.event,u._onDidEnd=u._register(new l["a"]),u.onDidEnd=u._onDidEnd.event,u.linkedSash=void 0,u.orthogonalStartSashDisposables=u._register(new i["b"]),u.orthogonalEndSashDisposables=u._register(new i["b"]),u.el=Object(c["m"])(t,Object(c["a"])(".monaco-sash")),r["d"]&&Object(c["f"])(u.el,"mac"),u._register(Object(d["a"])(u.el,"mousedown")(u.onMouseDown,u)),u._register(Object(d["a"])(u.el,"dblclick")(u.onMouseDoubleClick,u)),a["b"].addTarget(u.el),u._register(Object(d["a"])(u.el,a["a"].Start)(u.onTouchStart,u)),o["k"]&&Object(c["f"])(u.el,"touch"),u.setOrientation(s.orientation||0),u.hidden=!1,u.layoutProvider=n,u.orthogonalStartSash=s.orthogonalStartSash,u.orthogonalEndSash=s.orthogonalEndSash,Object(c["R"])(u.el,"debug",p),u}return h(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){this._state!==e&&(Object(c["R"])(this.el,"disabled",0===e),Object(c["R"])(this.el,"minimum",1===e),Object(c["R"])(this.el,"maximum",2===e),this._state=e,this._onDidEnablementChange.fire(e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalStartSash",{get:function(){return this._orthogonalStartSash},set:function(e){this.orthogonalStartSashDisposables.clear(),e?(this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this)),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalEndSash",{get:function(){return this._orthogonalEndSash},set:function(e){this.orthogonalEndSashDisposables.clear(),e?(this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this)),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e},enumerable:!0,configurable:!0}),t.prototype.setOrientation=function(e){this.orientation=e,1===this.orientation?(Object(c["f"])(this.el,"horizontal"),Object(c["I"])(this.el,"vertical")):(Object(c["I"])(this.el,"horizontal"),Object(c["f"])(this.el,"vertical")),this.layoutProvider&&this.layout()},t.prototype.onMouseDown=function(e){var t=this;c["c"].stop(e,!1);var n=!1;if(!e.__orthogonalSashEvent){var o=this.getOrthogonalSash(e);o&&(n=!0,e.__orthogonalSashEvent=!0,o.onMouseDown(e))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onMouseDown(e)),this.state){for(var s=Object(c["y"])("iframe").concat(Object(c["y"])("webview")),a=0,l=s;a=this.el.clientHeight-4)return this.orthogonalEndSash}else{if(e.offsetX<=4)return this.orthogonalStartSash;if(e.offsetX>=this.el.clientWidth-4)return this.orthogonalEndSash}},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.el&&this.el.parentElement&&this.el.parentElement.removeChild(this.el),this.el=null},t}(i["a"])},"70cb":function(e,t,n){"use strict";var i=n("fdcc"),o=n("308f"),r=n("a666"),s=n("3742"),a=n("6a89"),u=n("d093"),l=n("2837"),c=n("045b"),d=function(){function e(t){if(t.autoClosingPairs?this._autoClosingPairs=t.autoClosingPairs.map(function(e){return new l["b"](e)}):t.brackets?this._autoClosingPairs=t.brackets.map(function(e){return new l["b"]({open:e[0],close:e[1]})}):this._autoClosingPairs=[],t.__electricCharacterSupport&&t.__electricCharacterSupport.docComment){var n=t.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new l["b"]({open:n.open,close:n.close||""}))}this._autoCloseBefore="string"===typeof t.autoCloseBefore?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=t.surroundingPairs||this._autoClosingPairs}return e.prototype.getAutoClosingPairs=function(){return this._autoClosingPairs},e.prototype.getAutoCloseBeforeSet=function(){return this._autoCloseBefore},e.shouldAutoClosePair=function(e,t,n){if(0===t.getTokenCount())return!0;var i=t.findTokenIndexAtOffset(n-2),o=t.getStandardTokenType(i);return e.isOK(o)},e.prototype.getSurroundingPairs=function(){return this._surroundingPairs},e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t",e}(),h=n("1080"),p=function(){function e(e){this._richEditBrackets=e}return e.prototype.getElectricCharacters=function(){var e=[];if(this._richEditBrackets)for(var t=0,n=this._richEditBrackets.brackets.length;t0&&n.length>0)for(i=0,o=this._brackets.length;i0)for(i=0,o=this._brackets.length;i1){var o=void 0,r=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==i)return r;var s=e.getLineContent(o);if(!n.shouldIgnore(s)&&!/^\s+$/.test(s)&&""!==s)return o;r=o}}return-1},e.prototype.getInheritIndentForLine=function(e,t,n){void 0===n&&(n=!0);var i=this.getIndentRulesSupport(e.getLanguageIdentifier().id);if(!i)return null;if(t<=1)return{indentation:"",action:null};var o=this.getPrecedingValidLine(e,t,i);if(o<0)return null;if(o<1)return{indentation:"",action:null};var r=e.getLineContent(o);if(i.shouldIncrease(r)||i.shouldIndentNextLine(r))return{indentation:s["s"](r),action:l["a"].Indent,line:o};if(i.shouldDecrease(r))return{indentation:s["s"](r),action:null,line:o};if(1===o)return{indentation:s["s"](e.getLineContent(o)),action:null,line:o};var a=o-1,u=i.getIndentMetadata(e.getLineContent(a));if(!(3&u)&&4&u){for(var c=0,d=a-1;d>0;d--)if(!i.shouldIndentNextLine(e.getLineContent(d))){c=d;break}return{indentation:s["s"](e.getLineContent(c+1)),action:null,line:c+1}}if(n)return{indentation:s["s"](e.getLineContent(o)),action:null,line:o};for(d=o;d>0;d--){var h=e.getLineContent(d);if(i.shouldIncrease(h))return{indentation:s["s"](h),action:l["a"].Indent,line:d};if(i.shouldIndentNextLine(h)){c=0;for(var p=d-1;p>0;p--)if(!i.shouldIndentNextLine(e.getLineContent(d))){c=p;break}return{indentation:s["s"](e.getLineContent(c+1)),action:null,line:c+1}}if(i.shouldDecrease(h))return{indentation:s["s"](h),action:null,line:d}}return{indentation:s["s"](e.getLineContent(1)),action:null,line:1}},e.prototype.getGoodIndentForLine=function(e,t,n,o){var r=this.getIndentRulesSupport(t);if(!r)return null;var a=this.getInheritIndentForLine(e,n),u=e.getLineContent(n);if(a){var c=a.line;if(void 0!==c){var d=this._getOnEnterSupport(t),h=null;try{d&&(h=d.onEnter("",e.getLineContent(c),""))}catch(f){Object(i["e"])(f)}if(h){var p=s["s"](e.getLineContent(c));return h.removeText&&(p=p.substring(0,p.length-h.removeText)),h.indentAction===l["a"].Indent||h.indentAction===l["a"].IndentOutdent?p=o.shiftIndent(p):h.indentAction===l["a"].Outdent&&(p=o.unshiftIndent(p)),r.shouldDecrease(u)&&(p=o.unshiftIndent(p)),h.appendText&&(p+=h.appendText),s["s"](p)}}return r.shouldDecrease(u)?a.action===l["a"].Indent?a.indentation:o.unshiftIndent(a.indentation):a.action===l["a"].Indent?o.shiftIndent(a.indentation):a.indentation}return null},e.prototype.getIndentForEnter=function(e,t,n,i){e.forceTokenization(t.startLineNumber);var o,r,a=e.getLineTokens(t.startLineNumber),u=Object(c["a"])(a,t.startColumn-1),d=u.getLineContent(),h=!1;if(u.firstCharOffset>0&&a.getLanguageId(0)!==u.languageId?(h=!0,o=d.substr(0,t.startColumn-1-u.firstCharOffset)):o=a.getLineContent().substring(0,t.startColumn-1),t.isEmpty())r=d.substr(t.startColumn-1-u.firstCharOffset);else{var p=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn);r=p.getLineContent().substr(t.endColumn-1-u.firstCharOffset)}var f=this.getIndentRulesSupport(u.languageId);if(!f)return null;var g=o,m=s["s"](o);if(!i&&!h){var v=this.getInheritIndentForLine(e,t.startLineNumber);f.shouldDecrease(o)&&v&&(m=v.indentation,v.action!==l["a"].Indent&&(m=n.unshiftIndent(m))),g=m+s["B"](s["B"](o," "),"\t")}var _={getLineTokens:function(t){return e.getLineTokens(t)},getLanguageIdentifier:function(){return e.getLanguageIdentifier()},getLanguageIdAtPosition:function(t,n){return e.getLanguageIdAtPosition(t,n)},getLineContent:function(n){return n===t.startLineNumber?g:e.getLineContent(n)}},b=s["s"](a.getLineContent()),y=this.getInheritIndentForLine(_,t.startLineNumber+1);if(!y){var w=h?b:m;return{beforeEnter:w,afterEnter:w}}var C=h?b:y.indentation;return y.action===l["a"].Indent&&(C=n.shiftIndent(C)),f.shouldDecrease(r)&&(C=n.unshiftIndent(C)),{beforeEnter:h?b:m,afterEnter:C}},e.prototype.getIndentActionForType=function(e,t,n,i){var o=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),r=this.getIndentRulesSupport(o.languageId);if(!r)return null;var s,a=o.getLineContent(),u=a.substr(0,t.startColumn-1-o.firstCharOffset);if(t.isEmpty())s=a.substr(t.startColumn-1-o.firstCharOffset);else{var c=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn);s=c.getLineContent().substr(t.endColumn-1-o.firstCharOffset)}if(!r.shouldDecrease(u+s)&&r.shouldDecrease(u+n+s)){var d=this.getInheritIndentForLine(e,t.startLineNumber,!1);if(!d)return null;var h=d.indentation;return d.action!==l["a"].Indent&&(h=i.unshiftIndent(h)),h}return null},e.prototype.getIndentMetadata=function(e,t){var n=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null},e.prototype._getOnEnterSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.onEnter||null},e.prototype.getRawEnterActionAtPosition=function(e,t,n){var i=this.getEnterAction(e,new a["a"](t,n,t,n));return i?i.enterAction:null},e.prototype.getEnterAction=function(e,t){var n=this.getIndentationAtPosition(e,t.startLineNumber,t.startColumn),o=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),r=this._getOnEnterSupport(o.languageId);if(!r)return null;var s,a=o.getLineContent(),u=a.substr(0,t.startColumn-1-o.firstCharOffset);if(t.isEmpty())s=a.substr(t.startColumn-1-o.firstCharOffset);else{var c=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn);s=c.getLineContent().substr(t.endColumn-1-o.firstCharOffset)}var d=t.startLineNumber,h="";if(d>1&&0===o.firstCharOffset){var p=this.getScopedLineTokens(e,d-1);p.languageId===o.languageId&&(h=p.getLineContent())}var f=null;try{f=r.onEnter(h,u,s)}catch(g){Object(i["e"])(g)}return f?(f.appendText||(f.indentAction===l["a"].Indent||f.indentAction===l["a"].IndentOutdent?f.appendText="\t":f.appendText=""),f.removeText&&(n=n.substring(0,n.length-f.removeText)),{enterAction:f,indentation:n}):null},e.prototype.getIndentationAtPosition=function(e,t,n){var i=e.getLineContent(t),o=s["s"](i);return o.length>n-1&&(o=o.substring(0,n-1)),o},e.prototype.getScopedLineTokens=function(e,t,n){e.forceTokenization(t);var i=e.getLineTokens(t),o="undefined"===typeof n?e.getLineMaxColumn(t)-1:n-1,r=Object(c["a"])(i,o);return r},e.prototype.getBracketsSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.brackets||null},e}(),b=new _},7121:function(e,t,n){"use strict";var i,o,r=n("11f7"),s=n("ceb8"),a=n("308f"),u=n("a666"),l=n("b589"),c=n("82c9"),d=(n("3359"),n("d379")),h=n("6a89"),p=n("b57f"),f=n("b78f"),g=n("3a57"),m=n("c4e3"),v=(n("54f2"),n("3742")),_=n("aa3d"),b={badgeBackground:s["a"].fromHex("#4D4D4D"),badgeForeground:s["a"].fromHex("#FFFFFF")},y=function(){function e(e,t){this.count=0,this.options=t||Object.create(null),Object(_["g"])(this.options,b,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=Object(r["m"])(e,Object(r["a"])(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}return e.prototype.setCount=function(e){this.count=e,this.render()},e.prototype.setTitleFormat=function(e){this.titleFormat=e,this.render()},e.prototype.render=function(){this.element.textContent=Object(v["r"])(this.countFormat,this.count),this.element.title=Object(v["r"])(this.titleFormat,this.count),this.applyStyles()},e.prototype.style=function(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()},e.prototype.applyStyles=function(){if(this.element){var e=this.badgeBackground?this.badgeBackground.toString():null,t=this.badgeForeground?this.badgeForeground.toString():null,n=this.badgeBorder?this.badgeBorder.toString():null;this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=n?"1px":null,this.element.style.borderStyle=n?"solid":null,this.element.style.borderColor=n}},e}(),w=n("47cb"),C=n("b7d0"),S=n("a6d7"),L=n("dff7"),O=n("debc"),x=n("0a0f"),N=n("6dec"),D=n("7e93"),k=n("ee56"),I=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},M=function(e,t){return function(n,i){t(n,i,e)}},T=function(){function e(e){this._resolverService=e}return e.prototype.hasChildren=function(e){return e instanceof g["c"]||e instanceof g["a"]&&!e.failure},e.prototype.getChildren=function(e){if(e instanceof g["c"])return e.groups;if(e instanceof g["a"])return e.resolve(this._resolverService).then(function(e){return e.children});throw new Error("bad tree")},e=E([M(0,f["a"])],e),e}(),P=function(){function e(){}return e.prototype.getHeight=function(){return 23},e.prototype.getTemplateId=function(e){return e instanceof g["a"]?j.id:V.id},e}(),R=function(){function e(e){this._keybindingService=e}return e.prototype.getKeyboardNavigationLabel=function(e){if(e instanceof g["b"]){var t=e.parent.preview,n=t&&t.preview(e.range);if(n)return n.value}return Object(c["b"])(e.uri)},e.prototype.mightProducePrintableCharacter=function(e){return this._keybindingService.mightProducePrintableCharacter(e)},e=E([M(0,N["a"])],e),e}(),A=function(){function e(){}return e.prototype.getId=function(e){return e.id},e}(),F=function(e){function t(t,n,i){var o=e.call(this)||this;o._uriLabel=n;var s=document.createElement("div");return r["f"](s,"reference-file"),o.file=o._register(new m["a"](s,{supportHighlights:!0})),o.badge=new y(r["m"](s,r["a"](".count"))),o._register(Object(S["a"])(o.badge,i)),t.appendChild(s),o}return I(t,e),t.prototype.set=function(e,t){var n=Object(c["d"])(e.uri);this.file.setLabel(Object(O["a"])(e.uri),this._uriLabel.getUriLabel(n,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});var i=e.children.length;this.badge.setCount(i),e.failure?this.badge.setTitleFormat(Object(L["a"])("referencesFailre","Failed to resolve file.")):i>1?this.badge.setTitleFormat(Object(L["a"])("referencesCount","{0} references",i)):this.badge.setTitleFormat(Object(L["a"])("referenceCount","{0} reference",i))},t=E([M(1,w["a"]),M(2,C["c"])],t),t}(u["a"]),j=function(){function e(t){this._instantiationService=t,this.templateId=e.id}return e.prototype.renderTemplate=function(e){return this._instantiationService.createInstance(F,e)},e.prototype.renderElement=function(e,t,n){n.set(e.element,Object(D["c"])(e.filterData))},e.prototype.disposeTemplate=function(e){e.dispose()},e.id="FileReferencesRenderer",e=E([M(0,x["a"])],e),e}(),W=function(){function e(e){this.label=new k["a"](e,!1)}return e.prototype.set=function(e,t){var n=e.parent.preview,i=n&&n.preview(e.range);if(i){var o=i.value,s=i.highlight;t&&!D["a"].isDefault(t)?(r["R"](this.label.element,"referenceMatch",!1),this.label.set(o,Object(D["c"])(t))):(r["R"](this.label.element,"referenceMatch",!0),this.label.set(o,[s]))}else this.label.set(Object(c["b"])(e.uri)+":"+(e.range.startLineNumber+1)+":"+(e.range.startColumn+1))},e}(),V=function(){function e(){this.templateId=e.id}return e.prototype.renderTemplate=function(e){return new W(e)},e.prototype.renderElement=function(e,t,n){n.set(e.element,e.filterData)},e.prototype.disposeTemplate=function(){},e.id="OneReferenceRenderer",e}(),B=function(){function e(){}return e.prototype.getAriaLabel=function(e){return e instanceof g["a"]?e.getAriaMessage():e instanceof g["b"]?e.getAriaMessage():null},e}(),H=n("4fc3"),z=n("93d9"),U=n("303e"),K=n("e5aa"),q=(n("e750"),n("ef8e")),G=n("49d9"),Z=n("e8e3"),Y=n("70c3"),X=n("e32d"),$=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Q={separatorBorder:s["a"].transparent},J=function(){function e(e,t,n,i){this.container=e,this.view=t,this.disposable=i,this._cachedVisibleSize=void 0,"number"===typeof n?(this._size=n,this._cachedVisibleSize=void 0,r["f"](e,"visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return"undefined"===typeof this._cachedVisibleSize},enumerable:!0,configurable:!0}),e.prototype.setVisible=function(e,t){e!==this.visible&&(e?(this.size=Object(G["a"])(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"===typeof t?t:this.size,this.size=0),r["R"](this.container,"visible",e),this.view.setVisible&&this.view.setVisible(e))},Object.defineProperty(e.prototype,"minimumSize",{get:function(){return this.visible?this.view.minimumSize:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewMinimumSize",{get:function(){return this.view.minimumSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximumSize",{get:function(){return this.visible?this.view.maximumSize:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewMaximumSize",{get:function(){return this.view.maximumSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){return this.view.priority},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"snap",{get:function(){return!!this.view.snap},enumerable:!0,configurable:!0}),e.prototype.layout=function(e){this.view.layout(this.size,e)},e.prototype.dispose=function(){return this.disposable.dispose(),this.view},e}(),ee=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $(t,e),t.prototype.layout=function(t){e.prototype.layout.call(this,t),this.container.style.height=this.size+"px"},t}(J),te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $(t,e),t.prototype.layout=function(t){e.prototype.layout.call(this,t),this.container.style.width=this.size+"px"},t}(J);(function(e){e[e["Idle"]=0]="Idle",e[e["Busy"]=1]="Busy"})(i||(i={})),function(e){function t(e){return{type:"split",index:e}}function n(e){return{type:"invisible",cachedVisibleSize:e}}e.Distribute={type:"distribute"},e.Split=t,e.Invisible=n}(o||(o={}));var ne=function(e){function t(t,n){void 0===n&&(n={});var o=e.call(this)||this;return o.size=0,o.contentSize=0,o.proportions=void 0,o.viewItems=[],o.sashItems=[],o.state=i.Idle,o._onDidSashChange=o._register(new a["a"]),o.onDidSashChange=o._onDidSashChange.event,o._onDidSashReset=o._register(new a["a"]),o.orientation=q["j"](n.orientation)?0:n.orientation,o.inverseAltBehavior=!!n.inverseAltBehavior,o.proportionalLayout=!!q["j"](n.proportionalLayout)||!!n.proportionalLayout,o.el=document.createElement("div"),r["f"](o.el,"monaco-split-view2"),r["f"](o.el,0===o.orientation?"vertical":"horizontal"),t.appendChild(o.el),o.sashContainer=r["m"](o.el,r["a"](".sash-container")),o.viewContainer=r["m"](o.el,r["a"](".split-view-container")),o.style(n.styles||Q),n.descriptor&&(o.size=n.descriptor.size,n.descriptor.views.forEach(function(e,t){var n=q["j"](e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},i=e.view;o.doAddView(i,n,t,!0)}),o.contentSize=o.viewItems.reduce(function(e,t){return e+t.size},0),o.saveProportions()),o}return $(t,e),Object.defineProperty(t.prototype,"orthogonalStartSash",{get:function(){return this._orthogonalStartSash},set:function(e){for(var t=0,n=this.sashItems;t0&&(this.proportions=this.viewItems.map(function(t){return t.size/e.contentSize}))},t.prototype.onSashStart=function(e){var t=this,n=e.sash,i=e.start,o=e.alt,r=Object(Z["j"])(this.sashItems,function(e){return e.sash===n}),s=Object(u["e"])(Object(X["a"])(document.body,"keydown")(function(e){return a(t.sashDragState.current,e.altKey)}),Object(X["a"])(document.body,"keyup")(function(){return a(t.sashDragState.current,!1)})),a=function(e,n){var i,o,a=t.viewItems.map(function(e){return e.size}),u=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(t.inverseAltBehavior&&(n=!n),n){var c=r===t.sashItems.length-1;if(c){var d=t.viewItems[r];u=(d.minimumSize-d.size)/2,l=(d.maximumSize-d.size)/2}else{d=t.viewItems[r+1];u=(d.size-d.maximumSize)/2,l=(d.size-d.minimumSize)/2}}if(!n){var h=Object(Z["r"])(r,-1),p=Object(Z["r"])(r+1,t.viewItems.length),f=h.reduce(function(e,n){return e+(t.viewItems[n].minimumSize-a[n])},0),g=h.reduce(function(e,n){return e+(t.viewItems[n].viewMaximumSize-a[n])},0),m=0===p.length?Number.POSITIVE_INFINITY:p.reduce(function(e,n){return e+(a[n]-t.viewItems[n].minimumSize)},0),v=0===p.length?Number.NEGATIVE_INFINITY:p.reduce(function(e,n){return e+(a[n]-t.viewItems[n].viewMaximumSize)},0),_=Math.max(f,v),b=Math.min(m,g),y=t.findFirstSnapIndex(h),w=t.findFirstSnapIndex(p);if("number"===typeof y){d=t.viewItems[y];var C=Math.floor(d.viewMinimumSize/2);i={index:y,limitDelta:d.visible?_-C:_+C,size:d.size}}if("number"===typeof w){d=t.viewItems[w],C=Math.floor(d.viewMinimumSize/2);o={index:w,limitDelta:d.visible?b+C:b-C,size:d.size}}}t.sashDragState={start:e,current:e,index:r,sizes:a,minDelta:u,maxDelta:l,alt:n,snapBefore:i,snapAfter:o,disposable:s}};a(i,o)},t.prototype.onSashChange=function(e){var t=e.current,n=this.sashDragState,i=n.index,o=n.start,r=n.sizes,s=n.alt,a=n.minDelta,u=n.maxDelta,l=n.snapBefore,c=n.snapAfter;this.sashDragState.current=t;var d=t-o,h=this.resize(i,d,r,void 0,void 0,a,u,l,c);if(s){var p=i===this.sashItems.length-1,f=this.viewItems.map(function(e){return e.size}),g=p?i:i+1,m=this.viewItems[g],v=m.size-m.maximumSize,_=m.size-m.minimumSize,b=p?i-1:i+1;this.resize(b,-h,f,void 0,void 0,v,_)}this.distributeEmptySpace(),this.layoutViews()},t.prototype.onSashEnd=function(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions()},t.prototype.onViewChange=function(e,t){var n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t="number"===typeof t?t:e.size,t=Object(G["a"])(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)))},t.prototype.resizeView=function(e,t){var n=this;if(this.state!==i.Idle)throw new Error("Cant modify splitview");if(this.state=i.Busy,!(e<0||e>=this.viewItems.length)){var o=Object(Z["r"])(this.viewItems.length).filter(function(t){return t!==e}),r=o.filter(function(e){return 1===n.viewItems[e].priority}).concat([e]),s=o.filter(function(e){return 2===n.viewItems[e].priority}),a=this.viewItems[e];t=Math.round(t),t=Object(G["a"])(t,a.minimumSize,Math.min(a.maximumSize,this.size)),a.size=t,this.relayout(r,s),this.state=i.Idle}},t.prototype.distributeViewSizes=function(){for(var e=this,t=[],n=0,i=0,o=this.viewItems;i0&&(t.push(r),n+=r.size)}for(var s=Math.floor(n/t.length),a=0,u=t;a=this.viewItems.length?-1:this.viewItems[e].size},t.prototype.doAddView=function(e,t,n,o){var s=this;if(void 0===n&&(n=this.viewItems.length),this.state!==i.Idle)throw new Error("Cant modify splitview");this.state=i.Busy;var l=r["a"](".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(l):this.viewContainer.insertBefore(l,this.viewContainer.children.item(n));var c,d=e.onDidChange(function(e){return s.onViewChange(g,e)}),h=Object(u["h"])(function(){return s.viewContainer.removeChild(l)}),p=Object(u["e"])(d,h);c="number"===typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;var f,g=0===this.orientation?new ee(l,e,c,p):new te(l,e,c,p);if(this.viewItems.splice(n,0,g),this.viewItems.length>1){var m=0===this.orientation?1:0,v=0===this.orientation?{getHorizontalSashTop:function(e){return s.getSashPosition(e)}}:{getVerticalSashLeft:function(e){return s.getSashPosition(e)}},_=new Y["a"](this.sashContainer,v,{orientation:m,orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash}),b=0===this.orientation?function(e){return{sash:_,start:e.startY,current:e.currentY,alt:e.altKey}}:function(e){return{sash:_,start:e.startX,current:e.currentX,alt:e.altKey}},y=a["b"].map(_.onDidStart,b),w=y(this.onSashStart,this),C=a["b"].map(_.onDidChange,b),S=C(this.onSashChange,this),L=a["b"].map(_.onDidEnd,function(){return Object(Z["j"])(s.sashItems,function(e){return e.sash===_})}),O=L(this.onSashEnd,this),x=_.onDidReset(function(){var e=Object(Z["j"])(s.sashItems,function(e){return e.sash===_}),t=Object(Z["r"])(e,-1),n=Object(Z["r"])(e+1,s.viewItems.length),i=s.findFirstSnapIndex(t),o=s.findFirstSnapIndex(n);("number"!==typeof i||s.viewItems[i].visible)&&("number"!==typeof o||s.viewItems[o].visible)&&s._onDidSashReset.fire(e)}),N=Object(u["e"])(w,S,O,x,_),D={sash:_,disposable:N};this.sashItems.splice(n-1,0,D)}l.appendChild(e.element),"number"!==typeof t&&"split"===t.type&&(f=[t.index]),o||this.relayout([n],f),this.state=i.Idle,o||"number"===typeof t||"distribute"!==t.type||this.distributeViewSizes()},t.prototype.relayout=function(e,t){var n=this.viewItems.reduce(function(e,t){return e+t.size},0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()},t.prototype.resize=function(e,t,n,i,o,r,s,a,u){var l=this;if(void 0===n&&(n=this.viewItems.map(function(e){return e.size})),void 0===r&&(r=Number.NEGATIVE_INFINITY),void 0===s&&(s=Number.POSITIVE_INFINITY),e<0||e>=this.viewItems.length)return 0;var c=Object(Z["r"])(e,-1),d=Object(Z["r"])(e+1,this.viewItems.length);if(o)for(var h=0,p=o;h=a.limitDelta;D=I!==k.visible,k.setVisible(I,a.size)}if(!D&&u){k=this.viewItems[u.index],I=t0||t});t=!1;var i=this.viewItems.map(function(e){return t=e.maximumSize-e.size>0||t}),o=this.viewItems.slice().reverse();t=!1;var r=o.map(function(e){return t=e.size-e.minimumSize>0||t}).reverse();t=!1;var s=o.map(function(e){return t=e.maximumSize-e.size>0||t}).reverse();this.sashItems.forEach(function(t,o){var a=t.sash,u=!(n[o]&&s[o+1]),l=!(i[o]&&r[o+1]);if(u&&l){var c=Object(Z["r"])(o,-1),d=Object(Z["r"])(o+1,e.viewItems.length),h=e.findFirstSnapIndex(c),p=e.findFirstSnapIndex(d),f="number"===typeof h&&!e.viewItems[h].visible,g="number"===typeof p&&!e.viewItems[p].visible;f&&r[o]?a.state=1:g&&n[o]?a.state=2:a.state=0}else a.state=u&&!l?1:!u&&l?2:3})},t.prototype.getSashPosition=function(e){for(var t=0,n=0;n0)return;if(!o.visible&&o.snap)return i}},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.viewItems.forEach(function(e){return e.dispose()}),this.viewItems=[],this.sashItems.forEach(function(e){return e.disposable.dispose()}),this.sashItems=[]},t}(u["a"]);n.d(t,"a",function(){return le}),n.d(t,"c",function(){return ce}),n.d(t,"b",function(){return de}),n.d(t,"d",function(){return pe}),n.d(t,"e",function(){return fe});var ie=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),oe=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},re=function(e,t){return function(n,i){t(n,i,e)}},se=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},ae=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0?e.children[0]:void 0},t.prototype._revealReference=function(e,t){return se(this,void 0,void 0,function(){var n,i,o,r,s;return ae(this,function(a){switch(a.label){case 0:return this._revealedReference===e?[2]:(this._revealedReference=e,e.uri.scheme!==l["b"].inMemory?this.setTitle(Object(c["c"])(e.uri),this._uriLabel.getUriLabel(Object(c["d"])(e.uri))):this.setTitle(L["a"]("peekView.alternateTitle","References")),n=this._textModelResolverService.createModelReference(e.uri),this._tree.getInput()!==e.parent?[3,1]:(this._tree.reveal(e),[3,3]));case 1:return t&&this._tree.reveal(e.parent),[4,this._tree.expand(e.parent)];case 2:a.sent(),this._tree.reveal(e),a.label=3;case 3:return[4,n];case 4:return i=a.sent(),this._model?(Object(u["f"])(this._previewModelReference),o=i.object,o?(r=this._preview.getModel()===o.textEditorModel?0:1,s=h["a"].lift(e.range).collapseToStart(),this._previewModelReference=i,this._preview.setModel(o.textEditorModel),this._preview.setSelection(s),this._preview.revealRangeInCenter(s,r)):(this._preview.setModel(this._previewNotAvailableMessage),i.dispose()),[2]):(i.dispose(),[2])}})})},t=oe([re(3,C["c"]),re(4,f["a"]),re(5,x["a"]),re(6,K["a"]),re(7,w["a"])],t),t}(K["c"]),he=Object(U["Kb"])("peekViewTitle.background",{dark:"#1E1E1E",light:"#FFFFFF",hc:"#0C141F"},L["a"]("peekViewTitleBackground","Background color of the peek view title area.")),pe=Object(U["Kb"])("peekViewTitleLabel.foreground",{dark:"#FFFFFF",light:"#333333",hc:"#FFFFFF"},L["a"]("peekViewTitleForeground","Color of the peek view title.")),fe=Object(U["Kb"])("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#6c6c6cb3",hc:"#FFFFFF99"},L["a"]("peekViewTitleInfoForeground","Color of the peek view title info.")),ge=Object(U["Kb"])("peekView.border",{dark:"#007acc",light:"#007acc",hc:U["e"]},L["a"]("peekViewBorder","Color of the peek view borders and arrow.")),me=Object(U["Kb"])("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:s["a"].black},L["a"]("peekViewResultsBackground","Background color of the peek view result list.")),ve=Object(U["Kb"])("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:s["a"].white},L["a"]("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),_e=Object(U["Kb"])("peekViewResult.fileForeground",{dark:s["a"].white,light:"#1E1E1E",hc:s["a"].white},L["a"]("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),be=Object(U["Kb"])("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},L["a"]("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),ye=Object(U["Kb"])("peekViewResult.selectionForeground",{dark:s["a"].white,light:"#6C6C6C",hc:s["a"].white},L["a"]("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),we=Object(U["Kb"])("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:s["a"].black},L["a"]("peekViewEditorBackground","Background color of the peek view editor.")),Ce=Object(U["Kb"])("peekViewEditorGutter.background",{dark:we,light:we,hc:we},L["a"]("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),Se=Object(U["Kb"])("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},L["a"]("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),Le=Object(U["Kb"])("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},L["a"]("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),Oe=Object(U["Kb"])("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:U["b"]},L["a"]("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));Object(C["f"])(function(e,t){var n=e.getColor(Se);n&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: "+n+"; }");var i=e.getColor(Le);i&&t.addRule(".monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: "+i+"; }");var o=e.getColor(Oe);o&&t.addRule(".monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid "+o+"; box-sizing: border-box; }");var r=e.getColor(U["b"]);r&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted "+r+"; box-sizing: border-box; }");var s=e.getColor(me);s&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree { background-color: "+s+"; }");var a=e.getColor(ve);a&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree { color: "+a+"; }");var u=e.getColor(_e);u&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .reference-file { color: "+u+"; }");var l=e.getColor(be);l&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: "+l+"; }");var c=e.getColor(ye);c&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: "+c+" !important; }");var d=e.getColor(we);d&&t.addRule(".monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {\tbackground-color: "+d+";}");var h=e.getColor(Ce);h&&t.addRule(".monaco-editor .reference-zone-widget .preview .monaco-editor .margin {\tbackground-color: "+h+";}")})},"722f9":function(e,t,n){},"725e":function(e,t,n){},"72a7":function(e,t,n){"use strict";n("e2b8");var i,o=n("dff7"),r=n("a666"),s=n("ef8e"),a=n("e8e3"),u=n("6424"),l=n("11f7"),c=n("30db"),d=n("a60f"),h=n("b835"),p=n("308f"),f=n("e32d");(function(e){e["TREE"]="tree",e["FORM"]="form"})(i||(i={}));var g=n("7de1"),m=n("ceb8"),v=n("aa3d"),_=function(){function e(e){this.spliceables=e}return e.prototype.splice=function(e,t,n){this.spliceables.forEach(function(i){return i.splice(e,t,n)})},e}(),b=n("49d9"),y=n("7e93");n.d(t,"f",function(){return E}),n.d(t,"e",function(){return P}),n.d(t,"d",function(){return R}),n.d(t,"c",function(){return W}),n.d(t,"a",function(){return V}),n.d(t,"b",function(){return X});var w=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),C=function(){return C=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},L=function(){function e(e){this.trait=e,this.renderedElements=[]}return Object.defineProperty(e.prototype,"templateId",{get:function(){return"template:"+this.trait.trait},enumerable:!0,configurable:!0}),e.prototype.renderTemplate=function(e){return e},e.prototype.renderElement=function(e,t,n){var i=Object(a["j"])(this.renderedElements,function(e){return e.templateData===n});if(i>=0){var o=this.renderedElements[i];this.trait.unrender(n),o.index=t}else{o={index:t,templateData:n};this.renderedElements.push(o)}this.trait.renderIndex(t,n)},e.prototype.splice=function(e,t,n){for(var i=[],o=0,r=this.renderedElements;o=e+t&&i.push({index:s.index+n-t,templateData:s.templateData})}this.renderedElements=i},e.prototype.renderIndexes=function(e){for(var t=0,n=this.renderedElements;t-1&&this.trait.renderIndex(o,r)}},e.prototype.disposeTemplate=function(e){var t=Object(a["j"])(this.renderedElements,function(t){return t.templateData===e});t<0||this.renderedElements.splice(t,1)},e}(),O=function(){function e(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new p["a"],this.onChange=this._onChange.event}return Object.defineProperty(e.prototype,"trait",{get:function(){return this._trait},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return new L(this)},enumerable:!0,configurable:!0}),e.prototype.splice=function(e,t,n){var i=n.length-t,o=e+t,r=this.sortedIndexes.filter(function(t){return t=o}).map(function(e){return e+i}));this.renderer.splice(e,t,n.length),this._set(r,r)},e.prototype.renderIndex=function(e,t){l["R"](t,this._trait,this.contains(e))},e.prototype.unrender=function(e){l["I"](e,this._trait)},e.prototype.set=function(e,t){return this._set(e,e.slice().sort(q),t)},e.prototype._set=function(e,t,n){var i=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;var r=U(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:n}),i},e.prototype.get=function(){return this.indexes},e.prototype.contains=function(e){return Object(a["c"])(this.sortedIndexes,e,q)>=0},e.prototype.dispose=function(){this._onChange=Object(r["f"])(this._onChange)},S([u["a"]],e.prototype,"renderer",null),e}(),x=function(e){function t(){return e.call(this,"focused")||this}return w(t,e),t.prototype.renderIndex=function(t,n){e.prototype.renderIndex.call(this,t,n),this.contains(t)?n.setAttribute("aria-selected","true"):n.removeAttribute("aria-selected")},t}(O),N=function(){function e(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}return e.prototype.splice=function(e,t,n){var i=this;if(!this.identityProvider)return this.trait.splice(e,t,n.map(function(){return!1}));var o=this.trait.get().map(function(e){return i.identityProvider.getId(i.view.element(e)).toString()}),r=n.map(function(e){return o.indexOf(i.identityProvider.getId(e).toString())>-1});this.trait.splice(e,t,r)},e}();function D(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}var k,I=function(){function e(e,t,n){this.list=e,this.view=t,this.disposables=new r["b"];var i=!1!==n.multipleSelectionSupport;this.openController=n.openController||j;var o=p["b"].chain(Object(f["a"])(t.domNode,"keydown")).filter(function(e){return!D(e.target)}).map(function(e){return new h["a"](e)});o.filter(function(e){return 3===e.keyCode}).on(this.onEnter,this,this.disposables),o.filter(function(e){return 16===e.keyCode}).on(this.onUpArrow,this,this.disposables),o.filter(function(e){return 18===e.keyCode}).on(this.onDownArrow,this,this.disposables),o.filter(function(e){return 11===e.keyCode}).on(this.onPageUpArrow,this,this.disposables),o.filter(function(e){return 12===e.keyCode}).on(this.onPageDownArrow,this,this.disposables),o.filter(function(e){return 9===e.keyCode}).on(this.onEscape,this,this.disposables),i&&o.filter(function(e){return(c["d"]?e.metaKey:e.ctrlKey)&&31===e.keyCode}).on(this.onCtrlA,this,this.disposables)}return e.prototype.onEnter=function(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent),this.openController.shouldOpen(e.browserEvent)&&this.list.open(this.list.getFocus(),e.browserEvent)},e.prototype.onUpArrow=function(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()},e.prototype.onDownArrow=function(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()},e.prototype.onPageUpArrow=function(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()},e.prototype.onPageDownArrow=function(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()},e.prototype.onCtrlA=function(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Object(a["r"])(this.list.length),e.browserEvent),this.view.domNode.focus()},e.prototype.onEscape=function(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.view.domNode.focus()},e.prototype.dispose=function(){this.disposables.dispose()},e}();function E(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}(function(e){e[e["Idle"]=0]="Idle",e[e["Typing"]=1]="Typing"})(k||(k={}));var M=function(){function e(e,t,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.enabled=!1,this.state=k.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.enabledDisposables=new r["b"],this.disposables=new r["b"],this.updateOptions(e.options)}return e.prototype.updateOptions=function(e){var t="undefined"===typeof e.enableKeyboardNavigation||!!e.enableKeyboardNavigation;t?this.enable():this.disable(),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)},e.prototype.enable=function(){var e=this;if(!this.enabled){var t=p["b"].chain(Object(f["a"])(this.view.domNode,"keydown")).filter(function(e){return!D(e.target)}).filter(function(){return e.automaticKeyboardNavigation||e.triggered}).map(function(e){return new h["a"](e)}).filter(this.keyboardNavigationLabelProvider.mightProducePrintableCharacter?function(t){return e.keyboardNavigationLabelProvider.mightProducePrintableCharacter(t)}:function(e){return E(e)}).forEach(function(e){e.stopPropagation(),e.preventDefault()}).map(function(e){return e.browserEvent.key}).event,n=p["b"].debounce(t,function(){return null},800),i=p["b"].reduce(p["b"].any(t,n),function(e,t){return null===t?null:(e||"")+t});i(this.onInput,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}},e.prototype.disable=function(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)},e.prototype.onInput=function(e){if(!e)return this.state=k.Idle,void(this.triggered=!1);var t=this.list.getFocus(),n=t.length>0?t[0]:0,i=this.state===k.Idle?1:0;this.state=k.Typing;for(var o=0;o=0&&e[o]===t-(n-o))i.push(e[o--]);i.reverse(),o=n;while(o=e.length)n.push(t[o++]);else if(o>=t.length)n.push(e[i++]);else{if(e[i]===t[o]){n.push(e[i]),i++,o++;continue}e[i]=e.length)n.push(t[o++]);else if(o>=t.length)n.push(e[i++]);else{if(e[i]===t[o]){i++,o++;continue}e[i]-1?t:[e];return n},e.prototype.getDragURI=function(e){return this.dnd.getDragURI(e)},e.prototype.getDragLabel=function(e){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e)},e.prototype.onDragStart=function(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)},e.prototype.onDragOver=function(e,t,n,i){return this.dnd.onDragOver(e,t,n,i)},e.prototype.drop=function(e,t,n,i){this.dnd.drop(e,t,n,i)},e}(),X=function(){function e(e,t,n,s){void 0===s&&(s=H),this._options=s,this.eventBufferer=new p["c"],this.disposables=new r["b"],this._onDidOpen=new p["a"],this.onDidOpen=this._onDidOpen.event,this._onPin=new p["a"],this.didJustPressContextMenuKey=!1,this._onDidDispose=new p["a"],this.onDidDispose=this._onDidDispose.event,this.focus=new x,this.selection=new O("selected"),Object(v["g"])(s,B,!1);var a=[this.focus.renderer,this.selection.renderer];s.accessibilityProvider&&a.push(new Z(s.accessibilityProvider)),n=n.map(function(e){return new G(e.templateId,a.concat([e]))});var u=C({},s,{dnd:s.dnd&&new Y(this,s.dnd)});if(this.view=new g["b"](e,t,n,u),"string"!==typeof s.ariaRole?this.view.domNode.setAttribute("role",i.TREE):this.view.domNode.setAttribute("role",s.ariaRole),this.styleElement=l["s"](this.view.domNode),this.styleController=s.styleController||new V(this.styleElement,this.view.domId),this.spliceable=new _([new N(this.focus,this.view,s.identityProvider),new N(this.selection,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.onDidFocus=p["b"].map(Object(f["a"])(this.view.domNode,"focus",!0),function(){return null}),this.onDidBlur=p["b"].map(Object(f["a"])(this.view.domNode,"blur",!0),function(){return null}),this.disposables.add(new T(this,this.view)),"boolean"!==typeof s.keyboardSupport||s.keyboardSupport){var c=new I(this,this.view,s);this.disposables.add(c)}s.keyboardNavigationLabelProvider&&(this.typeLabelController=new M(this,this.view,s.keyboardNavigationLabelProvider),this.disposables.add(this.typeLabelController)),this.disposables.add(this.createMouseController(s)),this.onFocusChange(this._onFocusChange,this,this.disposables),this.onSelectionChange(this._onSelectionChange,this,this.disposables),s.ariaLabel&&this.view.domNode.setAttribute("aria-label",Object(o["a"])("aria list","{0}. Use the navigation keys to navigate.",s.ariaLabel)),this.style(s)}return Object.defineProperty(e.prototype,"onFocusChange",{get:function(){var e=this;return p["b"].map(this.eventBufferer.wrapEvent(this.focus.onChange),function(t){return e.toListEvent(t)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){var e=this;return p["b"].map(this.eventBufferer.wrapEvent(this.selection.onChange),function(t){return e.toListEvent(t)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domId",{get:function(){return this.view.domId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMouseClick",{get:function(){return this.view.onMouseClick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMouseDblClick",{get:function(){return this.view.onMouseDblClick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMouseMiddleClick",{get:function(){return this.view.onMouseMiddleClick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMouseDown",{get:function(){return this.view.onMouseDown},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTouchStart",{get:function(){return this.view.onTouchStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTap",{get:function(){return this.view.onTap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onContextMenu",{get:function(){var e=this,t=p["b"].chain(Object(f["a"])(this.view.domNode,"keydown")).map(function(e){return new h["a"](e)}).filter(function(t){return e.didJustPressContextMenuKey=58===t.keyCode||t.shiftKey&&68===t.keyCode}).filter(function(e){return e.preventDefault(),e.stopPropagation(),!1}).event,n=p["b"].chain(Object(f["a"])(this.view.domNode,"keyup")).filter(function(){var t=e.didJustPressContextMenuKey;return e.didJustPressContextMenuKey=!1,t}).filter(function(){return e.getFocus().length>0&&!!e.view.domElement(e.getFocus()[0])}).map(function(t){var n=e.getFocus()[0],i=e.view.element(n),o=e.view.domElement(n);return{index:n,element:i,anchor:o,browserEvent:t}}).event,i=p["b"].chain(this.view.onContextMenu).filter(function(){return!e.didJustPressContextMenuKey}).map(function(e){var t=e.element,n=e.index,i=e.browserEvent;return{element:t,index:n,anchor:{x:i.clientX+1,y:i.clientY},browserEvent:i}}).event;return p["b"].any(t,n,i)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onKeyDown",{get:function(){return Object(f["a"])(this.view.domNode,"keydown")},enumerable:!0,configurable:!0}),e.prototype.createMouseController=function(e){return new W(this)},e.prototype.updateOptions=function(e){void 0===e&&(e={}),this._options=C({},this._options,e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options)},Object.defineProperty(e.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),e.prototype.splice=function(e,t,n){var i=this;if(void 0===n&&(n=[]),e<0||e>this.view.length)throw new Error("Invalid start index: "+e);if(t<0)throw new Error("Invalid delete count: "+t);0===t&&0===n.length||this.eventBufferer.bufferEvents(function(){return i.spliceable.splice(e,t,n)})},e.prototype.rerender=function(){this.view.rerender()},e.prototype.element=function(e){return this.view.element(e)},Object.defineProperty(e.prototype,"length",{get:function(){return this.view.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentHeight",{get:function(){return this.view.contentHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollTop",{get:function(){return this.view.getScrollTop()},set:function(e){this.view.setScrollTop(e)},enumerable:!0,configurable:!0}),e.prototype.domFocus=function(){this.view.domNode.focus()},e.prototype.layout=function(e,t){this.view.layout(e,t)},e.prototype.setSelection=function(e,t){for(var n=0,i=e;n=this.length)throw new Error("Invalid index "+o)}this.selection.set(e,t)},e.prototype.getSelection=function(){return this.selection.get()},e.prototype.getSelectedElements=function(){var e=this;return this.getSelection().map(function(t){return e.view.element(t)})},e.prototype.setFocus=function(e,t){for(var n=0,i=e;n=this.length)throw new Error("Invalid index "+o)}this.focus.set(e,t)},e.prototype.focusNext=function(e,t,n,i){if(void 0===e&&(e=1),void 0===t&&(t=!1),0!==this.length){var o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,i);r>-1&&this.setFocus([r],n)}},e.prototype.focusPrevious=function(e,t,n,i){if(void 0===e&&(e=1),void 0===t&&(t=!1),0!==this.length){var o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,i);r>-1&&this.setFocus([r],n)}},e.prototype.focusNextPage=function(e,t){var n=this,i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;var o=this.view.element(i),r=this.getFocusedElements()[0];if(r!==o){var s=this.findPreviousIndex(i,!1,t);s>-1&&r!==this.view.element(s)?this.setFocus([s],e):this.setFocus([i],e)}else{var a=this.view.getScrollTop();this.view.setScrollTop(a+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==a&&setTimeout(function(){return n.focusNextPage(e,t)},0)}},e.prototype.focusPreviousPage=function(e,t){var n,i=this,o=this.view.getScrollTop();n=0===o?this.view.indexAt(o):this.view.indexAfter(o-1);var r=this.view.element(n),s=this.getFocusedElements()[0];if(s!==r){var a=this.findNextIndex(n,!1,t);a>-1&&s!==this.view.element(a)?this.setFocus([a],e):this.setFocus([n],e)}else{var u=o;this.view.setScrollTop(o-this.view.renderHeight),this.view.getScrollTop()!==u&&setTimeout(function(){return i.focusPreviousPage(e,t)},0)}},e.prototype.focusLast=function(e,t){if(0!==this.length){var n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}},e.prototype.focusFirst=function(e,t){if(0!==this.length){var n=this.findNextIndex(0,!1,t);n>-1&&this.setFocus([n],e)}},e.prototype.findNextIndex=function(e,t,n){void 0===t&&(t=!1);for(var i=0;i=this.length&&!t)return-1;if(e%=this.length,!n||n(this.element(e)))return e;e++}return-1},e.prototype.findPreviousIndex=function(e,t,n){void 0===t&&(t=!1);for(var i=0;i=this.length)throw new Error("Invalid index "+e);var n=this.view.getScrollTop(),i=this.view.elementTop(e),o=this.view.elementHeight(e);if(Object(s["g"])(t)){var r=o-this.view.renderHeight;this.view.setScrollTop(r*Object(b["a"])(t,0,1)+i)}else{var a=i+o,u=n+this.view.renderHeight;i=u&&this.view.setScrollTop(a-this.view.renderHeight)}},e.prototype.getRelativeTop=function(e){if(e<0||e>=this.length)throw new Error("Invalid index "+e);var t=this.view.getScrollTop(),n=this.view.elementTop(e),i=this.view.elementHeight(e);if(nt+this.view.renderHeight)return null;var o=i-this.view.renderHeight;return Math.abs((t-n)/o)},e.prototype.getHTMLElement=function(){return this.view.domNode},e.prototype.open=function(e,t){for(var n=this,i=0,o=e;i=this.length)throw new Error("Invalid index "+r)}this._onDidOpen.fire({indexes:e,elements:e.map(function(e){return n.view.element(e)}),browserEvent:t})},e.prototype.pin=function(e){for(var t=0,n=e;t=this.length)throw new Error("Invalid index "+i)}this._onPin.fire(e)},e.prototype.style=function(e){this.styleController.style(e)},e.prototype.toListEvent=function(e){var t=this,n=e.indexes,i=e.browserEvent;return{indexes:n,elements:n.map(function(e){return t.view.element(e)}),browserEvent:i}},e.prototype._onFocusChange=function(){var e=this.focus.get();e.length>0?this.view.domNode.setAttribute("aria-activedescendant",this.view.getElementDomId(e[0])):this.view.domNode.removeAttribute("aria-activedescendant"),this.view.domNode.setAttribute("role","tree"),l["R"](this.view.domNode,"element-focused",e.length>0)},e.prototype._onSelectionChange=function(){var e=this.selection.get();l["R"](this.view.domNode,"selection-none",0===e.length),l["R"](this.view.domNode,"selection-single",1===e.length),l["R"](this.view.domNode,"selection-multiple",e.length>1)},e.prototype.dispose=function(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidOpen.dispose(),this._onPin.dispose(),this._onDidDispose.dispose()},S([u["a"]],e.prototype,"onFocusChange",null),S([u["a"]],e.prototype,"onSelectionChange",null),S([u["a"]],e.prototype,"onContextMenu",null),e}()},7416:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a});var i=n("3742"),o=function(){function e(e,t,n,i){this.startColumn=e,this.endColumn=t,this.className=n,this.type=i}return e._equals=function(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type},e.equalsArr=function(t,n){var i=t.length,o=n.length;if(i!==o)return!1;for(var r=0;rn)&&(!c.isEmpty()||0!==l.type&&3!==l.type)){var d=c.startLineNumber===n?c.startColumn:i,h=c.endLineNumber===n?c.endColumn:o;r[s++]=new e(d,h,l.inlineClassName,l.type)}}return r},e.compare=function(e,t){return e.startColumn===t.startColumn?e.endColumn===t.endColumn?e.classNamet.className?1:0:e.endColumn-t.endColumn:e.startColumn-t.startColumn},e}(),r=function(){function e(e,t,n){this.startOffset=e,this.endOffset=t,this.className=n}return e}(),s=function(){function e(){this.stopOffsets=[],this.classNames=[],this.count=0}return e.prototype.consumeLowerThan=function(e,t,n){while(this.count>0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t);break}this.count++},e}(),a=function(){function e(){}return e.normalize=function(e,t){if(0===t.length)return[];for(var n=[],o=new s,r=0,a=0,u=t.length;a1){var p=e.charCodeAt(c-2);i["w"](p)&&c--}if(d>1){p=e.charCodeAt(d-2);i["w"](p)&&d--}var f=c-1,g=d-2;r=o.consumeLowerThan(f,r,n),0===o.count&&(r=f),o.insert(g,h)}return o.consumeLowerThan(1073741824,r,n),n},e}()},7457:function(e,t,n){},"747f":function(e,t,n){"use strict";n.r(t);var i=n("dff7"),o=n("fe45"),r=n("d585"),s=n("b2cc"),a=n("2c29"),u=n("3742"),l=n("d3f49"),c=n("6a89"),d=function(){function e(e,t){this._selection=e,this._cursors=t,this._selectionId=null}return e.prototype.getEditOperations=function(e,t){for(var n=h(e,this._cursors),i=0,o=n.length;i=0;n--)t[n].lineNumber===t[n+1].lineNumber&&t.splice(n,1);for(var i=[],o=0,r=0,s=t.length,a=1,d=e.getLineCount();a<=d;a++){var h=e.getLineContent(a),p=h.length+1,f=0;if(!(r=i.startLineNumber+1&&t<=i.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t)};var D=y["a"].getGoodIndentForLine(d,e.getLanguageIdAtPosition(f,1),i.startLineNumber+1,l);if(null!==D){b=u["s"](e.getLineContent(i.startLineNumber)),S=w(D,r),x=w(b,r);if(S!==x){var k=S-x;this.getIndentEditsOfMovingBlock(e,t,i,r,a,k)}}}}else t.addEditOperation(new c["a"](i.startLineNumber,1,i.startLineNumber,1),v+"\n")}else if(f=i.startLineNumber-1,m=e.getLineContent(f),t.addEditOperation(new c["a"](f,1,f+1,1),null),t.addEditOperation(new c["a"](i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),"\n"+m),this.shouldAutoIndent(e,i)){d.getLineContent=function(t){return t===f?e.getLineContent(i.startLineNumber):e.getLineContent(t)};N=this.matchEnterRule(e,l,r,i.startLineNumber,i.startLineNumber-2);if(null!==N)0!==N&&this.getIndentEditsOfMovingBlock(e,t,i,r,a,N);else{var I=y["a"].getGoodIndentForLine(d,e.getLanguageIdAtPosition(i.startLineNumber,1),f,l);if(null!==I){var E=u["s"](e.getLineContent(i.startLineNumber));S=w(I,r),x=w(E,r);if(S!==x){k=S-x;this.getIndentEditsOfMovingBlock(e,t,i,r,a,k)}}}}}this._selectionId=t.trackSelection(i)}else this._selectionId=t.trackSelection(this._selection)},e.prototype.buildIndentConverter=function(e,t,n){return{shiftIndent:function(i){return _["a"].shiftIndent(i,i.length+1,e,t,n)},unshiftIndent:function(i){return _["a"].unshiftIndent(i,i.length+1,e,t,n)}}},e.prototype.matchEnterRule=function(e,t,n,i,o,r){var s=o;while(s>=1){var a=void 0;a=s===o&&void 0!==r?r:e.getLineContent(s);var l=u["A"](a);if(l>=0)break;s--}if(s<1||i>e.getLineCount())return null;var d=e.getLineMaxColumn(s),h=y["a"].getEnterAction(e,new c["a"](s,d,s,d));if(h){var p=h.indentation,f=h.enterAction;f.indentAction===b["a"].None?p=h.indentation+f.appendText:f.indentAction===b["a"].Indent?p=h.indentation+f.appendText:f.indentAction===b["a"].IndentOutdent?p=h.indentation:f.indentAction===b["a"].Outdent&&(p=t.unshiftIndent(h.indentation)+f.appendText);var g=e.getLineContent(i);if(this.trimLeft(g).indexOf(this.trimLeft(p))>=0){var m=u["s"](e.getLineContent(i)),v=u["s"](p),_=y["a"].getIndentMetadata(e,i);null!==_&&2&_&&(v=t.unshiftIndent(v));var C=w(v,n),S=w(m,n);return C-S}}return null},e.prototype.trimLeft=function(e){return e.replace(/^\s+/,"")},e.prototype.shouldAutoIndent=function(e,t){if(!this._autoIndent)return!1;if(!e.isCheapToTokenize(t.startLineNumber))return!1;var n=e.getLanguageIdAtPosition(t.startLineNumber,1),i=e.getLanguageIdAtPosition(t.endLineNumber,1);return n===i&&null!==y["a"].getIndentRulesSupport(n)},e.prototype.getIndentEditsOfMovingBlock=function(e,t,n,i,o,r){for(var s=n.startLineNumber;s<=n.endLineNumber;s++){var a=e.getLineContent(s),l=u["s"](a),d=w(l,i),h=d+r,p=C(h,i,o);p!==l&&(t.addEditOperation(new c["a"](s,1,s,l.length+1),p),s===n.endLineNumber&&n.endColumn<=l.length+1&&""===p&&(this._moveEndLineSelectionShrink=!0))}},e.prototype.computeCursorState=function(e,t){var n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber=o)return null;for(var r=[],s=i;s<=o;s++)r.push(e.getLineContent(s));var a=r.slice(0);return a.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),!0===n&&(a=a.reverse()),{startLineNumber:i,endLineNumber:o,before:r,after:a}}function x(e,t,n){var i=O(e,t,n);return i?l["a"].replace(new c["a"](i.startLineNumber,1,i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),i.after.join("\n")):null}n.d(t,"AbstractSortLinesAction",function(){return P}),n.d(t,"SortLinesAscendingAction",function(){return R}),n.d(t,"SortLinesDescendingAction",function(){return A}),n.d(t,"TrimTrailingWhitespaceAction",function(){return F}),n.d(t,"DeleteLinesAction",function(){return j}),n.d(t,"IndentLinesAction",function(){return W}),n.d(t,"InsertLineBeforeAction",function(){return B}),n.d(t,"InsertLineAfterAction",function(){return H}),n.d(t,"AbstractDeleteAllToBoundaryAction",function(){return z}),n.d(t,"DeleteAllLeftAction",function(){return U}),n.d(t,"DeleteAllRightAction",function(){return K}),n.d(t,"JoinLinesAction",function(){return q}),n.d(t,"TransposeAction",function(){return G}),n.d(t,"AbstractCaseAction",function(){return Z}),n.d(t,"UpperCaseAction",function(){return Y}),n.d(t,"LowerCaseAction",function(){return X}),n.d(t,"TitleCaseAction",function(){return $});var N=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),D=function(e){function t(t,n){var i=e.call(this,n)||this;return i.down=t,i}return N(t,e),t.prototype.run=function(e,t){for(var n=[],i=t.getSelections()||[],o=0,r=i;o1&&(d-=1,p=i.getLineMaxColumn(d)),r.push(l["a"].replace(new g["a"](d,p,h,f),"")),s.push(new g["a"](d-o,c.positionColumn,d-o,c.positionColumn)),o+=c.endLineNumber-c.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}}},t.prototype._getLinesToRemove=function(e){var t=e.getSelections().map(function(e){var t=e.endLineNumber;return e.startLineNumber=t[o].startLineNumber?i.endLineNumber=t[o].endLineNumber:(n.push(i),i=t[o]);return n.push(i),n},t}(s["b"]),W=function(e){function t(){return e.call(this,{id:"editor.action.indentLines",label:i["a"]("lines.indent","Indent Line"),alias:"Indent Line",precondition:m["a"].writable,kbOpts:{kbExpr:m["a"].editorTextFocus,primary:2137,weight:100}})||this}return N(t,e),t.prototype.run=function(e,t){var n=t._getCursors();n&&(t.pushUndoStop(),t.executeCommands(this.id,p["a"].indent(n.context.config,t.getModel(),t.getSelections())),t.pushUndoStop())},t}(s["b"]),V=function(e){function t(){return e.call(this,{id:"editor.action.outdentLines",label:i["a"]("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:m["a"].writable,kbOpts:{kbExpr:m["a"].editorTextFocus,primary:2135,weight:100}})||this}return N(t,e),t.prototype.run=function(e,t){r["CoreEditingCommands"].Outdent.runEditorCommand(e,t,null)},t}(s["b"]),B=function(e){function t(){return e.call(this,{id:"editor.action.insertLineBefore",label:i["a"]("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:m["a"].writable,kbOpts:{kbExpr:m["a"].editorTextFocus,primary:3075,weight:100}})||this}return N(t,e),t.prototype.run=function(e,t){var n=t._getCursors();n&&(t.pushUndoStop(),t.executeCommands(this.id,p["a"].lineInsertBefore(n.context.config,t.getModel(),t.getSelections())))},t}(s["b"]),H=function(e){function t(){return e.call(this,{id:"editor.action.insertLineAfter",label:i["a"]("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:m["a"].writable,kbOpts:{kbExpr:m["a"].editorTextFocus,primary:2051,weight:100}})||this}return N(t,e),t.prototype.run=function(e,t){var n=t._getCursors();n&&(t.pushUndoStop(),t.executeCommands(this.id,p["a"].lineInsertAfter(n.context.config,t.getModel(),t.getSelections())))},t}(s["b"]),z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return N(t,e),t.prototype.run=function(e,t){if(t.hasModel()){for(var n=t.getSelection(),i=this._getRangesToDelete(t),o=[],r=0,s=i.length-1;r0){var s=t.startLineNumber-o;r=new g["a"](s,t.startColumn,s,t.startColumn)}else r=new g["a"](t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?n=r:i.push(r)}),n&&i.unshift(n),i},t.prototype._getRangesToDelete=function(e){var t=e.getSelections();if(null===t)return[];var n=t,i=e.getModel();return null===i?[]:(n.sort(c["a"].compareRangesUsingStarts),n=n.map(function(e){if(e.isEmpty()){if(1===e.startColumn){var t=Math.max(1,e.startLineNumber-1),n=1===e.startLineNumber?1:i.getLineContent(t).length+1;return new c["a"](t,n,e.startLineNumber,1)}return new c["a"](e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new c["a"](e.startLineNumber,1,e.endLineNumber,e.endColumn)}),n)},t}(z),K=function(e){function t(){return e.call(this,{id:"deleteAllRight",label:i["a"]("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:m["a"].writable,kbOpts:{kbExpr:m["a"].textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})||this}return N(t,e),t.prototype._getEndCursorState=function(e,t){for(var n=null,i=[],o=0,r=t.length,s=0;oe.endLineNumber+1?(o.push(e),t):new g["a"](e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new g["a"](e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)});o.push(r);var s=t.getModel();if(null!==s){for(var a=[],u=[],d=i,h=0,p=0,f=o.length;p=1){var D=!0;""===L&&(D=!1),!D||" "!==L.charAt(L.length-1)&&"\t"!==L.charAt(L.length-1)||(D=!1,L=L.replace(/[\s\uFEFF\xA0]+$/g," "));var k=x.substr(N-1);L+=(D?" ":"")+k,b=D?k.length+1:k.length}else b=0}var I=new c["a"](v,_,y,w);if(!I.isEmpty()){var E=void 0;m.isEmpty()?(a.push(l["a"].replace(I,L)),E=new g["a"](I.startLineNumber-h,L.length-b+1,v-h,L.length-b+1)):m.startLineNumber===m.endLineNumber?(a.push(l["a"].replace(I,L)),E=new g["a"](m.startLineNumber-h,m.startColumn,m.endLineNumber-h,m.endColumn)):(a.push(l["a"].replace(I,L)),E=new g["a"](m.startLineNumber-h,m.startColumn,m.startLineNumber-h,L.length-C)),null!==c["a"].intersectRanges(I,i)?d=E:u.push(E)}h+=I.endLineNumber-I.startLineNumber}u.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,a,u),t.pushUndoStop()}}}},t}(s["b"]),G=function(e){function t(){return e.call(this,{id:"editor.action.transpose",label:i["a"]("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:m["a"].writable})||this}return N(t,e),t.prototype.run=function(e,t){var n=t.getSelections();if(null!==n){var i=t.getModel();if(null!==i){for(var o=[],r=0,s=n.length;r=d){if(l.lineNumber===i.getLineCount())continue;var h=new c["a"](l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),p=i.getValueInRange(h).split("").reverse().join("");o.push(new a["a"](new g["a"](l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),p))}else{h=new c["a"](l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),p=i.getValueInRange(h).split("").reverse().join("");o.push(new a["b"](h,p,new g["a"](l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}},t}(s["b"]),Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return N(t,e),t.prototype.run=function(e,t){var n=t.getSelections();if(null!==n){var i=t.getModel();if(null!==i){for(var o=t.getConfiguration().wordSeparators,r=[],s=0,u=n.length;s=0?(r=!0,o+=a):r?(r=!1,o+=a.toLocaleUpperCase()):o+=a.toLocaleLowerCase()}return o},t}(Z);Object(s["f"])(k),Object(s["f"])(I),Object(s["f"])(M),Object(s["f"])(T),Object(s["f"])(R),Object(s["f"])(A),Object(s["f"])(F),Object(s["f"])(j),Object(s["f"])(W),Object(s["f"])(V),Object(s["f"])(B),Object(s["f"])(H),Object(s["f"])(U),Object(s["f"])(K),Object(s["f"])(q),Object(s["f"])(G),Object(s["f"])(Y),Object(s["f"])(X),Object(s["f"])($)},7605:function(e,t,n){"use strict";n.r(t);n("0a33");var i=n("dff7"),o=n("ef8e"),r=n("3742"),s=n("5fe7"),a=n("fe45"),u=n("a666"),l=n("b2cc"),c=n("308f"),d=65535,h=16777215,p=4278190080,f=function(){function e(e,t,n){if(e.length!==t.length||e.length>d)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=n,this._parentsComputed=!1}return e.prototype.ensureParentIndices=function(){var e=this;if(!this._parentsComputed){this._parentsComputed=!0;for(var t=[],n=function(n,i){var o=t[t.length-1];return e.getStartLineNumber(o)<=n&&e.getEndLineNumber(o)>=i},i=0,o=this._startIndexes.length;ih||s>h)throw new Error("startLineNumber or endLineNumber must not exceed "+h);while(t.length>0&&!n(r,s))t.pop();var a=t.length>0?t[t.length-1]:-1;t.push(i),this._startIndexes[i]=r+((255&a)<<24),this._endIndexes[i]=s+((65280&a)<<16)}}},Object.defineProperty(e.prototype,"length",{get:function(){return this._startIndexes.length},enumerable:!0,configurable:!0}),e.prototype.getStartLineNumber=function(e){return this._startIndexes[e]&h},e.prototype.getEndLineNumber=function(e){return this._endIndexes[e]&h},e.prototype.getType=function(e){return this._types?this._types[e]:void 0},e.prototype.hasTypes=function(){return!!this._types},e.prototype.isCollapsed=function(e){var t=e/32|0,n=e%32;return 0!==(this._collapseStates[t]&1<>>24)+((this._endIndexes[e]&p)>>>16);return t===d?-1:t},e.prototype.contains=function(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t},e.prototype.findIndex=function(e){var t=0,n=this._startIndexes.length;if(0===n)return-1;while(t=0){var n=this.getEndLineNumber(t);if(n>=e)return t;t=this.getParentIndex(t);while(-1!==t){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1},e.prototype.toString=function(){for(var e=[],t=0;t=this.endLineNumber},e.prototype.containsLine=function(e){return this.startLineNumber<=e&&e<=this.endLineNumber},e}(),m=function(){function e(e,t){this._updateEventEmitter=new c["a"],this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new f(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}return Object.defineProperty(e.prototype,"regions",{get:function(){return this._regions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textModel",{get:function(){return this._textModel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInitialized",{get:function(){return this._isInitialized},enumerable:!0,configurable:!0}),e.prototype.toggleCollapseState=function(e){var t=this;if(e.length){var n={};this._decorationProvider.changeDecorations(function(i){for(var o=0,r=e;o=h))break;r(u,d===h),u++}}l=a()}while(u0)return e},e.prototype.applyMemento=function(e){if(Array.isArray(e)){for(var t=[],n=0,i=e;n=0){var r=this._regions.toRegion(i);t&&!t(r,o)||n.push(r),o++,i=r.parentIndex}}return n},e.prototype.getRegionAtLine=function(e){if(this._regions){var t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null},e.prototype.getRegionsInside=function(e,t){var n=[],i=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length)for(var r=[],s=i,a=this._regions.length;s0&&!u.containedBy(r[r.length-1]))r.pop();r.push(u),t(u,r.length)&&n.push(u)}else for(s=i,a=this._regions.length;s0)for(var r=0,s=i;r1)){var l=e.getRegionsInside(u,function(e,i){return e.isCollapsed!==t&&i=0;s--)if(n!==o.isCollapsed(s)){var a=o.getStartLineNumber(s);t.test(i.getLineContent(a))&&r.push(o.toRegion(s))}e.toggleCollapseState(r)}function w(e,t,n){for(var i=e.regions,o=[],r=i.length-1;r>=0;r--)n!==i.isCollapsed(r)&&t===i.getType(r)&&o.push(i.toRegion(r));e.toggleCollapseState(o)}var C=n("b57f"),S=function(){function e(e){this.editor=e,this.autoHideFoldingControls=!0}return e.prototype.getDecorationOption=function(t){return t?e.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?e.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:e.EXPANDED_VISUAL_DECORATION},e.prototype.deltaDecorations=function(e,t){return this.editor.deltaDecorations(e,t)},e.prototype.changeDecorations=function(e){return this.editor.changeDecorations(e)},e.COLLAPSED_VISUAL_DECORATION=C["a"].register({stickiness:1,afterContentClassName:"inline-folded",linesDecorationsClassName:"folding collapsed"}),e.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=C["a"].register({stickiness:1,linesDecorationsClassName:"folding"}),e.EXPANDED_VISUAL_DECORATION=C["a"].register({stickiness:1,linesDecorationsClassName:"folding alwaysShowFoldIcons"}),e}(),L=n("c101"),O=n("6a89"),x=n("e8e3"),N=function(){function e(e){var t=this;this._updateEventEmitter=new c["a"],this._foldingModel=e,this._foldingModelListener=e.onDidChange(function(e){return t.updateHiddenRanges()}),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._updateEventEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hiddenRanges",{get:function(){return this._hiddenRanges},enumerable:!0,configurable:!0}),e.prototype.updateHiddenRanges=function(){for(var e=!1,t=[],n=0,i=0,o=Number.MAX_VALUE,r=-1,s=this._foldingModel.regions;n0},e.prototype.isHidden=function(e){return null!==k(this._hiddenRanges,e)},e.prototype.adjustSelections=function(e){for(var t=this,n=!1,i=this._foldingModel.textModel,o=null,r=function(e){return o&&D(e,o)||(o=k(t._hiddenRanges,e)),o?o.startLineNumber-1:null},s=0,a=e.length;s0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)},e}();function D(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}function k(e,t){var n=Object(x["h"])(e,function(e){return t=0&&e[n].endLineNumber>=t?e[n]:null}var I=n("70cb"),E=5e3,M="indent",T=function(){function e(e){this.editorModel=e,this.id=M}return e.prototype.dispose=function(){},e.prototype.compute=function(e){var t=I["a"].getFoldingRules(this.editorModel.getLanguageIdentifier().id),n=t&&!!t.offSide,i=t&&t.markers;return Promise.resolve(R(this.editorModel,n,i))},e}(),P=function(){function e(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}return e.prototype.insertFirst=function(e,t,n){if(!(e>h||t>h)){var i=this._length;this._startIndexes[i]=e,this._endIndexes[i]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}},e.prototype.toIndentRanges=function(e){if(this._length<=this._foldingRangesLimit){for(var t=new Uint32Array(this._length),n=new Uint32Array(this._length),i=this._length-1,o=0;i>=0;i--,o++)t[o]=this._startIndexes[i],n[o]=this._endIndexes[i];return new f(t,n)}var r=0,s=this._indentOccurrences.length;for(i=0;ithis._foldingRangesLimit){s=i;break}r+=a}}var u=e.getOptions().tabSize;for(t=new Uint32Array(this._foldingRangesLimit),n=new Uint32Array(this._foldingRangesLimit),i=this._length-1,o=0;i>=0;i--){var l=this._startIndexes[i],c=e.getLineContent(l),d=C["b"].computeIndentLevel(c,u);(d0;l--){var c=e.getLineContent(l),d=C["b"].computeIndentLevel(c,o),h=a[a.length-1];if(-1!==d){var p=void 0;if(s&&(p=c.match(s))){if(!p[1]){a.push({indent:-2,endAbove:l,line:l});continue}var f=a.length-1;while(f>0&&-2!==a[f].indent)f--;if(f>0){a.length=f+1,h=a[f],r.insertFirst(l,h.line,d),h.line=l,h.indent=d,h.endAbove=l;continue}}if(h.indent>d){do{a.pop(),h=a[a.length-1]}while(h.indent>d);var g=h.endAbove-1;g-l>=1&&r.insertFirst(l,g,d)}h.indent===d?h.endAbove=l:a.push({indent:d,endAbove:l,line:l})}else t&&(h.endAbove=l)}return r.toIndentRanges(e)}var A=n("b707"),F=n("fdcc"),j=5e3,W={},V="syntax",B=function(){function e(e,t,n){void 0===n&&(n=j),this.editorModel=e,this.providers=t,this.limit=n,this.id=V}return e.prototype.compute=function(e){var t=this;return H(this.providers,this.editorModel,e).then(function(e){if(e){var n=U(e,t.limit);return n}return null})},e.prototype.dispose=function(){},e}();function H(e,t,n){var i=null,o=e.map(function(e,o){return Promise.resolve(e.provideFoldingRanges(t,W,n)).then(function(e){if(!n.isCancellationRequested&&Array.isArray(e)){Array.isArray(i)||(i=[]);for(var r=t.getLineCount(),s=0,a=e;s0&&u.end>u.start&&u.end<=r&&i.push({start:u.start,end:u.end,rank:o,kind:u.kind})}}},F["f"])});return Promise.all(o).then(function(e){return i})}var z=function(){function e(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}return e.prototype.add=function(e,t,n,i){if(!(e>h||t>h)){var o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=i,this._types[o]=n,this._length++,i<30&&(this._nestingLevelCounts[i]=(this._nestingLevelCounts[i]||0)+1)}},e.prototype.toIndentRanges=function(){if(this._length<=this._foldingRangesLimit){for(var e=new Uint32Array(this._length),t=new Uint32Array(this._length),n=0;nthis._foldingRangesLimit){o=n;break}i+=r}}e=new Uint32Array(this._foldingRangesLimit),t=new Uint32Array(this._foldingRangesLimit);for(var s=[],a=(n=0,0);no.start)if(u.end<=o.end)r.push(o),o=u,i.add(u.start,u.end,u.kind&&u.kind.value,r.length);else{if(u.start>o.end){do{o=r.pop()}while(o&&u.start>o.end);o&&r.push(o),o=u}i.add(u.start,u.end,u.kind&&u.kind.value,r.length)}}else o=u,i.add(u.start,u.end,u.kind&&u.kind.value,r.length)}return i.toIndentRanges()}var K="init",q=function(){function e(e,t,n,i){if(this.editorModel=e,this.id=K,t.length){var o=function(t){return{range:{startLineNumber:t.startLineNumber,startColumn:0,endLineNumber:t.endLineNumber,endColumn:e.getLineLength(t.endLineNumber)},options:{stickiness:1}}};this.decorationIds=e.deltaDecorations([],t.map(o)),this.timeout=setTimeout(n,i)}}return e.prototype.dispose=function(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),"number"===typeof this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)},e.prototype.compute=function(e){var t=[];if(this.decorationIds)for(var n=0,i=this.decorationIds;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},X=function(e,t){return function(n,i){t(n,i,e)}},$=new G["d"]("foldingEnabled",!1),Q="editor.contrib.folding",J=function(e){function t(t,n){var i=e.call(this)||this;return i.contextKeyService=n,i.localToDispose=i._register(new u["b"]),i.editor=t,i._isEnabled=i.editor.getConfiguration().contribInfo.folding,i._autoHideFoldingControls="mouseover"===i.editor.getConfiguration().contribInfo.showFoldingControls,i._useFoldingProviders="indentation"!==i.editor.getConfiguration().contribInfo.foldingStrategy,i.foldingModel=null,i.hiddenRangeModel=null,i.rangeProvider=null,i.foldingRegionPromise=null,i.foldingStateMemento=null,i.foldingModelPromise=null,i.updateScheduler=null,i.cursorChangedScheduler=null,i.mouseDownInfo=null,i.foldingDecorationProvider=new S(t),i.foldingDecorationProvider.autoHideFoldingControls=i._autoHideFoldingControls,i.foldingEnabled=$.bindTo(i.contextKeyService),i.foldingEnabled.set(i._isEnabled),i._register(i.editor.onDidChangeModel(function(){return i.onModelChanged()})),i._register(i.editor.onDidChangeConfiguration(function(e){if(e.contribInfo){var t=i._isEnabled;i._isEnabled=i.editor.getConfiguration().contribInfo.folding,i.foldingEnabled.set(i._isEnabled),t!==i._isEnabled&&i.onModelChanged();var n=i._autoHideFoldingControls;i._autoHideFoldingControls="mouseover"===i.editor.getConfiguration().contribInfo.showFoldingControls,n!==i._autoHideFoldingControls&&(i.foldingDecorationProvider.autoHideFoldingControls=i._autoHideFoldingControls,i.onModelContentChanged());var o=i._useFoldingProviders;i._useFoldingProviders="indentation"!==i.editor.getConfiguration().contribInfo.foldingStrategy,o!==i._useFoldingProviders&&i.onFoldingStrategyChanged()}})),i.onModelChanged(),i}return Z(t,e),t.get=function(e){return e.getContribution(Q)},t.prototype.getId=function(){return Q},t.prototype.saveViewState=function(){var e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){var t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n}}},t.prototype.restoreViewState=function(e){var t=this.editor.getModel();if(t&&this._isEnabled&&!t.isTooLargeForTokenization()&&this.hiddenRangeModel&&e&&e.collapsedRegions&&e.lineCount===t.getLineCount()){e.provider!==V&&e.provider!==K||(this.foldingStateMemento=e);var n=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(n)){var i=this.getFoldingModel();i&&i.then(function(e){e&&e.applyMemento(n)}).then(void 0,F["e"])}}},t.prototype.onModelChanged=function(){var e=this;this.localToDispose.clear();var t=this.editor.getModel();this._isEnabled&&t&&!t.isTooLargeForTokenization()&&(this.foldingModel=new m(t,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new N(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(function(t){return e.onHiddenRangesChanges(t)})),this.updateScheduler=new s["a"](200),this.cursorChangedScheduler=new s["d"](function(){return e.revealCursor()},200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(A["m"].onDidChange(function(){return e.onFoldingStrategyChanged()})),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(function(){return e.onFoldingStrategyChanged()})),this.localToDispose.add(this.editor.onDidChangeModelContent(function(){return e.onModelContentChanged()})),this.localToDispose.add(this.editor.onDidChangeCursorPosition(function(){return e.onCursorPositionChanged()})),this.localToDispose.add(this.editor.onMouseDown(function(t){return e.onEditorMouseDown(t)})),this.localToDispose.add(this.editor.onMouseUp(function(t){return e.onEditorMouseUp(t)})),this.localToDispose.add({dispose:function(){e.foldingRegionPromise&&(e.foldingRegionPromise.cancel(),e.foldingRegionPromise=null),e.updateScheduler&&e.updateScheduler.cancel(),e.updateScheduler=null,e.foldingModel=null,e.foldingModelPromise=null,e.hiddenRangeModel=null,e.cursorChangedScheduler=null,e.foldingStateMemento=null,e.rangeProvider&&e.rangeProvider.dispose(),e.rangeProvider=null}}),this.onModelContentChanged())},t.prototype.onFoldingStrategyChanged=function(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.onModelContentChanged()},t.prototype.getRangeProvider=function(e){var t=this;if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new T(e),this._useFoldingProviders&&this.foldingModel){var n=A["m"].ordered(this.foldingModel.textModel);if(0===n.length&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions){var i=this.rangeProvider=new q(e,this.foldingStateMemento.collapsedRegions,function(){t.foldingStateMemento=null,t.onFoldingStrategyChanged()},3e4);return i}n.length>0&&(this.rangeProvider=new B(e,n))}return this.foldingStateMemento=null,this.rangeProvider},t.prototype.getFoldingModel=function(){return this.foldingModelPromise},t.prototype.onModelContentChanged=function(){var e=this;this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(function(){var t=e.foldingModel;if(!t)return null;var n=e.foldingRegionPromise=Object(s["f"])(function(n){return e.getRangeProvider(t.textModel).compute(n)});return n.then(function(i){if(i&&n===e.foldingRegionPromise){var o=e.editor.getSelections(),r=o?o.map(function(e){return e.startLineNumber}):[];t.update(i,r)}return t})}).then(void 0,function(e){return Object(F["e"])(e),null}))},t.prototype.onHiddenRangesChanges=function(e){if(this.hiddenRangeModel&&e.length){var t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e)},t.prototype.onCursorPositionChanged=function(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()},t.prototype.revealCursor=function(){var e=this,t=this.getFoldingModel();t&&t.then(function(t){if(t){var n=e.editor.getSelections();if(n&&n.length>0){for(var i=[],o=function(n){var o=n.selectionStartLineNumber;e.hiddenRangeModel&&e.hiddenRangeModel.isHidden(o)&&i.push.apply(i,t.getAllRegionsAtLine(o,function(e){return e.isCollapsed&&o>e.startLineNumber}))},r=0,s=n;rt.symbol.range.startLineNumber?1:i.get(e.provider)i.get(t.provider)?1:e.symbol.range.startColumnt.symbol.range.startColumn?1:0}),r})}Object(a["j"])("_executeCodeLensProvider",function(e,t){var n=t.resource,i=t.itemResolveCount;if(!(n instanceof d["a"]))throw Object(o["b"])();var s=e.get(h["a"]).getModel(n);if(!s)throw Object(o["b"])();var a=[],u=new r["b"];return f(s,c["a"].None).then(function(e){u.add(e);for(var t=[],n=function(e){"undefined"===typeof i||Boolean(e.symbol.command)?a.push(e.symbol):i-- >0&&e.provider.resolveCodeLens&&t.push(Promise.resolve(e.provider.resolveCodeLens(s,e.symbol,c["a"].None)).then(function(t){return a.push(t||e.symbol)}))},o=0,r=e.lenses;ono commands";else{for(var i=[],o=0;o"+s+"",this._commands.set(String(o),r)):a=""+s+"",i.push(a)}}var u=""===this._domNode.innerHTML||" "===this._domNode.innerHTML;this._domNode.innerHTML=i.join(" | "),this._editor.layoutContentWidget(this),u&&t&&g["f"](this._domNode,"fadein")}},e.prototype.getCommand=function(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0},e.prototype.getId=function(){return this._id},e.prototype.getDomNode=function(){return this._domNode},e.prototype.setSymbolRange=function(e){if(this._editor.hasModel()){var t=e.startLineNumber,n=this._editor.getModel().getLineFirstNonWhitespaceColumn(t);this._widgetPosition={position:{lineNumber:t,column:n},preference:[1]}}},e.prototype.getPosition=function(){return this._widgetPosition||null},e.prototype.isVisible=function(){return this._domNode.hasAttribute("monaco-visible-content-widget")},e._idPool=0,e}(),L=function(){function e(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}return e.prototype.addDecoration=function(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)},e.prototype.removeDecoration=function(e){this._removeDecorations.push(e)},e.prototype.commit=function(e){for(var t=e.deltaDecorations(this._removeDecorations,this._addDecorations),n=0,i=t.length;n a:hover { color: "+i+" !important; }")});var x=n("9e74"),N=n("b0cd"),D=n("0a0f"),k=n("f5f3"),I=n("4035"),E=n("03e8"),M=n("0bfbc"),T=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},P=function(e,t){return function(n,i){t(n,i,e)}},R=Object(D["c"])("ICodeLensCache"),A=function(){function e(e,t){this.lineCount=e,this.data=t}return e}(),F=function(){function e(e){var t=this;this._fakeProvider=new(function(){function e(){}return e.prototype.provideCodeLenses=function(){throw new Error("not supported")},e}()),this._cache=new I["a"](20,.75);var n="codelens/cache";Object(i["k"])(function(){return e.remove(n,1)});var o="codelens/cache2",r=e.get(o,1,"{}");this._deserialize(r),Object(M["a"])(e.onWillSaveState)(function(n){n.reason===E["c"].SHUTDOWN&&e.store(o,t._serialize(),1)})}return e.prototype.put=function(e,t){var n=new p;n.add({lenses:t.lenses.map(function(e){return e.symbol}),dispose:function(){}},this._fakeProvider);var i=new A(e.getLineCount(),n);this._cache.set(e.uri.toString(),i)},e.prototype.get=function(e){var t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0},e.prototype.delete=function(e){this._cache.delete(e.uri.toString())},e.prototype._serialize=function(){var e=Object.create(null);return this._cache.forEach(function(t,n){for(var i=new Set,o=0,r=t.data.lenses;o=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},W=function(e,t){return function(n,i){t(n,i,e)}},V=function(){function e(e,t,n,i){var o=this;this._editor=e,this._commandService=t,this._notificationService=n,this._codeLensCache=i,this._globalToDispose=new r["b"],this._localToDispose=new r["b"],this._lenses=[],this._oldCodeLensModels=new r["b"],this._modelChangeCounter=0,this._isEnabled=this._editor.getConfiguration().contribInfo.codeLens,this._globalToDispose.add(this._editor.onDidChangeModel(function(){return o._onModelChange()})),this._globalToDispose.add(this._editor.onDidChangeModelLanguage(function(){return o._onModelChange()})),this._globalToDispose.add(this._editor.onDidChangeConfiguration(function(){var e=o._isEnabled;o._isEnabled=o._editor.getConfiguration().contribInfo.codeLens,e!==o._isEnabled&&o._onModelChange()})),this._globalToDispose.add(u["b"].onDidChange(this._onModelChange,this)),this._onModelChange()}return e.prototype.dispose=function(){this._localDispose(),this._globalToDispose.dispose(),this._oldCodeLensModels.dispose(),Object(r["f"])(this._currentCodeLensModel)},e.prototype._localDispose=function(){this._currentFindCodeLensSymbolsPromise&&(this._currentFindCodeLensSymbolsPromise.cancel(),this._currentFindCodeLensSymbolsPromise=void 0,this._modelChangeCounter++),this._currentResolveCodeLensSymbolsPromise&&(this._currentResolveCodeLensSymbolsPromise.cancel(),this._currentResolveCodeLensSymbolsPromise=void 0),this._localToDispose.clear(),this._oldCodeLensModels.clear(),Object(r["f"])(this._currentCodeLensModel)},e.prototype.getId=function(){return e.ID},e.prototype._onModelChange=function(){var e=this;this._localDispose();var t=this._editor.getModel();if(t&&this._isEnabled){var n=this._codeLensCache.get(t);if(n&&this._renderCodeLensSymbols(n),u["b"].has(t)){for(var a=0,l=u["b"].all(t);a0&&h.schedule()})),this._localToDispose.add(this._editor.onDidLayoutChange(function(){h.schedule()})),this._localToDispose.add(Object(r["h"])(function(){if(e._editor.getModel()){var t=s["c"].capture(e._editor);e._editor.changeDecorations(function(t){e._editor.changeViewZones(function(n){e._disposeAllLenses(t,n)})}),t.restore(e._editor)}else e._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onDidChangeConfiguration(function(t){if(t.fontInfo)for(var n=0,i=e._lenses;ni||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(u):(n=[u],o.push(n)))}var c=s["c"].capture(this._editor);this._editor.changeDecorations(function(e){t._editor.changeViewZones(function(n){var i=new L,r=0,s=0;while(s=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},C=function(e,t){return function(n,i){t(n,i,e)}},S=function(){function e(){}return e.prototype.select=function(e,t,n){if(0===n.length)return 0;for(var i=n[0].score[0],o=1;ou&&d.type===i[l].completion.kind&&d.insertText===i[l].completion.insertText&&(u=d.touch,a=l),i[l].completion.preselect&&-1===s)return l}return-1!==a?a:-1!==s?s:0},t.prototype.toJSON=function(){var e=[];return this._cache.forEach(function(t,n){e.push([n,t])}),e},t.prototype.fromJSON=function(e){this._cache.clear();for(var t=0,n=0,i=e;n0){this._seq=e[0][1].touch+1;for(var t=0,n=e;t=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},R=function(e,t){return function(n,i){t(n,i,e)}},A=function(){function e(t,n){this._editor=t,this._index=0,this._ckOtherSuggestions=e.OtherSuggestions.bindTo(n)}return e.prototype.dispose=function(){this.reset()},e.prototype.reset=function(){this._ckOtherSuggestions.reset(),Object(s["f"])(this._listener),this._model=void 0,this._acceptNext=void 0,this._ignore=!1},e.prototype.set=function(t,n){var i=this,o=t.model,r=t.index;if(0!==o.items.length){var s=e._moveIndex(!0,o,r);s!==r?(this._acceptNext=n,this._model=o,this._index=r,this._listener=this._editor.onDidChangeCursorPosition(function(){i._ignore||i.reset()}),this._ckOtherSuggestions.set(!0)):this.reset()}else this.reset()},e._moveIndex=function(e,t,n){var i=n;while(1){if(i=(i+t.items.length+(e?1:-1))%t.items.length,i===n)break;if(!t.items[i].completion.additionalTextEdits)break}return i},e.prototype.next=function(){this._move(!0)},e.prototype.prev=function(){this._move(!1)},e.prototype._move=function(t){if(this._model)try{this._ignore=!0,this._index=e._moveIndex(t,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}},e.OtherSuggestions=new M["d"]("hasOtherSuggestions",!1),e=P([R(1,M["c"])],e),e}(),F=n("308f"),j=n("8025"),W=n("7e93"),V=n("fd49"),B=n("3742"),H=(function(){function e(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}(),function(){function e(t,n,i,o,r){void 0===r&&(r=V["a"].contribInfo.suggest),this._snippetCompareFn=e._compareCompletionItems,this._items=t,this._column=n,this._wordDistance=o,this._options=r,this._refilterKind=1,this._lineContext=i,"top"===r.snippets?this._snippetCompareFn=e._compareCompletionItemsSnippetsUp:"bottom"===r.snippets&&(this._snippetCompareFn=e._compareCompletionItemsSnippetsDown)}return Object.defineProperty(e.prototype,"lineContext",{get:function(){return this._lineContext},set:function(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta2e3?W["d"]:W["e"],u=0;u=d)l.score=W["a"].Default;else if("string"===typeof l.completion.filterText){var f=a(i,o,h,l.completion.filterText,l.filterTextLow,0,!1);if(!f)continue;0===Object(B["e"])(l.completion.filterText,l.completion.label)?l.score=f:(l.score=Object(W["b"])(i,o,h,l.completion.label,l.labelLow,0),l.score[0]=f[0])}else{f=a(i,o,h,l.completion.label,l.labelLow,0,!1);if(!f)continue;l.score=f}}switch(l.idx=u,l.distance=this._wordDistance.distance(l.position,l.completion),s.push(l),this._stats.suggestionCount++,l.completion.kind){case 25:this._stats.snippetCount++;break;case 18:this._stats.textCount++;break}}this._filteredItems=s.sort(this._snippetCompareFn),this._refilterKind=0},e._compareCompletionItems=function(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0},e._compareCompletionItemsSnippetsDown=function(t,n){if(t.completion.kind!==n.completion.kind){if(25===t.completion.kind)return 1;if(25===n.completion.kind)return-1}return e._compareCompletionItems(t,n)},e._compareCompletionItemsSnippetsUp=function(t,n){if(t.completion.kind!==n.completion.kind){if(25===t.completion.kind)return-1;if(25===n.completion.kind)return 1}return e._compareCompletionItems(t,n)},e}()),z=n("2504"),U=n("67b4"),K=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),q=function(){function e(){}return e.create=function(t,n){if(!n.getConfiguration().contribInfo.suggest.localityBonus)return Promise.resolve(e.None);if(!n.hasModel())return Promise.resolve(e.None);var i=n.getModel(),r=n.getPosition();return t.canComputeWordRanges(i.uri)?(new U["a"]).provideSelectionRanges(i,[r]).then(function(s){return s&&0!==s.length&&0!==s[0].length?t.computeWordRanges(i.uri,s[0][0].range).then(function(t){return new(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return K(i,e),i.prototype.distance=function(e,i){if(!t||!r.equals(n.getPosition()))return 0;if(17===i.kind)return 2<<20;var a=i.label,u=t[a];if(Object(o["m"])(u))return 2<<20;for(var c=Object(o["c"])(u,l["a"].fromPositions(e),l["a"].compareRangesUsingStarts),d=c>=0?u[c]:u[Math.max(0,~c-1)],h=s.length,p=0,f=s[0];p0?{triggerKind:2}:{triggerKind:0},this._requestToken=new z["b"];var h=this._editor.getConfiguration().contribInfo,p=new Set,f=1;switch(h.suggest.snippets){case"top":f=0;break;case"bottom":f=2;break;case"none":p.add(25);break}for(var m in h.suggest.filteredTypes){var v=Object(g["A"])(m,!0);"undefined"!==typeof v&&!1===h.suggest.filteredTypes[m]&&p.add(v)}var _=q.create(this._editorWorker,this._editor),b=Object(T["e"])(l,this._editor.getPosition(),new T["a"](f,p,n),u,this._requestToken.token);Promise.all([b,_]).then(function(t){var n=t[0],r=t[1];if(Object(s["f"])(a._requestToken),0!==a._state&&a._editor.hasModel()){var u=a._editor.getModel();if(Object(o["n"])(i)){var l=Object(T["d"])(f);n=n.concat(i).sort(l)}var d=new G(u,a._editor.getPosition(),c,e.shy);a._completionModel=new H(n,a._context.column,{leadingLineContent:d.leadingLineContent,characterCountDelta:d.column-a._context.column},r,a._editor.getConfiguration().contribInfo.suggest);for(var h=0,p=n;hthis._context.column&&this._completionModel.incomplete.size>0&&0!==e.leadingWord.word.length){var t=this._completionModel.incomplete,n=this._completionModel.adopt(t);this.trigger({auto:2===this._state,shy:!1},!0,t,n)}else{var i=this._completionModel.lineContext,o=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){if(G.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn0,o&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:o})}}else this.cancel()},e}(),Y=(n("0829"),n("11f7")),X=n("72a7"),$=n("1898"),Q=n("6dec"),J=n("5d75"),ee=n("a6d7"),te=n("b7d0"),ne=n("303e"),ie=n("dea0"),oe=n("5818"),re=n("5bd7"),se=n("c4e3"),ae=n("b589"),ue=n("82c9"),le=n("32a4");function ce(e,t,n,i){var o=i===k.ROOT_FOLDER?["rootfolder-icon"]:i===k.FOLDER?["folder-icon"]:["file-icon"];if(n){var r;if(n.scheme===ae["b"].data){var s=ue["a"].parseMetaData(n);r=s.get(ue["a"].META_DATA_LABEL)}else r=he(Object(ue["c"])(n).toLowerCase());if(i===k.FOLDER)o.push(r+"-name-folder-icon");else{if(r){o.push(r+"-name-file-icon");for(var a=r.split("."),u=1;u=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},_e=function(e,t){return function(n,i){t(n,i,e)}},be=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},ye=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0&&(a.extraClasses=(a.extraClasses||[]).concat(["deprecated"]),a.matches=[]),r.iconLabel.setLabel(s.label,void 0,a),r.typeLabel.textContent=(s.detail||"").replace(/\n.*$/m,""),ke(e)?(Object(Y["Q"])(r.readMore),r.readMore.onmousedown=function(e){e.stopPropagation(),e.preventDefault()},r.readMore.onclick=function(e){e.stopPropagation(),e.preventDefault(),i.widget.toggleDetails()}):(Object(Y["D"])(r.readMore),r.readMore.onmousedown=null,r.readMore.onclick=null)},e.prototype.disposeTemplate=function(e){e.disposables.dispose()},e=ve([_e(3,pe["a"]),_e(4,oe["a"]),_e(5,te["c"])],e),e}(),Ee=function(){function e(e,t,n,i,o){var r=this;this.widget=t,this.editor=n,this.markdownRenderer=i,this.triggerKeybindingLabel=o,this.borderWidth=1,this.disposables=new s["b"],this.el=Object(Y["m"])(e,Object(Y["a"])(".details")),this.disposables.add(Object(s["h"])(function(){return e.removeChild(r.el)})),this.body=Object(Y["a"])(".body"),this.scrollbar=new $["a"](this.body,{}),Object(Y["m"])(this.el,this.scrollbar.getDomNode()),this.disposables.add(this.scrollbar),this.header=Object(Y["m"])(this.body,Object(Y["a"])(".header")),this.close=Object(Y["m"])(this.header,Object(Y["a"])("span.close")),this.close.title=I["a"]("readLess","Read less...{0}",this.triggerKeybindingLabel),this.type=Object(Y["m"])(this.header,Object(Y["a"])("p.type")),this.docs=Object(Y["m"])(this.body,Object(Y["a"])("p.docs")),this.ariaLabel=null,this.configureFont(),F["b"].chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(function(e){return e.fontInfo}).on(this.configureFont,this,this.disposables),i.onDidRenderCodeBlock(function(){return r.scrollbar.scanDomNode()},this,this.disposables)}return Object.defineProperty(e.prototype,"element",{get:function(){return this.el},enumerable:!0,configurable:!0}),e.prototype.renderLoading=function(){this.type.textContent=I["a"]("loading","Loading..."),this.docs.textContent=""},e.prototype.renderItem=function(e,t){var n=this;this.renderDisposeable=Object(s["f"])(this.renderDisposeable);var i=e.completion,o=i.documentation,r=i.detail;if(t){var a="";a+="score: "+e.score[0]+(e.word?", compared '"+(e.completion.filterText&&e.completion.filterText+" (filterText)"||e.completion.label)+"' with '"+e.word+"'":" (no prefix)")+"\n",a+="distance: "+e.distance+", see localityBonus-setting\n",a+="index: "+e.idx+", based on "+(e.completion.sortText&&'sortText: "'+e.completion.sortText+'"'||"label")+"\n",o=(new ge["a"]).appendCodeblock("empty",a),r="Provider: "+e.provider._debugDisplayName}if(!t&&!ke(e))return this.type.textContent="",this.docs.textContent="",Object(Y["f"])(this.el,"no-docs"),void(this.ariaLabel=null);if(Object(Y["I"])(this.el,"no-docs"),"string"===typeof o)Object(Y["I"])(this.docs,"markdown-docs"),this.docs.textContent=o;else{Object(Y["f"])(this.docs,"markdown-docs"),this.docs.innerHTML="";var u=this.markdownRenderer.render(o);this.renderDisposeable=u,this.docs.appendChild(u.element)}r?(this.type.innerText=r,Object(Y["Q"])(this.type)):(this.type.innerText="",Object(Y["D"])(this.type)),this.el.style.height=this.header.offsetHeight+this.docs.offsetHeight+2*this.borderWidth+"px",this.close.onmousedown=function(e){e.preventDefault(),e.stopPropagation()},this.close.onclick=function(e){e.preventDefault(),e.stopPropagation(),n.widget.toggleDetails()},this.body.scrollTop=0,this.scrollbar.scanDomNode(),this.ariaLabel=B["r"]("{0}{1}",r||"",o?"string"===typeof o?o:o.value:"")},e.prototype.getAriaLabel=function(){return this.ariaLabel},e.prototype.scrollDown=function(e){void 0===e&&(e=8),this.body.scrollTop+=e},e.prototype.scrollUp=function(e){void 0===e&&(e=8),this.body.scrollTop-=e},e.prototype.scrollTop=function(){this.body.scrollTop=0},e.prototype.scrollBottom=function(){this.body.scrollTop=this.body.scrollHeight},e.prototype.pageDown=function(){this.scrollDown(80)},e.prototype.pageUp=function(){this.scrollUp(80)},e.prototype.setBorderWidth=function(e){this.borderWidth=e},e.prototype.configureFont=function(){var e=this.editor.getConfiguration(),t=e.fontInfo.fontFamily,n=e.contribInfo.suggestFontSize||e.fontInfo.fontSize,i=e.contribInfo.suggestLineHeight||e.fontInfo.lineHeight,o=e.fontInfo.fontWeight,r=n+"px",s=i+"px";this.el.style.fontSize=r,this.el.style.fontWeight=o,this.type.style.fontFamily=t,this.close.style.height=s,this.close.style.width=s},e.prototype.dispose=function(){this.disposables.dispose(),this.renderDisposeable=Object(s["f"])(this.renderDisposeable)},e}(),Me=function(){function e(e,t,n,i,o,r,a,u,l){var c=this;this.editor=e,this.telemetryService=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.state=null,this.isAuto=!1,this.loadingTimeout=s["a"].None,this.currentSuggestionDetails=null,this.ignoreFocusEvents=!1,this.completionModel=null,this.showTimeout=new m["e"],this.toDispose=new s["b"],this.onDidSelectEmitter=new F["a"],this.onDidFocusEmitter=new F["a"],this.onDidHideEmitter=new F["a"],this.onDidShowEmitter=new F["a"],this.onDidSelect=this.onDidSelectEmitter.event,this.onDidFocus=this.onDidFocusEmitter.event,this.onDidHide=this.onDidHideEmitter.event,this.onDidShow=this.onDidShowEmitter.event,this.maxWidgetWidth=660,this.listWidth=330,this.firstFocusInCurrentList=!1,this.preferDocPositionTop=!1,this.docsPositionPreviousWidgetY=null,this.explainMode=!1,this._lastAriaAlertLabel=null;var d=r.lookupKeybinding("editor.action.triggerSuggest"),h=d?" ("+d.getLabel()+")":"",p=this.toDispose.add(new ie["a"](e,a,u));this.isAuto=!1,this.focusedItem=null,this.storageService=o,this.element=Object(Y["a"])(".editor-widget.suggest-widget"),this.toDispose.add(Object(Y["h"])(this.element,"click",function(e){e.target===c.element&&c.hideWidget()})),this.messageElement=Object(Y["m"])(this.element,Object(Y["a"])(".message")),this.listElement=Object(Y["m"])(this.element,Object(Y["a"])(".tree")),this.details=l.createInstance(Ee,this.element,this,this.editor,p,h);var f=function(){return Object(Y["R"])(c.element,"no-icons",!c.editor.getConfiguration().contribInfo.suggest.showIcons)};f();var g=l.createInstance(Ie,this,this.editor,h);this.list=new X["b"](this.listElement,this,[g],{useShadows:!1,openController:{shouldOpen:function(){return!1}},mouseSupport:!1}),this.toDispose.add(Object(ee["b"])(this.list,i,{listInactiveFocusBackground:Oe,listInactiveFocusOutline:ne["b"]})),this.toDispose.add(i.onThemeChange(function(e){return c.onThemeChange(e)})),this.toDispose.add(e.onDidLayoutChange(function(){return c.onEditorLayoutChange()})),this.toDispose.add(this.list.onMouseDown(function(e){return c.onListMouseDown(e)})),this.toDispose.add(this.list.onSelectionChange(function(e){return c.onListSelection(e)})),this.toDispose.add(this.list.onFocusChange(function(e){return c.onListFocus(e)})),this.toDispose.add(this.editor.onDidChangeCursorSelection(function(){return c.onCursorSelectionChanged()})),this.toDispose.add(this.editor.onDidChangeConfiguration(function(e){return e.contribInfo&&f()})),this.suggestWidgetVisible=T["b"].Visible.bindTo(n),this.suggestWidgetMultipleSuggestions=T["b"].MultipleSuggestions.bindTo(n),this.editor.addContentWidget(this),this.setState(0),this.onThemeChange(i.getTheme())}return e.prototype.onCursorSelectionChanged=function(){0!==this.state&&this.editor.layoutContentWidget(this)},e.prototype.onEditorLayoutChange=function(){3!==this.state&&5!==this.state||!this.expandDocsSettingFromStorage()||this.expandSideOrBelow()},e.prototype.onListMouseDown=function(e){"undefined"!==typeof e.element&&"undefined"!==typeof e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this.select(e.element,e.index))},e.prototype.onListSelection=function(e){e.elements.length&&this.select(e.elements[0],e.indexes[0])},e.prototype.select=function(e,t){var n=this.completionModel;n&&(this.onDidSelectEmitter.fire({item:e,index:t,model:n}),this.editor.focus())},e.prototype._getSuggestionAriaAlertLabel=function(e){return this.expandDocsSettingFromStorage()?I["a"]("ariaCurrenttSuggestionReadDetails","Item {0}, docs: {1}",e.completion.label,this.details.getAriaLabel()):e.completion.label},e.prototype._ariaAlert=function(e){this._lastAriaAlertLabel!==e&&(this._lastAriaAlertLabel=e,this._lastAriaAlertLabel&&Object(i["a"])(this._lastAriaAlertLabel,!0))},e.prototype.onThemeChange=function(e){var t=e.getColor(Ce);t&&(this.listElement.style.backgroundColor=t.toString(),this.details.element.style.backgroundColor=t.toString(),this.messageElement.style.backgroundColor=t.toString());var n=e.getColor(Se);n&&(this.listElement.style.borderColor=n.toString(),this.details.element.style.borderColor=n.toString(),this.messageElement.style.borderColor=n.toString(),this.detailsBorderColor=n.toString());var i=e.getColor(ne["S"]);i&&(this.detailsFocusBorderColor=i.toString()),this.details.setBorderWidth("hc"===e.type?2:1)},e.prototype.onListFocus=function(e){var t=this;if(!this.ignoreFocusEvents){if(!e.elements.length)return this.currentSuggestionDetails&&(this.currentSuggestionDetails.cancel(),this.currentSuggestionDetails=null,this.focusedItem=null),void this._ariaAlert(null);if(this.completionModel){var n=e.elements[0],i=e.indexes[0];this.firstFocusInCurrentList=!this.focusedItem,n!==this.focusedItem&&(this.currentSuggestionDetails&&(this.currentSuggestionDetails.cancel(),this.currentSuggestionDetails=null),this.focusedItem=n,this.list.reveal(i),this.currentSuggestionDetails=Object(m["f"])(function(e){return be(t,void 0,void 0,function(){var t,i,o=this;return ye(this,function(r){switch(r.label){case 0:return t=Object(m["g"])(function(){return o.showDetails(!0)},250),e.onCancellationRequested(function(){return t.dispose()}),[4,n.resolve(e)];case 1:return i=r.sent(),t.dispose(),[2,i]}})})}),this.currentSuggestionDetails.then(function(){i>=t.list.length||n!==t.list.element(i)||(t.ignoreFocusEvents=!0,t.list.splice(i,1,[n]),t.list.setFocus([i]),t.ignoreFocusEvents=!1,t.expandDocsSettingFromStorage()?t.showDetails(!1):Object(Y["I"])(t.element,"docs-side"),t._ariaAlert(t._getSuggestionAriaAlertLabel(n)))}).catch(r["e"])),this.onDidFocusEmitter.fire({item:n,index:i,model:this.completionModel})}}},e.prototype.setState=function(t){if(this.element){var n=this.state!==t;switch(this.state=t,Object(Y["R"])(this.element,"frozen",4===t),t){case 0:Object(Y["D"])(this.messageElement,this.details.element,this.listElement),this.hide(),this.listHeight=0,n&&this.list.splice(0,this.list.length),this.focusedItem=null;break;case 1:this.messageElement.textContent=e.LOADING_MESSAGE,Object(Y["D"])(this.listElement,this.details.element),Object(Y["Q"])(this.messageElement),Object(Y["I"])(this.element,"docs-side"),this.show(),this.focusedItem=null;break;case 2:this.messageElement.textContent=e.NO_SUGGESTIONS_MESSAGE,Object(Y["D"])(this.listElement,this.details.element),Object(Y["Q"])(this.messageElement),Object(Y["I"])(this.element,"docs-side"),this.show(),this.focusedItem=null;break;case 3:Object(Y["D"])(this.messageElement),Object(Y["Q"])(this.listElement),this.show();break;case 4:Object(Y["D"])(this.messageElement),Object(Y["Q"])(this.listElement),this.show();break;case 5:Object(Y["D"])(this.messageElement),Object(Y["Q"])(this.details.element,this.listElement),this.show(),this._ariaAlert(this.details.getAriaLabel());break}}},e.prototype.showTriggered=function(e,t){var n=this;0===this.state&&(this.isAuto=!!e,this.isAuto||(this.loadingTimeout=Object(m["g"])(function(){return n.setState(1)},t)))},e.prototype.showSuggestions=function(e,t,n,i){if(this.preferDocPositionTop=!1,this.docsPositionPreviousWidgetY=null,this.loadingTimeout.dispose(),this.currentSuggestionDetails&&(this.currentSuggestionDetails.cancel(),this.currentSuggestionDetails=null),this.completionModel!==e&&(this.completionModel=e),n&&2!==this.state&&0!==this.state)this.setState(4);else{var o=this.completionModel.items.length,r=0===o;if(this.suggestWidgetMultipleSuggestions.set(o>1),r)i?this.setState(0):this.setState(2),this.completionModel=null;else{if(3!==this.state){var s=this.completionModel.stats;s["wasAutomaticallyTriggered"]=!!i,this.telemetryService.publicLog("suggestWidget",me({},s))}this.focusedItem=null,this.list.splice(0,this.list.length,this.completionModel.items),n?this.setState(4):this.setState(3),this.list.reveal(t,0),this.list.setFocus([t]),this.detailsBorderColor&&(this.details.element.style.borderColor=this.detailsBorderColor)}}},e.prototype.selectNextPage=function(){switch(this.state){case 0:return!1;case 5:return this.details.pageDown(),!0;case 1:return!this.isAuto;default:return this.list.focusNextPage(),!0}},e.prototype.selectNext=function(){switch(this.state){case 0:return!1;case 1:return!this.isAuto;default:return this.list.focusNext(1,!0),!0}},e.prototype.selectLast=function(){switch(this.state){case 0:return!1;case 5:return this.details.scrollBottom(),!0;case 1:return!this.isAuto;default:return this.list.focusLast(),!0}},e.prototype.selectPreviousPage=function(){switch(this.state){case 0:return!1;case 5:return this.details.pageUp(),!0;case 1:return!this.isAuto;default:return this.list.focusPreviousPage(),!0}},e.prototype.selectPrevious=function(){switch(this.state){case 0:return!1;case 1:return!this.isAuto;default:return this.list.focusPrevious(1,!0),!1}},e.prototype.selectFirst=function(){switch(this.state){case 0:return!1;case 5:return this.details.scrollTop(),!0;case 1:return!this.isAuto;default:return this.list.focusFirst(),!0}},e.prototype.getFocusedItem=function(){if(0!==this.state&&2!==this.state&&1!==this.state&&this.completionModel)return{item:this.list.getFocusedElements()[0],index:this.list.getFocus()[0],model:this.completionModel}},e.prototype.toggleDetailsFocus=function(){5===this.state?(this.setState(3),this.detailsBorderColor&&(this.details.element.style.borderColor=this.detailsBorderColor)):3===this.state&&this.expandDocsSettingFromStorage()&&(this.setState(5),this.detailsFocusBorderColor&&(this.details.element.style.borderColor=this.detailsFocusBorderColor)),this.telemetryService.publicLog2("suggestWidget:toggleDetailsFocus")},e.prototype.toggleDetails=function(){if(ke(this.list.getFocusedElements()[0]))if(this.expandDocsSettingFromStorage())this.updateExpandDocsSetting(!1),Object(Y["D"])(this.details.element),Object(Y["I"])(this.element,"docs-side"),Object(Y["I"])(this.element,"docs-below"),this.editor.layoutContentWidget(this),this.telemetryService.publicLog2("suggestWidget:collapseDetails");else{if(3!==this.state&&5!==this.state&&4!==this.state)return;this.updateExpandDocsSetting(!0),this.showDetails(!1),this._ariaAlert(this.details.getAriaLabel()),this.telemetryService.publicLog2("suggestWidget:expandDetails")}},e.prototype.showDetails=function(e){this.expandSideOrBelow(),Object(Y["Q"])(this.details.element),this.details.element.style.maxHeight=this.maxWidgetHeight+"px",e?this.details.renderLoading():this.details.renderItem(this.list.getFocusedElements()[0],this.explainMode),this.listElement.style.marginTop="0px",this.editor.layoutContentWidget(this),this.adjustDocsPosition(),this.editor.focus()},e.prototype.toggleExplainMode=function(){this.list.getFocusedElements()[0]&&this.expandDocsSettingFromStorage()&&(this.explainMode=!this.explainMode,this.showDetails(!1))},e.prototype.show=function(){var e=this,t=this.updateListHeight();t!==this.listHeight&&(this.editor.layoutContentWidget(this),this.listHeight=t),this.suggestWidgetVisible.set(!0),this.showTimeout.cancelAndSet(function(){Object(Y["f"])(e.element,"visible"),e.onDidShowEmitter.fire(e)},100)},e.prototype.hide=function(){this.suggestWidgetVisible.reset(),this.suggestWidgetMultipleSuggestions.reset(),Object(Y["I"])(this.element,"visible")},e.prototype.hideWidget=function(){this.loadingTimeout.dispose(),this.setState(0),this.onDidHideEmitter.fire(this)},e.prototype.getPosition=function(){if(0===this.state)return null;var e=[2,1];return this.preferDocPositionTop&&(e=[1]),{position:this.editor.getPosition(),preference:e}},e.prototype.getDomNode=function(){return this.element},e.prototype.getId=function(){return e.ID},e.prototype.updateListHeight=function(){var e=0;if(2===this.state||1===this.state)e=this.unfocusedHeight;else{var t=this.list.contentHeight/this.unfocusedHeight,n=this.editor.getConfiguration().contribInfo.suggest.maxVisibleSuggestions;e=Math.min(t,n)*this.unfocusedHeight}return this.element.style.lineHeight=this.unfocusedHeight+"px",this.listElement.style.height=e+"px",this.list.layout(e),e},e.prototype.adjustDocsPosition=function(){if(this.editor.hasModel()){var e=this.editor.getConfiguration().fontInfo.lineHeight,t=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),n=Object(Y["x"])(this.editor.getDomNode()),i=n.left+t.left,o=n.top+t.top+t.height,r=Object(Y["x"])(this.element),s=r.left,a=r.top;if(this.docsPositionPreviousWidgetY&&this.docsPositionPreviousWidgetYa&&this.details.element.offsetHeight>this.listElement.offsetHeight&&(this.listElement.style.marginTop=this.details.element.offsetHeight-this.listElement.offsetHeight+"px")}},e.prototype.expandSideOrBelow=function(){if(!ke(this.focusedItem)&&this.firstFocusInCurrentList)return Object(Y["I"])(this.element,"docs-side"),void Object(Y["I"])(this.element,"docs-below");var e=this.element.style.maxWidth.match(/(\d+)px/);!e||Number(e[1])=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Re=function(e,t){return function(n,i){t(n,i,e)}},Ae=function(e){function t(n,i){var o=e.call(this)||this;return o._editor=n,o._enabled=!1,o._ckAtEnd=t.AtEnd.bindTo(i),o._register(o._editor.onDidChangeConfiguration(function(e){return e.contribInfo&&o._update()})),o._update(),o}return Te(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),Object(s["f"])(this._selectionListener),this._ckAtEnd.reset()},t.prototype._update=function(){var e=this,t="on"===this._editor.getConfiguration().contribInfo.tabCompletion;if(this._enabled!==t)if(this._enabled=t,this._enabled){var n=function(){if(e._editor.hasModel()){var t=e._editor.getModel(),n=e._editor.getSelection(),i=t.getWordAtPosition(n.getStartPosition());i?e._ckAtEnd.set(i.endColumn===n.getStartPosition().column):e._ckAtEnd.set(!1)}else e._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(n),n()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)},t.AtEnd=new M["d"]("atEndOfWord",!1),t=Pe([Re(1,M["c"])],t),t}(s["a"]),Fe=n("a40b"),je=n("ef8e"),We=n("3170"),Ve=function(){function e(e,t,n){var i=this;this._disposables=new s["b"],this._disposables.add(t.onDidShow(function(){return i._onItem(t.getFocusedItem())})),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(function(t){if(i._active){var o=t.charCodeAt(t.length-1);i._active.acceptCharacters.has(o)&&e.getConfiguration().contribInfo.acceptSuggestionOnCommitCharacter&&n(i._active.item)}}))}return e.prototype._onItem=function(e){if(e&&Object(o["n"])(e.item.completion.commitCharacters)){if(!this._active||this._active.item.item!==e.item){for(var t=new We["b"],n=0,i=e.item.completion.commitCharacters;n0&&t.add(r.charCodeAt(0))}this._active={acceptCharacters:t,item:e}}}else this.reset()},e.prototype.reset=function(){this._active=void 0},e.prototype.dispose=function(){this._disposables.dispose()},e}();n.d(t,"SuggestController",function(){return Ge}),n.d(t,"TriggerSuggestAction",function(){return Ze});var Be=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),He=function(){return He=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Ue=function(e,t){return function(n,i){t(n,i,e)}},Ke=!1,qe=function(){function e(e,t){this._model=e,this._position=t;var n=e.getLineMaxColumn(t.lineNumber);if(n!==t.column){var i=e.getOffsetAt(t),o=e.getPositionAt(i+1);this._marker=e.deltaDecorations([],[{range:l["a"].fromPositions(t,o),options:{stickiness:1}}])}}return e.prototype.dispose=function(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])},e.prototype.delta=function(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){var t=this._model.getDecorationRange(this._marker[0]),n=this._model.getOffsetAt(t.getStartPosition());return n-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column},e}(),Ge=function(){function e(e,t,n,i,o,r){var a=this;this._editor=e,this._memoryService=n,this._commandService=i,this._contextKeyService=o,this._instantiationService=r,this._lineSuffix=new s["d"],this._toDispose=new s["b"],this._model=new Z(this._editor,t),this._widget=new m["b"](function(){var e=a._instantiationService.createInstance(Me,a._editor);a._toDispose.add(e),a._toDispose.add(e.onDidSelect(function(e){return a._insertSuggestion(e,!1,!0)},a));var t=new Ve(a._editor,e,function(e){return a._insertSuggestion(e,!1,!0)});a._toDispose.add(t),a._toDispose.add(a._model.onDidSuggest(function(e){0===e.completionModel.items.length&&t.reset()}));var n=T["b"].MakesTextEdit.bindTo(a._contextKeyService);return a._toDispose.add(e.onDidFocus(function(e){var t=e.item,i=a._editor.getPosition(),o=t.completion.range.startColumn,r=i.column,s=!0;if("smart"===a._editor.getConfiguration().contribInfo.acceptSuggestionOnEnter&&2===a._model.state&&!t.completion.command&&!t.completion.additionalTextEdits&&!(4&t.completion.insertTextRules)&&r-o===t.completion.insertText.length){var u=a._editor.getModel().getValueInRange({startLineNumber:i.lineNumber,startColumn:o,endLineNumber:i.lineNumber,endColumn:r});s=u!==t.completion.insertText}n.set(s)})),a._toDispose.add(Object(s["h"])(function(){return n.reset()})),e}),this._alternatives=new m["b"](function(){return a._toDispose.add(new A(a._editor,a._contextKeyService))}),this._toDispose.add(r.createInstance(Ae,e)),this._toDispose.add(this._model.onDidTrigger(function(e){a._widget.getValue().showTriggered(e.auto,e.shy?250:50),a._lineSuffix.value=new qe(a._editor.getModel(),e.position)})),this._toDispose.add(this._model.onDidSuggest(function(e){if(!e.shy){var t=a._memoryService.select(a._editor.getModel(),a._editor.getPosition(),e.completionModel.items);a._widget.getValue().showSuggestions(e.completionModel,t,e.isFrozen,e.auto)}})),this._toDispose.add(this._model.onDidCancel(function(e){e.retrigger||a._widget.getValue().hideWidget()})),this._toDispose.add(this._editor.onDidBlurEditorWidget(function(){Ke||(a._model.cancel(),a._model.clear())}));var u=T["b"].AcceptSuggestionsOnEnter.bindTo(o),l=function(){var e=a._editor.getConfiguration().contribInfo.acceptSuggestionOnEnter;u.set("on"===e||"smart"===e)};this._toDispose.add(this._editor.onDidChangeConfiguration(function(){return l()})),l()}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this._alternatives.dispose(),this._toDispose.dispose(),this._widget.dispose(),this._model.dispose(),this._lineSuffix.dispose()},e.prototype._insertSuggestion=function(e,t,n){var i,o=this;if(!e||!e.item)return this._alternatives.getValue().reset(),this._model.cancel(),void this._model.clear();if(this._editor.hasModel()){var s=this._editor.getModel(),a=s.getAlternativeVersionId(),c=e.item,p=c.completion,f=c.position,g=this._editor.getPosition().column,m=g-f.column;n&&this._editor.pushUndoStop(),Array.isArray(p.additionalTextEdits)&&this._editor.executeEdits("suggestController.additionalTextEdits",p.additionalTextEdits.map(function(e){return u["a"].replace(l["a"].lift(e.range),e.text)})),this._memoryService.memorize(s,this._editor.getPosition(),e.item);var v=p.insertText;4&p.insertTextRules||(v=h["c"].escape(v));var _=f.column-p.range.startColumn,b=p.range.endColumn-f.column,y=this._lineSuffix.value?this._lineSuffix.value.delta(this._editor.getPosition()):0;d["SnippetController2"].get(this._editor).insert(v,{overwriteBefore:_+m,overwriteAfter:b+y,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&p.insertTextRules)}),n&&this._editor.pushUndoStop(),p.command?p.command.id===Ze.id?this._model.trigger({auto:!0,shy:!1},!0):((i=this._commandService).executeCommand.apply(i,[p.command.id].concat(p.command.arguments?p.command.arguments.slice():[])).catch(r["e"]).finally(function(){return o._model.clear()}),this._model.cancel()):(this._model.cancel(),this._model.clear()),t&&this._alternatives.getValue().set(e,function(e){while(s.canUndo()){a!==s.getAlternativeVersionId()&&s.undo(),o._insertSuggestion(e,!1,!1);break}}),this._alertCompletionItem(e.item)}},e.prototype._alertCompletionItem=function(e){var t=e.completion;if(Object(o["n"])(t.additionalTextEdits)){var n=I["a"]("arai.alert.snippet","Accepting '{0}' made {1} additional edits",t.label,t.additionalTextEdits.length);Object(i["a"])(n)}},e.prototype.triggerSuggest=function(e){this._editor.hasModel()&&(this._model.trigger({auto:!1,shy:!1},!1,e),this._editor.revealLine(this._editor.getPosition().lineNumber,0),this._editor.focus())},e.prototype.triggerSuggestAndAcceptBest=function(e){var t=this;if(this._editor.hasModel()){var n=this._editor.getPosition(),i=function(){n.equals(t._editor.getPosition())&&t._commandService.executeCommand(e.fallback)},o=function(e){if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;var n=t._editor.getPosition(),i=e.completion.range.startColumn,o=n.column;if(o-i!==e.completion.insertText.length)return!0;var r=t._editor.getModel().getValueInRange({startLineNumber:n.lineNumber,startColumn:i,endLineNumber:n.lineNumber,endColumn:o});return r!==e.completion.insertText};F["b"].once(this._model.onDidTrigger)(function(e){var n=[];F["b"].any(t._model.onDidTrigger,t._model.onDidCancel)(function(){Object(s["f"])(n),i()},void 0,n),t._model.onDidSuggest(function(e){var r=e.completionModel;if(Object(s["f"])(n),0!==r.items.length){var a=t._memoryService.select(t._editor.getModel(),t._editor.getPosition(),r.items),u=r.items[a];o(u)?(t._editor.pushUndoStop(),t._insertSuggestion({index:a,item:u,model:r},!0,!1)):i()}else i()},void 0,n)}),this._model.trigger({auto:!1,shy:!0}),this._editor.revealLine(n.lineNumber,0),this._editor.focus()}},e.prototype.acceptSelectedSuggestion=function(e){var t=this._widget.getValue().getFocusedItem();this._insertSuggestion(t,!!e,!0)},e.prototype.acceptNextSuggestion=function(){this._alternatives.getValue().next()},e.prototype.acceptPrevSuggestion=function(){this._alternatives.getValue().prev()},e.prototype.cancelSuggestWidget=function(){this._model.cancel(),this._model.clear(),this._widget.getValue().hideWidget()},e.prototype.selectNextSuggestion=function(){this._widget.getValue().selectNext()},e.prototype.selectNextPageSuggestion=function(){this._widget.getValue().selectNextPage()},e.prototype.selectLastSuggestion=function(){this._widget.getValue().selectLast()},e.prototype.selectPrevSuggestion=function(){this._widget.getValue().selectPrevious()},e.prototype.selectPrevPageSuggestion=function(){this._widget.getValue().selectPreviousPage()},e.prototype.selectFirstSuggestion=function(){this._widget.getValue().selectFirst()},e.prototype.toggleSuggestionDetails=function(){this._widget.getValue().toggleDetails()},e.prototype.toggleExplainMode=function(){this._widget.getValue().toggleExplainMode()},e.prototype.toggleSuggestionFocus=function(){this._widget.getValue().toggleDetailsFocus()},e.ID="editor.contrib.suggestController",e=ze([Ue(1,Fe["a"]),Ue(2,D),Ue(3,E["b"]),Ue(4,M["c"]),Ue(5,v["a"])],e),e}(),Ze=function(e){function t(){return e.call(this,{id:t.id,label:I["a"]("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:M["a"].and(c["a"].writable,c["a"].hasCompletionItemProvider),kbOpts:{kbExpr:c["a"].textInputFocus,primary:2058,mac:{primary:266},weight:100}})||this}return Be(t,e),t.prototype.run=function(e,t){var n=Ge.get(t);n&&n.triggerSuggest()},t.id="editor.action.triggerSuggest",t}(a["b"]);Object(a["h"])(Ge),Object(a["f"])(Ze);var Ye=190,Xe=a["c"].bindToContribution(Ge.get);Object(a["g"])(new Xe({id:"acceptSelectedSuggestion",precondition:T["b"].Visible,handler:function(e){return e.acceptSelectedSuggestion(!0)},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:2}})),Object(a["g"])(new Xe({id:"acceptSelectedSuggestionOnEnter",precondition:T["b"].Visible,handler:function(e){return e.acceptSelectedSuggestion(!1)},kbOpts:{weight:Ye,kbExpr:M["a"].and(c["a"].textInputFocus,T["b"].AcceptSuggestionsOnEnter,T["b"].MakesTextEdit),primary:3}})),Object(a["g"])(new Xe({id:"hideSuggestWidget",precondition:T["b"].Visible,handler:function(e){return e.cancelSuggestWidget()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:9,secondary:[1033]}})),Object(a["g"])(new Xe({id:"selectNextSuggestion",precondition:M["a"].and(T["b"].Visible,T["b"].MultipleSuggestions),handler:function(e){return e.selectNextSuggestion()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Object(a["g"])(new Xe({id:"selectNextPageSuggestion",precondition:M["a"].and(T["b"].Visible,T["b"].MultipleSuggestions),handler:function(e){return e.selectNextPageSuggestion()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:12,secondary:[2060]}})),Object(a["g"])(new Xe({id:"selectLastSuggestion",precondition:M["a"].and(T["b"].Visible,T["b"].MultipleSuggestions),handler:function(e){return e.selectLastSuggestion()}})),Object(a["g"])(new Xe({id:"selectPrevSuggestion",precondition:M["a"].and(T["b"].Visible,T["b"].MultipleSuggestions),handler:function(e){return e.selectPrevSuggestion()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Object(a["g"])(new Xe({id:"selectPrevPageSuggestion",precondition:M["a"].and(T["b"].Visible,T["b"].MultipleSuggestions),handler:function(e){return e.selectPrevPageSuggestion()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:11,secondary:[2059]}})),Object(a["g"])(new Xe({id:"selectFirstSuggestion",precondition:M["a"].and(T["b"].Visible,T["b"].MultipleSuggestions),handler:function(e){return e.selectFirstSuggestion()}})),Object(a["g"])(new Xe({id:"toggleSuggestionDetails",precondition:T["b"].Visible,handler:function(e){return e.toggleSuggestionDetails()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:2058,mac:{primary:266}}})),Object(a["g"])(new Xe({id:"toggleExplainMode",precondition:T["b"].Visible,handler:function(e){return e.toggleExplainMode()},kbOpts:{weight:100,primary:2133}})),Object(a["g"])(new Xe({id:"toggleSuggestionFocus",precondition:T["b"].Visible,handler:function(e){return e.toggleSuggestionFocus()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:2570,mac:{primary:778}}})),Object(a["g"])(new Xe({id:"insertBestCompletion",precondition:M["a"].and(M["a"].equals("config.editor.tabCompletion","on"),Ae.AtEnd,T["b"].Visible.toNegated(),A.OtherSuggestions.toNegated(),d["SnippetController2"].InSnippetMode.toNegated()),handler:function(e,t){e.triggerSuggestAndAcceptBest(Object(je["h"])(t)?He({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:Ye,primary:2}})),Object(a["g"])(new Xe({id:"insertNextSuggestion",precondition:M["a"].and(M["a"].equals("config.editor.tabCompletion","on"),A.OtherSuggestions,T["b"].Visible.toNegated(),d["SnippetController2"].InSnippetMode.toNegated()),handler:function(e){return e.acceptNextSuggestion()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:2}})),Object(a["g"])(new Xe({id:"insertPrevSuggestion",precondition:M["a"].and(M["a"].equals("config.editor.tabCompletion","on"),A.OtherSuggestions,T["b"].Visible.toNegated(),d["SnippetController2"].InSnippetMode.toNegated()),handler:function(e){return e.acceptPrevSuggestion()},kbOpts:{weight:Ye,kbExpr:c["a"].textInputFocus,primary:1026}}))},"7aad":function(e,t,n){},"7ab3":function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i,o=n("3742");i="undefined"!==typeof TextDecoder?function(e){return new r(e)}:function(e){return new s};var r=function(){function e(e){this._decoder=new TextDecoder("UTF-16LE"),this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}return e.prototype.reset=function(){this._completedStrings=null,this._bufferLength=0},e.prototype.build=function(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()},e.prototype._buildBuffer=function(){if(0===this._bufferLength)return"";var e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return this._decoder.decode(e)},e.prototype._flushBuffer=function(){var e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e},e.prototype.write1=function(e){var t=this._capacity-this._bufferLength;t<=1&&(0===t||o["w"](e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e},e.prototype.appendASCII=function(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e},e.prototype.appendASCIIString=function(e){var t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(var n=0;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},g=function(e,t){return function(n,i){t(n,i,e)}},m=function(){function e(e,t,n,i,o,r){var a=this;this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=i,this._keybindingService=o,this._menuService=r,this._toDispose=new s["b"],this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(function(e){return a._onContextMenu(e)})),this._toDispose.add(this._editor.onMouseWheel(function(e){a._contextMenuIsBeingShownCount>0&&a._contextViewService.hideContextView()})),this._toDispose.add(this._editor.onKeyDown(function(e){58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),a.showContextMenu())}))}return e.get=function(t){return t.getContribution(e.ID)},e.prototype._onContextMenu=function(e){if(this._editor.hasModel()){if(!this._editor.getConfiguration().contribInfo.contextmenu)return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12!==e.target.type&&(e.event.preventDefault(),6===e.target.type||7===e.target.type||1===e.target.type)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);var t=null;1!==e.target.type&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}}},e.prototype.showContextMenu=function(e){if(this._editor.getConfiguration().contribInfo.contextmenu&&this._editor.hasModel())if(this._contextMenuService){var t=this._getMenuActions(this._editor.getModel());t.length>0&&this._doShowContextMenu(t,e)}else this._editor.focus()},e.prototype._getMenuActions=function(e){var t=[],n=this._menuService.createMenu(7,this._contextKeyService),i=n.getActions({arg:e.uri});n.dispose();for(var o=0,s=i;o0&&this._contextViewService.hideContextView(),this._toDispose.dispose()},e.ID="editor.contrib.contextmenu",e=f([g(1,d["a"]),g(2,d["b"]),g(3,c["c"]),g(4,h["a"]),g(5,l["a"])],e),e}(),v=function(e){function t(){return e.call(this,{id:"editor.action.showContextMenu",label:i["a"]("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:u["a"].textInputFocus,primary:1092,weight:100}})||this}return p(t,e),t.prototype.run=function(e,t){var n=m.get(t);n.showContextMenu()},t}(a["b"]);Object(a["h"])(m),Object(a["f"])(v)},"7de1":function(e,t,n){"use strict";var i=n("aa3d"),o=n("a666"),r=n("a60f"),s=n("11f7"),a=n("308f"),u=n("e32d"),l=n("1898"),c=n("9ee1");function d(e,t){for(var n=[],i=0,o=t;i=r.range.end)){if(e.end=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},O={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:function(e){return[e]},getDragURI:function(){return null},onDragStart:function(){},onDragOver:function(){return!1},drop:function(){}},horizontalScrolling:!1},x=function(){function e(e){this.elements=e}return e.prototype.update=function(){},e.prototype.getData=function(){return this.elements},e}(),N=function(){function e(e){this.elements=e}return e.prototype.update=function(){},e.prototype.getData=function(){return this.elements},e}(),D=function(){function e(){this.types=[],this.files=[]}return e.prototype.update=function(e){var t;if(e.types&&(t=this.types).splice.apply(t,[0,this.types.length].concat(e.types)),e.files){this.files.splice(0,this.files.length);for(var n=0;n=this.items.length?(this.rangeMap=new g,this.rangeMap.splice(0,0,v),this.items=v,d=[]):(this.rangeMap.splice(e,t,v),d=(i=this.items).splice.apply(i,[e,t].concat(v)));var _=n.length-t,b=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),y=h(f,_),w=c["a"].intersect(b,y);for(l=w.start;l=-1&&en&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}},e.prototype.teardownDragAndDropScrollTopAnimation=function(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},e.prototype.getItemIndexFromEventTarget=function(e){var t=e;while(t instanceof HTMLElement&&t!==this.rowsContainer){var n=t.getAttribute("data-index");if(n){var i=Number(n);if(!isNaN(i))return i}t=t.parentElement}},e.prototype.getRenderRange=function(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}},e.prototype._rerender=function(e,t){var n,i,o=this.getRenderRange(e,t);e===this.elementTop(o.start)?(n=o.start,i=0):o.end-o.start>1&&(n=o.start+1,i=this.elementTop(n)-e);var r=0;while(1){for(var s=this.getRenderRange(e,t),a=!1,u=s.start;u=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},c=function(e,t){return function(n,i){t(n,i,e)}};function d(e){return void 0!==e.command}var h=Object(o["c"])("menuService"),p=new(function(){function e(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new a["a"],this.onDidChangeMenu=this._onDidChangeMenu.event}return e.prototype.addCommand=function(e){var t=this;return this._commands.set(e.id,e),this._onDidChangeMenu.fire(0),{dispose:function(){t._commands.delete(e.id)&&t._onDidChangeMenu.fire(0)}}},e.prototype.getCommand=function(e){return this._commands.get(e)},e.prototype.getCommands=function(){var e=new Map;return this._commands.forEach(function(t,n){return e.set(n,t)}),e},e.prototype.appendMenuItem=function(e,t){var n=this,i=this._menuItems.get(e);return i?i.push(t):(i=[t],this._menuItems.set(e,i)),this._onDidChangeMenu.fire(e),{dispose:function(){var o=i.indexOf(t);o>=0&&(i.splice(o,1),n._onDidChangeMenu.fire(e))}}},e.prototype.getMenuItems=function(e){var t=(this._menuItems.get(e)||[]).slice(0);return 0===e&&this._appendImplicitItems(t),t},e.prototype._appendImplicitItems=function(e){for(var t=new Set,n=e.filter(function(e){return d(e)}),i=0,o=n;i0?[{start:0,end:t.length}]:[]:null);var i}function u(e,t){var n=t.toLowerCase().indexOf(e.toLowerCase());return-1===n?null:[{start:n,end:n+e.length}]}function l(e,t){return c(e.toLowerCase(),t.toLowerCase(),0,0)}function c(e,t,n,i){if(n===e.length)return[];if(i===t.length)return null;if(e[n]===t[i]){var o=null;return(o=c(e,t,n+1,i+1))?v({start:i,end:i+1},o):null}return c(e,t,n,i+1)}function d(e){return 97<=e&&e<=122}function h(e){return 65<=e&&e<=90}function p(e){return 48<=e&&e<=57}function f(e){return 32===e||9===e||10===e||13===e}var g=new Set;function m(e){return d(e)||h(e)||p(e)}function v(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function _(e,t){for(var n=t;n0&&!m(e.charCodeAt(n-1)))return n}return e.length}function b(e,t,n,i){if(n===e.length)return[];if(i===t.length)return null;if(e[n]!==t[i].toLowerCase())return null;var o=null,r=i+1;o=b(e,t,n+1,i+1);while(!o&&(r=_(t,r)).6}function C(e){var t=e.upperPercent,n=e.lowerPercent,i=e.alphaPercent,o=e.numericPercent;return n>.2&&t<.8&&i>.6&&o<.2}function S(e){for(var t=0,n=0,i=0,o=0,r=0;r60)return null;var n=y(t);if(!C(n)){if(!w(n))return null;t=t.toLowerCase()}var i=null,o=0;e=e.toLowerCase();while(o/?".split("").forEach(function(e){return g.add(e.charCodeAt(0))});var O=r(s,L,u),x=r(s,L,l),N=new i["a"](1e4);function D(e,t,n){if(void 0===n&&(n=!1),"string"!==typeof e||"string"!==typeof t)return null;var i=N.get(e);i||(i=new RegExp(o["j"](e),"i"),N.set(e,i));var r=i.exec(t);return r?[{start:r.index,end:r.index+r[0].length}]:n?x(e,t):O(e,t)}function k(e,t,n,i,o,r){var s=U(e,t,0,i,o,0,!0);if(s)return s;for(var a=0,u=0,l=r,c=0;c=0)u+=1,a+=Math.pow(2,d),l=d+1;else if(0!==a)break}return[u,a,r]}function I(e){if("undefined"===typeof e)return[];for(var t=e[1].toString(2),n=e[2],i=[],o=n;o=e.length)return!1;var n=e.charCodeAt(t);switch(n){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:return!0;default:return!1}}function B(e,t){if(t<0||t>=e.length)return!1;var n=e.charCodeAt(t);switch(n){case 32:case 9:return!0;default:return!1}}function H(e,t,n){return t[e]!==n[e]}function z(e,t,n,i,o,r){while(tE?E:e.length,u=i.length>E?E:i.length;if(!(n>=a||r>=u||a>u)&&z(t,n,a,o,r,u)){var l=1,c=1,d=n,h=r;for(l=1,d=n;d1?1:p),g=P[l-1][c]+-1,m=P[l][c-1]+-1;m>=g?m>f?(P[l][c]=m,A[l][c]=4):m===f?(P[l][c]=m,A[l][c]=6):(P[l][c]=f,A[l][c]=2):g>f?(P[l][c]=g,A[l][c]=1):g===f?(P[l][c]=g,A[l][c]=3):(P[l][c]=f,A[l][c]=2)}if(F&&W(e,n,i,r),q=0,Z=-100,Y=r,X=s,$(l-1,c-1,a===u?1:0,0,!1),0!==q)return[Z,G,r]}}function K(e,t,n,i,o,r,s){return t[n]!==r[s]?-1:s===n-i?e[n]===o[s]?7:5:!H(s,o,r)||0!==s&&H(s-1,o,r)?!V(r,s)||0!==s&&V(r,s-1)?V(r,s-1)||B(r,s-1)?5:1:5:e[n]===o[s]?7:5}(function(e){function t(e){return!e||-100===e[0]&&0===e[1]&&0===e[2]}e.Default=Object.freeze([-100,0,0]),e.isDefault=t})(T||(T={}));var q=0,G=0,Z=0,Y=0,X=!1;function $(e,t,n,i,o){if(!(q>=10||n<-25)){var r=0;while(e>0&&t>0){var s=R[e][t],a=A[e][t];if(4===a)t-=1,o?n-=5:0!==i&&(n-=1),o=!1,r=0;else{if(!(2&a))return;if(4&a&&$(e,t-1,0!==i?n-1:n,i,o),n+=s,e-=1,t-=1,o=!0,i+=Math.pow(2,t+Y),1===s){if(r+=1,0===e&&!X)return}else n+=1+r*(s-1),r=0}}n-=t>=3?9:3*t,q+=1,n>Z&&(Z=n,G=i)}}function Q(e,t,n,i,o,r,s){return J(e,t,n,i,o,r,!0,s)}function J(e,t,n,i,o,r,s,a){var u=U(e,t,n,i,o,r,a);if(u&&!s)return u;if(e.length>=3)for(var l=Math.min(7,e.length-1),c=n+1;cu[0])&&(u=h))}}return u}function ee(e,t){if(!(t+1>=e.length)){var n=e[t],i=e[t+1];if(n!==i)return e.slice(0,t)+i+n+e.slice(t+2)}}},8025:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("7061"),o=n("6a89"),r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),s=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i,o)||this;return r.selectionStartLineNumber=t,r.selectionStartColumn=n,r.positionLineNumber=i,r.positionColumn=o,r}return r(t,e),t.prototype.clone=function(){return new t(this.selectionStartLineNumber,this.selectionStartColumn,this.positionLineNumber,this.positionColumn)},t.prototype.toString=function(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"},t.prototype.equalsSelection=function(e){return t.selectionsEqual(this,e)},t.selectionsEqual=function(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1},t.prototype.setEndPosition=function(e,n){return 0===this.getDirection()?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.getPosition=function(){return new i["a"](this.positionLineNumber,this.positionColumn)},t.prototype.setStartPosition=function(e,n){return 0===this.getDirection()?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.liftSelection=function(e){return new t(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)},t.selectionsArrEqual=function(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(var n=0,i=e.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},m=function(e,t){return function(n,i){t(n,i,e)}},v=function(e){function t(t,n,i){var o=e.call(this)||this;return o._editor=t,o._modeService=i,o._widget=null,o._register(o._editor.onDidChangeModel(function(e){return o.stop()})),o._register(o._editor.onDidChangeModelLanguage(function(e){return o.stop()})),o._register(a["y"].onDidChange(function(e){return o.stop()})),o}return f(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.getId=function(){return t.ID},t.prototype.dispose=function(){this.stop(),e.prototype.dispose.call(this)},t.prototype.launch=function(){this._widget||this._editor.hasModel()&&(this._widget=new w(this._editor,this._modeService))},t.prototype.stop=function(){this._widget&&(this._widget.dispose(),this._widget=null)},t.ID="editor.contrib.inspectTokens",t=g([m(1,c["a"]),m(2,l["a"])],t),t}(o["a"]),_=function(e){function t(){return e.call(this,{id:"editor.action.inspectTokens",label:p["c"].inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})||this}return f(t,e),t.prototype.run=function(e,t){var n=v.get(t);n&&n.launch()},t}(s["b"]);function b(e){for(var t="",n=0,i=e.length;n=0;o--){var s=t.tokens1[o];if(e.column-1>=s.offset){n=o;break}}var a=0;for(o=t.tokens2.length>>>1;o>=0;o--)if(e.column-1>=t.tokens2[o<<1]){a=o;break}var u="",l=this._model.getLineContent(e.lineNumber),c="";if(n'+b(c)+'('+c.length+" "+(1===c.length?"char":"chars")+")",u+='
';var p=this._decodeMetadata(t.tokens2[1+(a<<1)]);u+='',u+='",u+='",u+='",u+='",u+='",u+="",u+='
',n'+Object(r["o"])(t.tokens1[n].type)+""),this._domNode.innerHTML=u,this._editor.layoutContentWidget(this)},t.prototype._decodeMetadata=function(e){var t=a["y"].getColorMap(),n=a["x"].getLanguageId(e),i=a["x"].getTokenType(e),o=a["x"].getFontStyle(e),r=a["x"].getForeground(e),s=a["x"].getBackground(e);return{languageIdentifier:this._modeService.getLanguageIdentifier(n),tokenType:i,fontStyle:o,foreground:t[r],background:t[s]}},t.prototype._tokenTypeToString=function(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 4:return"RegEx"}return"??"},t.prototype._fontStyleToString=function(e){var t="";return 1&e&&(t+="italic "),2&e&&(t+="bold "),4&e&&(t+="underline "),0===t.length&&(t="---"),t},t.prototype._getTokensAtLine=function(e){var t=this._getStateBeforeLine(e),n=this._tokenizationSupport.tokenize(this._model.getLineContent(e),t,0),i=this._tokenizationSupport.tokenize2(this._model.getLineContent(e),t,0);return{startState:t,tokens1:n.tokens,tokens2:i.tokens,endState:n.endState}},t.prototype._getStateBeforeLine=function(e){for(var t=this._tokenizationSupport.getInitialState(),n=1;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},C=function(e,t){return function(n,i){t(n,i,e)}},S=function(){function e(e,t,n){var i=this;this.textModelResolverService=t,this.modeService=n,this.toUnhook=new h["b"],this.decorations=[],this.currentWordUnderMouse=null,this.previousPromise=null,this.editor=e;var o=new _["a"](e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(function(e){var t=e[0],n=e[1];i.startFindDefinition(t,Object(y["m"])(n))})),this.toUnhook.add(o.onExecute(function(e){i.isEnabled(e)&&i.gotoDefinition(e.target,e.hasSideBySideModifier).then(function(){i.removeDecorations()},function(e){i.removeDecorations(),Object(r["e"])(e)})})),this.toUnhook.add(o.onCancel(function(){i.removeDecorations(),i.currentWordUnderMouse=null}))}return e.prototype.startFindDefinition=function(e,t){var n=this;if(!(9===e.target.type&&this.decorations.length>0)){if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordUnderMouse=null,void this.removeDecorations();var a=e.target.position?this.editor.getModel().getWordAtPosition(e.target.position):null;if(!a)return this.currentWordUnderMouse=null,void this.removeDecorations();var l=e.target.position;if(!this.currentWordUnderMouse||this.currentWordUnderMouse.startColumn!==a.startColumn||this.currentWordUnderMouse.endColumn!==a.endColumn||this.currentWordUnderMouse.word!==a.word){this.currentWordUnderMouse=a;var c=new m["a"](this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Object(o["f"])(function(t){return n.findDefinition(e.target,t)}),this.previousPromise.then(function(e){if(e&&e.length&&c.validate(n.editor))if(e.length>1)n.addDecoration(new u["a"](l.lineNumber,a.startColumn,l.lineNumber,a.endColumn),(new s["a"]).appendText(i["a"]("multipleResults","Click to show {0} definitions.",e.length)));else{var t=e[0];if(!t.uri)return;n.textModelResolverService.createModelReference(t.uri).then(function(e){if(e.object&&e.object.textEditorModel){var i=e.object.textEditorModel,o=t.range.startLineNumber;if(o<1||o>i.getLineCount())e.dispose();else{var r,c=n.getPreviewValue(i,o,t);r=t.originSelectionRange?u["a"].lift(t.originSelectionRange):new u["a"](l.lineNumber,a.startColumn,l.lineNumber,a.endColumn);var d=n.modeService.getModeIdByFilepathOrFirstLine(i.uri);n.addDecoration(r,(new s["a"]).appendCodeblock(d||"",c)),e.dispose()}}else e.dispose()})}else n.removeDecorations()}).then(void 0,r["e"])}}},e.prototype.getPreviewValue=function(t,n,i){var o=i.targetSelectionRange?i.range:this.getPreviewRangeBasedOnBrackets(t,n),r=o.endLineNumber-o.startLineNumber;r>=e.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(t,n));var s=this.stripIndentationFromPreviewRange(t,n,o);return s},e.prototype.stripIndentationFromPreviewRange=function(e,t,n){for(var i=e.getLineFirstNonWhitespaceColumn(t),o=i,r=t+1;ri)return new u["a"](n,1,i+1,1);s=t.findNextBracket(new b["a"](c,d))}return new u["a"](n,1,i+1,1)},e.prototype.addDecoration=function(e,t){var n={range:e,options:{inlineClassName:"goto-definition-link",hoverMessage:t}};this.decorations=this.editor.deltaDecorations(this.decorations,[n])},e.prototype.removeDecorations=function(){this.decorations.length>0&&(this.decorations=this.editor.deltaDecorations(this.decorations,[]))},e.prototype.isEnabled=function(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&6===e.target.type&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&l["f"].has(this.editor.getModel())},e.prototype.findDefinition=function(e,t){var n=this.editor.getModel();return n?Object(d["b"])(n,e.position,t):Promise.resolve(null)},e.prototype.gotoDefinition=function(e,t){var n=this;this.editor.setPosition(e.position);var i=new v["DefinitionAction"](new v["DefinitionActionConfig"](t,!1,!0,!1),{alias:"",label:"",id:"",precondition:void 0});return this.editor.invokeWithinContext(function(e){return i.run(e,n.editor)})},e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this.toUnhook.dispose()},e.ID="editor.contrib.gotodefinitionwithmouse",e.MAX_SOURCE_PREVIEW_LINES=8,e=w([C(1,p["a"]),C(2,a["a"])],e),e}();Object(c["h"])(S),Object(f["f"])(function(e,t){var n=e.getColor(g["n"]);n&&t.addRule(".monaco-editor .goto-definition-link { color: "+n+" !important; }")})},"82c9":function(e,t,n){"use strict";n.d(t,"c",function(){return d}),n.d(t,"e",function(){return p}),n.d(t,"b",function(){return f}),n.d(t,"d",function(){return g}),n.d(t,"f",function(){return m}),n.d(t,"g",function(){return v}),n.d(t,"h",function(){return b}),n.d(t,"a",function(){return i});var i,o=n("3d37"),r=n("32b8"),s=n("6d8e"),a=n("3742"),u=n("b589"),l=n("30db");function c(e){return!e||e.scheme!==u["b"].file||!l["c"]}function d(e){return f(e)||e.authority}function h(e,t){return e===t||Object(a["n"])(e,t)}function p(e,t,n){if(void 0===n&&(n=c(e)),e===t)return!0;if(!e||!t)return!1;if(e.scheme!==t.scheme||!h(e.authority,t.authority))return!1;var i=e.path||"/",o=t.path||"/";return i===o||n&&Object(a["n"])(i||"/",o||"/")}function f(e){return r["posix"].basename(e.path)}function g(e){if(0===e.path.length)return e;if(e.scheme===u["b"].file)return s["a"].file(r["dirname"](_(e)));var t=r["posix"].dirname(e.path);return e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error('dirname("'+e.toString+")) resulted in a relative path"),t="/"),e.with({path:t})}function m(e){for(var t,n,i=[],o=1;o1&&e.scheme===u["b"].file?"//"+e.authority+n:l["g"]&&47===n.charCodeAt(0)&&o["b"](n.charCodeAt(1))&&58===n.charCodeAt(2)?n.substr(1):n,l["g"]&&(t=t.replace(/\//g,"\\")),t}function b(e,t,n){if(void 0===n&&(n=c(e)),e.scheme===t.scheme&&h(e.authority,t.authority)){if(e.scheme===u["b"].file){var i=r["relative"](e.path,t.path);return l["g"]?o["c"](i):i}var s=e.path||"/",a=t.path||"/";if(n){for(var d=0,p=Math.min(s.length,a.length);d0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1] console.log` because `log` has been completed recently."),i["a"]("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],default:"recentlyUsed",description:i["a"]("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")},"editor.suggestFontSize":{type:"integer",default:0,minimum:0,markdownDescription:i["a"]("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")},"editor.suggestLineHeight":{type:"integer",default:0,minimum:0,markdownDescription:i["a"]("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.")},"editor.tabCompletion":{type:"string",default:"off",enum:["on","off","onlySnippets"],enumDescriptions:[i["a"]("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),i["a"]("tabCompletion.off","Disable tab completions."),i["a"]("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:i["a"]("tabCompletion","Enables tab completions.")},"editor.suggest.filterGraceful":{type:"boolean",default:!0,description:i["a"]("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:!1,description:i["a"]("suggest.localityBonus","Controls whether sorting favours words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:!1,markdownDescription:i["a"]("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:!0,description:i["a"]("suggest.snippetsPreventQuickSuggestions","Control whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:f.contribInfo.suggest.showIcons,description:i["a"]("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.maxVisibleSuggestions":{type:"number",default:f.contribInfo.suggest.maxVisibleSuggestions,minimum:1,maximum:15,description:i["a"]("suggest.maxVisibleSuggestions","Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).")},"editor.suggest.filteredTypes":{type:"object",default:{keyword:!0,snippet:!0},markdownDescription:i["a"]("suggest.filtered","Controls whether some suggestion types should be filtered from IntelliSense. A list of suggestion types can be found here: https://code.visualstudio.com/docs/editor/intellisense#_types-of-completions."),properties:{method:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.method","When set to `false` IntelliSense never shows `method` suggestions.")},function:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.function","When set to `false` IntelliSense never shows `function` suggestions.")},constructor:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.constructor","When set to `false` IntelliSense never shows `constructor` suggestions.")},field:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.field","When set to `false` IntelliSense never shows `field` suggestions.")},variable:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.variable","When set to `false` IntelliSense never shows `variable` suggestions.")},class:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.class","When set to `false` IntelliSense never shows `class` suggestions.")},struct:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.struct","When set to `false` IntelliSense never shows `struct` suggestions.")},interface:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.interface","When set to `false` IntelliSense never shows `interface` suggestions.")},module:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.module","When set to `false` IntelliSense never shows `module` suggestions.")},property:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.property","When set to `false` IntelliSense never shows `property` suggestions.")},event:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.event","When set to `false` IntelliSense never shows `event` suggestions.")},operator:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.operator","When set to `false` IntelliSense never shows `operator` suggestions.")},unit:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.unit","When set to `false` IntelliSense never shows `unit` suggestions.")},value:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.value","When set to `false` IntelliSense never shows `value` suggestions.")},constant:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.constant","When set to `false` IntelliSense never shows `constant` suggestions.")},enum:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.enum","When set to `false` IntelliSense never shows `enum` suggestions.")},enumMember:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.enumMember","When set to `false` IntelliSense never shows `enumMember` suggestions.")},keyword:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.keyword","When set to `false` IntelliSense never shows `keyword` suggestions.")},text:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.text","When set to `false` IntelliSense never shows `text` suggestions.")},color:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.color","When set to `false` IntelliSense never shows `color` suggestions.")},file:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.file","When set to `false` IntelliSense never shows `file` suggestions.")},reference:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.reference","When set to `false` IntelliSense never shows `reference` suggestions.")},customcolor:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.customcolor","When set to `false` IntelliSense never shows `customcolor` suggestions.")},folder:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.folder","When set to `false` IntelliSense never shows `folder` suggestions.")},typeParameter:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.typeParameter","When set to `false` IntelliSense never shows `typeParameter` suggestions.")},snippet:{type:"boolean",default:!0,markdownDescription:i["a"]("suggest.filtered.snippet","When set to `false` IntelliSense never shows `snippet` suggestions.")}}},"editor.gotoLocation.multiple":{description:i["a"]("editor.gotoLocation.multiple","Controls the behavior of 'Go To' commands, like Go To Definition, when multiple target locations exist."),type:"string",enum:["peek","gotoAndPeek","goto"],default:f.contribInfo.gotoLocation.multiple,enumDescriptions:[i["a"]("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),i["a"]("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),i["a"]("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},"editor.selectionHighlight":{type:"boolean",default:f.contribInfo.selectionHighlight,description:i["a"]("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")},"editor.occurrencesHighlight":{type:"boolean",default:f.contribInfo.occurrencesHighlight,description:i["a"]("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")},"editor.overviewRulerLanes":{type:"integer",default:3,description:i["a"]("overviewRulerLanes","Controls the number of decorations that can show up at the same position in the overview ruler.")},"editor.overviewRulerBorder":{type:"boolean",default:f.viewInfo.overviewRulerBorder,description:i["a"]("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")},"editor.cursorBlinking":{type:"string",enum:["blink","smooth","phase","expand","solid"],default:u["h"](f.viewInfo.cursorBlinking),description:i["a"]("cursorBlinking","Control the cursor animation style.")},"editor.mouseWheelZoom":{type:"boolean",default:f.viewInfo.mouseWheelZoom,markdownDescription:i["a"]("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")},"editor.cursorSmoothCaretAnimation":{type:"boolean",default:f.viewInfo.cursorSmoothCaretAnimation,description:i["a"]("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")},"editor.cursorStyle":{type:"string",enum:["block","block-outline","line","line-thin","underline","underline-thin"],default:u["i"](f.viewInfo.cursorStyle),description:i["a"]("cursorStyle","Controls the cursor style.")},"editor.cursorWidth":{type:"integer",default:f.viewInfo.cursorWidth,markdownDescription:i["a"]("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")},"editor.fontLigatures":{type:"boolean",default:f.viewInfo.fontLigatures,description:i["a"]("fontLigatures","Enables/Disables font ligatures.")},"editor.hideCursorInOverviewRuler":{type:"boolean",default:f.viewInfo.hideCursorInOverviewRuler,description:i["a"]("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")},"editor.renderWhitespace":{type:"string",enum:["none","boundary","selection","all"],enumDescriptions:["",i["a"]("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),i["a"]("renderWhitespace.selection","Render whitespace characters only on selected text."),""],default:f.viewInfo.renderWhitespace,description:i["a"]("renderWhitespace","Controls how the editor should render whitespace characters.")},"editor.renderControlCharacters":{type:"boolean",default:f.viewInfo.renderControlCharacters,description:i["a"]("renderControlCharacters","Controls whether the editor should render control characters.")},"editor.renderIndentGuides":{type:"boolean",default:f.viewInfo.renderIndentGuides,description:i["a"]("renderIndentGuides","Controls whether the editor should render indent guides.")},"editor.highlightActiveIndentGuide":{type:"boolean",default:f.viewInfo.highlightActiveIndentGuide,description:i["a"]("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],enumDescriptions:["","","",i["a"]("renderLineHighlight.all","Highlights both the gutter and the current line.")],default:f.viewInfo.renderLineHighlight,description:i["a"]("renderLineHighlight","Controls how the editor should render the current line highlight.")},"editor.codeLens":{type:"boolean",default:f.contribInfo.codeLens,description:i["a"]("codeLens","Controls whether the editor shows CodeLens.")},"editor.folding":{type:"boolean",default:f.contribInfo.folding,description:i["a"]("folding","Controls whether the editor has code folding enabled.")},"editor.foldingStrategy":{type:"string",enum:["auto","indentation"],default:f.contribInfo.foldingStrategy,markdownDescription:i["a"]("foldingStrategy","Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.")},"editor.showFoldingControls":{type:"string",enum:["always","mouseover"],default:f.contribInfo.showFoldingControls,description:i["a"]("showFoldingControls","Controls whether the fold controls on the gutter are automatically hidden.")},"editor.matchBrackets":{type:"boolean",default:f.contribInfo.matchBrackets,description:i["a"]("matchBrackets","Highlight matching brackets when one of them is selected.")},"editor.glyphMargin":{type:"boolean",default:f.viewInfo.glyphMargin,description:i["a"]("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")},"editor.useTabStops":{type:"boolean",default:f.useTabStops,description:i["a"]("useTabStops","Inserting and deleting whitespace follows tab stops.")},"editor.trimAutoWhitespace":{type:"boolean",default:m.trimAutoWhitespace,description:i["a"]("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:i["a"]("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.dragAndDrop":{type:"boolean",default:f.dragAndDrop,description:i["a"]("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")},"editor.accessibilitySupport":{type:"string",enum:["auto","on","off"],enumDescriptions:[i["a"]("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),i["a"]("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader."),i["a"]("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:f.accessibilitySupport,description:i["a"]("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers.")},"editor.showUnused":{type:"boolean",default:f.showUnused,description:i["a"]("showUnused","Controls fading out of unused code.")},"editor.links":{type:"boolean",default:f.contribInfo.links,description:i["a"]("links","Controls whether the editor should detect links and make them clickable.")},"editor.colorDecorators":{type:"boolean",default:f.contribInfo.colorDecorators,description:i["a"]("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")},"editor.lightbulb.enabled":{type:"boolean",default:f.contribInfo.lightbulbEnabled,description:i["a"]("codeActions","Enables the code action lightbulb in the editor.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:i["a"]("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.codeActionsOnSave":{type:"object",properties:{"source.organizeImports":{type:"boolean",description:i["a"]("codeActionsOnSave.organizeImports","Controls whether organize imports action should be run on file save.")},"source.fixAll":{type:"boolean",description:i["a"]("codeActionsOnSave.fixAll","Controls whether auto fix action should be run on file save.")}},additionalProperties:{type:"boolean"},default:f.contribInfo.codeActionsOnSave,description:i["a"]("codeActionsOnSave","Code action kinds to be run on save.")},"editor.codeActionsOnSaveTimeout":{type:"number",default:f.contribInfo.codeActionsOnSaveTimeout,description:i["a"]("codeActionsOnSaveTimeout","Timeout in milliseconds after which the code actions that are run on save are cancelled.")},"editor.selectionClipboard":{type:"boolean",default:f.contribInfo.selectionClipboard,description:i["a"]("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:a["c"]},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:i["a"]("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:i["a"]("ignoreTrimWhitespace","Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")},"editor.largeFileOptimizations":{type:"boolean",default:m.largeFileOptimizations,description:i["a"]("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:i["a"]("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")}}},C=null;function S(){return null===C&&(C=Object.create(null),Object.keys(w.properties).forEach(function(e){C[e]=!0})),C}function L(e){var t=S();return t["editor."+e]||!1}function O(e){var t=S();return t["diffEditor."+e]||!1}y.registerConfiguration(w)},8899:function(e,t,n){},"89cd":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("ef8e"),o=n("1569"),r=function(){function e(){this.data=new Map}return e.prototype.add=function(e,t){o["a"](i["i"](e)),o["a"](i["h"](t)),o["a"](!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)},e.prototype.as=function(e){return this.data.get(e)||null},e}(),s=new r},"8ad2":function(e,t,n){"use strict";var i=n("55f3"),o=n.n(i);o.a},"8ae8":function(e,t,n){"use strict";function i(e){return e&&"string"===typeof e.id}n.d(t,"c",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r});var o={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},r={ExecuteCommand:"executeCommand",ExecuteCommands:"executeCommands",Type:"type",ReplacePreviousChar:"replacePreviousChar",CompositionStart:"compositionStart",CompositionEnd:"compositionEnd",Paste:"paste",Cut:"cut",Undo:"undo",Redo:"redo"}},"8b4e":function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return s});var i=n("dff7"),o=function(){function e(e,t,n){void 0===n&&(n=t),this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=n}return e.prototype.toLabel=function(e,t,n){if(0===t.length)return null;for(var i=[],o=0,r=t.length;o>>0,new i["c"](r,null===n?s:n)}},"8bf4":function(e,t,n){},"8c02":function(e,t,n){"use strict";n.d(t,"a",function(){return l}),n.d(t,"d",function(){return h}),n.d(t,"c",function(){return f}),n.d(t,"e",function(){return v}),n.d(t,"b",function(){return _});var i=n("3742"),o=n("e6ff"),r=n("7061"),s=n("6a89"),a=n("3352"),u=999,l=function(){function e(e,t,n,i){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=i}return e.prototype.parseSearchRequest=function(){if(""===this.searchString)return null;var e;e=this.isRegex?c(this.searchString):this.searchString.indexOf("\n")>=0;var t=null;try{t=i["k"](this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0})}catch(r){return null}if(!t)return null;var n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new d(t,this.wordSeparators?Object(o["a"])(this.wordSeparators):null,n?this.searchString:null)},e}();function c(e){if(!e||0===e.length)return!1;for(var t=0,n=e.length;t=n)break;var o=e.charCodeAt(t);if(110===o||114===o||87===o)return!0}}return!1}var d=function(){function e(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}return e}();function h(e,t,n){if(!n)return new a["b"](e,null);for(var i=[],o=0,r=t.length;o>0);t[o]>=e?i=o-1:t[o+1]>=e?(n=o,i=o):n=o+1}return n+1},e}(),f=function(){function e(){}return e.findMatches=function(e,t,n,i,o){var r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,n,new _(r.wordSeparators,r.regex),i,o):this._doFindMatchesLineByLine(e,n,r,i,o):[]},e._getMultilineMatchRange=function(e,t,n,i,o,r){var a,u,l=0;if(i?(l=i.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o,i){var c=i.findLineFeedCountBeforeOffset(o+r.length),d=c-l;u=a+r.length+d}else u=a+r.length;var h=e.getPositionAt(a),p=e.getPositionAt(u);return new s["a"](h.lineNumber,h.column,p.lineNumber,p.column)},e._doFindMatchesMultiline=function(e,t,n,i,o){var r,s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),u="\r\n"===e.getEOL()?new p(a):null,l=[],c=0;n.reset(0);while(r=n.next(a))if(l[c++]=h(this._getMultilineMatchRange(e,s,a,u,r.index,r[0]),r,i),c>=o)return l;return l},e._doFindMatchesLineByLine=function(e,t,n,i,o){var r=[],s=0;if(t.startLineNumber===t.endLineNumber){var a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return s=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,s,r,i,o),r}var u=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);s=this._findMatchesInLine(n,u,t.startLineNumber,t.startColumn-1,s,r,i,o);for(var l=t.startLineNumber+1;l=l))return o;return o}var m,b=new _(e.wordSeparators,e.regex);b.reset(0);do{if(m=b.next(t),m&&(r[o++]=h(new s["a"](n,m.index+1+i,n,m.index+1+m[0].length+i),m,u),o>=l))return o}while(m);return o},e.findNextMatch=function(e,t,n,i){var o=t.parseSearchRequest();if(!o)return null;var r=new _(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,r,i):this._doFindNextMatchLineByLine(e,n,r,i)},e._doFindNextMatchMultiline=function(e,t,n,i){var o=new r["a"](t.lineNumber,1),a=e.getOffsetAt(o),u=e.getLineCount(),l=e.getValueInRange(new s["a"](o.lineNumber,o.column,u,e.getLineMaxColumn(u)),1),c="\r\n"===e.getEOL()?new p(l):null;n.reset(t.column-1);var d=n.next(l);return d?h(this._getMultilineMatchRange(e,a,l,c,d.index,d[0]),d,i):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new r["a"](1,1),n,i):null},e._doFindNextMatchLineByLine=function(e,t,n,i){var o=e.getLineCount(),r=t.lineNumber,s=e.getLineContent(r),a=this._findFirstMatchInLine(n,s,r,t.column,i);if(a)return a;for(var u=1;u<=o;u++){var l=(r+u-1)%o,c=e.getLineContent(l+1),d=this._findFirstMatchInLine(n,c,l+1,1,i);if(d)return d}return null},e._findFirstMatchInLine=function(e,t,n,i,o){e.reset(i-1);var r=e.next(t);return r?h(new s["a"](n,r.index+1,n,r.index+1+r[0].length),r,o):null},e.findPreviousMatch=function(e,t,n,i){var o=t.parseSearchRequest();if(!o)return null;var r=new _(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,r,i):this._doFindPreviousMatchLineByLine(e,n,r,i)},e._doFindPreviousMatchMultiline=function(e,t,n,i){var o=this._doFindMatchesMultiline(e,new s["a"](1,1,t.lineNumber,t.column),n,i,10*u);if(o.length>0)return o[o.length-1];var a=e.getLineCount();return t.lineNumber!==a||t.column!==e.getLineMaxColumn(a)?this._doFindPreviousMatchMultiline(e,new r["a"](a,e.getLineMaxColumn(a)),n,i):null},e._doFindPreviousMatchLineByLine=function(e,t,n,i){var o=e.getLineCount(),r=t.lineNumber,s=e.getLineContent(r).substring(0,t.column-1),a=this._findLastMatchInLine(n,s,r,i);if(a)return a;for(var u=1;u<=o;u++){var l=(o+r-u-1)%o,c=e.getLineContent(l+1),d=this._findLastMatchInLine(n,c,l+1,i);if(d)return d}return null},e._findLastMatchInLine=function(e,t,n,i){var o,r=null;e.reset(0);while(o=e.next(t))r=h(new s["a"](n,o.index+1,n,o.index+1+o[0].length),o,i);return r},e}();function g(e,t,n,i,o){if(0===i)return!0;var r=t.charCodeAt(i-1);if(0!==e.get(r))return!0;if(13===r||10===r)return!0;if(o>0){var s=t.charCodeAt(i);if(0!==e.get(s))return!0}return!1}function m(e,t,n,i,o){if(i+o===n)return!0;var r=t.charCodeAt(i+o);if(0!==e.get(r))return!0;if(13===r||10===r)return!0;if(o>0){var s=t.charCodeAt(i+o-1);if(0!==e.get(s))return!0}return!1}function v(e,t,n,i,o){return g(e,t,n,i,o)&&m(e,t,n,i,o)}var _=function(){function e(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}return e.prototype.reset=function(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0},e.prototype.next=function(e){var t,n=e.length;do{if(this._prevMatchStartIndex+this._prevMatchLength===n)return null;if(t=this._searchRegex.exec(e),!t)return null;var i=t.index,o=t[0].length;if(i===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=i,this._prevMatchLength=o,!this._wordSeparators||v(this._wordSeparators,e,n,i,o))return t}while(t);return null},e}()},9146:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"monaco-view",attrs:{id:"monaco-"+e.id}})},o=[],r=n("75fc"),s=n("33f9");n("28a5"),n("a481"),n("4917"),n("ac6a"),n("7f7f");function a(e,t){return e}function u(e,t,n){var i=n.word,o=[];return e.length&&(o=e.map(function(e){return{label:e.name,kind:e.type?s["languages"].CompletionItemKind[e.type]:s["languages"].CompletionItemKind.Function,documentation:e.documentation,insertText:a(e.name,i),detail:e.detail||"EMQX",range:t}})),o}function l(e){var t=e.name,n=e.default,i=e.valueType;return i&&(t="".concat(t,": ").concat(i)),n?"".concat(t,", value: ").concat(n):t}function c(e,t){var n=[];return t.forEach(function(t){var i=t.name;t.name.match(/\$events\//)&&(i=t.name.split("/")[1].replace('"',"")),e===i&&n.push({value:l(t)},{value:t.documentation})}),n}var d={name:"Monaco",props:{id:{type:String,required:!0},value:{type:String,required:!0},lang:{type:String,required:!0},disabled:{type:Boolean,default:!1},warp:{type:Boolean,default:!1},provider:{type:Array,default:function(){return[]}}},data:function(){return{editor:null,providerDisposeID:null,hoverDisposeID:null,sqlHints:[{name:"SELECT",type:"Keyword",detail:"SQL",documentation:"SQL selector."},{name:"FROM",type:"Keyword",detail:"SQL",documentation:"What event."},{name:"WHERE",type:"Keyword",detail:"SQL",documentation:"Filters a result set to include only records that fulfill a specified condition. "},{name:"and",type:"Keyword",detail:"SQL",documentation:"Operator."},{name:"or",type:"Keyword",detail:"SQL",documentation:"Operator."}]}},watch:{value:function(e){this.editor&&e!==this.editor.getValue()&&this.editor.setValue(e)},lang:function(){this.editor&&(this.editor.dispose(),this.initEditor())}},created:function(){var e=this;window.onresize=function(){e.editor&&e.editor.layout()},this.provider.length&&(this.registerCustomHintsProvider(),this.registerCustomHoverProvider())},mounted:function(){this.initEditor()},beforeDestroy:function(){this.editor&&(this.editor.getModel().dispose(),this.editor.dispose(),this.editor=null),this.providerDisposeID&&this.providerDisposeID.dispose(),this.hoverDisposeID&&this.hoverDisposeID.dispose()},methods:{initEditor:function(){var e=this,t="monaco-".concat(this.id),n={value:this.value,language:this.lang,readOnly:this.disabled,fontSize:14,automaticLayout:!0,scrollBeyondLastLine:!1,lineNumbersMinChars:2,theme:"vs",minimap:{enabled:!1},hover:{delay:500,enabled:!0}},i=this.beforeMonacoCreate(n);this.editor=s["editor"].create(document.getElementById(t),i),this.editor.onDidChangeModelContent(function(t){var n=e.editor.getValue();n!==e.value&&(e.$emit("input",n,t),e.$emit("change",n,t))}),this.editor.addCommand(s["KeyMod"].CtrlCmd|s["KeyCode"].KEY_S,function(){e.$emit("qucik-save",e.value)}),this.editor.getModel().updateOptions({tabSize:2})},beforeMonacoCreate:function(e){if(this.warp){var t={wordWrap:"on",wrappingIndent:"indent"};Object.assign(e,t)}return e},getHints:function(){var e=Object(r["a"])(this.provider);return"sql"===this.lang&&e.push.apply(e,Object(r["a"])(this.sqlHints)),e},registerCustomHintsProvider:function(){var e=this;this.providerDisposeID=s["languages"].registerCompletionItemProvider(this.lang,{provideCompletionItems:function(t,n){var i=t.getWordUntilPosition(n),o=e.getHints(i),r={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn};return{suggestions:u(o,r,i)}},triggerCharacters:[" "]})},registerCustomHoverProvider:function(){var e=this;s["languages"].register({id:this.lang}),this.hoverDisposeID=s["languages"].registerHoverProvider(this.lang,{provideHover:function(t,n){if(!t.getWordAtPosition(n))return{};var i=t.getWordAtPosition(n),o=i.word;return{contents:c(o,e.provider)}}})}}},h=d,p=(n("8ad2"),n("2877")),f=Object(p["a"])(h,i,o,!1,null,null,null);t["a"]=f.exports},"918c":function(e,t,n){"use strict";n.d(t,"i",function(){return a}),n.d(t,"j",function(){return u}),n.d(t,"g",function(){return d}),n.d(t,"f",function(){return h}),n.d(t,"h",function(){return f}),n.d(t,"a",function(){return g}),n.d(t,"k",function(){return m}),n.d(t,"b",function(){return _}),n.d(t,"m",function(){return b}),n.d(t,"e",function(){return y}),n.d(t,"c",function(){return w}),n.d(t,"d",function(){return C}),n.d(t,"l",function(){return S}),n.d(t,"n",function(){return O}),n.d(t,"o",function(){return x}),n.d(t,"p",function(){return N}),n.d(t,"r",function(){return D}),n.d(t,"q",function(){return k});var i=n("dff7"),o=n("ceb8"),r=n("303e"),s=n("b7d0"),a=Object(r["Kb"])("editor.lineHighlightBackground",{dark:null,light:null,hc:null},i["a"]("lineHighlight","Background color for the highlight of line at the cursor position.")),u=Object(r["Kb"])("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},i["a"]("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),l=Object(r["Kb"])("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},i["a"]("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),c=Object(r["Kb"])("editor.rangeHighlightBorder",{dark:null,light:null,hc:r["b"]},i["a"]("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),d=Object(r["Kb"])("editorCursor.foreground",{dark:"#AEAFAD",light:o["a"].black,hc:o["a"].white},i["a"]("caret","Color of the editor cursor.")),h=Object(r["Kb"])("editorCursor.background",null,i["a"]("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),p=Object(r["Kb"])("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},i["a"]("editorWhitespaces","Color of whitespace characters in the editor.")),f=Object(r["Kb"])("editorIndentGuide.background",{dark:p,light:p,hc:p},i["a"]("editorIndentGuides","Color of the editor indentation guides.")),g=Object(r["Kb"])("editorIndentGuide.activeBackground",{dark:p,light:p,hc:p},i["a"]("editorActiveIndentGuide","Color of the active editor indentation guides.")),m=Object(r["Kb"])("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:o["a"].white},i["a"]("editorLineNumbers","Color of editor line numbers.")),v=Object(r["Kb"])("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:r["b"]},i["a"]("editorActiveLineNumber","Color of editor active line number"),!1,i["a"]("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),_=Object(r["Kb"])("editorLineNumber.activeForeground",{dark:v,light:v,hc:v},i["a"]("editorActiveLineNumber","Color of editor active line number")),b=Object(r["Kb"])("editorRuler.foreground",{dark:"#5A5A5A",light:o["a"].lightgrey,hc:o["a"].white},i["a"]("editorRuler","Color of the editor rulers.")),y=Object(r["Kb"])("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},i["a"]("editorCodeLensForeground","Foreground color of editor code lenses")),w=Object(r["Kb"])("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},i["a"]("editorBracketMatchBackground","Background color behind matching brackets")),C=Object(r["Kb"])("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:r["e"]},i["a"]("editorBracketMatchBorder","Color for matching brackets boxes")),S=Object(r["Kb"])("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},i["a"]("editorOverviewRulerBorder","Color of the overview ruler border.")),L=Object(r["Kb"])("editorGutter.background",{dark:r["o"],light:r["o"],hc:r["o"]},i["a"]("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),O=Object(r["Kb"])("editorUnnecessaryCode.border",{dark:null,light:null,hc:o["a"].fromHex("#fff").transparent(.8)},i["a"]("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),x=Object(r["Kb"])("editorUnnecessaryCode.opacity",{dark:o["a"].fromHex("#000a"),light:o["a"].fromHex("#0007"),hc:null},i["a"]("unnecessaryCodeOpacity","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.")),N=Object(r["Kb"])("editorOverviewRuler.errorForeground",{dark:new o["a"](new o["c"](255,18,18,.7)),light:new o["a"](new o["c"](255,18,18,.7)),hc:new o["a"](new o["c"](255,50,50,1))},i["a"]("overviewRuleError","Overview ruler marker color for errors.")),D=Object(r["Kb"])("editorOverviewRuler.warningForeground",{dark:r["M"],light:r["M"],hc:r["L"]},i["a"]("overviewRuleWarning","Overview ruler marker color for warnings.")),k=Object(r["Kb"])("editorOverviewRuler.infoForeground",{dark:r["G"],light:r["G"],hc:r["F"]},i["a"]("overviewRuleInfo","Overview ruler marker color for infos."));Object(s["f"])(function(e,t){var n=e.getColor(r["o"]);n&&t.addRule(".monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: "+n+"; }");var i=e.getColor(r["x"]);i&&t.addRule(".monaco-editor, .monaco-editor .inputarea.ime-input { color: "+i+"; }");var o=e.getColor(L);o&&t.addRule(".monaco-editor .margin { background-color: "+o+"; }");var s=e.getColor(l);s&&t.addRule(".monaco-editor .rangeHighlight { background-color: "+s+"; }");var a=e.getColor(c);a&&t.addRule(".monaco-editor .rangeHighlight { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+a+"; }");var u=e.getColor(p);u&&t.addRule(".vs-whitespace { color: "+u+" !important; }")})},"92a6":function(e,t,n){"use strict";n.r(t);var i=n("5fe7"),o=n("ceb8"),r=n("fdcc");function s(e,t){switch(void 0===t&&(t=0),typeof e){case"object":return null===e?a(349,t):Array.isArray(e)?c(e,t):d(e,t);case"string":return l(e,t);case"boolean":return u(e,t);case"number":return a(e,t);case"undefined":return a(0,937);default:return a(0,617)}}function a(e,t){return(t<<5)-t+e|0}function u(e,t){return a(e?433:863,t)}function l(e,t){t=a(149417,t);for(var n=0,i=e.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},C=function(e,t){return function(n,i){t(n,i,e)}},S=500,L=function(e){function t(t,n,i){var o=e.call(this)||this;return o._editor=t,o._codeEditorService=n,o._configurationService=i,o._localToDispose=o._register(new h["b"]),o._decorationsIds=[],o._colorDatas=new Map,o._colorDecoratorIds=[],o._decorationsTypes=new Set,o._register(t.onDidChangeModel(function(e){o._isEnabled=o.isEnabled(),o.onModelChanged()})),o._register(t.onDidChangeModelLanguage(function(e){return o.onModelChanged()})),o._register(v["c"].onDidChange(function(e){return o.onModelChanged()})),o._register(t.onDidChangeConfiguration(function(e){var t=o._isEnabled;o._isEnabled=o.isEnabled(),t!==o._isEnabled&&(o._isEnabled?o.onModelChanged():o.removeAllDecorations())})),o._timeoutTimer=null,o._computePromise=null,o._isEnabled=o.isEnabled(),o.onModelChanged(),o}return y(t,e),t.prototype.isEnabled=function(){var e=this._editor.getModel();if(!e)return!1;var t=e.getLanguageIdentifier(),n=this._configurationService.getValue(t.language);if(n){var i=n["colorDecorators"];if(i&&void 0!==i["enable"]&&!i["enable"])return i["enable"]}return this._editor.getConfiguration().contribInfo.colorDecorators},t.prototype.getId=function(){return t.ID},t.get=function(e){return e.getContribution(this.ID)},t.prototype.dispose=function(){this.stop(),this.removeAllDecorations(),e.prototype.dispose.call(this)},t.prototype.onModelChanged=function(){var e=this;if(this.stop(),this._isEnabled){var n=this._editor.getModel();n&&v["c"].has(n)&&(this._localToDispose.add(this._editor.onDidChangeModelContent(function(n){e._timeoutTimer||(e._timeoutTimer=new i["e"],e._timeoutTimer.cancelAndSet(function(){e._timeoutTimer=null,e.beginCompute()},t.RECOMPUTE_TIME))})),this.beginCompute())}},t.prototype.beginCompute=function(){var e=this;this._computePromise=Object(i["f"])(function(t){var n=e._editor.getModel();return n?Object(_["b"])(n,t):Promise.resolve([])}),this._computePromise.then(function(t){e.updateDecorations(t),e.updateColorDecorators(t),e._computePromise=null},r["e"])},t.prototype.stop=function(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()},t.prototype.updateDecorations=function(e){var t=this,n=e.map(function(e){return{range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:m["a"].EMPTY}});this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,n),this._colorDatas=new Map,this._decorationsIds.forEach(function(n,i){return t._colorDatas.set(n,e[i])})},t.prototype.updateColorDecorators=function(e){for(var t=this,n=[],i={},r=0;r=0&&m0&&o){var D=function(e){o(e),e.children.forEach(D)};w.forEach(D)}var k=C["d"].map(C["d"].fromArray(w),O);return this._onDidSplice.fire({insertedNodes:_,deletedNodes:w}),k},e.prototype.rerender=function(e){if(0===e.length)throw new Error("Invalid tree location");var t=this.getTreeNodeWithListIndex(e),n=t.node,i=t.listIndex,o=t.revealed;o&&this.list.splice(i,1,[n])},e.prototype.getListIndex=function(e){var t=this.getTreeNodeWithListIndex(e),n=t.listIndex,i=t.visible,o=t.revealed;return i&&o?n:-1},e.prototype.getListRenderCount=function(e){return this.getTreeNode(e).renderNodeCount},e.prototype.isCollapsed=function(e){return this.getTreeNode(e).collapsed},e.prototype.setCollapsed=function(e,t,n){var i=this,o=this.getTreeNode(e);return"undefined"===typeof t&&(t=!o.collapsed),this.eventBufferer.bufferEvents(function(){return i._setCollapsed(e,t,n)})},e.prototype._setCollapsed=function(e,t,n){var i=this.getTreeNodeWithListIndex(e),o=i.node,r=i.listIndex,s=i.revealed,a=this._setListNodeCollapsed(o,r,s,t,n||!1);if(o!==this.root&&this.autoExpandSingleChildren&&!t&&!n){for(var u=-1,l=0;l-1){u=-1;break}u=l}}u>-1&&this._setCollapsed(e.concat([u]),!1,!1)}return a},e.prototype._setListNodeCollapsed=function(e,t,n,i,o){var r=this._setNodeCollapsed(e,i,o,!1);if(!n||!e.visible)return r;var s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),u=s-(-1===t?0:1);return this.list.splice(t+1,u,a.slice(1)),r},e.prototype._setNodeCollapsed=function(e,t,n,i){var o=e.collapsible&&e.collapsed!==t;if(e.collapsible&&(e.collapsed=t,o&&this._onDidChangeCollapseState.fire({node:e,deep:i})),n)for(var r=0,s=e.children;r0,a.visibleChildrenCount=h,a.visible=2===u?h>0:1===u,a.visible?a.collapsed||(a.renderNodeCount=p):(a.renderNodeCount=0,i&&o.pop()),r&&r(a),a},e.prototype.updateNodeAfterCollapseChange=function(e){var t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n},e.prototype._updateNodeAfterCollapseChange=function(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(var n=0,i=e.children;nt.children.length)throw new Error("Invalid tree location");return this.getTreeNode(i,t.children[n])},e.prototype.getTreeNodeWithListIndex=function(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};var t=this.getParentNodeWithListIndex(e),n=t.parentNode,i=t.listIndex,o=t.revealed,r=t.visible,s=e[e.length-1];if(s<0||s>n.children.length)throw new Error("Invalid tree location");var a=n.children[s];return{node:a,listIndex:i,revealed:o,visible:r&&a.visible}},e.prototype.getParentNodeWithListIndex=function(e,t,n,i,o){void 0===t&&(t=this.root),void 0===n&&(n=0),void 0===i&&(i=!0),void 0===o&&(o=!0);var r=e[0],s=e.slice(1);if(r<0||r>t.children.length)throw new Error("Invalid tree location");for(var a=0;a0&&!e.collapsed?n.add(e):e.parent&&n.add(e.parent)}),this.activeIndentNodes.forEach(function(e){n.has(e)||t.renderedIndentGuides.forEach(e,function(e){return Object(i["I"])(e,"active")})}),n.forEach(function(e){t.activeIndentNodes.has(e)||t.renderedIndentGuides.forEach(e,function(e){return Object(i["f"])(e,"active")})}),this.activeIndentNodes=n}},e.prototype.dispose=function(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),this.disposables=Object(r["f"])(this.disposables)},e.DefaultIndent=8,e}(),B=function(){function e(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=[],e.onWillRefilter(this.reset,this,this.disposables)}return Object.defineProperty(e.prototype,"totalCount",{get:function(){return this._totalCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matchCount",{get:function(){return this._matchCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pattern",{set:function(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()},enumerable:!0,configurable:!0}),e.prototype.filter=function(e,t){if(this._filter){var n=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return n;var i=void 0;if(i="boolean"===typeof n?n?1:0:S(n)?L(n.visibility):n,0===i)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:w["a"].Default,visibility:!0};var o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=o&&o.toString();if("undefined"===typeof r)return{data:w["a"].Default,visibility:!0};var s=Object(w["d"])(this._pattern,this._lowercasePattern,0,r,r.toLowerCase(),0,!0);return s?(this._matchCount++,{data:s,visibility:!0}):this.tree.options.filterOnType?2:{data:w["a"].Default,visibility:!0}},e.prototype.reset=function(){this._totalCount=0,this._matchCount=0},e.prototype.dispose=function(){this.disposables=Object(r["f"])(this.disposables)},e}(),H=function(){function e(e,t,n,o,r){this.tree=e,this.view=n,this.filter=o,this.keyboardNavigationLabelProvider=r,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new g["a"],this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new g["a"],this.enabledDisposables=[],this.disposables=[],this.domNode=Object(i["a"])(".monaco-list-type-filter."+this.positionClassName),this.domNode.draggable=!0,Object(y["a"])(this.domNode,"dragstart")(this.onDragStart,this,this.disposables),this.messageDomNode=Object(i["m"])(n.getHTMLElement(),Object(i["a"])(".monaco-list-type-filter-message")),this.labelDomNode=Object(i["m"])(this.domNode,Object(i["a"])("span.label"));var a=Object(i["m"])(this.domNode,Object(i["a"])(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=Object(i["m"])(a,Object(i["a"])("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitle(),Object(y["a"])(this.filterOnTypeDomNode,"input")(this.onDidChangeFilterOnType,this,this.disposables),this.clearDomNode=Object(i["m"])(a,Object(i["a"])("button.clear")),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=Object(s["a"])("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pattern",{get:function(){return this._pattern},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filterOnType",{get:function(){return this._filterOnType},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e){e.simpleKeyboardNavigation?this.disable():this.enable(),"undefined"!==typeof e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")},e.prototype.enable=function(){var e=this;if(!this._enabled){var t=this.keyboardNavigationLabelProvider.mightProducePrintableCharacter?function(t){return e.keyboardNavigationLabelProvider.mightProducePrintableCharacter(t)}:function(e){return Object(o["f"])(e)},n=g["b"].chain(Object(y["a"])(this.view.getHTMLElement(),"keydown")).filter(function(t){return!z(t.target)||t.target===e.filterOnTypeDomNode}).map(function(e){return new m["a"](e)}).filter(this.keyboardNavigationEventFilter||function(){return!0}).filter(function(){return e.automaticKeyboardNavigation||e.triggered}).filter(function(n){return t(n)||(e.pattern.length>0||e.triggered)&&(9===n.keyCode||1===n.keyCode)&&!n.altKey&&!n.ctrlKey&&!n.metaKey||1===n.keyCode&&(D["d"]?n.altKey&&!n.metaKey:n.ctrlKey)&&!n.shiftKey}).forEach(function(e){e.stopPropagation(),e.preventDefault()}).event,i=Object(y["a"])(this.clearDomNode,"click");g["b"].chain(g["b"].any(n,i)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}},e.prototype.disable=function(){this._enabled&&(this.domNode.remove(),this.enabledDisposables=Object(r["f"])(this.enabledDisposables),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)},e.prototype.onEventOrInput=function(e){"string"===typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(D["d"]?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)},e.prototype.onInput=function(e){var t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,function(e){return!w["a"].isDefault(e.filterData)});var n=this.tree.getFocus();if(n.length>0){var i=n[0];null===this.tree.getRelativeTop(i)&&this.tree.reveal(i,.5)}this.render(),e||(this.triggered=!1)},e.prototype.onDragStart=function(){var e=this,t=this.view.getHTMLElement(),n=Object(i["x"])(t).left,o=t.clientWidth,s=o/2,a=this.domNode.clientWidth,u=[],l=this.positionClassName,c=function(){switch(l){case"nw":e.domNode.style.top="4px",e.domNode.style.left="4px";break;case"ne":e.domNode.style.top="4px",e.domNode.style.left=o-a-6+"px";break}},d=function(e){e.preventDefault();var t=e.screenX-n;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),l=t0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=Object(s["a"])("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerHTML="",this._empty=!1),Object(i["R"])(this.domNode,"no-matches",e),this.domNode.title=Object(s["a"])("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)},e.prototype.shouldAllowFocus=function(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||(this.filter.totalCount>0&&this.filter.matchCount<=1||!w["a"].isDefault(e.filterData))},e.prototype.dispose=function(){this.disable(),this._onDidChangePattern.dispose(),this.disposables=Object(r["f"])(this.disposables)},e}();function z(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function U(e){return{elements:e.elements.map(function(e){return e.element}),browserEvent:e.browserEvent}}function K(e,t){t(e),e.children.forEach(function(e){return K(e,t)})}var q=function(){function e(e){this.identityProvider=e,this.nodes=[],this._onDidChange=new g["a"],this.onDidChange=this._onDidChange.event}return Object.defineProperty(e.prototype,"nodeSet",{get:function(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t){Object(_["g"])(this.nodes,e)||this._set(e,!1,t)},e.prototype._set=function(e,t,n){if(this.nodes=e.slice(),this.elements=void 0,this._nodeSet=void 0,!t){var i=this;this._onDidChange.fire({get elements(){return i.get()},browserEvent:n})}},e.prototype.get=function(){return this.elements||(this.elements=this.nodes.map(function(e){return e.element})),this.elements.slice()},e.prototype.getNodes=function(){return this.nodes},e.prototype.has=function(e){return this.nodeSet.has(e)},e.prototype.onDidModelSplice=function(e){var t=this,n=e.insertedNodes,i=e.deletedNodes;if(!this.identityProvider){var o=this.createNodeSet(),r=function(e){return o.delete(e)};return i.forEach(function(e){return K(e,r)}),void this.set(Object(k["e"])(o))}var s=new Set,a=function(e){return s.add(t.identityProvider.getId(e.element).toString())};i.forEach(function(e){return K(e,a)});var u=new Map,l=function(e){return u.set(t.identityProvider.getId(e.element).toString(),e)};n.forEach(function(e){return K(e,l)});for(var c=[],d=!0,h=0,p=this.nodes;h0&&e.prototype.setFocus.call(this,Object(_["f"])(e.prototype.getFocus.call(this).concat(r))),s.length>0&&e.prototype.setSelection.call(this,Object(_["f"])(e.prototype.getSelection.call(this).concat(s)))}},t.prototype.setFocus=function(t,n,i){var o=this;void 0===i&&(i=!1),e.prototype.setFocus.call(this,t,n),i||this.focusTrait.set(t.map(function(e){return o.element(e)}),n)},t.prototype.setSelection=function(t,n,i){var o=this;void 0===i&&(i=!1),e.prototype.setSelection.call(this,t,n),i||this.selectionTrait.set(t.map(function(e){return o.element(e)}),n)},t}(o["b"]),Y=function(){function e(e,t,n,o){var r,s=this;void 0===o&&(o={}),this._options=o,this.eventBufferer=new g["c"],this.disposables=[],this._onWillRefilter=new g["a"],this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new g["a"];var a,u=new j(t),l=new g["f"],c=new g["f"],d=new W(c.event);if(this.disposables.push(d),this.renderers=n.map(function(e){return new V(e,l.event,d,o)}),(r=this.disposables).push.apply(r,this.renderers),o.keyboardNavigationLabelProvider&&(a=new B(this,o.keyboardNavigationLabelProvider,o.filter),o=T({},o,{filter:a}),this.disposables.push(a)),this.focus=new q(o.identityProvider),this.selection=new q(o.identityProvider),this.view=new Z(e,u,this.renderers,this.focus,this.selection,T({},A(function(){return s.model},o),{tree:this})),this.model=this.createModel(this.view,o),l.input=this.model.onDidChangeCollapseState,this.model.onDidSplice(function(e){s.focus.onDidModelSplice(e),s.selection.onDidModelSplice(e)},null,this.disposables),c.input=g["b"].map(g["b"].any(this.focus.onDidChange,this.selection.onDidChange,this.model.onDidSplice),function(){return s.focus.getNodes().concat(s.selection.getNodes())}),!1!==o.keyboardSupport){var h=g["b"].chain(this.view.onKeyDown).filter(function(e){return!z(e.target)}).map(function(e){return new m["a"](e)});h.filter(function(e){return 15===e.keyCode}).on(this.onLeftArrow,this,this.disposables),h.filter(function(e){return 17===e.keyCode}).on(this.onRightArrow,this,this.disposables),h.filter(function(e){return 10===e.keyCode}).on(this.onSpace,this,this.disposables)}o.keyboardNavigationLabelProvider&&(this.typeFilterController=new H(this,this.model,this.view,a,o.keyboardNavigationLabelProvider),this.focusNavigationFilter=function(e){return s.typeFilterController.shouldAllowFocus(e)},this.disposables.push(this.typeFilterController)),this.styleElement=Object(i["s"])(this.view.getHTMLElement()),Object(i["R"])(this.getHTMLElement(),"always",this._options.renderIndentGuides===F.Always)}return Object.defineProperty(e.prototype,"onDidChangeFocus",{get:function(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidChangeSelection",{get:function(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidOpen",{get:function(){return g["b"].map(this.view.onDidOpen,U)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidFocus",{get:function(){return this.view.onDidFocus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidChangeCollapseState",{get:function(){return this.model.onDidChangeCollapseState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"openOnSingleClick",{get:function(){return"undefined"===typeof this._options.openOnSingleClick||this._options.openOnSingleClick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expandOnlyOnTwistieClick",{get:function(){return"undefined"!==typeof this._options.expandOnlyOnTwistieClick&&this._options.expandOnlyOnTwistieClick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidDispose",{get:function(){return this.view.onDidDispose},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e){void 0===e&&(e={}),this._options=T({},this._options,e);for(var t=0,n=this.renderers;t .indent-guide, .monaco-list"+t+".always .monaco-tl-indent > .indent-guide { border-color: "+e.treeIndentGuidesStroke.transparent(.4)+"; }"),n.push(".monaco-list"+t+" .monaco-tl-indent > .indent-guide.active { border-color: "+e.treeIndentGuidesStroke+"; }"));var i=n.join("\n");i!==this.styleElement.innerHTML&&(this.styleElement.innerHTML=i),this.view.style(e)},e.prototype.getNode=function(e){return this.model.getNode(e)},e.prototype.collapse=function(e,t){return void 0===t&&(t=!1),this.model.setCollapsed(e,!0,t)},e.prototype.expand=function(e,t){return void 0===t&&(t=!1),this.model.setCollapsed(e,!1,t)},e.prototype.isCollapsed=function(e){return this.model.isCollapsed(e)},e.prototype.refilter=function(){this._onWillRefilter.fire(void 0),this.model.refilter()},e.prototype.setSelection=function(e,t){var n=this,i=e.map(function(e){return n.model.getNode(e)});this.selection.set(i,t);var o=e.map(function(e){return n.model.getListIndex(e)}).filter(function(e){return e>-1});this.view.setSelection(o,t,!0)},e.prototype.getSelection=function(){return this.selection.get()},e.prototype.setFocus=function(e,t){var n=this,i=e.map(function(e){return n.model.getNode(e)});this.focus.set(i,t);var o=e.map(function(e){return n.model.getListIndex(e)}).filter(function(e){return e>-1});this.view.setFocus(o,t,!0)},e.prototype.focusNext=function(e,t,n,i){void 0===e&&(e=1),void 0===t&&(t=!1),void 0===i&&(i=this.focusNavigationFilter),this.view.focusNext(e,t,n,i)},e.prototype.getFocus=function(){return this.focus.get()},e.prototype.reveal=function(e,t){this.model.expandTo(e);var n=this.model.getListIndex(e);-1!==n&&this.view.reveal(n,t)},e.prototype.getRelativeTop=function(e){var t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(t)},e.prototype.onLeftArrow=function(e){e.preventDefault(),e.stopPropagation();var t=this.view.getFocusedElements();if(0!==t.length){var n=t[0],i=this.model.getNodeLocation(n),o=this.model.setCollapsed(i,!0);if(!o){var r=this.model.getParentNodeLocation(i);if(null===r)return;var s=this.model.getListIndex(r);this.view.reveal(s),this.view.setFocus([s])}}},e.prototype.onRightArrow=function(e){e.preventDefault(),e.stopPropagation();var t=this.view.getFocusedElements();if(0!==t.length){var n=t[0],i=this.model.getNodeLocation(n),o=this.model.setCollapsed(i,!1);if(!o){if(!n.children.some(function(e){return e.visible}))return;var r=this.view.getFocus()[0],s=r+1;this.view.reveal(s),this.view.setFocus([s])}}},e.prototype.onSpace=function(e){e.preventDefault(),e.stopPropagation();var t=this.view.getFocusedElements();if(0!==t.length){var n=t[0],i=this.model.getNodeLocation(n),o=e.browserEvent.altKey;this.model.setCollapsed(i,void 0,o)}},e.prototype.dispose=function(){this.disposables=Object(r["f"])(this.disposables),this.view.dispose()},e}(),X=function(){return X=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?C["d"].map(C["d"].fromArray(e.children),function(e){return fe(e,t)}):[],collapsible:e.hasChildren,collapsed:n}}function ge(e,t){t(e),e.children.forEach(function(e){return ge(e,t)})}var me=function(){function e(e,t,n,i,o){var r=this;void 0===o&&(o={}),this.dataSource=i,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new g["a"],this._onDidChangeNodeSlowState=new g["a"],this.disposables=[],this.identityProvider=o.identityProvider,this.autoExpandSingleChildren="undefined"!==typeof o.autoExpandSingleChildren&&o.autoExpandSingleChildren,this.sorter=o.sorter,this.collapseByDefault=o.collapseByDefault;var s=new j(t),a=n.map(function(e){return new le(e,r._onDidChangeNodeSlowState.event)}),u=pe(o)||{};this.tree=new J(e,s,a,u),this.root=oe({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=te({},this.root,{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}return Object.defineProperty(e.prototype,"onDidChangeFocus",{get:function(){return g["b"].map(this.tree.onDidChangeFocus,ce)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidChangeSelection",{get:function(){return g["b"].map(this.tree.onDidChangeSelection,ce)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidOpen",{get:function(){return g["b"].map(this.tree.onDidOpen,ce)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidFocus",{get:function(){return this.tree.onDidFocus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidDispose",{get:function(){return this.tree.onDidDispose},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e){void 0===e&&(e={}),this.tree.updateOptions(e)},e.prototype.getHTMLElement=function(){return this.tree.getHTMLElement()},Object.defineProperty(e.prototype,"scrollTop",{get:function(){return this.tree.scrollTop},set:function(e){this.tree.scrollTop=e},enumerable:!0,configurable:!0}),e.prototype.domFocus=function(){this.tree.domFocus()},e.prototype.layout=function(e,t){this.tree.layout(e,t)},e.prototype.style=function(e){this.tree.style(e)},e.prototype.getInput=function(){return this.root.element},e.prototype.setInput=function(e,t){return ne(this,void 0,void 0,function(){var n;return ie(this,function(i){switch(i.label){case 0:return this.refreshPromises.forEach(function(e){return e.cancel()}),this.refreshPromises.clear(),this.root.element=e,n=t&&{viewState:t,focus:[],selection:[]},[4,this.updateChildren(e,!0,n)];case 1:return i.sent(),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&"number"===typeof t.scrollTop&&(this.scrollTop=t.scrollTop),[2]}})})},e.prototype.updateChildren=function(e,t,n){return void 0===e&&(e=this.root.element),void 0===t&&(t=!0),ne(this,void 0,void 0,function(){return ie(this,function(i){switch(i.label){case 0:if("undefined"===typeof this.root.element)throw new Error("Tree input not set");return this.root.loading?[4,this.subTreeRefreshPromises.get(this.root)]:[3,3];case 1:return i.sent(),[4,g["b"].toPromise(this._onDidRender.event)];case 2:i.sent(),i.label=3;case 3:return[4,this.refreshAndRenderNode(this.getDataNode(e),t,ae.Refresh,n)];case 4:return i.sent(),[2]}})})},e.prototype.rerender=function(e){if(void 0!==e&&e!==this.root.element){var t=this.getDataNode(e);this.tree.rerender(t)}else this.tree.rerender()},e.prototype.collapse=function(e,t){void 0===t&&(t=!1);var n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)},e.prototype.expand=function(e,t){return void 0===t&&(t=!1),ne(this,void 0,void 0,function(){var n,i;return ie(this,function(o){switch(o.label){case 0:if("undefined"===typeof this.root.element)throw new Error("Tree input not set");return this.root.loading?[4,this.subTreeRefreshPromises.get(this.root)]:[3,3];case 1:return o.sent(),[4,g["b"].toPromise(this._onDidRender.event)];case 2:o.sent(),o.label=3;case 3:return n=this.getDataNode(e),n===this.root||n.loading||this.tree.isCollapsed(n)?(i=this.tree.expand(n===this.root?null:n,t),n.loading?[4,this.subTreeRefreshPromises.get(n)]:[3,6]):[2,!1];case 4:return o.sent(),[4,g["b"].toPromise(this._onDidRender.event)];case 5:o.sent(),o.label=6;case 6:return[2,i]}})})},e.prototype.setSelection=function(e,t){var n=this,i=e.map(function(e){return n.getDataNode(e)});this.tree.setSelection(i,t)},e.prototype.getSelection=function(){var e=this.tree.getSelection();return e.map(function(e){return e.element})},e.prototype.setFocus=function(e,t){var n=this,i=e.map(function(e){return n.getDataNode(e)});this.tree.setFocus(i,t)},e.prototype.getFocus=function(){var e=this.tree.getFocus();return e.map(function(e){return e.element})},e.prototype.reveal=function(e,t){this.tree.reveal(this.getDataNode(e),t)},e.prototype.getDataNode=function(e){var t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Error("Data tree node not found: "+e);return t},e.prototype.refreshAndRenderNode=function(e,t,n,i){return ne(this,void 0,void 0,function(){var o,r;return ie(this,function(s){switch(s.label){case 0:return[4,this.refreshNode(e,t,i)];case 1:return s.sent(),this.render(e,i),e!==this.root&&this.autoExpandSingleChildren&&n===ae.Expand?(o=this.tree.getNode(e),r=o.children.filter(function(e){return e.visible}),1!==r.length?[3,3]:[4,this.tree.expand(r[0].element,!1)]):[3,3];case 2:s.sent(),s.label=3;case 3:return[2]}})})},e.prototype.refreshNode=function(e,t,n){return ne(this,void 0,void 0,function(){var i,o=this;return ie(this,function(r){switch(r.label){case 0:if(this.subTreeRefreshPromises.forEach(function(r,s){!i&&se(s,e)&&(i=r.then(function(){return o.refreshNode(e,t,n)}))}),i)return[2,i];i=this.doRefreshSubTree(e,t,n),this.subTreeRefreshPromises.set(e,i),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,i];case 2:return r.sent(),[3,4];case 3:return this.subTreeRefreshPromises.delete(e),[7];case 4:return[2]}})})},e.prototype.doRefreshSubTree=function(e,t,n){return ne(this,void 0,void 0,function(){var i,o=this;return ie(this,function(r){switch(r.label){case 0:e.loading=!0,r.label=1;case 1:return r.trys.push([1,,4,5]),[4,this.doRefreshNode(e,t,n)];case 2:return i=r.sent(),e.stale=!1,[4,Promise.all(i.map(function(e){return o.doRefreshSubTree(e,t,n)}))];case 3:return r.sent(),[3,5];case 4:return e.loading=!1,[7];case 5:return[2]}})})},e.prototype.doRefreshNode=function(e,t,n){return ne(this,void 0,void 0,function(){var i,o,r,s,a=this;return ie(this,function(u){switch(u.label){case 0:e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren?(o=Object(N["l"])(800),o.then(function(){e.slow=!0,a._onDidChangeNodeSlowState.fire(e)},function(e){return null}),i=this.doGetChildren(e).finally(function(){return o.cancel()})):i=Promise.resolve([]),u.label=1;case 1:return u.trys.push([1,3,4,5]),[4,i];case 2:return r=u.sent(),[2,this.setChildren(e,r,t,n)];case 3:if(s=u.sent(),e!==this.root&&this.tree.collapse(e===this.root?null:e),Object(ee["d"])(s))return[2,[]];throw s;case 4:return e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e)),[7];case 5:return[2]}})})},e.prototype.doGetChildren=function(e){var t=this,n=this.refreshPromises.get(e);return n||(n=Object(N["f"])(function(){return ne(t,void 0,void 0,function(){var t;return ie(this,function(n){switch(n.label){case 0:return[4,this.dataSource.getChildren(e.element)];case 1:return t=n.sent(),this.sorter&&t.sort(this.sorter.compare.bind(this.sorter)),[2,t]}})})}),this.refreshPromises.set(e,n),n.finally(function(){return t.refreshPromises.delete(e)}))},e.prototype._onDidChangeCollapseState=function(e){var t=e.node,n=e.deep;!t.collapsed&&t.element.stale&&(n?this.collapse(t.element.element):this.refreshAndRenderNode(t.element,!1,ae.Expand).catch(ee["e"]))},e.prototype.setChildren=function(e,t,n,i){var o,r=this;if(0===e.children.length&&0===t.length)return[];for(var s=new Map,a=new Map,u=0,l=e.children;u-1&&i.focus.push(h),i&&i.viewState.selection&&i.viewState.selection.indexOf(l)>-1&&i.selection.push(h),i&&i.viewState.expanded&&i.viewState.expanded.indexOf(l)>-1?d.push(h):o&&r.collapseByDefault&&!r.collapseByDefault(t)&&(h.collapsedByDefault=!1,d.push(h)),h}),p=0,f=Object(k["e"])(s);p=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Le=function(e,t){return function(n,i){t(n,i,e)}},Oe=Object(c["c"])("listService"),xe=function(){function e(e){this.lists=[],this._lastFocusedWidget=void 0}return Object.defineProperty(e.prototype,"lastFocusedList",{get:function(){return this._lastFocusedWidget},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;if(this.lists.some(function(t){return t.widget===e}))throw new Error("Cannot register the same widget multiple times");var i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),Object(r["e"])(e.onDidFocus(function(){return n._lastFocusedWidget=e}),Object(r["h"])(function(){return n.lists.splice(n.lists.indexOf(i),1)}),e.onDidDispose(function(){n.lists=n.lists.filter(function(e){return e!==i}),n._lastFocusedWidget===e&&(n._lastFocusedWidget=void 0)}))},e=Se([Le(0,l["c"])],e),e}(),Ne=new l["d"]("listFocus",!0),De=new l["d"]("listSupportsMultiselect",!0),ke=new l["d"]("listHasSelectionOrFocus",!1),Ie=new l["d"]("listDoubleSelection",!1),Ee=new l["d"]("listMultiSelection",!1),Me=new l["d"]("listSupportsKeyboardNavigation",!0),Te="listAutomaticKeyboardNavigation",Pe=new l["d"](Te,!0),Re=!1;function Ae(e,t){var n=e.createScoped(t.getHTMLElement());return Ne.bindTo(n),n}var Fe="workbench.list.multiSelectModifier",je="workbench.list.openMode",We="workbench.list.horizontalScrolling",Ve="workbench.list.keyboardNavigation",Be="workbench.list.automaticKeyboardNavigation",He="workbench.tree.indent",ze="workbench.tree.renderIndentGuides";function Ue(e){return Object(a["f"])(e,We,"workbench.tree.horizontalScrolling")}function Ke(e){return"alt"===e.getValue(Fe)}function qe(e){return"doubleClick"!==e.getValue(je)}var Ge,Ze=function(e){function t(t){var n=e.call(this)||this;return n.configurationService=t,n.useAltAsMultipleSelectionModifier=Ke(t),n.registerListeners(),n}return we(t,e),t.prototype.registerListeners=function(){var e=this;this._register(this.configurationService.onDidChangeConfiguration(function(t){t.affectsConfiguration(Fe)&&(e.useAltAsMultipleSelectionModifier=Ke(e.configurationService))}))},t.prototype.isSelectionSingleChangeEvent=function(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Object(o["e"])(e)},t.prototype.isSelectionRangeChangeEvent=function(e){return Object(o["d"])(e)},t}(r["a"]),Ye=function(e){function t(t,n){var i=e.call(this)||this;return i.configurationService=t,i.existingOpenController=n,i.openOnSingleClick=qe(t),i.registerListeners(),i}return we(t,e),t.prototype.registerListeners=function(){var e=this;this._register(this.configurationService.onDidChangeConfiguration(function(t){t.affectsConfiguration(je)&&(e.openOnSingleClick=qe(e.configurationService))}))},t.prototype.shouldOpen=function(e){if(e instanceof MouseEvent){var t=0===e.button,n=2===e.detail;return!(t&&!this.openOnSingleClick&&!n)&&(!(!t&&1!==e.button)&&(!this.existingOpenController||this.existingOpenController.shouldOpen(e)))}return!this.existingOpenController||this.existingOpenController.shouldOpen(e)},t}(r["a"]);function Xe(e,t,n){var i=new r["b"],o=Ce({},e);if(!1!==e.multipleSelectionSupport&&!e.multipleSelectionController){var s=new Ze(t);o.multipleSelectionController=s,i.add(s)}var a=new Ye(t,e.openController);if(o.openController=a,i.add(a),e.keyboardNavigationLabelProvider){var u=e.keyboardNavigationLabelProvider;o.keyboardNavigationLabelProvider={getKeyboardNavigationLabel:function(e){return u.getKeyboardNavigationLabel(e)},mightProducePrintableCharacter:function(e){return n.mightProducePrintableCharacter(e)}}}return[o,i]}function $e(){return Ge||(Ge=Object(i["s"])()),Ge}function Qe(e,t){var n=!1;return function(i){if(n)return n=!1,!1;var o=t.softDispatch(i,e);return o&&o.enterChord?(n=!0,!1):(n=!1,!0)}}(function(e){function t(t,n,i,o,r,s,a,u,l,c){var d=this,h=et(t,o,r,a,u,l,c),p=h.options,f=h.getAutomaticKeyboardNavigation,g=h.disposable;return d=e.call(this,t,n,i,p)||this,d.disposables.push(g),d.internals=new tt(d,p,f,r,s,a,u,c),d.disposables.push(d.internals),d}we(t,e),t=Se([Le(4,l["c"]),Le(5,Oe),Le(6,f["c"]),Le(7,a["a"]),Le(8,d["a"]),Le(9,be["b"])],t)})(J),function(e){function t(t,n,i,o,r,s,a,u,l,c,d){var h=this,p=et(t,r,s,u,l,c,d),f=p.options,g=p.getAutomaticKeyboardNavigation,m=p.disposable;return h=e.call(this,t,n,i,o,f)||this,h.disposables.push(m),h.internals=new tt(h,f,g,s,a,u,l,d),h.disposables.push(h.internals),h}we(t,e),t=Se([Le(5,l["c"]),Le(6,Oe),Le(7,f["c"]),Le(8,a["a"]),Le(9,d["a"]),Le(10,be["b"])],t)}(_e);var Je=function(e){function t(t,n,i,o,r,s,a,u,l,c,d){var h=this,p=et(t,r,s,u,l,c,d),f=p.options,g=p.getAutomaticKeyboardNavigation,m=p.disposable;return h=e.call(this,t,n,i,o,f)||this,h.disposables.push(m),h.internals=new tt(h,f,g,s,a,u,l,d),h.disposables.push(h.internals),h}return we(t,e),Object.defineProperty(t.prototype,"contextKeyService",{get:function(){return this.internals.contextKeyService},enumerable:!0,configurable:!0}),t=Se([Le(5,l["c"]),Le(6,Oe),Le(7,f["c"]),Le(8,a["a"]),Le(9,d["a"]),Le(10,be["b"])],t),t}(me);function et(e,t,n,i,r,s,a){Me.bindTo(n),Re||(Pe.bindTo(n),Re=!0);var u=function(){var e=n.getContextKeyValue(Te);return e&&(e=r.getValue(Be)),e},l=2===a.getAccessibilitySupport(),c=l?"simple":r.getValue(Ve),d="undefined"!==typeof t.horizontalScrolling?t.horizontalScrolling:Ue(r),h=qe(r),f=Xe(t,r,s),g=f[0],m=f[1],v=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:u,disposable:m,options:Ce({keyboardSupport:!1,styleController:new o["a"]($e())},Object(p["e"])(i.getTheme(),p["f"]),g,{indent:r.getValue(He),renderIndentGuides:r.getValue(ze),automaticKeyboardNavigation:u(),simpleKeyboardNavigation:"simple"===c,filterOnType:"filter"===c,horizontalScrolling:d,openOnSingleClick:h,keyboardNavigationEventFilter:Qe(e,s),additionalScrollHeight:v})}}var tt=function(){function e(e,t,n,i,o,r,s,a){var u=this;this.disposables=[],this.contextKeyService=Ae(i,e);var l=De.bindTo(this.contextKeyService);l.set(!(!1===t.multipleSelectionSupport)),this.hasSelectionOrFocus=ke.bindTo(this.contextKeyService),this.hasDoubleSelection=Ie.bindTo(this.contextKeyService),this.hasMultiSelection=Ee.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Ke(s);var c=new Set;c.add(Te);var d=function(){var t=2===a.getAccessibilitySupport(),n=t?"simple":s.getValue(Ve);e.updateOptions({simpleKeyboardNavigation:"simple"===n,filterOnType:"filter"===n})};this.disposables.push(this.contextKeyService,o.register(e),Object(p["b"])(e,r),e.onDidChangeSelection(function(){var t=e.getSelection(),n=e.getFocus();u.hasSelectionOrFocus.set(t.length>0||n.length>0),u.hasMultiSelection.set(t.length>1),u.hasDoubleSelection.set(2===t.length)}),e.onDidChangeFocus(function(){var t=e.getSelection(),n=e.getFocus();u.hasSelectionOrFocus.set(t.length>0||n.length>0)}),s.onDidChangeConfiguration(function(t){if(t.affectsConfiguration(je)&&e.updateOptions({openOnSingleClick:qe(s)}),t.affectsConfiguration(Fe)&&(u._useAltAsMultipleSelectionModifier=Ke(s)),t.affectsConfiguration(He)){var i=s.getValue(He);e.updateOptions({indent:i})}if(t.affectsConfiguration(ze)){var o=s.getValue(ze);e.updateOptions({renderIndentGuides:o})}t.affectsConfiguration(Ve)&&d(),t.affectsConfiguration(Be)&&e.updateOptions({automaticKeyboardNavigation:n()})}),this.contextKeyService.onDidChangeContext(function(t){t.affectsSome(c)&&e.updateOptions({automaticKeyboardNavigation:n()})}),a.onDidChangeAccessibilitySupport(function(){return d()}))}return e.prototype.dispose=function(){this.disposables=Object(r["f"])(this.disposables)},e=Se([Le(3,l["c"]),Le(4,Oe),Le(5,f["c"]),Le(6,a["a"]),Le(7,be["b"])],e),e}(),nt=h["a"].as(u["a"].Configuration);nt.registerConfiguration({id:"workbench",order:7,title:Object(s["a"])("workbenchConfigurationTitle","Workbench"),type:"object",properties:(ye={},ye[Fe]={type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[Object(s["a"])("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),Object(s["a"])("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:Object(s["a"])({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},ye[je]={type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Object(s["a"])({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ")},ye[We]={type:"boolean",default:!1,description:Object(s["a"])("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench.")},ye["workbench.tree.horizontalScrolling"]={type:"boolean",default:!1,description:Object(s["a"])("tree horizontalScrolling setting","Controls whether trees support horizontal scrolling in the workbench."),deprecationMessage:Object(s["a"])("deprecated","This setting is deprecated, please use '{0}' instead.",We)},ye[He]={type:"number",default:8,minimum:0,maximum:40,description:Object(s["a"])("tree indent setting","Controls tree indentation in pixels.")},ye[ze]={type:"string",enum:["none","onHover","always"],default:"onHover",description:Object(s["a"])("render tree indent guides","Controls whether the tree should render indent guides.")},ye[Ve]={type:"string",enum:["simple","highlight","filter"],enumDescriptions:[Object(s["a"])("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),Object(s["a"])("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),Object(s["a"])("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:Object(s["a"])("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},ye[Be]={type:"boolean",default:!0,markdownDescription:Object(s["a"])("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},ye)})},"94a7":function(e,t,n){},"958f":function(e,t,n){"use strict";n.r(t);var i,o=n("dff7"),r=n("308f"),s=n("a666"),a=n("4fc3"),u=n("b400"),l=n("6a89"),c=n("b2cc"),d=n("b7d0"),h=n("c101"),p=(n("fe86"),n("11f7")),f=n("303e"),g=n("ceb8"),m=n("1898"),v=n("debc"),_=n("e8e3"),b=n("e5aa"),y=n("82c9"),w=n("7121"),C=n("4b76"),S=encodeURIComponent(''),O=encodeURIComponent(''),N=encodeURIComponent(''),k=encodeURIComponent(''),E=encodeURIComponent(''),T=encodeURIComponent('');function R(e,t){return"."+i.className(e).split(" ").join(".")+' { background: url("data:image/svg+xml,'+i.getSVGData(e,t)+'") center center no-repeat; height: 16px; width: 16px; }'}(function(e){function t(e,t){switch(e){case C["a"].Ignore:var n=t.type===d["d"]?g["a"].fromHex("#75BEFF"):g["a"].fromHex("#007ACC");return t.type===d["d"]?E+encodeURIComponent(n.toString())+M:T+encodeURIComponent(n.toString())+P;case C["a"].Info:var i=t.type===d["d"]?g["a"].fromHex("#007ACC"):g["a"].fromHex("#75BEFF");return t.type===d["d"]?E+encodeURIComponent(i.toString())+M:T+encodeURIComponent(i.toString())+P;case C["a"].Warning:var o=t.type===d["d"]?g["a"].fromHex("#DDB100"):g["a"].fromHex("#fc0");return t.type===d["d"]?N+encodeURIComponent(o.toString())+D:k+encodeURIComponent(o.toString())+I;case C["a"].Error:var r=t.type===d["d"]?g["a"].fromHex("#A1260D"):g["a"].fromHex("#F48771");return t.type===d["d"]?S+encodeURIComponent(r.toString())+L:O+encodeURIComponent(r.toString())+x}return""}function n(e){switch(e){case C["a"].Ignore:return"severity-icon severity-ignore";case C["a"].Info:return"severity-icon severity-info";case C["a"].Warning:return"severity-icon severity-warning";case C["a"].Error:return"severity-icon severity-error"}return""}e.getSVGData=t,e.className=n})(i||(i={})),Object(d["f"])(function(e,t){t.addRule(R(C["a"].Error,e)),t.addRule(R(C["a"].Warning,e)),t.addRule(R(C["a"].Info,e)),t.addRule(R(C["a"].Ignore,e))});var A=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),F=function(){function e(e,t,n){var i=this;this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=[],this._editor=t;var o=document.createElement("div");o.className="descriptioncontainer",o.setAttribute("aria-live","assertive"),o.setAttribute("role","alert"),this._messageBlock=document.createElement("div"),p["f"](this._messageBlock,"message"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.push(p["k"](this._relatedBlock,"click",function(e){e.preventDefault();var t=i._relatedDiagnostics.get(e.target);t&&n(t)})),this._scrollable=new m["b"](o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:3,verticalScrollbarSize:3}),e.appendChild(this._scrollable.getDomNode()),this._disposables.push(this._scrollable.onScroll(function(e){o.style.left="-"+e.scrollLeft+"px",o.style.top="-"+e.scrollTop+"px"})),this._disposables.push(this._scrollable)}return e.prototype.dispose=function(){Object(s["f"])(this._disposables)},e.prototype.update=function(e){var t=e.source,n=e.message,i=e.relatedInformation,o=e.code,r=n.split(/\r\n|\r|\n/g);this._lines=r.length,this._longestLineLength=0;for(var s=0,a=r;s1?o["a"]("problems","{0} of {1} problems",n,r):o["a"]("change","{0} of {1} problem",n,r);this.setTitle(Object(y["b"])(d.uri),h)}this._icon.className=i.className(u["c"].toSeverity(this._severity)),this.editor.revealPositionInCenter(c,0)},t.prototype.updateMarker=function(e){this._container.classList.remove("stale"),this._message.update(e)},t.prototype.showStale=function(){this._container.classList.add("stale"),this._relayout()},t.prototype._doLayoutBody=function(t,n){e.prototype._doLayoutBody.call(this,t,n),this._heightInPixel=t,this._message.layout(t,n),this._container.style.height=t+"px"},t.prototype._onWidth=function(e){this._message.layout(this._heightInPixel,e)},t.prototype._relayout=function(){e.prototype._relayout.call(this,this.computeRequiredHeight())},t.prototype.computeRequiredHeight=function(){return 3+this._message.getHeightInLines()},t}(b["c"]),W=Object(f["Eb"])(f["q"],f["p"]),V=Object(f["Eb"])(f["M"],f["L"]),B=Object(f["Eb"])(f["G"],f["F"]),H=Object(f["Kb"])("editorMarkerNavigationError.background",{dark:W,light:W,hc:W},o["a"]("editorMarkerNavigationError","Editor marker navigation widget error color.")),z=Object(f["Kb"])("editorMarkerNavigationWarning.background",{dark:V,light:V,hc:V},o["a"]("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),U=Object(f["Kb"])("editorMarkerNavigationInfo.background",{dark:B,light:B,hc:B},o["a"]("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),K=Object(f["Kb"])("editorMarkerNavigation.background",{dark:"#2D2D30",light:g["a"].white,hc:"#0C141F"},o["a"]("editorMarkerNavigationBackground","Editor marker navigation widget background."));Object(d["f"])(function(e,t){var n=e.getColor(f["Ub"]);n&&t.addRule(".monaco-editor .marker-widget a { color: "+n+"; }")});var q=n("3742"),G=n("5717"),Z=n("fdcc"),Y=n("7e32"),X=n("f070"),$=n("6dec");n.d(t,"MarkerController",function(){return oe}),n.d(t,"NextMarkerAction",function(){return se});var Q=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),J=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},ee=function(e,t){return function(n,i){t(n,i,e)}},te=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},ne=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0?this._markers[this._nextIdx]:void 0;this._markers=e||[],this._markers.sort(re.compareMarker),this._nextIdx=t?Math.max(-1,Object(_["c"])(this._markers,t,re.compareMarker)):-1,this._onMarkerSetChanged.fire(this)},e.prototype.withoutWatchingEditorPosition=function(e){this._ignoreSelectionChange=!0;try{e()}finally{this._ignoreSelectionChange=!1}},e.prototype._initIdx=function(e){for(var t=!1,n=this._editor.getPosition(),i=0;i0?this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length:i=!0),n!==this._nextIdx){var o=this._markers[this._nextIdx];this._onCurrentMarkerChanged.fire(o)}return i},e.prototype.canNavigate=function(){return this._markers.length>0},e.prototype.findMarkerAtPosition=function(e){for(var t=0,n=this._markers;t0;n--){var r=e.charCodeAt(n-1);if(47===r||92===r)break}t=e.substr(n)}var s=o.indexOf(t);return-1!==s?i[s]:null};a.basenames=o,a.patterns=i,a.allBasenames=o;var u=e.filter(function(e){return!e.basenames});return u.push(a),u}},"9c1d":function(e,t,n){"use strict";n("96b9"),n("b768");var i=n("dff7"),o=n("11f7"),r=n("fdcc"),s=n("308f"),a=n("a666"),u=n("b589"),l=n("1ddc"),c=n("b2cc"),d=n("5717"),h=n("6653"),p=n("a60f"),f=n("0f70"),g=n("5d28"),m=n("5fe7"),v=n("30db"),_=n("00a3"),b=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),y=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toClientCoordinates=function(){return new w(this.x-o["e"].scrollX,this.y-o["e"].scrollY)},e}(),w=function(){function e(e,t){this.clientX=e,this.clientY=t}return e.prototype.toPageCoordinates=function(){return new y(this.clientX+o["e"].scrollX,this.clientY+o["e"].scrollY)},e}(),C=function(){function e(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}return e}();function S(e){var t=o["x"](e);return new C(t.left,t.top,t.width,t.height)}var L=function(e){function t(t,n){var i=e.call(this,t)||this;return i.pos=new y(i.posx,i.posy),i.editorPos=S(n),i}return b(t,e),t}(g["b"]),O=function(){function e(e){this._editorViewDomNode=e}return e.prototype._create=function(e){return new L(e,this._editorViewDomNode)},e.prototype.onContextMenu=function(e,t){var n=this;return o["h"](e,"contextmenu",function(e){t(n._create(e))})},e.prototype.onMouseUp=function(e,t){var n=this;return o["h"](e,"mouseup",function(e){t(n._create(e))})},e.prototype.onMouseDown=function(e,t){var n=this;return o["h"](e,"mousedown",function(e){t(n._create(e))})},e.prototype.onMouseLeave=function(e,t){var n=this;return o["i"](e,function(e){t(n._create(e))})},e.prototype.onMouseMoveThrottled=function(e,t,n,i){var r=this,s=function(e,t){return n(e,r._create(t))};return o["j"](e,"mousemove",t,s,i)},e}(),x=function(e){function t(t){var n=e.call(this)||this;return n._editorViewDomNode=t,n._globalMouseMoveMonitor=n._register(new _["a"]),n._keydownListener=null,n}return b(t,e),t.prototype.startMonitoring=function(e,t,n){var i=this;this._keydownListener=o["k"](document,"keydown",function(e){var t=e.toKeybinding();t.isModifierKey()||i._globalMouseMoveMonitor.stopMonitoring(!0)},!0);var r=function(t,n){return e(t,new L(n,i._editorViewDomNode))};this._globalMouseMoveMonitor.startMonitoring(r,t,function(){i._keydownListener.dispose(),n()})},t}(a["a"]),N=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),D=function(e){function t(){var t=e.call(this)||this;return t._shouldRender=!0,t}return N(t,e),t.prototype.shouldRender=function(){return this._shouldRender},t.prototype.forceShouldRender=function(){this._shouldRender=!0},t.prototype.setShouldRender=function(){this._shouldRender=!0},t.prototype.onDidRender=function(){this._shouldRender=!1},t.prototype.onConfigurationChanged=function(e){return!1},t.prototype.onCursorStateChanged=function(e){return!1},t.prototype.onDecorationsChanged=function(e){return!1},t.prototype.onFlushed=function(e){return!1},t.prototype.onFocusChanged=function(e){return!1},t.prototype.onLanguageConfigurationChanged=function(e){return!1},t.prototype.onLineMappingChanged=function(e){return!1},t.prototype.onLinesChanged=function(e){return!1},t.prototype.onLinesDeleted=function(e){return!1},t.prototype.onLinesInserted=function(e){return!1},t.prototype.onRevealRangeRequest=function(e){return!1},t.prototype.onScrollChanged=function(e){return!1},t.prototype.onTokensChanged=function(e){return!1},t.prototype.onTokensColorsChanged=function(e){return!1},t.prototype.onZonesChanged=function(e){return!1},t.prototype.onThemeChanged=function(e){return!1},t.prototype.handleEvents=function(e){for(var t=!1,n=0,i=e.length;n=u?o=Math.max(o,u+l-i):(t[n++]=new A(i,o),i=u,o=l)}return t[n++]=new A(i,o),t},e._createHorizontalRangesFromClientRects=function(e,t){if(!e||0===e.length)return null;for(var n=[],i=0,o=e.length;iu)return null;t=Math.min(u,Math.max(a,t)),i=Math.min(u,Math.max(a,i)),t!==i&&i>0&&0===o&&(i--,o=1073741824);var l=e.children[t].firstChild,c=e.children[i].firstChild;if(l&&c||(!l&&0===n&&t>0&&(l=e.children[t-1].firstChild,n=1073741824),!c&&0===o&&i>0&&(c=e.children[i-1].firstChild,o=1073741824)),!l||!c)return null;n=Math.min(l.textContent.length,Math.max(0,n)),o=Math.min(c.textContent.length,Math.max(0,o));var d=this._readClientRects(l,n,c,o,s);return this._createHorizontalRangesFromClientRects(d,r)},e}(),W=n("7416"),V=n("6da2"),B=n("b7d0"),H=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),z=function(){return!!v["e"]||!(v["c"]||f["i"]||f["l"])}(),U=f["g"],K=function(){function e(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}return Object.defineProperty(e.prototype,"clientRectDeltaLeft",{get:function(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft},enumerable:!0,configurable:!0}),e}(),q=function(){function e(e,t){this.themeType=t,this.renderWhitespace=e.editor.viewInfo.renderWhitespace,this.renderControlCharacters=e.editor.viewInfo.renderControlCharacters,this.spaceWidth=e.editor.fontInfo.spaceWidth,this.useMonospaceOptimizations=e.editor.fontInfo.isMonospace&&!e.editor.viewInfo.disableMonospaceOptimizations,this.canUseHalfwidthRightwardsArrow=e.editor.fontInfo.canUseHalfwidthRightwardsArrow,this.lineHeight=e.editor.lineHeight,this.stopRenderingLineAfter=e.editor.viewInfo.stopRenderingLineAfter,this.fontLigatures=e.editor.viewInfo.fontLigatures}return e.prototype.equals=function(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures},e}(),G=function(){function e(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}return e.prototype.getDomNode=function(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null},e.prototype.setDomNode=function(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Object(h["b"])(e)},e.prototype.onContentChanged=function(){this._isMaybeInvalid=!0},e.prototype.onTokensChanged=function(){this._isMaybeInvalid=!0},e.prototype.onDecorationsChanged=function(){this._isMaybeInvalid=!0},e.prototype.onOptionsChanged=function(e){this._isMaybeInvalid=!0,this._options=e},e.prototype.onSelectionChanged=function(){return!(!U&&this._options.themeType!==B["b"]&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)},e.prototype.renderLine=function(t,n,i,o){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;var r=i.getViewLineRenderingData(t),s=this._options,a=W["a"].filter(r.inlineDecorations,t,r.minColumn,r.maxColumn),u=null;if(U||s.themeType===B["b"]||"selection"===this._options.renderWhitespace)for(var l=i.selections,c=0,d=l;ct)){var p=h.startLineNumber===t?h.startColumn:r.minColumn,f=h.endLineNumber===t?h.endColumn:r.maxColumn;p');var m=Object(V["d"])(g,o);o.appendASCIIString("");var v=null;return z&&r.isBasicASCII&&s.useMonospaceOptimizations&&0===m.containsForeignElements&&r.content.length<300&&g.lineTokens.getCount()<100&&(v=new Z(this._renderedViewLine?this._renderedViewLine.domNode:null,g,m.characterMapping)),v||(v=$(this._renderedViewLine?this._renderedViewLine.domNode:null,g,m.characterMapping,m.containsRTL,m.containsForeignElements)),this._renderedViewLine=v,!0},e.prototype.layoutLine=function(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))},e.prototype.getWidth=function(){return this._renderedViewLine?this._renderedViewLine.getWidth():0},e.prototype.getWidthIsFast=function(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()},e.prototype.getVisibleRangesForRange=function(e,t,n){if(!this._renderedViewLine)return null;e|=0,t|=0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));var i=0|this._renderedViewLine.input.stopRenderingLineAfter;return-1!==i&&e>i&&t>i?null:(-1!==i&&e>i&&(e=i),-1!==i&&t>i&&(t=i),this._renderedViewLine.getVisibleRangesForRange(e,t,n))},e.prototype.getColumnOfNodeOffset=function(e,t,n){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,n):1},e.CLASS_NAME="view-line",e}(),Z=function(){function e(e,t,n){this.domNode=e,this.input=t,this._characterMapping=n,this._charWidth=t.spaceWidth}return e.prototype.getWidth=function(){return this._getCharPosition(this._characterMapping.length)},e.prototype.getWidthIsFast=function(){return!0},e.prototype.getVisibleRangesForRange=function(e,t,n){var i=this._getCharPosition(e),o=this._getCharPosition(t);return[new A(i,o-i)]},e.prototype._getCharPosition=function(e){var t=this._characterMapping.getAbsoluteOffsets();return 0===t.length?0:Math.round(this._charWidth*t[e-1])},e.prototype.getColumnOfNodeOffset=function(e,t,n){var i=t.textContent.length,o=-1;while(t)t=t.previousSibling,o++;var r=this._characterMapping.partDataToCharOffset(o,i,n);return r+1},e}(),Y=function(){function e(e,t,n,i,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!i||0===this._characterMapping.length){this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(var r=0,s=this._characterMapping.length;r<=s;r++)this._pixelOffsetCache[r]=-1}}return e.prototype._getReadingTarget=function(){return this.domNode.domNode.firstChild},e.prototype.getWidth=function(){return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget().offsetWidth),this._cachedWidth},e.prototype.getWidthIsFast=function(){return-1!==this._cachedWidth},e.prototype.getVisibleRangesForRange=function(e,t,n){if(null!==this._pixelOffsetCache){var i=this._readPixelOffset(e,n);if(-1===i)return null;var o=this._readPixelOffset(t,n);return-1===o?null:[new A(i,o-i)]}return this._readVisibleRangesForRange(e,t,n)},e.prototype._readVisibleRangesForRange=function(e,t,n){if(e===t){var i=this._readPixelOffset(e,n);return-1===i?null:[new A(i,0)]}return this._readRawVisibleRangesForRange(e,t,n)},e.prototype._readPixelOffset=function(e,t){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth()}if(null!==this._pixelOffsetCache){var n=this._pixelOffsetCache[e];if(-1!==n)return n;var i=this._actualReadPixelOffset(e,t);return this._pixelOffsetCache[e]=i,i}return this._actualReadPixelOffset(e,t)},e.prototype._actualReadPixelOffset=function(e,t){if(0===this._characterMapping.length){var n=j.readHorizontalRanges(this._getReadingTarget(),0,0,0,0,t.clientRectDeltaLeft,t.endNode);return n&&0!==n.length?n[0].left:-1}if(e===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();var i=this._characterMapping.charOffsetToPartData(e-1),o=V["a"].getPartIndex(i),r=V["a"].getCharIndex(i),s=j.readHorizontalRanges(this._getReadingTarget(),o,r,o,r,t.clientRectDeltaLeft,t.endNode);return s&&0!==s.length?s[0].left:-1},e.prototype._readRawVisibleRangesForRange=function(e,t,n){if(1===e&&t===this._characterMapping.length)return[new A(0,this.getWidth())];var i=this._characterMapping.charOffsetToPartData(e-1),o=V["a"].getPartIndex(i),r=V["a"].getCharIndex(i),s=this._characterMapping.charOffsetToPartData(t-1),a=V["a"].getPartIndex(s),u=V["a"].getCharIndex(s);return j.readHorizontalRanges(this._getReadingTarget(),o,r,a,u,n.clientRectDeltaLeft,n.endNode)},e.prototype.getColumnOfNodeOffset=function(e,t,n){var i=t.textContent.length,o=-1;while(t)t=t.previousSibling,o++;var r=this._characterMapping.partDataToCharOffset(o,i,n);return r+1},e}(),X=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return H(t,e),t.prototype._readVisibleRangesForRange=function(t,n,i){var o=e.prototype._readVisibleRangesForRange.call(this,t,n,i);if(!o||0===o.length||t===n||1===t&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){var r=this._readPixelOffset(n,i);if(-1!==r){var s=o[o.length-1];s.left=4&&3===e[0]&&7===e[3]},e.isStrictChildOfViewLines=function(e){return e.length>4&&3===e[0]&&7===e[3]},e.isChildOfScrollableElement=function(e){return e.length>=2&&3===e[0]&&5===e[1]},e.isChildOfMinimap=function(e){return e.length>=2&&3===e[0]&&8===e[1]},e.isChildOfContentWidgets=function(e){return e.length>=4&&3===e[0]&&1===e[3]},e.isChildOfOverflowingContentWidgets=function(e){return e.length>=1&&2===e[0]},e.isChildOfOverlayWidgets=function(e){return e.length>=2&&3===e[0]&&4===e[1]},e}(),se=function(){function e(e,t,n){this.model=e.model,this.layoutInfo=e.configuration.editor.layoutInfo,this.viewDomNode=t.viewDomNode,this.lineHeight=e.configuration.editor.lineHeight,this.typicalHalfwidthCharacterWidth=e.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this.lastViewCursorsRenderData=n,this._context=e,this._viewHelper=t}return e.prototype.getZoneAtCoord=function(t){return e.getZoneAtCoord(this._context,t)},e.getZoneAtCoord=function(e,t){var n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){var i=n.verticalOffset+n.height/2,o=e.model.getLineCount(),r=null,s=void 0,a=null;return n.afterLineNumber!==o&&(a=new ee["a"](n.afterLineNumber+1,1)),n.afterLineNumber>0&&(r=new ee["a"](n.afterLineNumber,e.model.getLineMaxColumn(n.afterLineNumber))),s=null===a?r:null===r?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,de._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}return e}(),ue=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i)||this;return r._ctx=t,o?(r.target=o,r.targetPath=E.collect(o,t.viewDomNode)):(r.target=null,r.targetPath=new Uint8Array(0)),r}return ie(t,e),t.prototype.toString=function(){return"pos("+this.pos.x+","+this.pos.y+"), editorPos("+this.editorPos.x+","+this.editorPos.y+"), mouseVerticalOffset: "+this.mouseVerticalOffset+", mouseContentHorizontalOffset: "+this.mouseContentHorizontalOffset+"\n\ttarget: "+(this.target?this.target.outerHTML:null)},t.prototype.fulfill=function(e,t,n,i){void 0===t&&(t=null),void 0===n&&(n=null),void 0===i&&(i=null);var o=this.mouseColumn;return t&&t.columnr.contentLeft+r.width)){var c=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(c<=a&&a<=c+r.height)return t.fulfill(6,r.position)}}}return null},e._hitTestViewZone=function(e,t){var n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){var i=t.isInContentArea?8:5;return t.fulfill(i,n.position,null,n)}return null},e._hitTestTextArea=function(e,t){return re.isTextArea(t.targetPath)?t.fulfill(1):null},e._hitTestMargin=function(e,t){if(t.isInMarginArea){var n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),i=n.range.getStartPosition(),o=Math.abs(t.pos.x-t.editorPos.x),r={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,i,n.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,i,n.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,i,n.range,r)))}return null},e._hitTestViewLines=function(t,n,i){if(!re.isChildOfViewLines(n.targetPath))return null;if(t.isAfterLines(n.mouseVerticalOffset)){var o=t.model.getLineCount(),r=t.model.getLineMaxColumn(o);return n.fulfill(7,new ee["a"](o,r),void 0,le)}if(i){if(re.isStrictChildOfViewLines(n.targetPath)){var s=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(0===t.model.getLineLength(s)){var a=t.getLineWidth(s),u=ce(n.mouseContentHorizontalOffset-a);return n.fulfill(7,new ee["a"](s,1),void 0,u)}}return n.fulfill(0)}var l=e._doHitTest(t,n);return l.position?e.createMouseTargetFromHitTestPosition(t,n,l.position.lineNumber,l.position.column):this._createMouseTarget(t,n.withTarget(l.hitTarget),!0)},e._hitTestMinimap=function(e,t){if(re.isChildOfMinimap(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.model.getLineMaxColumn(n);return t.fulfill(11,new ee["a"](n,i))}return null},e._hitTestScrollbarSlider=function(e,t){if(re.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){var n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){var i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.model.getLineMaxColumn(i);return t.fulfill(11,new ee["a"](i,o))}}return null},e._hitTestScrollbar=function(e,t){if(re.isChildOfScrollableElement(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.model.getLineMaxColumn(n);return t.fulfill(11,new ee["a"](n,i))}return null},e.prototype.getMouseColumn=function(t,n){var i=this._context.configuration.editor.layoutInfo,o=this._context.viewLayout.getCurrentScrollLeft()+n.x-t.x-i.contentLeft;return e._getMouseColumn(o,this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth)},e._getMouseColumn=function(e,t){if(e<0)return 1;var n=Math.round(e/t);return n+1},e.createMouseTargetFromHitTestPosition=function(e,t,n,i){var o=new ee["a"](n,i),r=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>r){if(f["f"]&&1===o.column){var s=ce(t.mouseContentHorizontalOffset-r);return t.fulfill(7,new ee["a"](n,e.model.getLineMaxColumn(n)),void 0,s)}var a=ce(t.mouseContentHorizontalOffset-r);return t.fulfill(7,o,void 0,a)}var u=e.visibleRangeForPosition2(n,i);if(!u)return t.fulfill(0,o);var l=u.left;if(t.mouseContentHorizontalOffset===l)return t.fulfill(6,o);var c=[];if(c.push({offset:u.left,column:i}),i>1){var d=e.visibleRangeForPosition2(n,i-1);d&&c.push({offset:d.left,column:i-1})}var h=e.model.getLineMaxColumn(n);if(i=t.editorPos.y+e.layoutInfo.height&&(r=t.editorPos.y+e.layoutInfo.height-1);var s=new y(t.pos.x,r),a=this._actualDoHitTestWithCaretRangeFromPoint(e,s.toClientCoordinates());return a.position?a:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())},e._actualDoHitTestWithCaretRangeFromPoint=function(e,t){var n=document.caretRangeFromPoint(t.clientX,t.clientY);if(!n||!n.startContainer)return{position:null,hitTarget:null};var i=n.startContainer,o=null;if(i.nodeType===i.TEXT_NODE){var r=i.parentNode,s=r?r.parentNode:null,a=s?s.parentNode:null,u=a&&a.nodeType===a.ELEMENT_NODE?a.className:null;if(u===G.CLASS_NAME){var l=e.getPositionFromDOMInfo(r,n.startOffset);return{position:l,hitTarget:null}}o=i.parentNode}else if(i.nodeType===i.ELEMENT_NODE){r=i.parentNode,s=r?r.parentNode:null;var c=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(c===G.CLASS_NAME){l=e.getPositionFromDOMInfo(i,i.textContent.length);return{position:l,hitTarget:null}}o=i}return{position:null,hitTarget:o}},e._doHitTestWithCaretPositionFromPoint=function(e,t){var n=document.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){var i=n.offsetNode.parentNode,o=i?i.parentNode:null,r=o?o.parentNode:null,s=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(s===G.CLASS_NAME){var a=e.getPositionFromDOMInfo(n.offsetNode.parentNode,n.offset);return{position:a,hitTarget:null}}return{position:null,hitTarget:n.offsetNode.parentNode}}return{position:null,hitTarget:n.offsetNode}},e._doHitTestWithMoveToPoint=function(e,t){var n=null,i=null,o=document.body.createTextRange();try{o.moveToPoint(t.clientX,t.clientY)}catch(c){return{position:null,hitTarget:null}}o.collapse(!0);var r=o?o.parentElement():null,s=r?r.parentNode:null,a=s?s.parentNode:null,u=a&&a.nodeType===a.ELEMENT_NODE?a.className:"";if(u===G.CLASS_NAME){var l=o.duplicate();l.moveToElementText(r),l.setEndPoint("EndToStart",o),n=e.getPositionFromDOMInfo(r,l.text.length),l.moveToElementText(e.viewDomNode)}else i=r;return o.moveToElementText(e.viewDomNode),{position:n,hitTarget:i}},e._doHitTest=function(e,t){return document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null}},e}(),he=n("62bd"),pe=n("8025"),fe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ge(e){return function(t,n){var i=!1;return e&&(i=e.mouseTargetIsWidget(n)),i||n.preventDefault(),n}}var me=function(e){function t(n,i,r){var s=e.call(this)||this;s._isFocused=!1,s._context=n,s.viewController=i,s.viewHelper=r,s.mouseTargetFactory=new de(s._context,r),s._mouseDownOperation=s._register(new ve(s._context,s.viewController,s.viewHelper,function(e,t){return s._createMouseTarget(e,t)},function(e){return s._getMouseColumn(e)})),s._asyncFocus=s._register(new m["d"](function(){return s.viewHelper.focusTextArea()},0)),s.lastMouseLeaveTime=-1;var a=new O(s.viewHelper.viewDomNode);s._register(a.onContextMenu(s.viewHelper.viewDomNode,function(e){return s._onContextMenu(e,!0)})),s._register(a.onMouseMoveThrottled(s.viewHelper.viewDomNode,function(e){return s._onMouseMove(e)},ge(s.mouseTargetFactory),t.MOUSE_MOVE_MINIMUM_TIME)),s._register(a.onMouseUp(s.viewHelper.viewDomNode,function(e){return s._onMouseUp(e)})),s._register(a.onMouseLeave(s.viewHelper.viewDomNode,function(e){return s._onMouseLeave(e)})),s._register(a.onMouseDown(s.viewHelper.viewDomNode,function(e){return s._onMouseDown(e)}));var u=function(e){if(s.viewController.emitMouseWheel(e),s._context.configuration.editor.viewInfo.mouseWheelZoom){var t=new g["c"](e);if(t.browserEvent.ctrlKey||t.browserEvent.metaKey){var n=he["a"].getZoomLevel(),i=t.deltaY>0?1:-1;he["a"].setZoomLevel(n+i),t.preventDefault(),t.stopPropagation()}}};return s._register(o["h"](s.viewHelper.viewDomNode,f["g"]?"mousewheel":"wheel",u,!0)),s._context.addEventHandler(s),s}return fe(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onCursorStateChanged=function(e){return this._mouseDownOperation.onCursorStateChanged(e),!1},t.prototype.onFocusChanged=function(e){return this._isFocused=e.isFocused,!1},t.prototype.onScrollChanged=function(e){return this._mouseDownOperation.onScrollChanged(),!1},t.prototype.getTargetAtClientPoint=function(e,t){var n=new w(e,t),i=n.toPageCoordinates(),o=S(this.viewHelper.viewDomNode);if(i.yo.y+o.height||i.xo.x+o.width)return null;var r=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(r,o,i,null)},t.prototype._createMouseTarget=function(e,t){var n=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(n,e.editorPos,e.pos,t?e.target:null)},t.prototype._getMouseColumn=function(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)},t.prototype._onContextMenu=function(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})},t.prototype._onMouseMove=function(e){if(!this._mouseDownOperation.isActive()){var t=e.timestamp;tt.y+t.height){r=i.getCurrentScrollTop()+(e.posy-t.y),s=se.getZoneAtCoord(this._context,r);if(s){a=this._helpPositionJumpOverViewZone(s);if(a)return new oe(null,13,o,a)}var l=i.getLineNumberAtVerticalOffset(r);return new oe(null,13,o,new ee["a"](l,n.getLineMaxColumn(l)))}var c=i.getLineNumberAtVerticalOffset(i.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new oe(null,13,o,new ee["a"](c,n.getLineMaxColumn(c))):null},t.prototype._findMousePosition=function(e,t){var n=this._getPositionOutsideEditor(e);if(n)return n;var i=this._createMouseTarget(e,t),o=i.position;if(!o)return null;if(8===i.type||5===i.type){var r=this._helpPositionJumpOverViewZone(i.detail);if(r)return new oe(i.element,i.type,i.mouseColumn,r,null,i.detail)}return i},t.prototype._helpPositionJumpOverViewZone=function(e){var t=new ee["a"](this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,i=e.positionAfter;return n&&i?n.isBefore(t)?n:i:null},t.prototype._dispatchMouse=function(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})},t}(a["a"]),_e=function(){function e(){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}return Object.defineProperty(e.prototype,"altKey",{get:function(){return this._altKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ctrlKey",{get:function(){return this._ctrlKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metaKey",{get:function(){return this._metaKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shiftKey",{get:function(){return this._shiftKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftButton",{get:function(){return this._leftButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"middleButton",{get:function(){return this._middleButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startedOnLineNumbers",{get:function(){return this._startedOnLineNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._lastMouseDownCount},enumerable:!0,configurable:!0}),e.prototype.setModifiers=function(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey},e.prototype.setStartButtons=function(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton},e.prototype.setStartedOnLineNumbers=function(e){this._startedOnLineNumbers=e},e.prototype.trySetCount=function(t,n){var i=(new Date).getTime();i-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=i,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)},e.CLEAR_MOUSE_DOWN_COUNT_TIME=400,e}(),be=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ye(e,t){var n={translationY:t.translationY,translationX:t.translationX};return e&&(n.translationY+=e.translationY,n.translationX+=e.translationX),n}var we=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.viewHelper.linesContentDomNode.style.msTouchAction="none",r.viewHelper.linesContentDomNode.style.msContentZooming="none",r._installGestureHandlerTimeout=window.setTimeout(function(){if(r._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=r.viewHelper.linesContentDomNode,t.target=r.viewHelper.linesContentDomNode,r.viewHelper.linesContentDomNode.addEventListener("MSPointerDown",function(n){var i=n.pointerType;i!==(n.MSPOINTER_TYPE_MOUSE||"mouse")?i===(n.MSPOINTER_TYPE_TOUCH||"touch")?(r._lastPointerType="touch",e.addPointer(n.pointerId)):(r._lastPointerType="pen",t.addPointer(n.pointerId)):r._lastPointerType="mouse"}),r._register(o["j"](r.viewHelper.linesContentDomNode,"MSGestureChange",function(e){return r._onGestureChange(e)},ye)),r._register(o["h"](r.viewHelper.linesContentDomNode,"MSGestureTap",function(e){return r._onCaptureGestureTap(e)},!0))}},100),r._lastPointerType="mouse",r}return be(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new L(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(n,!1);i.position&&this.viewController.moveTo(i.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout(function(){t.viewHelper.focusTextArea()})},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(me),Ce=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.viewHelper.linesContentDomNode.style.touchAction="none",r._installGestureHandlerTimeout=window.setTimeout(function(){if(r._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=r.viewHelper.linesContentDomNode,t.target=r.viewHelper.linesContentDomNode,r.viewHelper.linesContentDomNode.addEventListener("pointerdown",function(n){var i=n.pointerType;"mouse"!==i?"touch"===i?(r._lastPointerType="touch",e.addPointer(n.pointerId)):(r._lastPointerType="pen",t.addPointer(n.pointerId)):r._lastPointerType="mouse"}),r._register(o["j"](r.viewHelper.linesContentDomNode,"MSGestureChange",function(e){return r._onGestureChange(e)},ye)),r._register(o["h"](r.viewHelper.linesContentDomNode,"MSGestureTap",function(e){return r._onCaptureGestureTap(e)},!0))}},100),r._lastPointerType="mouse",r}return be(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new L(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(n,!1);i.position&&this.viewController.moveTo(i.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout(function(){t.viewHelper.focusTextArea()})},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(me),Se=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return p["b"].addTarget(r.viewHelper.linesContentDomNode),r._register(o["h"](r.viewHelper.linesContentDomNode,p["a"].Tap,function(e){return r.onTap(e)})),r._register(o["h"](r.viewHelper.linesContentDomNode,p["a"].Change,function(e){return r.onChange(e)})),r._register(o["h"](r.viewHelper.linesContentDomNode,p["a"].Contextmenu,function(e){return r._onContextMenu(new L(e,r.viewHelper.viewDomNode),!1)})),r}return be(t,e),t.prototype.onTap=function(e){e.preventDefault(),this.viewHelper.focusTextArea();var t=this._createMouseTarget(new L(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.moveTo(t.position)},t.prototype.onChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t}(me),Le=function(e){function t(t,n,i){var o=e.call(this)||this;return window.navigator.msPointerEnabled?o.handler=o._register(new we(t,n,i)):window.TouchEvent?o.handler=o._register(new Se(t,n,i)):window.navigator.pointerEnabled||window.PointerEvent?o.handler=o._register(new Ce(t,n,i)):o.handler=o._register(new me(t,n,i)),o}return be(t,e),t.prototype.getTargetAtClientPoint=function(e,t){return this.handler.getTargetAtClientPoint(e,t)},t}(a["a"]),Oe=(n("56f3"),n("3742")),xe=n("e53c"),Ne=n("0a89"),De=(n("2ab7"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return De(t,e),t}(D),Ie=n("918c"),Ee=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Me=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._readConfig(),n._lastCursorModelPosition=new ee["a"](1,1),n._renderResult=null,n._context.addEventHandler(n),n}return Ee(t,e),t.prototype._readConfig=function(){var e=this._context.configuration.editor;this._lineHeight=e.lineHeight,this._renderLineNumbers=e.viewInfo.renderLineNumbers,this._renderCustomLineNumbers=e.viewInfo.renderCustomLineNumbers,this._renderFinalNewline=e.viewInfo.renderFinalNewline,this._lineNumbersLeft=e.layoutInfo.lineNumbersLeft,this._lineNumbersWidth=e.layoutInfo.lineNumbersWidth},t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return this._readConfig(),!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0].getPosition();return this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t),2===this._renderLineNumbers||3===this._renderLineNumbers},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getLineRenderLineNumber=function(e){var t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ee["a"](e,1));if(1!==t.column)return"";var n=t.lineNumber;if(!this._renderFinalNewline){var i=this._context.model.getLineCount(),o=this._context.model.getLineContent(n);if(n===i&&""===o)return""}if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(2===this._renderLineNumbers){var r=Math.abs(this._lastCursorModelPosition.lineNumber-n);return 0===r?''+n+"":String(r)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===n?String(n):n%10===0?String(n):"":String(n)},t.prototype.prepareRender=function(e){if(0!==this._renderLineNumbers){for(var n=v["c"]?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r='
',s=[],a=i;a<=o;a++){var u=a-i,l=this._getLineRenderLineNumber(a);s[u]=l?r+l+"
":""}this._renderResult=s}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.CLASS_NAME="line-numbers",t}(ke);Object(B["f"])(function(e,t){var n=e.getColor(Ie["k"]);n&&t.addRule(".monaco-editor .line-numbers { color: "+n+"; }");var i=e.getColor(Ie["b"]);i&&t.addRule(".monaco-editor .current-line ~ .line-numbers { color: "+i+"; }")});var Te=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Pe=function(e){function t(n){var i=e.call(this,n)||this;return i._canUseLayerHinting=i._context.configuration.editor.canUseLayerHinting,i._contentLeft=i._context.configuration.editor.layoutInfo.contentLeft,i._glyphMarginLeft=i._context.configuration.editor.layoutInfo.glyphMarginLeft,i._glyphMarginWidth=i._context.configuration.editor.layoutInfo.glyphMarginWidth,i._domNode=Object(h["b"])(document.createElement("div")),i._domNode.setClassName(t.OUTER_CLASS_NAME),i._domNode.setPosition("absolute"),i._domNode.setAttribute("role","presentation"),i._domNode.setAttribute("aria-hidden","true"),i._glyphMarginBackgroundDomNode=Object(h["b"])(document.createElement("div")),i._glyphMarginBackgroundDomNode.setClassName(t.CLASS_NAME),i._domNode.appendChild(i._glyphMarginBackgroundDomNode),i}return Te(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return e.canUseLayerHinting&&(this._canUseLayerHinting=this._context.configuration.editor.canUseLayerHinting),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,this._glyphMarginLeft=this._context.configuration.editor.layoutInfo.glyphMarginLeft,this._glyphMarginWidth=this._context.configuration.editor.layoutInfo.glyphMarginWidth),!0},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollTopChanged},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setLayerHinting(this._canUseLayerHinting);var t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);var 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)},t.CLASS_NAME="glyph-margin",t.OUTER_CLASS_NAME="margin",t}(I),Re=n("e6ff"),Ae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fe=function(){function e(e){this.type=1,this.canUseLayerHinting=e.canUseLayerHinting,this.pixelRatio=e.pixelRatio,this.editorClassName=e.editorClassName,this.lineHeight=e.lineHeight,this.readOnly=e.readOnly,this.accessibilitySupport=e.accessibilitySupport,this.emptySelectionClipboard=e.emptySelectionClipboard,this.copyWithSyntaxHighlighting=e.copyWithSyntaxHighlighting,this.layoutInfo=e.layoutInfo,this.fontInfo=e.fontInfo,this.viewInfo=e.viewInfo,this.wrappingInfo=e.wrappingInfo}return e}(),je=function(){function e(e){this.type=2,this.selections=e}return e}(),We=function(){function e(){this.type=3}return e}(),Ve=function(){function e(){this.type=4}return e}(),Be=function(){function e(e){this.type=5,this.isFocused=e}return e}(),He=function(){function e(){this.type=6}return e}(),ze=function(){function e(e,t){this.type=7,this.fromLineNumber=e,this.toLineNumber=t}return e}(),Ue=function(){function e(e,t){this.type=8,this.fromLineNumber=e,this.toLineNumber=t}return e}(),Ke=function(){function e(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}return e}(),qe=function(){function e(e,t,n,i){this.type=10,this.range=e,this.verticalType=t,this.revealHorizontal=n,this.scrollType=i}return e}(),Ge=function(){function e(e){this.type=11,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}return e}(),Ze=function(){function e(e){this.type=12,this.ranges=e}return e}(),Ye=function(){function e(){this.type=15}return e}(),Xe=function(){function e(){this.type=13}return e}(),$e=function(){function e(){this.type=14}return e}(),Qe=function(){function e(){this.type=16}return e}(),Je=function(e){function t(){var t=e.call(this)||this;return t._listeners=[],t._collector=null,t._collectorCnt=0,t}return Ae(t,e),t.prototype.dispose=function(){this._listeners=[],e.prototype.dispose.call(this)},t.prototype._beginEmit=function(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new et),this._collector},t.prototype._endEmit=function(){if(this._collectorCnt--,0===this._collectorCnt){var e=this._collector.finalize();this._collector=null,e.length>0&&this._emit(e)}},t.prototype._emit=function(e){for(var t=this._listeners.slice(0),n=0,i=t.length;n0)return new Ne["b"](i,i.length,i.length,n,n)}}return Ne["b"].EMPTY}return Ne["a"].fromEditorSelection(e,s,o._selections[0],0===o._accessibilitySupport)},deduceModelPosition:function(e,t,n){return o._context.model.deduceModelPositionRelativeToViewPosition(e,t,n)}};return o._textAreaInput=o._register(new xe["b"](a,o.textArea)),o._register(o._textAreaInput.onKeyDown(function(e){o._viewController.emitKeyDown(e)})),o._register(o._textAreaInput.onKeyUp(function(e){o._viewController.emitKeyUp(e)})),o._register(o._textAreaInput.onPaste(function(e){var t=rt.INSTANCE.get(e.text),n=!1,i=null;t&&(n=o._emptySelectionClipboard&&t.isFromEmptySelection,i=t.multicursorText),o._viewController.paste("keyboard",e.text,n,i)})),o._register(o._textAreaInput.onCut(function(){o._viewController.cut("keyboard")})),o._register(o._textAreaInput.onType(function(e){e.replaceCharCnt?o._viewController.replacePreviousChar("keyboard",e.text,e.replaceCharCnt):o._viewController.type("keyboard",e.text)})),o._register(o._textAreaInput.onSelectionChangeRequest(function(e){o._viewController.setSelection("keyboard",e)})),o._register(o._textAreaInput.onCompositionStart(function(){var e=o._selections[0].startLineNumber,t=o._selections[0].startColumn;o._context.privateViewEventBus.emit(new qe(new te["a"](e,t,e,t),0,!0,1));var n=o._viewHelper.visibleRangeForPositionRelativeToEditor(e,t);n&&(o._visibleTextArea=new it(o._context.viewLayout.getVerticalOffsetForLineNumber(e),n.left,ot?0:1),o._render()),o.textArea.setClassName("inputarea ime-input"),o._viewController.compositionStart("keyboard")})),o._register(o._textAreaInput.onCompositionUpdate(function(e){f["g"]?o._visibleTextArea=o._visibleTextArea.setWidth(0):o._visibleTextArea=o._visibleTextArea.setWidth(at(e.data,o._fontInfo)),o._render()})),o._register(o._textAreaInput.onCompositionEnd(function(){o._visibleTextArea=null,o._render(),o.textArea.setClassName("inputarea"),o._viewController.compositionEnd("keyboard")})),o._register(o._textAreaInput.onFocus(function(){o._context.privateViewEventBus.emit(new Be(!0))})),o._register(o._textAreaInput.onBlur(function(){o._context.privateViewEventBus.emit(new Be(!1))})),o}return nt(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getWordBeforePosition=function(e){var t=this._context.model.getLineContent(e.lineNumber),n=Object(Re["a"])(this._context.configuration.editor.wordSeparators),i=e.column,o=0;while(i>1){var r=t.charCodeAt(i-2),s=n.get(r);if(0!==s||o>50)return t.substring(i-1,e.column-1);o++,i--}return t.substring(0,e.column-1)},t.prototype._getCharacterBeforePosition=function(e){if(e.column>1){var t=this._context.model.getLineContent(e.lineNumber),n=t.charAt(e.column-2);if(!Oe["w"](n.charCodeAt(0)))return n}return""},t.prototype.onConfigurationChanged=function(e){var t=this._context.configuration.editor;return e.fontInfo&&(this._fontInfo=t.fontInfo),e.viewInfo&&this.textArea.setAttribute("aria-label",t.viewInfo.ariaLabel),e.layoutInfo&&(this._contentLeft=t.layoutInfo.contentLeft,this._contentWidth=t.layoutInfo.contentWidth,this._contentHeight=t.layoutInfo.contentHeight),e.lineHeight&&(this._lineHeight=t.lineHeight),e.accessibilitySupport&&(this._accessibilitySupport=t.accessibilitySupport,this._textAreaInput.writeScreenReaderContent("strategy changed")),e.emptySelectionClipboard&&(this._emptySelectionClipboard=t.emptySelectionClipboard),e.copyWithSyntaxHighlighting&&(this._copyWithSyntaxHighlighting=t.copyWithSyntaxHighlighting),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.isFocused=function(){return this._textAreaInput.isFocused()},t.prototype.focusTextArea=function(){this._textAreaInput.focusTextArea()},t.prototype.prepareRender=function(e){var t=new ee["a"](this._selections[0].positionLineNumber,this._selections[0].positionColumn);this._primaryCursorVisibleRange=e.visibleRangeForPosition(t)},t.prototype.render=function(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()},t.prototype._render=function(){if(this._visibleTextArea)this._renderInsideEditor(this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight,!0);else if(this._primaryCursorVisibleRange){var e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)this._renderAtTopLeft();else{var t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;t<0||t>this._contentHeight?this._renderAtTopLeft():this._renderInsideEditor(t,e,ot?0:1,ot?0:1,!1)}}else this._renderAtTopLeft()},t.prototype._renderInsideEditor=function(e,t,n,i,o){var r=this.textArea,s=this.textAreaCover;o?l["a"].applyFontInfo(r,this._fontInfo):(r.setFontSize(1),r.setLineHeight(this._fontInfo.lineHeight)),r.setTop(e),r.setLeft(t),r.setWidth(n),r.setHeight(i),s.setTop(0),s.setLeft(0),s.setWidth(0),s.setHeight(0)},t.prototype._renderAtTopLeft=function(){var e=this.textArea,t=this.textAreaCover;if(l["a"].applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),ot)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1),this._context.configuration.editor.viewInfo.glyphMargin?t.setClassName("monaco-editor-background textAreaCover "+Pe.OUTER_CLASS_NAME):0!==this._context.configuration.editor.viewInfo.renderLineNumbers?t.setClassName("monaco-editor-background textAreaCover "+Me.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")},t}(I);function at(e,t){var n=document.createElement("canvas"),i=n.getContext("2d");i.font=ut(t);var o=i.measureText(e);return f["i"]?o.width+2:o.width}function ut(e){return lt("normal",e.fontWeight,e.fontSize,e.lineHeight,e.fontFamily)}function lt(e,t,n,i,o){return e+" normal "+t+" "+n+"px / "+i+"px "+o}var ct=n("d585"),dt=function(){function e(e,t,n,i){this.configuration=e,this.viewModel=t,this.outgoingEvents=n,this.commandDelegate=i}return e.prototype._execMouseCommand=function(e,t){t.source="mouse",this.commandDelegate.executeEditorCommand(e,t)},e.prototype.paste=function(e,t,n,i){this.commandDelegate.paste(e,t,n,i)},e.prototype.type=function(e,t){this.commandDelegate.type(e,t)},e.prototype.replacePreviousChar=function(e,t,n){this.commandDelegate.replacePreviousChar(e,t,n)},e.prototype.compositionStart=function(e){this.commandDelegate.compositionStart(e)},e.prototype.compositionEnd=function(e){this.commandDelegate.compositionEnd(e)},e.prototype.cut=function(e){this.commandDelegate.cut(e)},e.prototype.setSelection=function(e,t){this.commandDelegate.executeEditorCommand(ct["CoreNavigationCommands"].SetSelection,{source:e,selection:t})},e.prototype._validateViewColumn=function(e){var t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!1):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)},e.prototype._usualArgs=function(e){return e=this._validateViewColumn(e),{position:this._convertViewToModelPosition(e),viewPosition:e}},e.prototype.moveTo=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].MoveTo,this._usualArgs(e))},e.prototype._moveToSelect=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].MoveToSelect,this._usualArgs(e))},e.prototype._columnSelect=function(e,t,n){e=this._validateViewColumn(e),this._execMouseCommand(ct["CoreNavigationCommands"].ColumnSelect,{position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,setAnchorIfNotSet:n})},e.prototype._createCursor=function(e,t){e=this._validateViewColumn(e),this._execMouseCommand(ct["CoreNavigationCommands"].CreateCursor,{position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})},e.prototype._lastCursorMoveToSelect=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].LastCursorMoveToSelect,this._usualArgs(e))},e.prototype._wordSelect=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].WordSelect,this._usualArgs(e))},e.prototype._wordSelectDrag=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].WordSelectDrag,this._usualArgs(e))},e.prototype._lastCursorWordSelect=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].LastCursorWordSelect,this._usualArgs(e))},e.prototype._lineSelect=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].LineSelect,this._usualArgs(e))},e.prototype._lineSelectDrag=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].LineSelectDrag,this._usualArgs(e))},e.prototype._lastCursorLineSelect=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].LastCursorLineSelect,this._usualArgs(e))},e.prototype._lastCursorLineSelectDrag=function(e){this._execMouseCommand(ct["CoreNavigationCommands"].LastCursorLineSelectDrag,this._usualArgs(e))},e.prototype._selectAll=function(){this._execMouseCommand(ct["CoreNavigationCommands"].SelectAll,{})},e.prototype._convertViewToModelPosition=function(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)},e.prototype.emitKeyDown=function(e){this.outgoingEvents.emitKeyDown(e)},e.prototype.emitKeyUp=function(e){this.outgoingEvents.emitKeyUp(e)},e.prototype.emitContextMenu=function(e){this.outgoingEvents.emitContextMenu(e)},e.prototype.emitMouseMove=function(e){this.outgoingEvents.emitMouseMove(e)},e.prototype.emitMouseLeave=function(e){this.outgoingEvents.emitMouseLeave(e)},e.prototype.emitMouseUp=function(e){this.outgoingEvents.emitMouseUp(e)},e.prototype.emitMouseDown=function(e){this.outgoingEvents.emitMouseDown(e)},e.prototype.emitMouseDrag=function(e){this.outgoingEvents.emitMouseDrag(e)},e.prototype.emitMouseDrop=function(e){this.outgoingEvents.emitMouseDrop(e)},e.prototype.emitMouseWheel=function(e){this.outgoingEvents.emitMouseWheel(e)},e}(),ht=n("7ab3"),pt=function(){function e(e){this._createLine=e,this._set(1,[])}return e.prototype.flush=function(){this._set(1,[])},e.prototype._set=function(e,t){this._lines=t,this._rendLineNumberStart=e},e.prototype._get=function(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}},e.prototype.getStartLineNumber=function(){return this._rendLineNumberStart},e.prototype.getEndLineNumber=function(){return this._rendLineNumberStart+this._lines.length-1},e.prototype.getCount=function(){return this._lines.length},e.prototype.getLine=function(e){var t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]},e.prototype.onLinesDeleted=function(e,t){if(0===this.getCount())return null;var n=this.getStartLineNumber(),i=this.getEndLineNumber();if(ti)return null;for(var r=0,s=0,a=n;a<=i;a++){var u=a-this._rendLineNumberStart;e<=a&&a<=t&&(0===s?(r=u,s=1):s++)}if(e=n&&r<=i&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o},e.prototype.onLinesInserted=function(e,t){if(0===this.getCount())return null;var n=t-e+1,i=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=i)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o){var r=this._lines.splice(e-this._rendLineNumberStart,o-e+1);return r}for(var s=[],a=0;an))for(var a=Math.max(t,s.fromLineNumber),u=Math.min(n,s.toLineNumber),l=a;l<=u;l++){var c=l-this._rendLineNumberStart;this._lines[c].onTokensChanged(),i=!0}}return i},e}(),ft=function(){function e(e){var t=this;this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new pt(function(){return t._host.createVisibleLine()})}return e.prototype._createDomNode=function(){var e=Object(h["b"])(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e},e.prototype.onConfigurationChanged=function(e){return e.layoutInfo},e.prototype.onFlushed=function(e){return this._linesCollection.flush(),!0},e.prototype.onLinesChanged=function(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)},e.prototype.onLinesDeleted=function(e){var t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(var n=0,i=t.length;nt){var s=t,a=Math.min(n,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,i,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,u),o.linesLength-=u)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1n){s=Math.max(0,n-o.rendLineNumberStart+1),a=o.linesLength-1,u=a-s+1;u>0&&(this._removeLinesAfter(o,u),o.linesLength-=u)}return this._finishRendering(o,!1,i),o},e.prototype._renderUntouchedLines=function(e,t,n,i,o){for(var r=e.rendLineNumberStart,s=e.lines,a=t;a<=n;a++){var u=r+a;s[a].layoutLine(u,i[u-o])}},e.prototype._insertLinesBefore=function(e,t,n,i,o){for(var r=[],s=0,a=t;a<=n;a++)r[s++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)},e.prototype._removeLinesBefore=function(e,t){for(var n=0;n=0;s--){var a=e.lines[s];i[s]&&(a.setDomNode(r),r=r.previousSibling)}},e.prototype._finishRenderingInvalidLines=function(e,t,n){var i=document.createElement("div");i.innerHTML=t;for(var o=0;o'),i.appendASCIIString(o),i.appendASCIIString(""),!0)},e.prototype.layoutLine=function(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))},e}(),bt=function(e){function t(t){var n=e.call(this,t)||this;return n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n.domNode.setHeight(0),n}return mt(t,e),t.prototype.onConfigurationChanged=function(t){return t.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),e.prototype.onConfigurationChanged.call(this,t)},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollWidthChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t),this.domNode.setWidth(Math.max(t.scrollWidth,this._contentWidth))},t}(vt),yt=function(e){function t(t){var n=e.call(this,t)||this;return n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n.domNode.setClassName("margin-view-overlays"),n.domNode.setWidth(1),l["a"].applyFontInfo(n.domNode,n._context.configuration.editor.fontInfo),n}return mt(t,e),t.prototype.onConfigurationChanged=function(t){var n=!1;return t.fontInfo&&(l["a"].applyFontInfo(this.domNode,this._context.configuration.editor.fontInfo),n=!0),t.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,n=!0),e.prototype.onConfigurationChanged.call(this,t)||n},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollHeightChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t);var n=Math.min(t.scrollHeight,1e6);this.domNode.setHeight(n),this.domNode.setWidth(this._contentLeft)},t}(vt),wt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ct=function(){function e(e,t){this.top=e,this.left=t}return e}(),St=function(e){function t(t,n){var i=e.call(this,t)||this;return i._viewDomNode=n,i._widgets={},i.domNode=Object(h["b"])(document.createElement("div")),E.write(i.domNode,1),i.domNode.setClassName("contentWidgets"),i.domNode.setPosition("absolute"),i.domNode.setTop(0),i.overflowingContentWidgetsDomNode=Object(h["b"])(document.createElement("div")),E.write(i.overflowingContentWidgetsDomNode,2),i.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets"),i}return wt(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.onConfigurationChanged=function(e){for(var t=Object.keys(this._widgets),n=0,i=t;n=i,d=a,h=u>=i,p=e.left,f=t.left;return p+n>o.scrollLeft+o.viewportWidth&&(p=o.scrollLeft+o.viewportWidth-n),f+n>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-n),p=b,C=f+i<=_-y;if(g+n+20>v){var S=g-(v-n-20);g-=S,c-=S}if(m+n+20>v){S=m-(v-n-20);m-=S,d-=S}if(g<0){S=g;g-=S,c-=S}if(m<0){S=m;m-=S,d-=S}return this._fixedOverflowWidgets&&(u=p,l=f,c=g,d=m),{fitsAbove:w,aboveTop:u,aboveLeft:c,fitsBelow:C,belowTop:l,belowLeft:d}},e.prototype._prepareRenderWidgetAtExactPositionOverflowing=function(e){return new Ct(e.top,e.left+this._contentLeft)},e.prototype._getTopAndBottomLeft=function(e){if(!this._viewPosition)return[null,null];var t=e.visibleRangeForPosition(this._viewPosition);if(!t)return[null,null];var n=e.getVerticalOffsetForLineNumber(this._viewPosition.lineNumber)-e.scrollTop,i=new Ct(n,t.left),o=this._viewPosition.lineNumber,r=t.left;if(this._viewRange){var s=e.linesVisibleRangesForRange(this._viewRange,!1);if(s&&s.length>0)for(var a=s.length-1;a>=0;a--){var u=s[a];if(u.lineNumber>=o){u.lineNumber>o&&(o=u.lineNumber,r=1073741824);for(var l=0,c=u.ranges.length;le.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))},e.prototype.prepareRender=function(e){this._renderData=this._prepareRenderWidget(e)},e.prototype.render=function(e){this._renderData?(this.allowEditorOverflow?(this.domNode.setTop(this._renderData.top),this.domNode.setLeft(this._renderData.left)):(this.domNode.setTop(this._renderData.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0)):this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden"))},e}(),Ot=(n("930f"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),xt=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._scrollWidth=0,n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n._context.addEventHandler(n),n}return Ot(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i?(this._selectionIsEmpty=i,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){this._scrollWidth=e.scrollWidth},t.prototype.render=function(e,t){if(t===this._primaryCursorLineNumber){if(this._shouldShowCurrentLine()){var n=this._willRenderMarginCurrentLine(),i="current-line"+(n?" current-line-both":"");return'
'}return""}return""},t.prototype._shouldShowCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t.prototype._willRenderMarginCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t}(ke);Object(B["f"])(function(e,t){var n=e.getColor(Ie["i"]);if(n&&t.addRule(".monaco-editor .view-overlays .current-line { background-color: "+n+"; }"),!n||n.isTransparent()||e.defines(Ie["j"])){var i=e.getColor(Ie["j"]);i&&(t.addRule(".monaco-editor .view-overlays .current-line { border: 2px solid "+i+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"))}});n("4e7d");var Nt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dt=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n._context.addEventHandler(n),n}return Nt(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i?(this._selectionIsEmpty=i,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e,t){if(t===this._primaryCursorLineNumber){var n="current-line";if(this._shouldShowCurrentLine()){var i=this._willRenderContentCurrentLine();n="current-line current-line-margin"+(i?" current-line-margin-both":"")}return'
'}return""},t.prototype._shouldShowCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t.prototype._willRenderContentCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t}(ke);Object(B["f"])(function(e,t){var n=e.getColor(Ie["i"]);if(n)t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { background-color: "+n+"; border: none; }");else{var i=e.getColor(Ie["j"]);i&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid "+i+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")}});n("56dc");var kt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),It=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return kt(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged||e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){for(var t=e.getDecorationsInViewport(),n=[],i=0,o=0,r=t.length;ot.options.zIndex)return 1;var n=e.options.className,i=t.options.className;return ni?1:te["a"].compareRangesUsingStarts(e.range,t.range)});for(var a=e.visibleRange.startLineNumber,u=e.visibleRange.endLineNumber,l=[],c=a;c<=u;c++){var d=c-a;l[d]=""}this._renderWholeLineDecorations(e,n,l),this._renderNormalDecorations(e,n,l),this._renderResult=l},t.prototype._renderWholeLineDecorations=function(e,t,n){for(var i=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=0,a=t.length;s',c=Math.max(u.range.startLineNumber,o),d=Math.min(u.range.endLineNumber,r),h=c;h<=d;h++){var p=h-o;n[p]+=l}}},t.prototype._renderNormalDecorations=function(e,t,n){for(var i=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=null,s=!1,a=null,u=0,l=t.length;u';s[d]+=m}}},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(ke),Et=n("1898"),Mt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Tt=function(e){function t(t,n,i,r){var s=e.call(this,t)||this,a=s._context.configuration.editor,u=a.viewInfo.scrollbar,l={listenOnDomNode:i.domNode,className:"editor-scrollable "+Object(B["e"])(t.theme.type),useShadows:!1,lazyRender:!0,vertical:u.vertical,horizontal:u.horizontal,verticalHasArrows:u.verticalHasArrows,horizontalHasArrows:u.horizontalHasArrows,verticalScrollbarSize:u.verticalScrollbarSize,verticalSliderSize:u.verticalSliderSize,horizontalScrollbarSize:u.horizontalScrollbarSize,horizontalSliderSize:u.horizontalSliderSize,handleMouseWheel:u.handleMouseWheel,arrowSize:u.arrowSize,mouseWheelScrollSensitivity:u.mouseWheelScrollSensitivity,fastScrollSensitivity:u.fastScrollSensitivity};s.scrollbar=s._register(new Et["c"](n.domNode,l,s._context.viewLayout.scrollable)),E.write(s.scrollbar.getDomNode(),5),s.scrollbarDomNode=Object(h["b"])(s.scrollbar.getDomNode()),s.scrollbarDomNode.setPosition("absolute"),s._setLayout();var c=function(e,t,n){var i={};if(t){var o=e.scrollTop;o&&(i.scrollTop=s._context.viewLayout.getCurrentScrollTop()+o,e.scrollTop=0)}if(n){var r=e.scrollLeft;r&&(i.scrollLeft=s._context.viewLayout.getCurrentScrollLeft()+r,e.scrollLeft=0)}s._context.viewLayout.setScrollPositionNow(i)};return s._register(o["h"](i.domNode,"scroll",function(e){return c(i.domNode,!0,!0)})),s._register(o["h"](n.domNode,"scroll",function(e){return c(n.domNode,!0,!1)})),s._register(o["h"](r.domNode,"scroll",function(e){return c(r.domNode,!0,!1)})),s._register(o["h"](s.scrollbarDomNode.domNode,"scroll",function(e){return c(s.scrollbarDomNode.domNode,!0,!1)})),s}return Mt(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._setLayout=function(){var e=this._context.configuration.editor.layoutInfo;this.scrollbarDomNode.setLeft(e.contentLeft);var t=this._context.configuration.editor.viewInfo.minimap.side;"right"===t?this.scrollbarDomNode.setWidth(e.contentWidth+e.minimapWidth):this.scrollbarDomNode.setWidth(e.contentWidth),this.scrollbarDomNode.setHeight(e.contentHeight)},t.prototype.getOverviewRulerLayoutInfo=function(){return this.scrollbar.getOverviewRulerLayoutInfo()},t.prototype.getDomNode=function(){return this.scrollbarDomNode},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)},t.prototype.onConfigurationChanged=function(e){if(e.viewInfo){var t=this._context.configuration.editor,n={handleMouseWheel:t.viewInfo.scrollbar.handleMouseWheel,mouseWheelScrollSensitivity:t.viewInfo.scrollbar.mouseWheelScrollSensitivity,fastScrollSensitivity:t.viewInfo.scrollbar.fastScrollSensitivity};this.scrollbar.updateOptions(n)}return e.layoutInfo&&this._setLayout(),!0},t.prototype.onScrollChanged=function(e){return!0},t.prototype.onThemeChanged=function(e){return this.scrollbar.updateClassName("editor-scrollable "+Object(B["e"])(this._context.theme.type)),!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this.scrollbar.renderNow()},t}(I),Pt=(n("8478d"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Rt=function(){function e(e,t,n){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n)}return e}(),At=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype._render=function(e,t,n){for(var i=[],o=e;o<=t;o++){var r=o-e;i[r]=[]}if(0===n.length)return i;n.sort(function(e,t){return e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',u=[],l=t;l<=n;l++){var c=l-t,d=i[c];0===d.length?u[c]="":u[c]='
=this._renderResult.length?"":this._renderResult[n]},t}(At),jt=(n("0baa"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Wt=function(e){function t(t){var n=e.call(this)||this;n._context=t,n._primaryLineNumber=0,n._lineHeight=n._context.configuration.editor.lineHeight,n._spaceWidth=n._context.configuration.editor.fontInfo.spaceWidth,n._enabled=n._context.configuration.editor.viewInfo.renderIndentGuides,n._activeIndentEnabled=n._context.configuration.editor.viewInfo.highlightActiveIndentGuide;var i=n._context.configuration.editor.wrappingInfo.wrappingColumn;return n._maxIndentLeft=-1===i?-1:i*n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return jt(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){if(e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._spaceWidth=this._context.configuration.editor.fontInfo.spaceWidth),e.viewInfo&&(this._enabled=this._context.configuration.editor.viewInfo.renderIndentGuides,this._activeIndentEnabled=this._context.configuration.editor.viewInfo.highlightActiveIndentGuide),e.wrappingInfo||e.fontInfo){var t=this._context.configuration.editor.wrappingInfo.wrappingColumn;this._maxIndentLeft=-1===t?-1:t*this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth}return!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0],n=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==n&&(this._primaryLineNumber=n,!0)},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.onLanguageConfigurationChanged=function(e){return!0},t.prototype.prepareRender=function(e){if(this._enabled){var t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=this._context.model.getOptions().indentSize,o=i*this._spaceWidth,r=e.scrollWidth,s=this._lineHeight,a=this._context.model.getLinesIndentGuides(t,n),u=0,l=0,c=0;if(this._activeIndentEnabled&&this._primaryLineNumber){var d=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,n);u=d.startLineNumber,l=d.endLineNumber,c=d.indent}for(var h=[],p=t;p<=n;p++){for(var f=u<=p&&p<=l,g=p-t,m=a[g],v="",_=e.visibleRangeForPosition(new ee["a"](p,1)),b=_?_.left:0,y=1;y<=m;y++){var w=f&&y===c?"cigra":"cigr";if(v+='
',b+=o,b>r||this._maxIndentLeft>0&&b>this._maxIndentLeft)break}h[g]=v}this._renderResult=h}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(ke);Object(B["f"])(function(e,t){var n=e.getColor(Ie["h"]);n&&t.addRule(".monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 "+n+" inset; }");var i=e.getColor(Ie["a"])||n;i&&t.addRule(".monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 "+i+" inset; }")});n("38a2b");var Vt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bt=function(){function e(){this._currentVisibleRange=new te["a"](1,1,1,1)}return e.prototype.getCurrentVisibleRange=function(){return this._currentVisibleRange},e.prototype.setCurrentVisibleRange=function(e){this._currentVisibleRange=e},e}(),Ht=function(){function e(e,t,n,i,o,r){this.lineNumber=e,this.startColumn=t,this.endColumn=n,this.startScrollTop=i,this.stopScrollTop=o,this.scrollType=r}return e}(),zt=function(e){function t(t,n){var i=e.call(this,t)||this;i._linesContent=n,i._textRangeRestingSpot=document.createElement("div"),i._visibleLines=new ft(i),i.domNode=i._visibleLines.domNode;var o=i._context.configuration;return i._lineHeight=o.editor.lineHeight,i._typicalHalfwidthCharacterWidth=o.editor.fontInfo.typicalHalfwidthCharacterWidth,i._isViewportWrapping=o.editor.wrappingInfo.isViewportWrapping,i._revealHorizontalRightPadding=o.editor.viewInfo.revealHorizontalRightPadding,i._scrollOff=o.editor.viewInfo.cursorSurroundingLines,i._canUseLayerHinting=o.editor.canUseLayerHinting,i._viewLineOptions=new q(o,i._context.theme.type),E.write(i.domNode,7),i.domNode.setClassName("view-lines"),l["a"].applyFontInfo(i.domNode,o.editor.fontInfo),i._maxLineWidth=0,i._asyncUpdateLineWidths=new m["d"](function(){i._updateLineWidthsSlow()},200),i._lastRenderedData=new Bt,i._horizontalRevealRequest=null,i}return Vt(t,e),t.prototype.dispose=function(){this._asyncUpdateLineWidths.dispose(),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this.domNode},t.prototype.createVisibleLine=function(){return new G(this._viewLineOptions)},t.prototype.onConfigurationChanged=function(e){this._visibleLines.onConfigurationChanged(e),e.wrappingInfo&&(this._maxLineWidth=0);var t=this._context.configuration;return e.lineHeight&&(this._lineHeight=t.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=t.editor.fontInfo.typicalHalfwidthCharacterWidth),e.wrappingInfo&&(this._isViewportWrapping=t.editor.wrappingInfo.isViewportWrapping),e.viewInfo&&(this._revealHorizontalRightPadding=t.editor.viewInfo.revealHorizontalRightPadding,this._scrollOff=t.editor.viewInfo.cursorSurroundingLines),e.canUseLayerHinting&&(this._canUseLayerHinting=t.editor.canUseLayerHinting),e.fontInfo&&l["a"].applyFontInfo(this.domNode,t.editor.fontInfo),this._onOptionsMaybeChanged(),e.layoutInfo&&(this._maxLineWidth=0),!0},t.prototype._onOptionsMaybeChanged=function(){var e=this._context.configuration,t=new q(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;for(var n=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),o=n;o<=i;o++){var r=this._visibleLines.getVisibleLine(o);r.onOptionsChanged(this._viewLineOptions)}return!0}return!1},t.prototype.onCursorStateChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),i=!1,o=t;o<=n;o++)i=this._visibleLines.getVisibleLine(o).onSelectionChanged()||i;return i},t.prototype.onDecorationsChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),i=t;i<=n;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged();return!0},t.prototype.onFlushed=function(e){var t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t},t.prototype.onLinesChanged=function(e){return this._visibleLines.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._visibleLines.onLinesDeleted(e)},t.prototype.onLinesInserted=function(e){return this._visibleLines.onLinesInserted(e)},t.prototype.onRevealRangeRequest=function(e){var t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.range,e.verticalType),n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:this._horizontalRevealRequest=new Ht(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):this._horizontalRevealRequest=null;var i=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop);return 0===e.scrollType&&i>this._lineHeight?this._context.viewLayout.setScrollPositionSmooth(n):this._context.viewLayout.setScrollPositionNow(n),!0},t.prototype.onScrollChanged=function(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){var 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},t.prototype.onTokensChanged=function(e){return this._visibleLines.onTokensChanged(e)},t.prototype.onZonesChanged=function(e){return this._context.viewLayout.onMaxLineWidthChanged(this._maxLineWidth),this._visibleLines.onZonesChanged(e)},t.prototype.onThemeChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.getPositionFromDOMInfo=function(e,t){var n=this._getViewLineDomNode(e);if(null===n)return null;var i=this._getLineNumberFor(n);if(-1===i)return null;if(i<1||i>this._context.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(i))return new ee["a"](i,1);var o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(ir)return null;var s=this._visibleLines.getVisibleLine(i).getColumnOfNodeOffset(i,e,t),a=this._context.model.getLineMinColumn(i);return sn?-1:this._visibleLines.getVisibleLine(e).getWidth()},t.prototype.linesVisibleRangesForRange=function(e,t){if(this.shouldRender())return null;var n=e.endLineNumber,i=te["a"].intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!i)return null;var o=[],r=0,s=new K(this.domNode.domNode,this._textRangeRestingSpot),a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ee["a"](i.startLineNumber,1)).lineNumber);for(var u=this._visibleLines.getStartLineNumber(),l=this._visibleLines.getEndLineNumber(),c=i.startLineNumber;c<=i.endLineNumber;c++)if(!(cl)){var d=c===i.startLineNumber?i.startColumn:1,h=c===i.endLineNumber?i.endColumn:this._context.model.getLineMaxColumn(c),p=this._visibleLines.getVisibleLine(c).getVisibleRangesForRange(d,h,s);if(p&&0!==p.length){if(t&&cr)){var a=s===t.startLineNumber?t.startColumn:1,u=s===t.endLineNumber?t.endColumn:this._context.model.getLineMaxColumn(s),l=this._visibleLines.getVisibleLine(s).getVisibleRangesForRange(a,u,i);l&&0!==l.length&&(n=n.concat(l))}return 0===n.length?null:n},t.prototype.visibleRangeForPosition=function(e){var t=this.visibleRangesForRange2(new te["a"](e.lineNumber,e.column,e.lineNumber,e.column));return t?t[0]:null},t.prototype.updateLineWidths=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidthsFast=function(){return this._updateLineWidths(!0)},t.prototype._updateLineWidthsSlow=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidths=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),i=1,o=!0,r=t;r<=n;r++){var s=this._visibleLines.getVisibleLine(r);!e||s.getWidthIsFast()?i=Math.max(i,s.getWidth()):o=!1}return o&&1===t&&n===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(i),o},t.prototype.prepareRender=function(){throw new Error("Not supported")},t.prototype.render=function(){throw new Error("Not supported")},t.prototype.renderText=function(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){var t=this._horizontalRevealRequest.lineNumber,n=this._horizontalRevealRequest.startColumn,i=this._horizontalRevealRequest.endColumn,o=this._horizontalRevealRequest.scrollType;if(e.startLineNumber<=t&&t<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();var r=this._computeScrollLeftToRevealRange(t,n,i),s=this._isViewportWrapping;s||this._ensureMaxLineWidth(r.maxHorizontalOffset),0===o?this._context.viewLayout.setScrollPositionSmooth({scrollLeft:r.scrollLeft}):this._context.viewLayout.setScrollPositionNow({scrollLeft:r.scrollLeft})}}this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),this._linesContent.setLayerHinting(this._canUseLayerHinting);var a=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-a),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())},t.prototype._ensureMaxLineWidth=function(e){var t=Math.ceil(e);this._maxLineWidthc&&(c=p.left+p.width)}o=c,l=Math.max(0,l-t.HORIZONTAL_EXTRA_PX),c+=this._revealHorizontalRightPadding;var f=this._computeMinimumScrolling(s,a,l,c);return{scrollLeft:f,maxHorizontalOffset:o}},t.prototype._computeMinimumScrolling=function(e,t,n,i,o,r){e|=0,t|=0,n|=0,i|=0,o=!!o,r=!!r;var s=t-e,a=i-n;return at?Math.max(0,i-s):e:n},t.HORIZONTAL_EXTRA_PX=30,t}(I),Ut=(n("27e6"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),Kt=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._decorationsLeft=n._context.configuration.editor.layoutInfo.decorationsLeft,n._decorationsWidth=n._context.configuration.editor.layoutInfo.decorationsWidth,n._renderResult=null,n._context.addEventHandler(n),n}return Ut(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.layoutInfo&&(this._decorationsLeft=this._context.configuration.editor.layoutInfo.decorationsLeft,this._decorationsWidth=this._context.configuration.editor.layoutInfo.decorationsWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getDecorations=function(e){for(var t=e.getDecorationsInViewport(),n=[],i=0,o=0,r=t.length;o
',a=[],u=t;u<=n;u++){for(var l=u-t,c=i[l],d="",h=0,p=c.length;h';o[s]=u}this._renderResult=o},t.prototype.render=function(e,t){return this._renderResult?this._renderResult[t-e]:""},t}(At),Zt=(n("f20b"),function(){function e(t,n,i,o){this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(i),this.a=e._clamp(o)}return e._clamp=function(e){return e<0?0:e>255?255:0|e},e.Empty=new e(0,0,0,0),e}()),Yt=n("b707"),Xt=function(){function e(){var e=this;this._onDidChange=new s["a"],this.onDidChange=this._onDidChange.event,this._updateColorMap(),Yt["y"].onDidChange(function(t){t.changedColorMap&&e._updateColorMap()})}return e.getInstance=function(){return this._INSTANCE||(this._INSTANCE=new e),this._INSTANCE},e.prototype._updateColorMap=function(){var e=Yt["y"].getColorMap();if(!e)return this._colors=[Zt.Empty],void(this._backgroundIsLight=!0);this._colors=[Zt.Empty];for(var t=1;t=.5,this._onDidChange.fire(void 0)},e.prototype.getColor=function(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]},e.prototype.backgroundIsLight=function(){return this._backgroundIsLight},e._INSTANCE=null,e}(),$t=function(){function e(t,n){var i=760;if(t.length!==i)throw new Error("Invalid x2CharData");var o=190;if(n.length!==o)throw new Error("Invalid x1CharData");this.x2charData=t,this.x1charData=n,this.x2charDataLight=e.soften(t,.8),this.x1charDataLight=e.soften(n,50/60)}return e.soften=function(e,t){for(var n=new Uint8ClampedArray(e.length),i=0,o=e.length;it.width||i+4>t.height)console.warn("bad render request outside image data");else{var u=a?this.x2charDataLight:this.x2charData,l=e._getChIndex(o),c=4*t.width,d=s.r,h=s.g,p=s.b,f=r.r-d,g=r.g-h,m=r.b-p,v=t.data,_=4*l*2,b=i*c+4*n,y=u[_]/255;v[b+0]=d+f*y,v[b+1]=h+g*y,v[b+2]=p+m*y;y=u[_+1]/255;v[b+4]=d+f*y,v[b+5]=h+g*y,v[b+6]=p+m*y,b+=c;y=u[_+2]/255;v[b+0]=d+f*y,v[b+1]=h+g*y,v[b+2]=p+m*y;y=u[_+3]/255;v[b+4]=d+f*y,v[b+5]=h+g*y,v[b+6]=p+m*y,b+=c;y=u[_+4]/255;v[b+0]=d+f*y,v[b+1]=h+g*y,v[b+2]=p+m*y;y=u[_+5]/255;v[b+4]=d+f*y,v[b+5]=h+g*y,v[b+6]=p+m*y,b+=c;y=u[_+6]/255;v[b+0]=d+f*y,v[b+1]=h+g*y,v[b+2]=p+m*y;y=u[_+7]/255;v[b+4]=d+f*y,v[b+5]=h+g*y,v[b+6]=p+m*y}},e.prototype.x1RenderChar=function(t,n,i,o,r,s,a){if(n+1>t.width||i+2>t.height)console.warn("bad render request outside image data");else{var u=a?this.x1charDataLight:this.x1charData,l=e._getChIndex(o),c=4*t.width,d=s.r,h=s.g,p=s.b,f=r.r-d,g=r.g-h,m=r.b-p,v=t.data,_=2*l*1,b=i*c+4*n,y=u[_]/255;v[b+0]=d+f*y,v[b+1]=h+g*y,v[b+2]=p+m*y,b+=c;y=u[_+1]/255;v[b+0]=d+f*y,v[b+1]=h+g*y,v[b+2]=p+m*y}},e.prototype.x2BlockRenderChar=function(e,t,n,i,o,r){if(t+2>e.width||n+4>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=.5,u=o.r,l=o.g,c=o.b,d=i.r-u,h=i.g-l,p=i.b-c,f=u+d*a,g=l+h*a,m=c+p*a,v=e.data,_=n*s+4*t;v[_+0]=f,v[_+1]=g,v[_+2]=m,v[_+4]=f,v[_+5]=g,v[_+6]=m,_+=s,v[_+0]=f,v[_+1]=g,v[_+2]=m,v[_+4]=f,v[_+5]=g,v[_+6]=m,_+=s,v[_+0]=f,v[_+1]=g,v[_+2]=m,v[_+4]=f,v[_+5]=g,v[_+6]=m,_+=s,v[_+0]=f,v[_+1]=g,v[_+2]=m,v[_+4]=f,v[_+5]=g,v[_+6]=m}},e.prototype.x1BlockRenderChar=function(e,t,n,i,o,r){if(t+1>e.width||n+2>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=.5,u=o.r,l=o.g,c=o.b,d=i.r-u,h=i.g-l,p=i.b-c,f=u+d*a,g=l+h*a,m=c+p*a,v=e.data,_=n*s+4*t;v[_+0]=f,v[_+1]=g,v[_+2]=m,_+=s,v[_+0]=f,v[_+1]=g,v[_+2]=m}},e}();function Qt(e){for(var t=new Uint8ClampedArray(e.length),n=0,i=e.length;n=s+y){var w=1,C=s;return new e(a,u,_,b,c,w,C)}w=Math.max(1,Math.floor(n-b*h/p));l&&l.scrollHeight===u&&(l.scrollTop>a&&(w=Math.min(w,l.startLineNumber)),l.scrollTopun)n._context.viewLayout.setScrollPositionNow({scrollTop:o.scrollTop});else{var s=e.posy-t;n._context.viewLayout.setScrollPositionNow({scrollTop:o.getDesiredScrollTopFromDelta(s)})}},function(){n._slider.toggleClassName("active",!1)})}}),n}return rn(t,e),t.prototype.dispose=function(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),e.prototype.dispose.call(this)},t.prototype._getMinimapDomNodeClassName=function(){return"always"===this._options.showSlider?"minimap slider-always":"minimap slider-mouseover"},t.prototype.getDomNode=function(){return this._domNode},t.prototype._applyLayout=function(){this._domNode.setLeft(this._options.minimapLeft),this._domNode.setWidth(this._options.minimapWidth),this._domNode.setHeight(this._options.minimapHeight),this._shadow.setHeight(this._options.minimapHeight),this._canvas.setWidth(this._options.canvasOuterWidth),this._canvas.setHeight(this._options.canvasOuterHeight),this._canvas.domNode.width=this._options.canvasInnerWidth,this._canvas.domNode.height=this._options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._options.canvasInnerHeight,this._slider.setWidth(this._options.minimapWidth)},t.prototype._getBuffer=function(){return this._buffers||(this._buffers=new pn(this._canvas.domNode.getContext("2d"),this._options.canvasInnerWidth,this._options.canvasInnerHeight,this._tokensColorTracker.getColor(2))),this._buffers.getBuffer()},t.prototype._onOptionsMaybeChanged=function(){var e=new ln(this._context.configuration);return!this._options.equals(e)&&(this._options=e,this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName()),!0)},t.prototype.onConfigurationChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.onFlushed=function(e){return this._lastRenderData=null,!0},t.prototype.onLinesChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e),!0},t.prototype.onLinesInserted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e),!0},t.prototype.onScrollChanged=function(e){return this._renderDecorations=!0,!0},t.prototype.onTokensChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)},t.prototype.onTokensColorsChanged=function(e){return this._lastRenderData=null,this._buffers=null,!0},t.prototype.onZonesChanged=function(e){return this._lastRenderData=null,!0},t.prototype.onDecorationsChanged=function(e){return this._renderDecorations=!0,!0},t.prototype.onThemeChanged=function(e){return this._context.model.invalidateMinimapColorCache(),this._renderDecorations=!!this._lastDecorations,!!this._lastDecorations},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){var t=this._options.renderMinimap;if(0===t)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");var n=cn.create(this._options,e.visibleRange.startLineNumber,e.visibleRange.endLineNumber,e.viewportHeight,e.viewportData.whitespaceViewportData.length>0,this._context.model.getLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setTop(n.sliderTop),this._slider.setHeight(n.sliderHeight);var i=e.scrollLeft/this._options.typicalHalfwidthCharacterWidth,o=Math.min(this._options.minimapWidth,Math.round(i*an(this._options.renderMinimap)/this._options.pixelRatio));this._sliderHorizontal.setLeft(o),this._sliderHorizontal.setWidth(this._options.minimapWidth-o),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(n.sliderHeight),this.renderDecorations(n),this._lastRenderData=this.renderLines(n)},t.prototype.renderDecorations=function(e){if(this._renderDecorations){this._renderDecorations=!1;var t=this._context.model.getDecorationsInViewport(new te["a"](e.startLineNumber,1,e.endLineNumber,this._context.model.getLineMaxColumn(e.endLineNumber))),n=this._options,i=n.renderMinimap,o=n.canvasInnerWidth,r=n.canvasInnerHeight,s=sn(i),a=an(i),u=this._context.model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,o,r);for(var c=new Map,d=0;do?c.length-1:_-1;if(C>0){var S=c[C]-w||2;this.renderDecoration(e,n.options.minimap,w,l,S,r)}d&&this.renderLineHighlight(e,n.options.minimap,l,r)},t.prototype.renderLineHighlight=function(e,t,n,i){var o=t.getColor(this._context.theme);e.fillStyle=o&&o.transparent(.5).toString()||"",e.fillRect(0,n,e.canvas.width,i)},t.prototype.renderDecoration=function(e,t,n,i,o,r){var s=t.getColor(this._context.theme);e.fillStyle=s&&s.toString()||"",e.fillRect(n,i,o,r)},t.prototype.renderLines=function(e){var n=this._options.renderMinimap,i=e.startLineNumber,o=e.endLineNumber,r=sn(n);if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){var s=this._lastRenderData._get();return new hn(e,s.imageData,s.lines)}for(var a=this._getBuffer(),u=t._renderUntouchedLines(a,i,o,r,this._lastRenderData),l=u[0],c=u[1],d=u[2],h=this._context.model.getMinimapLinesRenderingData(i,o,d),p=h.tabSize,f=this._tokensColorTracker.getColor(2),g=this._tokensColorTracker.backgroundIsLight(),m=0,v=[],_=0,b=o-i+1;_=0&&Oh)return;var w=l.charCodeAt(f);if(9===w){var C=a-(f+g)%a;g+=C-1,p+=C*d}else if(32===w)p+=d;else for(var S=Oe["v"](w)?2:1,L=0;Lh)return}},t}(I);Object(B["f"])(function(e,t){var n=e.getColor(on["Nb"]);if(n){var i=n.transparent(.5);t.addRule(".monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background: "+i+"; }")}var o=e.getColor(on["Ob"]);if(o){var r=o.transparent(.5);t.addRule(".monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: "+r+"; }")}var s=e.getColor(on["Mb"]);if(s){var a=s.transparent(.5);t.addRule(".monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: "+a+"; }")}var u=e.getColor(on["Lb"]);u&&t.addRule(".monaco-editor .minimap-shadow-visible { box-shadow: "+u+" -6px 0 6px -6px inset; }")});n("725e");var gn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),mn=function(e){function t(t){var n=e.call(this,t)||this;return n._widgets={},n._verticalScrollbarWidth=n._context.configuration.editor.layoutInfo.verticalScrollbarWidth,n._minimapWidth=n._context.configuration.editor.layoutInfo.minimapWidth,n._horizontalScrollbarHeight=n._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,n._editorHeight=n._context.configuration.editor.layoutInfo.height,n._editorWidth=n._context.configuration.editor.layoutInfo.width,n._domNode=Object(h["b"])(document.createElement("div")),E.write(n._domNode,4),n._domNode.setClassName("overlayWidgets"),n}return gn(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return!!e.layoutInfo&&(this._verticalScrollbarWidth=this._context.configuration.editor.layoutInfo.verticalScrollbarWidth,this._minimapWidth=this._context.configuration.editor.layoutInfo.minimapWidth,this._horizontalScrollbarHeight=this._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,this._editorHeight=this._context.configuration.editor.layoutInfo.height,this._editorWidth=this._context.configuration.editor.layoutInfo.width,!0)},t.prototype.addWidget=function(e){var t=Object(h["b"])(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()},t.prototype.setWidgetPosition=function(e,t){var n=this._widgets[e.getId()];return n.preference!==t&&(n.preference=t,this.setShouldRender(),!0)},t.prototype.removeWidget=function(e){var t=e.getId();if(this._widgets.hasOwnProperty(t)){var n=this._widgets[t],i=n.domNode.domNode;delete this._widgets[t],i.parentNode.removeChild(i),this.setShouldRender()}},t.prototype._renderWidget=function(e){var t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){var n=t.domNode.clientHeight;t.setTop(this._editorHeight-n-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._editorWidth);for(var t=Object.keys(this._widgets),n=0,i=t.length;n=3){var o=Math.floor(i/3),r=Math.floor(i/3),s=i-o-r,a=e,u=a+o,l=a+o+s;return[[0,a,u,a,l,a,u,a],[0,o,s,o+s,r,o+s+r,s+r,o+s+r]]}if(2===n){o=Math.floor(i/2),r=i-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}var c=e,d=i;return[[0,c,c,c,c,c,c,c],[0,d,d,d,d,d,d,d]]},e.prototype.equals=function(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight},e}(),yn=function(e){function t(t){var n=e.call(this,t)||this;return n._domNode=Object(h["b"])(document.createElement("canvas")),n._domNode.setClassName("decorationsOverviewRuler"),n._domNode.setPosition("absolute"),n._domNode.setLayerHinting(!0),n._domNode.setAttribute("aria-hidden","true"),n._updateSettings(!1),n._tokensColorTrackerListener=Yt["y"].onDidChange(function(e){e.changedColorMap&&n._updateSettings(!0)}),n._cursorPositions=[],n}return _n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._tokensColorTrackerListener.dispose()},t.prototype._updateSettings=function(e){var t=new bn(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)},t.prototype.onConfigurationChanged=function(e){return this._updateSettings(!1)},t.prototype.onCursorStateChanged=function(e){this._cursorPositions=[];for(var t=0,n=e.selections.length;tt&&(D=t-u),O=D-u,x=D+u}O>b+1||C!==v?(0!==y&&l.fillRect(c[v],_,d[v],b-_),v=C,_=O,b=x):x>b&&(b=x)}l.fillRect(c[v],_,d[v],b-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){var k=2*this._settings.pixelRatio|0,I=k/2|0,E=this._settings.x[7],M=this._settings.w[7];l.fillStyle=this._settings.cursorColor;for(_=-100,b=-100,y=0,w=this._cursorPositions.length;yt&&(D=t-I);O=D-I,x=O+k;O>b+1?(0!==y&&l.fillRect(E,_,M,b-_),_=O,b=x):x>b&&(b=x)}l.fillRect(E,_,M,b-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())},t}(I),wn=n("32f2"),Cn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sn=function(e){function t(t,n){var i=e.call(this)||this;return i._context=t,i._domNode=Object(h["b"])(document.createElement("canvas")),i._domNode.setClassName(n),i._domNode.setPosition("absolute"),i._domNode.setLayerHinting(!0),i._zoneManager=new wn["b"](function(e){return i._context.viewLayout.getVerticalOffsetForLineNumber(e)}),i._zoneManager.setDOMWidth(0),i._zoneManager.setDOMHeight(0),i._zoneManager.setOuterHeight(i._context.viewLayout.getScrollHeight()),i._zoneManager.setLineHeight(i._context.configuration.editor.lineHeight),i._zoneManager.setPixelRatio(i._context.configuration.editor.pixelRatio),i._context.addEventHandler(i),i}return Cn(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._zoneManager.setLineHeight(this._context.configuration.editor.lineHeight),this._render()),e.pixelRatio&&(this._zoneManager.setPixelRatio(this._context.configuration.editor.pixelRatio),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},t.prototype.onFlushed=function(e){return this._render(),!0},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0},t.prototype.onZonesChanged=function(e){return this._render(),!0},t.prototype.getDomNode=function(){return this._domNode.domNode},t.prototype.setLayout=function(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);var 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())},t.prototype.setZones=function(e){this._zoneManager.setZones(e),this._render()},t.prototype._render=function(){if(0===this._zoneManager.getOuterHeight())return!1;var e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),i=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,i,e),!0},t.prototype._renderOneLane=function(e,t,n,i){for(var o=0,r=0,s=0,a=0,u=t;a=d?s=Math.max(s,h):(e.fillRect(0,r,i,s-r),r=d,s=h)}e.fillRect(0,r,i,s-r)},t}(D),Ln=(n("ef37"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),On=function(e){function t(t){var n=e.call(this,t)||this;return n.domNode=Object(h["b"])(document.createElement("div")),n.domNode.setAttribute("role","presentation"),n.domNode.setAttribute("aria-hidden","true"),n.domNode.setClassName("view-rulers"),n._renderedRulers=[],n._rulers=n._context.configuration.editor.viewInfo.rulers,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n}return Ln(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return!!(e.viewInfo||e.layoutInfo||e.fontInfo)&&(this._rulers=this._context.configuration.editor.viewInfo.rulers,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,!0)},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged},t.prototype.prepareRender=function(e){},t.prototype._ensureRulersCount=function(){var e=this._renderedRulers.length,t=this._rulers.length;if(e!==t)if(e0){var r=Object(h["b"])(document.createElement("div"));r.setClassName("view-ruler"),r.setWidth(i),this.domNode.appendChild(r),this._renderedRulers.push(r),o--}}else{var s=e-t;while(s>0){r=this._renderedRulers.pop();this.domNode.removeChild(r),s--}}},t.prototype.render=function(e){this._ensureRulersCount();for(var t=0,n=this._rulers.length;t0;return this._shouldShow!==e&&(this._shouldShow=e,!0)},t.prototype.getDomNode=function(){return this._domNode},t.prototype._updateWidth=function(){var e=this._context.configuration.editor.layoutInfo,t=0;return t=0===e.renderMinimap||e.minimapWidth>0&&0===e.minimapLeft?e.width:e.width-e.minimapWidth-e.verticalScrollbarWidth,this._width!==t&&(this._width=t,!0)},t.prototype.onConfigurationChanged=function(e){var t=!1;return e.viewInfo&&(this._useShadows=this._context.configuration.editor.viewInfo.scrollbar.useShadows),e.layoutInfo&&(t=this._updateWidth()),this._updateShouldShow()||t},t.prototype.onScrollChanged=function(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")},t}(I);Object(B["f"])(function(e,t){var n=e.getColor(on["Lb"]);n&&t.addRule(".monaco-editor .scroll-decoration { box-shadow: "+n+" 0 6px 6px -6px inset; }")});n("782d");var Dn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kn=function(){function e(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}return e}(),In=function(){function e(e,t){this.lineNumber=e,this.ranges=t}return e}();function En(e){return new kn(e)}function Mn(e){return new In(e.lineNumber,e.ranges.map(En))}var Tn=f["g"],Pn=function(e){function t(t){var n=e.call(this)||this;return n._previousFrameVisibleRangesWithStyle=[],n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._roundedSelection=n._context.configuration.editor.viewInfo.roundedSelection,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._selections=[],n._renderResult=null,n._context.addEventHandler(n),n}return Dn(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._roundedSelection=this._context.configuration.editor.viewInfo.roundedSelection),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._visibleRangesHaveGaps=function(e){for(var t=0,n=e.length;t1)return!0}return!1},t.prototype._enrichVisibleRangesWithStyle=function(e,t,n){var i=this._typicalHalfwidthCharacterWidth/4,o=null,r=null;if(n&&n.length>0&&t.length>0){var s=t[0].lineNumber;if(s===e.startLineNumber)for(var a=0;!o&&a=0;a--)n[a].lineNumber===u&&(r=n[a].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}a=0;for(var l=t.length;a0){var g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Rn(d-g)g&&(p.top=1),Rn(h-m)'},t.prototype._actualRenderOneSelection=function(e,n,i,o){for(var r=o.length>0&&o[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),u=o.length>0?o[0].lineNumber:0,l=o.length>0?o[o.length-1].lineNumber:0,c=0,d=o.length;c1,c)}}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.SELECTION_CLASS_NAME="selected-text",t.SELECTION_TOP_LEFT="top-left-radius",t.SELECTION_BOTTOM_LEFT="bottom-left-radius",t.SELECTION_TOP_RIGHT="top-right-radius",t.SELECTION_BOTTOM_RIGHT="bottom-right-radius",t.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",t.ROUNDED_PIECE_WIDTH=10,t}(ke);function Rn(e){return e<0?-e:e}Object(B["f"])(function(e,t){var n=e.getColor(on["H"]);n&&t.addRule(".monaco-editor .focused .selected-text { background-color: "+n+"; }");var i=e.getColor(on["E"]);i&&t.addRule(".monaco-editor .selected-text { background-color: "+i+"; }");var o=e.getColor(on["I"]);o&&t.addRule(".monaco-editor .view-line span.inline-selected-text { color: "+o+"; }")});n("d93b");var An=n("fd49"),Fn=function(){function e(e,t,n,i,o,r){this.top=e,this.left=t,this.width=n,this.height=i,this.textContent=o,this.textContentClassName=r}return e}(),jn=function(){function e(e){this._context=e,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineHeight=this._context.configuration.editor.lineHeight,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Object(h["b"])(document.createElement("div")),this._domNode.setClassName("cursor"),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),l["a"].applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._domNode.setDisplay("none"),this._position=new ee["a"](1,1),this._lastRenderedContent="",this._renderData=null}return e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return this._position},e.prototype.show=function(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)},e.prototype.hide=function(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)},e.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(l["a"].applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),e.viewInfo&&(this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth)),!0},e.prototype.onCursorPositionChanged=function(e){return this._position=e,!0},e.prototype._prepareRender=function(e){var t="",n="";if(this._cursorStyle===An["g"].Line||this._cursorStyle===An["g"].LineThin){var i,r=e.visibleRangeForPosition(this._position);if(!r)return null;if(this._cursorStyle===An["g"].Line){if(i=o["q"](this._lineCursorWidth>0?this._lineCursorWidth:2),i>2){var s=this._context.model.getLineContent(this._position.lineNumber);t=s.charAt(this._position.column-1)}}else i=o["q"](1);var a=r.left;i>=2&&a>=1&&(a-=1);var u=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new Fn(u,a,i,this._lineHeight,t,n)}var l=e.linesVisibleRangesForRange(new te["a"](this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+1),!1);if(!l||0===l.length||0===l[0].ranges.length)return null;var c=l[0].ranges[0],d=c.width<1?this._typicalHalfwidthCharacterWidth:c.width;if(this._cursorStyle===An["g"].Block){var h=this._context.model.getViewLineData(this._position.lineNumber);t=h.content.charAt(this._position.column-1),Oe["w"](h.content.charCodeAt(this._position.column-1))&&(t+=h.content.charAt(this._position.column));var p=h.tokens.findTokenIndexAtOffset(this._position.column-1);n=h.tokens.getClassName(p)}var f=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,g=this._lineHeight;return this._cursorStyle!==An["g"].Underline&&this._cursorStyle!==An["g"].UnderlineThin||(f+=this._lineHeight-2,g=2),new Fn(f,c.left,d,g,t,n)},e.prototype.prepareRender=function(e){this._renderData=this._prepareRender(e)},e.prototype.render=function(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName("cursor "+this._renderData.textContentClassName),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)},e}(),Wn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Vn=function(e){function t(t){var n=e.call(this,t)||this;return n._readOnly=n._context.configuration.editor.readOnly,n._cursorBlinking=n._context.configuration.editor.viewInfo.cursorBlinking,n._cursorStyle=n._context.configuration.editor.viewInfo.cursorStyle,n._cursorSmoothCaretAnimation=n._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation,n._selectionIsEmpty=!0,n._isVisible=!1,n._primaryCursor=new jn(n._context),n._secondaryCursors=[],n._renderData=[],n._domNode=Object(h["b"])(document.createElement("div")),n._domNode.setAttribute("role","presentation"),n._domNode.setAttribute("aria-hidden","true"),n._updateDomClassName(),n._domNode.appendChild(n._primaryCursor.getDomNode()),n._startCursorBlinkAnimation=new m["e"],n._cursorFlatBlinkInterval=new m["c"],n._blinkingEnabled=!1,n._editorHasFocus=!1,n._updateBlinking(),n}return Wn(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){e.readOnly&&(this._readOnly=this._context.configuration.editor.readOnly),e.viewInfo&&(this._cursorBlinking=this._context.configuration.editor.viewInfo.cursorBlinking,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._cursorSmoothCaretAnimation=this._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation),this._primaryCursor.onConfigurationChanged(e),this._updateBlinking(),e.viewInfo&&this._updateDomClassName();for(var t=0,n=this._secondaryCursors.length;tt.length){var r=this._secondaryCursors.length-t.length;for(i=0;in){var r=t-n;for(o=0;o=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)},e.prototype._getAll=function(){var e=[];e[0]=this.primaryCursor;for(var t=0,n=this.secondaryCursors.length;th&&L.index--}e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),o--}}}}},e}(),ni=n("b272"),ii=n("191f"),oi=n("8ae8"),ri=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function si(e){for(var t=0,n=e.length;t=t.length)return!1;if(!t[n].strictContainsRange(e[n]))return!1}return!0},e}(),ci=function(e){function t(t,n,i){var o=e.call(this)||this;o._onDidReachMaxCursorCount=o._register(new s["a"]),o.onDidReachMaxCursorCount=o._onDidReachMaxCursorCount.event,o._onDidAttemptReadOnlyEdit=o._register(new s["a"]),o.onDidAttemptReadOnlyEdit=o._onDidAttemptReadOnlyEdit.event,o._onDidChange=o._register(new s["a"]),o.onDidChange=o._onDidChange.event,o._configuration=t,o._model=n,o._knownModelVersionId=o._model.getVersionId(),o._viewModel=i,o.context=new ne["c"](o._configuration,o._model,o._viewModel),o._cursors=new ti(o.context),o._isHandling=!1,o._isDoingComposition=!1,o._columnSelectData=null,o._autoClosedActions=[],o._prevEditOperationType=0,o._register(o._model.onDidChangeRawContent(function(e){if(o._knownModelVersionId=e.versionId,!o._isHandling){var t=e.containsEvent(1);o._onModelContentChanged(t)}})),o._register(i.addEventListener(function(e){si(e)&&o._knownModelVersionId===o._model.getVersionId()&&o.setStates("viewModel",0,o.getAll())}));var r=function(){o.context=new ne["c"](o._configuration,o._model,o._viewModel),o._cursors.updateContext(o.context)};return o._register(o._model.onDidChangeLanguage(function(e){r()})),o._register(o._model.onDidChangeLanguageConfiguration(function(){r()})),o._register(o._model.onDidChangeOptions(function(){r()})),o._register(o._configuration.onDidChange(function(e){ne["b"].shouldRecreate(e)&&r()})),o}return ri(t,e),t.prototype.dispose=function(){this._cursors.dispose(),this._autoClosedActions=Object(a["f"])(this._autoClosedActions),e.prototype.dispose.call(this)},t.prototype._validateAutoClosedActions=function(){if(this._autoClosedActions.length>0)for(var e=this._cursors.getSelections(),t=0;tt.MAX_CURSOR_COUNT&&(i=i.slice(0,t.MAX_CURSOR_COUNT),this._onDidReachMaxCursorCount.fire(void 0));var o=new ui(this._model,this);this._cursors.setStates(i),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,n,o)},t.prototype.setColumnSelectData=function(e){this._columnSelectData=e},t.prototype.reveal=function(e,t,n){this._revealRange(t,0,e,n)},t.prototype.revealRange=function(e,t,n,i){this.emitCursorRevealRange(t,n,e,i)},t.prototype.scrollTo=function(e){this._viewModel.viewLayout.setScrollPositionSmooth({scrollTop:e})},t.prototype.saveState=function(){for(var e=[],t=this._cursors.getSelections(),n=0,i=t.length;n0&&this._pushAutoClosedAction(n,i),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}},t.prototype._interpretCommandResult=function(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()},t.prototype._emitStateChangedIfNecessary=function(e,t,n){var i=new ui(this._model,this);if(i.equals(n))return!1;var o=this._cursors.getSelections(),r=this._cursors.getViewSelections();try{var s=this._beginEmit();s.emit(new je(r))}finally{this._endEmit()}return n&&n.cursorState.length===i.cursorState.length&&!i.cursorState.some(function(e,t){return!e.modelState.equals(n.cursorState[t].modelState)})||this._onDidChange.fire(new ai(o,e||"keyboard",t)),!0},t.prototype._revealRange=function(e,t,n,i){var o=this._cursors.getViewPositions(),r=o[0];if(1===e)for(var s=1;s1)return;var a=new te["a"](r.lineNumber,r.column,r.lineNumber,r.column);this.emitCursorRevealRange(a,t,n,i)},t.prototype.emitCursorRevealRange=function(e,t,n,i){try{var o=this._beginEmit();o.emit(new qe(e,t,n,i))}finally{this._endEmit()}},t.prototype._findAutoClosingPairs=function(e){if(!e.length)return null;for(var t=[],n=0,i=e.length;n=0)return null;var r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;var s=r[1],a=this.context.config.autoClosingPairsClose2.get(s);if(!a||1!==a.length)return null;var u=a[0].open,l=o.text.length-r[2].length-1,c=o.text.lastIndexOf(u,l-1);if(-1===c)return null;t.push([c,l])}return t},t.prototype.executeEdits=function(e,t,n){var i=this,o=null;"snippet"===e&&(o=this._findAutoClosingPairs(t)),o&&(t[0]._isTracked=!0);var r=[],s=[],a=this._model.pushEditOperations(this.getSelections(),t,function(e){if(o)for(var t=0,a=o.length;t0&&this._pushAutoClosedAction(r,s)},t.prototype.trigger=function(e,t,n){var i=oi["b"];if(t!==i.CompositionStart)if(t===i.CompositionEnd&&(this._isDoingComposition=!1),this._configuration.editor.readOnly)this._onDidAttemptReadOnlyEdit.fire(void 0);else{var o=new ui(this._model,this),s=0;t!==i.Undo&&t!==i.Redo&&this._cursors.stopTrackingSelections(),this._cursors.ensureValidState(),this._isHandling=!0;try{switch(t){case i.Type:this._type(e,n.text);break;case i.ReplacePreviousChar:this._replacePreviousChar(n.text,n.replaceCharCnt);break;case i.Paste:s=4,this._paste(n.text,n.pasteOnNewLine,n.multicursorText);break;case i.Cut:this._cut();break;case i.Undo:s=5,this._interpretCommandResult(this._model.undo());break;case i.Redo:s=6,this._interpretCommandResult(this._model.redo());break;case i.ExecuteCommand:this._externalExecuteCommand(n);break;case i.ExecuteCommands:this._externalExecuteCommands(n);break;case i.CompositionEnd:this._interpretCompositionEnd(e);break}}catch(a){Object(r["e"])(a)}this._isHandling=!1,t!==i.Undo&&t!==i.Redo&&this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,s,o)&&this._revealRange(0,0,!0,0)}else this._isDoingComposition=!0},t.prototype._interpretCompositionEnd=function(e){if(!this._isDoingComposition&&"keyboard"===e){var t=li.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(ii["a"].compositionEndWithInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t))}},t.prototype._type=function(e,t){if(this._isDoingComposition||"keyboard"!==e)this._executeEditOperation(ii["a"].typeWithoutInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t));else for(var n=0,i=t.length;n0&&(r[0]._isTracked=!0);var u=e.model.pushEditOperations(e.selectionsBefore,r,function(n){for(var i=[],o=0;o0?(i[n].sort(u),l[n]=t[n].computeCursorState(e.model,{getInverseEditOperations:function(){return i[n]},getTrackedSelection:function(t){var n=parseInt(t,10),i=e.model._getTrackedRange(e.trackedRanges[n]);return 0===e.trackedRangesDirection[n]?new pe["a"](i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new pe["a"](i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn)}})):l[n]=e.selectionsBefore[n]};for(o=0;oo.identifier.major?i.identifier.major:o.identifier.major,t[r.toString()]=!0;for(var s=0;s0&&n--}}return t},e}(),hi=n("f58f"),pi=n("c101"),fi=n("4d05"),gi=n("42e3"),mi=function(){function e(){this._instanceId=Oe["I"](++e.INSTANCE_COUNT),this._heights=[],this._minWidths=[],this._ids=[],this._afterLineNumbers=[],this._ordinals=[],this._prefixSum=[],this._prefixSumValidIndex=-1,this._whitespaceId2Index={},this._lastWhitespaceId=0,this._minWidth=-1}return e.findInsertionIndex=function(e,t,n,i){var o=0,r=e.length;while(o>>1;t===e[s]?i=t&&(this._whitespaceId2Index[l]=c+1)}this._whitespaceId2Index[e]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)},e.prototype.changeWhitespace=function(e,t,n){t|=0,n|=0;var i=!1;return i=this.changeWhitespaceHeight(e,n)||i,i=this.changeWhitespaceAfterLineNumber(e,t)||i,i},e.prototype.changeWhitespaceHeight=function(e,t){if(t|=0,this._whitespaceId2Index.hasOwnProperty(e)){var n=this._whitespaceId2Index[e];if(this._heights[n]!==t)return this._heights[n]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1),!0}return!1},e.prototype.changeWhitespaceAfterLineNumber=function(t,n){if(n|=0,this._whitespaceId2Index.hasOwnProperty(t)){var i=this._whitespaceId2Index[t];if(this._afterLineNumbers[i]!==n){var o=this._ordinals[i],r=this._heights[i],s=this._minWidths[i];this.removeWhitespace(t);var a=e.findInsertionIndex(this._afterLineNumbers,n,this._ordinals,o);return this._insertWhitespaceAtIndex(t,a,n,o,r,s),!0}}return!1},e.prototype.removeWhitespace=function(e){if(this._whitespaceId2Index.hasOwnProperty(e)){var t=this._whitespaceId2Index[e];return delete this._whitespaceId2Index[e],this._removeWhitespaceAtIndex(t),this._minWidth=-1,!0}return!1},e.prototype._removeWhitespaceAtIndex=function(e){e|=0,this._heights.splice(e,1),this._minWidths.splice(e,1),this._ids.splice(e,1),this._afterLineNumbers.splice(e,1),this._ordinals.splice(e,1),this._prefixSum.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1);for(var t=Object.keys(this._whitespaceId2Index),n=0,i=t.length;n=e&&(this._whitespaceId2Index[o]=r-1)}},e.prototype.onLinesDeleted=function(e,t){e|=0,t|=0;for(var n=0,i=this._afterLineNumbers.length;nt&&(this._afterLineNumbers[n]-=t-e+1)}},e.prototype.onLinesInserted=function(e,t){e|=0,t|=0;for(var n=0,i=this._afterLineNumbers.length;n=t.length||t[s+1]>=e)return s;n=s+1|0}else i=s-1|0}return-1},e.prototype._findFirstWhitespaceAfterLineNumber=function(e){e|=0;var t=this._findLastWhitespaceBeforeLineNumber(e),n=t+1;return n1?this._lineHeight*(e-1):0;var n=this._whitespaces.getAccumulatedHeightBeforeLineNumber(e);return t+n},e.prototype.getWhitespaceAccumulatedHeightBeforeLineNumber=function(e){return this._whitespaces.getAccumulatedHeightBeforeLineNumber(e)},e.prototype.getWhitespaceMinWidth=function(){return this._whitespaces.getMinWidth()},e.prototype.isAfterLines=function(e){var t=this.getLinesTotalHeight();return e>t},e.prototype.getLineNumberAtOrAfterVerticalOffset=function(e){if(e|=0,e<0)return 1;var t=0|this._lineCount,n=this._lineHeight,i=1,o=t;while(i=s+n)i=r+1;else{if(e>=s)return r;o=r}}return i>t?t:i},e.prototype.getLinesViewportData=function(e,t){e|=0,t|=0;var n,i,o=this._lineHeight,r=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(r),a=0|this._lineCount,u=0|this._whitespaces.getFirstWhitespaceIndexAfterLineNumber(r),l=0|this._whitespaces.getCount();-1===u?(u=l,i=a+1,n=0):(i=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));var c=s,d=c,h=5e5,p=0;s>=h&&(p=Math.floor(s/h)*h,p=Math.floor(p/o)*o,d-=p);for(var f=[],g=e+(t-e)/2,m=-1,v=r;v<=a;v++){if(-1===m){var _=c,b=c+o;(_<=g&&gg)&&(m=v)}c+=o,f[v-r]=d,d+=o;while(i===v)d+=n,c+=n,u++,u>=l?i=a+1:(i=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));if(c>=t){a=v;break}}-1===m&&(m=a);var y=0|this.getVerticalOffsetForLineNumber(a),w=r,C=a;return wt&&C--,{bigNumbersDelta:p,startLineNumber:r,endLineNumber:a,relativeVerticalOffset:f,centeredLineNumber:m,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:C}},e.prototype.getVerticalOffsetForWhitespaceIndex=function(e){e|=0;var t,n,i=this._whitespaces.getAfterLineNumberForWhitespaceIndex(e);return t=i>=1?this._lineHeight*i:0,n=e>0?this._whitespaces.getAccumulatedHeight(e-1):0,t+n},e.prototype.getWhitespaceIndexAtOrAfterVerticallOffset=function(e){e|=0;var t,n,i,o=0,r=this._whitespaces.getCount()-1;if(r<0)return-1;var s=this.getVerticalOffsetForWhitespaceIndex(r),a=this._whitespaces.getHeightForWhitespaceIndex(r);if(e>=s+a)return-1;while(o=n+i)o=t+1;else{if(e>=n)return t;r=t}return o},e.prototype.getWhitespaceAtVerticalOffset=function(e){e|=0;var t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this._whitespaces.getCount())return null;var n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;var i=this._whitespaces.getHeightForWhitespaceIndex(t),o=this._whitespaces.getIdForWhitespaceIndex(t),r=this._whitespaces.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:n,height:i}},e.prototype.getWhitespaceViewportData=function(e,t){e|=0,t|=0;var n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),i=this._whitespaces.getCount()-1;if(n<0)return[];for(var o=[],r=n;r<=i;r++){var s=this.getVerticalOffsetForWhitespaceIndex(r),a=this._whitespaces.getHeightForWhitespaceIndex(r);if(s>=t)break;o.push({id:this._whitespaces.getIdForWhitespaceIndex(r),afterLineNumber:this._whitespaces.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:s,height:a})}return o},e.prototype.getWhitespaces=function(){return this._whitespaces.getWhitespaces(this._lineHeight)},e}(),_i=n("a8d0"),bi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yi=125,wi=function(e){function t(t,n,i){var o=e.call(this)||this;return o._configuration=t,o._linesLayout=new vi(n,o._configuration.editor.lineHeight),o.scrollable=o._register(new gi["a"](0,i)),o._configureSmoothScrollDuration(),o.scrollable.setScrollDimensions({width:t.editor.layoutInfo.contentWidth,height:t.editor.layoutInfo.contentHeight}),o.onDidScroll=o.scrollable.onScroll,o._updateHeight(),o}return bi(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onHeightMaybeChanged=function(){this._updateHeight()},t.prototype._configureSmoothScrollDuration=function(){this.scrollable.setSmoothScrollDuration(this._configuration.editor.viewInfo.smoothScrolling?yi:0)},t.prototype.onConfigurationChanged=function(e){e.lineHeight&&this._linesLayout.setLineHeight(this._configuration.editor.lineHeight),e.layoutInfo&&this.scrollable.setScrollDimensions({width:this._configuration.editor.layoutInfo.contentWidth,height:this._configuration.editor.layoutInfo.contentHeight}),e.viewInfo&&this._configureSmoothScrollDuration(),this._updateHeight()},t.prototype.onFlushed=function(e){this._linesLayout.onFlushed(e)},t.prototype.onLinesDeleted=function(e,t){this._linesLayout.onLinesDeleted(e,t)},t.prototype.onLinesInserted=function(e,t){this._linesLayout.onLinesInserted(e,t)},t.prototype._getHorizontalScrollbarHeight=function(e){return 2===this._configuration.editor.viewInfo.scrollbar.horizontal?0:e.width>=e.scrollWidth?0:this._configuration.editor.viewInfo.scrollbar.horizontalScrollbarSize},t.prototype._getTotalHeight=function(){var e=this.scrollable.getScrollDimensions(),t=this._linesLayout.getLinesTotalHeight();return this._configuration.editor.viewInfo.scrollBeyondLastLine?t+=e.height-this._configuration.editor.lineHeight:t+=this._getHorizontalScrollbarHeight(e),Math.max(e.height,t)},t.prototype._updateHeight=function(){this.scrollable.setScrollDimensions({scrollHeight:this._getTotalHeight()})},t.prototype.getCurrentViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getCurrentScrollPosition();return new _i["f"](t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype.getFutureViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getFutureScrollPosition();return new _i["f"](t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype._computeScrollWidth=function(e,t){var n=this._configuration.editor.wrappingInfo.isViewportWrapping;if(!n){var i=this._configuration.editor.viewInfo.scrollBeyondLastColumn*this._configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,t,o)}return Math.max(e,t)},t.prototype.onMaxLineWidthChanged=function(e){var t=this._computeScrollWidth(e,this.getCurrentViewport().width);this.scrollable.setScrollDimensions({scrollWidth:t}),this._updateHeight()},t.prototype.saveState=function(){var e=this.scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),i=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);return{scrollTop:t,scrollTopWithoutViewZones:t-i,scrollLeft:e.scrollLeft}},t.prototype.addWhitespace=function(e,t,n,i){return this._linesLayout.insertWhitespace(e,t,n,i)},t.prototype.changeWhitespace=function(e,t,n){return this._linesLayout.changeWhitespace(e,t,n)},t.prototype.removeWhitespace=function(e){return this._linesLayout.removeWhitespace(e)},t.prototype.getVerticalOffsetForLineNumber=function(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)},t.prototype.isAfterLines=function(e){return this._linesLayout.isAfterLines(e)},t.prototype.getLineNumberAtVerticalOffset=function(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)},t.prototype.getWhitespaceAtVerticalOffset=function(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)},t.prototype.getLinesViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)},t.prototype.getLinesViewportDataAtScrollTop=function(e){var 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)},t.prototype.getWhitespaceViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)},t.prototype.getWhitespaces=function(){return this._linesLayout.getWhitespaces()},t.prototype.getScrollWidth=function(){var e=this.scrollable.getScrollDimensions();return e.scrollWidth},t.prototype.getScrollHeight=function(){var e=this.scrollable.getScrollDimensions();return e.scrollHeight},t.prototype.getCurrentScrollLeft=function(){var e=this.scrollable.getCurrentScrollPosition();return e.scrollLeft},t.prototype.getCurrentScrollTop=function(){var e=this.scrollable.getCurrentScrollPosition();return e.scrollTop},t.prototype.validateScrollPosition=function(e){return this.scrollable.validateScrollPosition(e)},t.prototype.setScrollPositionNow=function(e){this.scrollable.setScrollPositionNow(e)},t.prototype.setScrollPositionSmooth=function(e){this.scrollable.setScrollPositionSmooth(e)},t.prototype.deltaScrollNow=function(e,t){var n=this.scrollable.getCurrentScrollPosition();this.scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})},t}(a["a"]),Ci=n("3170"),Si=n("507c"),Li=n("2de5"),Oi=n("b57f"),xi=function(){function e(e,t){this.outputLineIndex=e,this.outputOffset=t}return e}(),Ni=function(){function e(e){this._lines=e}return e.prototype.convertViewPositionToModelPosition=function(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)},e.prototype.convertViewRangeToModelRange=function(e){var t=this._lines.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this._lines.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new te["a"](t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.validateViewPosition=function(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)},e.prototype.validateViewRange=function(e,t){var n=this._lines.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),i=this._lines.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new te["a"](n.lineNumber,n.column,i.lineNumber,i.column)},e.prototype.convertModelPositionToViewPosition=function(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)},e.prototype.convertModelRangeToViewRange=function(e){var t=this._lines.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),n=this._lines.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return new te["a"](t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.modelPositionIsVisible=function(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)},e}(),Di=function(){function e(e,t,n,i,o,r){this.model=e,this._validModelVersionId=-1,this.tabSize=n,this.wrappingColumn=i,this.columnsForFullWidthChar=o,this.wrappingIndent=r,this.linePositionMapperFactory=t,this._constructLines(!0)}return e.prototype.dispose=function(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])},e.prototype.createCoordinatesConverter=function(){return new Ni(this)},e.prototype._ensureValidState=function(){var e=this.model.getVersionId();if(e!==this._validModelVersionId)throw new Error("ViewModel is out of sync with Model!");this.lines.length!==this.model.getLineCount()&&this._constructLines(!1)},e.prototype._constructLines=function(e){var t=this;this.lines=[],e&&(this.hiddenAreasIds=[]);for(var n=this.model.getLinesContent(),i=n.length,o=new Uint32Array(i),r=this.hiddenAreasIds.map(function(e){return t.model.getDecorationRange(e)}).sort(te["a"].compareRangesUsingStarts),s=1,a=0,u=-1,l=u+1=s&&d<=a,p=Mi(this.linePositionMapperFactory,n[c],this.tabSize,this.wrappingColumn,this.columnsForFullWidthChar,this.wrappingIndent,!h);o[c]=p.getViewLineCount(),this.lines[c]=p}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new Li["b"](o)},e.prototype.getHiddenAreas=function(){var e=this;return this.hiddenAreasIds.map(function(t){return e.model.getDecorationRange(t)})},e.prototype._reduceRanges=function(e){var t=this;if(0===e.length)return[];for(var n=e.map(function(e){return t.model.validateRange(e)}).sort(te["a"].compareRangesUsingStarts),i=[],o=n[0].startLineNumber,r=n[0].endLineNumber,s=1,a=n.length;sr+1?(i.push(new te["a"](o,1,r,1)),o=u.startLineNumber,r=u.endLineNumber):u.endLineNumber>r&&(r=u.endLineNumber)}return i.push(new te["a"](o,1,r,1)),i},e.prototype.setHiddenAreas=function(e){var t=this,n=this._reduceRanges(e),i=this.hiddenAreasIds.map(function(e){return t.model.getDecorationRange(e)}).sort(te["a"].compareRangesUsingStarts);if(n.length===i.length){for(var o=!1,r=0;r=d&&m<=h?this.lines[r].isVisible()&&(this.lines[r]=this.lines[r].setVisible(!1),v=!0):(g=!0,this.lines[r].isVisible()||(this.lines[r]=this.lines[r].setVisible(!0),v=!0)),v){var _=this.lines[r].getViewLineCount();this.prefixSumComputer.changeValue(r,_)}}return g||this.setHiddenAreas([]),!0},e.prototype.modelPositionIsVisible=function(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()},e.prototype.setTabSize=function(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1),!0)},e.prototype.setWrappingSettings=function(e,t,n){return(this.wrappingIndent!==e||this.wrappingColumn!==t||this.columnsForFullWidthChar!==n)&&(this.wrappingIndent=e,this.wrappingColumn=t,this.columnsForFullWidthChar=n,this._constructLines(!1),!0)},e.prototype.onModelFlushed=function(){this._constructLines(!0)},e.prototype.onModelLinesDeleted=function(e,t,n){if(e<=this._validModelVersionId)return null;var i=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,o=this.prefixSumComputer.getAccumulatedValue(n-1);return this.lines.splice(t-1,n-t+1),this.prefixSumComputer.removeValues(t-1,n-t+1),new Ue(i,o)},e.prototype.onModelLinesInserted=function(e,t,n,i){if(e<=this._validModelVersionId)return null;for(var o=this.getHiddenAreas(),r=!1,s=new ee["a"](t,1),a=0,u=o;aa?(l=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,c=l+a-1,p=c+1,f=p+(o-a)-1,u=!0):ot?t:e},e.prototype.warmUpLookupCache=function(e,t){this.prefixSumComputer.warmUpCache(e-1,t-1)},e.prototype.getActiveIndentGuide=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);var i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),s=this.model.getActiveIndentGuide(i.lineNumber,o.lineNumber,r.lineNumber),a=this.convertModelPositionToViewPosition(s.startLineNumber,1),u=this.convertModelPositionToViewPosition(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:u.lineNumber,indent:s.indent}},e.prototype.getViewLinesIndentGuides=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);for(var n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),i=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),o=[],r=[],s=[],a=n.lineNumber-1,u=i.lineNumber-1,l=null,c=a;c<=u;c++){var d=this.lines[c];if(d.isVisible()){var h=d.getViewLineNumberOfModelPosition(0,c===a?n.column:1),p=d.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(c+1)),f=p-h+1,g=0;f>1&&1===d.getViewLineMinColumn(this.model,c+1,p)&&(g=0===h?1:2),r.push(f),s.push(g),null===l&&(l=new ee["a"](c+1,0))}else null!==l&&(o=o.concat(this.model.getLinesIndentGuides(l.lineNumber,c)),l=null)}null!==l&&(o=o.concat(this.model.getLinesIndentGuides(l.lineNumber,i.lineNumber)),l=null);for(var m=t-e+1,v=new Array(m),_=0,b=0,y=o.length;bt&&(p=!0,h=t-o+1);var f=d+h;if(c.getViewLinesData(this.model,u+1,d,f,o-e,n,a),o+=h,p)break}}return a},e.prototype.validateViewPosition=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e);var i=this.prefixSumComputer.getIndexOf(e-1),o=i.index,r=i.remainder,s=this.lines[o],a=s.getViewLineMinColumn(this.model,o+1,r),u=s.getViewLineMaxColumn(this.model,o+1,r);tu&&(t=u);var l=s.getModelColumnOfViewPosition(r,t),c=this.model.validatePosition(new ee["a"](o+1,l));return c.equals(n)?new ee["a"](e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)},e.prototype.convertViewPositionToModelPosition=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e);var n=this.prefixSumComputer.getIndexOf(e-1),i=n.index,o=n.remainder,r=this.lines[i].getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new ee["a"](i+1,r))},e.prototype.convertModelPositionToViewPosition=function(e,t){this._ensureValidState();var n=this.model.validatePosition(new ee["a"](e,t)),i=n.lineNumber,o=n.column,r=i-1,s=!1;while(r>0&&!this.lines[r].isVisible())r--,s=!0;if(0===r&&!this.lines[r].isVisible())return new ee["a"](1,1);var a,u=1+(0===r?0:this.prefixSumComputer.getAccumulatedValue(r-1));return a=s?this.lines[r].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(r+1)):this.lines[i-1].getViewPositionOfModelPosition(u,o),a},e.prototype._getViewLineNumberForModelPosition=function(e,t){var n=e-1;if(this.lines[n].isVisible()){var i=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(i,t)}while(n>0&&!this.lines[n].isVisible())n--;if(0===n&&!this.lines[n].isVisible())return 1;var o=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(n+1))},e.prototype.getAllOverviewRulerDecorations=function(e,t,n){for(var i=this.model.getOverviewRulerDecorations(e,t),o=new Ri,r=0,s=i;rt.id?1:0:n});for(var h=[],p=0,f=null,g=0,m=r;g0&&(r=this.wrappedIndent+r),r},e.prototype.getViewLineLength=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var i=this.getInputStartOffsetOfOutputLineIndex(n),o=this.getInputEndOffsetOfOutputLineIndex(e,t,n),r=o-i;return n>0&&(r=this.wrappedIndent.length+r),r},e.prototype.getViewLineMinColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return n>0?this.wrappedIndentLength+1:1},e.prototype.getViewLineMaxColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineContent(e,t,n).length+1},e.prototype.getViewLineData=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var i=this.getInputStartOffsetOfOutputLineIndex(n),o=this.getInputEndOffsetOfOutputLineIndex(e,t,n),r=e.getValueInRange({startLineNumber:t,startColumn:i+1,endLineNumber:t,endColumn:o+1});n>0&&(r=this.wrappedIndent+r);var s=n>0?this.wrappedIndentLength+1:1,a=r.length+1,u=n+10&&(l=this.wrappedIndentLength);var c=e.getLineTokens(t);return new _i["c"](r,u,s,a,c.sliceAndInflate(i,o,l))},e.prototype.getViewLinesData=function(e,t,n,i,o,r,s){if(!this._isVisible)throw new Error("Not supported");for(var a=n;a0&&(n0&&(o+=this.wrappedIndentLength),new ee["a"](e+i,o)},e.prototype.getViewLineNumberOfModelPosition=function(e,t){if(!this._isVisible)throw new Error("Not supported");var n=this.positionMapper.getOutputPositionOfInputOffset(t-1);return e+n.outputLineIndex},e}();function Mi(e,t,n,i,o,r,s){var a=e.createLineMapping(t,n,i,o,r);return null===a?s?ki.INSTANCE:Ii.INSTANCE:new Ei(a,s)}var Ti=function(){function e(e){this._lines=e}return e.prototype._validPosition=function(e){return this._lines.model.validatePosition(e)},e.prototype._validRange=function(e){return this._lines.model.validateRange(e)},e.prototype.convertViewPositionToModelPosition=function(e){return this._validPosition(e)},e.prototype.convertViewRangeToModelRange=function(e){return this._validRange(e)},e.prototype.validateViewPosition=function(e,t){return this._validPosition(t)},e.prototype.validateViewRange=function(e,t){return this._validRange(t)},e.prototype.convertModelPositionToViewPosition=function(e){return this._validPosition(e)},e.prototype.convertModelRangeToViewRange=function(e){return this._validRange(e)},e.prototype.modelPositionIsVisible=function(e){var t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)},e}(),Pi=function(){function e(e){this.model=e}return e.prototype.dispose=function(){},e.prototype.createCoordinatesConverter=function(){return new Ti(this)},e.prototype.getHiddenAreas=function(){return[]},e.prototype.setHiddenAreas=function(e){return!1},e.prototype.setTabSize=function(e){return!1},e.prototype.setWrappingSettings=function(e,t,n){return!1},e.prototype.onModelFlushed=function(){},e.prototype.onModelLinesDeleted=function(e,t,n){return new Ue(t,n)},e.prototype.onModelLinesInserted=function(e,t,n,i){return new Ke(t,n)},e.prototype.onModelLineChanged=function(e,t,n){return[!1,new ze(t,t),null,null]},e.prototype.acceptVersionId=function(e){},e.prototype.getViewLineCount=function(){return this.model.getLineCount()},e.prototype.warmUpLookupCache=function(e,t){},e.prototype.getActiveIndentGuide=function(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}},e.prototype.getViewLinesIndentGuides=function(e,t){for(var n=t-e+1,i=new Array(n),o=0;o=t)return void(n>s&&(o[o.length-1]=n));o.push(i,t,n)}else this.result[e]=[i,t,n]},e}(),Ai=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fi=function(e){function t(t,n,i){for(var o=e.call(this,0)||this,r=0;r=12352&&t<=12543||t>=13312&&t<=19903||t>=19968&&t<=40959?4:e.prototype.get.call(this,t)},t}(Ci["a"]),ji=function(){function e(e,t,n){this.classifier=new Fi(e,t,n)}return e.nextVisibleColumn=function(e,t,n,i){return e=+e,t=+t,i=+i,n?e+(t-e%t):e+i},e.prototype.createLineMapping=function(t,n,i,o,r){if(-1===i)return null;n=+n,i=+i,o=+o,r=+r;var s=0,a="",u=-1;if(0!==r&&(u=Oe["q"](t),-1!==u)){a=t.substring(0,u);for(var l=0;li&&(a="",s=0)}var d=this.classifier,h=0,p=[],f=0,g=0,m=-1,v=0,_=-1,b=0,y=t.length;for(l=0;l0){var L=t.charCodeAt(l-1),O=d.get(L);1!==O&&(m=l,v=s)}var x=1;if(Oe["v"](w)&&(x=o),g=e.nextVisibleColumn(g,n,C,x),g>i&&0!==l){var N=void 0,D=void 0;-1!==m&&v<=i?(N=m,D=v):-1!==_&&b<=i?(N=_,D=b):(N=l,D=s),p[f++]=N-h,h=N,g=e.nextVisibleColumn(D,n,C,x),m=-1,v=0,_=-1,b=0}if(-1!==m&&(v=e.nextVisibleColumn(v,n,C,x)),-1!==_&&(b=e.nextVisibleColumn(b,n,C,x)),2===S&&(0===r||l>=u)&&(m=l+1,v=s),4===S&&l=2&&e.viewportStartLineTrackedRange){var g=e.model._getTrackedRange(e.viewportStartLineTrackedRange);if(g){var m=e.coordinatesConverter.convertModelPositionToViewPosition(g.getStartPosition()),v=e.viewLayout.getVerticalOffsetForLineNumber(m.lineNumber);e.viewLayout.setScrollPositionNow({scrollTop:v+e.viewportStartLineDelta})}}})),this._register(this.model.onDidChangeTokens(function(t){for(var n=[],i=0,o=t.ranges.length;ia||(r0&&s[u-1]===s[u]||(a+=this.model.getLineContent(s[u])+o);return a}for(var l=[],c=0,d=r;c'+this._getHTMLToCopy(n,r)+""},t.prototype._getHTMLToCopy=function(e,t){for(var n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn,s=this.getTabSize(),a="",u=n;u<=o;u++){var l=this.model.getLineTokens(u),c=l.getLineContent(),d=u===n?i-1:0,h=u===o?r-1:c.length;a+=""===c?"
":Object(fi["a"])(c,l.inflate(),t,d,h,s)}return a},t.prototype._getColorMap=function(){var e=Yt["y"].getColorMap(),t=["#000000"];if(e)for(var n=1,i=e.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Ji=function(e,t){return function(n,i){t(n,i,e)}},eo=0,to="showUnused",no=function(){function e(e,t,n,i,o,r){this.model=e,this.viewModel=t,this.cursor=n,this.view=i,this.hasRealView=o,this.listenersToRemove=r}return e.prototype.dispose=function(){Object(a["f"])(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.cursor.dispose(),this.viewModel.dispose()},e}(),io=function(e){function t(t,n,i,o,a,u,l,d,h,p){var f,g=e.call(this)||this;g._onDidDispose=g._register(new s["a"]),g.onDidDispose=g._onDidDispose.event,g._onDidChangeModelContent=g._register(new s["a"]),g.onDidChangeModelContent=g._onDidChangeModelContent.event,g._onDidChangeModelLanguage=g._register(new s["a"]),g.onDidChangeModelLanguage=g._onDidChangeModelLanguage.event,g._onDidChangeModelLanguageConfiguration=g._register(new s["a"]),g.onDidChangeModelLanguageConfiguration=g._onDidChangeModelLanguageConfiguration.event,g._onDidChangeModelOptions=g._register(new s["a"]),g.onDidChangeModelOptions=g._onDidChangeModelOptions.event,g._onDidChangeModelDecorations=g._register(new s["a"]),g.onDidChangeModelDecorations=g._onDidChangeModelDecorations.event,g._onDidChangeConfiguration=g._register(new s["a"]),g.onDidChangeConfiguration=g._onDidChangeConfiguration.event,g._onDidChangeModel=g._register(new s["a"]),g.onDidChangeModel=g._onDidChangeModel.event,g._onDidChangeCursorPosition=g._register(new s["a"]),g.onDidChangeCursorPosition=g._onDidChangeCursorPosition.event,g._onDidChangeCursorSelection=g._register(new s["a"]),g.onDidChangeCursorSelection=g._onDidChangeCursorSelection.event,g._onDidAttemptReadOnlyEdit=g._register(new s["a"]),g.onDidAttemptReadOnlyEdit=g._onDidAttemptReadOnlyEdit.event,g._onDidLayoutChange=g._register(new s["a"]),g.onDidLayoutChange=g._onDidLayoutChange.event,g._editorTextFocus=g._register(new oo),g.onDidFocusEditorText=g._editorTextFocus.onDidChangeToTrue,g.onDidBlurEditorText=g._editorTextFocus.onDidChangeToFalse,g._editorWidgetFocus=g._register(new oo),g.onDidFocusEditorWidget=g._editorWidgetFocus.onDidChangeToTrue,g.onDidBlurEditorWidget=g._editorWidgetFocus.onDidChangeToFalse,g._onWillType=g._register(new s["a"]),g.onWillType=g._onWillType.event,g._onDidType=g._register(new s["a"]),g.onDidType=g._onDidType.event,g._onCompositionStart=g._register(new s["a"]),g.onCompositionStart=g._onCompositionStart.event,g._onCompositionEnd=g._register(new s["a"]),g.onCompositionEnd=g._onCompositionEnd.event,g._onDidPaste=g._register(new s["a"]),g.onDidPaste=g._onDidPaste.event,g._onMouseUp=g._register(new s["a"]),g.onMouseUp=g._onMouseUp.event,g._onMouseDown=g._register(new s["a"]),g.onMouseDown=g._onMouseDown.event,g._onMouseDrag=g._register(new s["a"]),g.onMouseDrag=g._onMouseDrag.event,g._onMouseDrop=g._register(new s["a"]),g.onMouseDrop=g._onMouseDrop.event,g._onContextMenu=g._register(new s["a"]),g.onContextMenu=g._onContextMenu.event,g._onMouseMove=g._register(new s["a"]),g.onMouseMove=g._onMouseMove.event,g._onMouseLeave=g._register(new s["a"]),g.onMouseLeave=g._onMouseLeave.event,g._onMouseWheel=g._register(new s["a"]),g.onMouseWheel=g._onMouseWheel.event,g._onKeyUp=g._register(new s["a"]),g.onKeyUp=g._onKeyUp.event,g._onKeyDown=g._register(new s["a"]),g.onKeyDown=g._onKeyDown.event,g._onDidScrollChange=g._register(new s["a"]),g.onDidScrollChange=g._onDidScrollChange.event,g._onDidChangeViewZones=g._register(new s["a"]),g.onDidChangeViewZones=g._onDidChangeViewZones.event,g._domElement=t,g._id=++eo,g._decorationTypeKeysToIds={},g._decorationTypeSubtypes={},g.isSimpleWidget=i.isSimpleWidget||!1,g._telemetryData=i.telemetryData,n=n||{},g._configuration=g._register(g._createConfiguration(n,p)),g._register(g._configuration.onDidChange(function(e){g._onDidChangeConfiguration.fire(e),e.layoutInfo&&g._onDidLayoutChange.fire(g._configuration.editor.layoutInfo),g._configuration.editor.showUnused?g._domElement.classList.add(to):g._domElement.classList.remove(to)})),g._contextKeyService=g._register(l.createScoped(g._domElement)),g._notificationService=h,g._codeEditorService=a,g._commandService=u,g._themeService=d,g._register(new ro(g,g._contextKeyService)),g._register(new so(g,g._contextKeyService)),g._instantiationService=o.createChild(new Gi["a"]([Ki["c"],g._contextKeyService])),g._modelData=null,g._contributions={},g._actions={},g._focusTracker=new ao(t),g._focusTracker.onChange(function(){g._editorWidgetFocus.setValue(g._focusTracker.hasFocus())}),g._contentWidgets={},g._overlayWidgets={},f=Array.isArray(i.contributions)?i.contributions:c["d"].getEditorContributions();for(var m=0,v=f.length;m1),this._hasNonEmptySelection.set(e.some(function(e){return!e.isEmpty()}))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())},t.prototype._updateFromFocus=function(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())},t.prototype._updateFromModel=function(){var e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))},t}(a["a"]),so=function(e){function t(t,n){var i=e.call(this)||this;i._editor=t,i._contextKeyService=n,i._langId=pi["a"].languageId.bindTo(n),i._hasCompletionItemProvider=pi["a"].hasCompletionItemProvider.bindTo(n),i._hasCodeActionsProvider=pi["a"].hasCodeActionsProvider.bindTo(n),i._hasCodeLensProvider=pi["a"].hasCodeLensProvider.bindTo(n),i._hasDefinitionProvider=pi["a"].hasDefinitionProvider.bindTo(n),i._hasDeclarationProvider=pi["a"].hasDeclarationProvider.bindTo(n),i._hasImplementationProvider=pi["a"].hasImplementationProvider.bindTo(n),i._hasTypeDefinitionProvider=pi["a"].hasTypeDefinitionProvider.bindTo(n),i._hasHoverProvider=pi["a"].hasHoverProvider.bindTo(n),i._hasDocumentHighlightProvider=pi["a"].hasDocumentHighlightProvider.bindTo(n),i._hasDocumentSymbolProvider=pi["a"].hasDocumentSymbolProvider.bindTo(n),i._hasReferenceProvider=pi["a"].hasReferenceProvider.bindTo(n),i._hasRenameProvider=pi["a"].hasRenameProvider.bindTo(n),i._hasSignatureHelpProvider=pi["a"].hasSignatureHelpProvider.bindTo(n),i._hasDocumentFormattingProvider=pi["a"].hasDocumentFormattingProvider.bindTo(n),i._hasDocumentSelectionFormattingProvider=pi["a"].hasDocumentSelectionFormattingProvider.bindTo(n),i._hasMultipleDocumentFormattingProvider=pi["a"].hasMultipleDocumentFormattingProvider.bindTo(n),i._hasMultipleDocumentSelectionFormattingProvider=pi["a"].hasMultipleDocumentSelectionFormattingProvider.bindTo(n),i._isInWalkThrough=pi["a"].isInEmbeddedEditor.bindTo(n);var o=function(){return i._update()};return i._register(t.onDidChangeModel(o)),i._register(t.onDidChangeModelLanguage(o)),i._register(Yt["d"].onDidChange(o)),i._register(Yt["a"].onDidChange(o)),i._register(Yt["b"].onDidChange(o)),i._register(Yt["f"].onDidChange(o)),i._register(Yt["e"].onDidChange(o)),i._register(Yt["o"].onDidChange(o)),i._register(Yt["z"].onDidChange(o)),i._register(Yt["n"].onDidChange(o)),i._register(Yt["i"].onDidChange(o)),i._register(Yt["k"].onDidChange(o)),i._register(Yt["s"].onDidChange(o)),i._register(Yt["t"].onDidChange(o)),i._register(Yt["g"].onDidChange(o)),i._register(Yt["j"].onDidChange(o)),i._register(Yt["v"].onDidChange(o)),o(),i}return $i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.reset=function(){var e=this;this._contextKeyService.bufferChangeEvents(function(){e._langId.reset(),e._hasCompletionItemProvider.reset(),e._hasCodeActionsProvider.reset(),e._hasCodeLensProvider.reset(),e._hasDefinitionProvider.reset(),e._hasDeclarationProvider.reset(),e._hasImplementationProvider.reset(),e._hasTypeDefinitionProvider.reset(),e._hasHoverProvider.reset(),e._hasDocumentHighlightProvider.reset(),e._hasDocumentSymbolProvider.reset(),e._hasReferenceProvider.reset(),e._hasRenameProvider.reset(),e._hasDocumentFormattingProvider.reset(),e._hasDocumentSelectionFormattingProvider.reset(),e._hasSignatureHelpProvider.reset(),e._isInWalkThrough.reset()})},t.prototype._update=function(){var e=this,t=this._editor.getModel();t?this._contextKeyService.bufferChangeEvents(function(){e._langId.set(t.getLanguageIdentifier().language),e._hasCompletionItemProvider.set(Yt["d"].has(t)),e._hasCodeActionsProvider.set(Yt["a"].has(t)),e._hasCodeLensProvider.set(Yt["b"].has(t)),e._hasDefinitionProvider.set(Yt["f"].has(t)),e._hasDeclarationProvider.set(Yt["e"].has(t)),e._hasImplementationProvider.set(Yt["o"].has(t)),e._hasTypeDefinitionProvider.set(Yt["z"].has(t)),e._hasHoverProvider.set(Yt["n"].has(t)),e._hasDocumentHighlightProvider.set(Yt["i"].has(t)),e._hasDocumentSymbolProvider.set(Yt["k"].has(t)),e._hasReferenceProvider.set(Yt["s"].has(t)),e._hasRenameProvider.set(Yt["t"].has(t)),e._hasSignatureHelpProvider.set(Yt["v"].has(t)),e._hasDocumentFormattingProvider.set(Yt["g"].has(t)||Yt["j"].has(t)),e._hasDocumentSelectionFormattingProvider.set(Yt["j"].has(t)),e._hasMultipleDocumentFormattingProvider.set(Yt["g"].all(t).length+Yt["j"].all(t).length>1),e._hasMultipleDocumentSelectionFormattingProvider.set(Yt["j"].all(t).length>1),e._isInWalkThrough.set(t.uri.scheme===u["b"].walkThroughSnippet)}):this.reset()},t}(a["a"]),ao=function(e){function t(t){var n=e.call(this)||this;return n._onChange=n._register(new s["a"]),n.onChange=n._onChange.event,n._hasFocus=!1,n._domFocusTracker=n._register(o["S"](t)),n._register(n._domFocusTracker.onDidFocus(function(){n._hasFocus=!0,n._onChange.fire(void 0)})),n._register(n._domFocusTracker.onDidBlur(function(){n._hasFocus=!1,n._onChange.fire(void 0)})),n}return $i(t,e),t.prototype.hasFocus=function(){return this._hasFocus},t}(a["a"]),uo=encodeURIComponent("");function co(e){return uo+encodeURIComponent(e.toString())+lo}var ho=encodeURIComponent('');function fo(e){return ho+encodeURIComponent(e.toString())+po}Object(B["f"])(function(e,t){var n=e.getColor(on["p"]);n&&t.addRule(".monaco-editor .squiggly-error { border-bottom: 4px double "+n+"; }");var i=e.getColor(on["q"]);i&&t.addRule('.monaco-editor .squiggly-error { background: url("data:image/svg+xml,'+co(i)+'") repeat-x bottom left; }');var o=e.getColor(on["L"]);o&&t.addRule(".monaco-editor .squiggly-warning { border-bottom: 4px double "+o+"; }");var r=e.getColor(on["M"]);r&&t.addRule('.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,'+co(r)+'") repeat-x bottom left; }');var s=e.getColor(on["F"]);s&&t.addRule(".monaco-editor .squiggly-info { border-bottom: 4px double "+s+"; }");var a=e.getColor(on["G"]);a&&t.addRule('.monaco-editor .squiggly-info { background: url("data:image/svg+xml,'+co(a)+'") repeat-x bottom left; }');var u=e.getColor(on["y"]);u&&t.addRule(".monaco-editor .squiggly-hint { border-bottom: 2px dotted "+u+"; }");var l=e.getColor(on["z"]);l&&t.addRule('.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,'+fo(l)+'") no-repeat bottom left; }');var c=e.getColor(Ie["o"]);c&&t.addRule("."+to+" .monaco-editor .squiggly-inline-unnecessary { opacity: "+c.rgba.a+"; }");var d=e.getColor(Ie["n"]);d&&t.addRule("."+to+" .monaco-editor .squiggly-unnecessary { border-bottom: 2px dashed "+d+"; }");var h=e.getColor(on["x"])||"inherit";t.addRule(".monaco-editor .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: "+h+"}")})},"9c3e":function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var i=function(){function e(e){this._prefix=e,this._lastId=0}return e.prototype.nextId=function(){return this._prefix+ ++this._lastId},e}(),o=new i("id#")},"9e74":function(e,t,n){"use strict";n.d(t,"b",function(){return l}),n.d(t,"a",function(){return c});var i=n("a666"),o=n("ef8e"),r=n("0a0f"),s=n("308f"),a=n("db88"),u=n("4035"),l=Object(r["c"])("commandService"),c=new(function(){function e(){this._commands=new Map,this._onDidRegisterCommand=new s["a"],this.onDidRegisterCommand=this._onDidRegisterCommand.event}return e.prototype.registerCommand=function(e,t){var n=this;if(!e)throw new Error("invalid command");if("string"===typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){for(var r=[],s=0,u=e.description.args;s=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))},e.prototype._assertNoCtrlAlt=function(t,n){t.ctrlKey&&t.altKey&&!t.metaKey&&e._mightProduceChar(t.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",t," for ",n)},e.prototype._registerDefaultKeybinding=function(e,t,n,i,r,s){1===o["a"]&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:s,weight1:i,weight2:r}),this._cachedMergedKeybindings=null},e.prototype.getDefaultKeybindings=function(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(c)),this._cachedMergedKeybindings.slice(0)},e}(),u=new a,l={EditorModes:"platform.keybindingsRegistry"};function c(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}s["a"].add(l.EditorModes,u)},"9ee1":function(e,t,n){"use strict";var i;n.d(t,"a",function(){return i}),function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};var n=Math.max(e.start,t.start),i=Math.min(e.end,t.end);return i-n<=0?{start:0,end:0}:{start:n,end:i}}function n(e){return e.end-e.start<=0}function i(e,i){return!n(t(e,i))}function o(e,t){var i=[],o={start:e.start,end:Math.min(t.start,e.end)},r={start:Math.max(t.end,e.start),end:e.end};return n(o)||i.push(o),n(r)||i.push(r),i}e.intersect=t,e.isEmpty=n,e.intersects=i,e.relativeComplement=o}(i||(i={}))},"9f4d":function(e,t,n){"use strict";n.r(t);var i=n("dff7"),o=n("fe45"),r=n("b2cc"),s=n("c101"),a=n("d3f49"),u=n("7061"),l=n("6a89"),c=n("8025"),d=n("70cb"),h=function(){function e(e){this._selection=e,this._usedEndToken=null}return e._haystackHasNeedleAtOffset=function(e,t,n){if(n<0)return!1;var i=t.length,o=e.length;if(n+i>o)return!1;for(var r=0;r=65&&s<=90&&s+32===a)&&!(a>=65&&a<=90&&a+32===s)))return!1}return!0},e.prototype._createOperationsForBlockComment=function(t,n,i,o,r){var s,a=t.startLineNumber,u=t.startColumn,c=t.endLineNumber,d=t.endColumn,h=o.getLineContent(a),p=o.getLineContent(c),f=h.lastIndexOf(n,u-1+n.length),g=p.indexOf(i,d-1-i.length);if(-1!==f&&-1!==g)if(a===c){var m=h.substring(f+n.length,g);m.indexOf(i)>=0&&(f=-1,g=-1)}else{var v=h.substring(f+n.length),_=p.substring(0,g);(v.indexOf(i)>=0||_.indexOf(i)>=0)&&(f=-1,g=-1)}-1!==f&&-1!==g?(f+n.length0&&32===p.charCodeAt(g-1)&&(i=" "+i,g-=1),s=e._createRemoveBlockCommentOperations(new l["a"](a,f+n.length+1,c,g+1),n,i)):(s=e._createAddBlockCommentOperations(t,n,i),this._usedEndToken=1===s.length?i:null);for(var b=0,y=s;ba?r-1:r}},e}(),g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),m=function(e){function t(t,n){var i=e.call(this,n)||this;return i._type=t,i}return g(t,e),t.prototype.run=function(e,t){if(t.hasModel()){for(var n=t.getModel(),i=[],o=t.getSelections(),r=n.getOptions(),s=0,a=o;s=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},M=function(e,t){return function(n,i){t(n,i,e)}},T=new _["d"]("hasSymbols",!1),P=Object(L["c"])("ISymbolNavigationService"),R=function(){function e(e,t,n,i){this._editorService=t,this._notificationService=n,this._keybindingService=i,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=T.bindTo(e)}return e.prototype.reset=function(){this._ctxHasSymbols.reset(),Object(N["f"])(this._currentState),Object(N["f"])(this._currentMessage),this._currentModel=void 0,this._currentIdx=-1},e.prototype.put=function(e){var t=this,n=e.parent.parent;if(n.references.length<=1)this.reset();else{this._currentModel=n,this._currentIdx=n.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();var i=new A(this._editorService),o=i.onDidChange(function(e){if(!t._ignoreEditorChange){var i=t._editorService.getActiveCodeEditor();if(i){var o=i.getModel(),r=i.getPosition();if(o&&r){for(var s=!1,a=!1,u=0,c=n.references;u0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]1?m["a"]("meta.title"," – {0} definitions",e.references.length):""},t.prototype._onResult=function(e,t,n,o){return j(this,void 0,void 0,function(){var r,s,a,u;return W(this,function(l){switch(l.label){case 0:return r=o.getAriaMessage(),Object(i["a"])(r),s=n.getConfiguration().contribInfo.gotoLocation,this._configuration.openInPeek||"peek"===s.multiple&&o.references.length>1?(this._openInPeek(e,n,o),[3,3]):[3,1];case 1:return n.hasModel()?(a=o.firstReference(),a?[4,this._openReference(n,e,a,this._configuration.openToSide)]:[2]):[3,3];case 2:u=l.sent(),u&&o.references.length>1&&"gotoAndPeek"===s.multiple?this._openInPeek(e,u,o):o.dispose(),"goto"===s.multiple&&t.put(a),l.label=3;case 3:return[2]}})})},t.prototype._openReference=function(e,t,n,i){var o=void 0;return Object(d["C"])(n)&&(o=n.targetSelectionRange),o||(o=n.range),t.openCodeEditor({resource:n.uri,options:{selection:l["a"].collapseToStart(o),revealInCenterIfOutsideViewport:!0}},e,i)},t.prototype._openInPeek=function(e,t,n){var i=this,r=f["a"].get(t);r&&t.hasModel()?r.toggleWidget(t.getSelection(),Object(o["f"])(function(e){return Promise.resolve(n)}),{getMetaTitle:function(e){return i._getMetaTitle(e)},onGoto:function(n){return r.closeWidget(),i._openReference(t,e,n,!1)}}):n.dispose()},t}(a["b"]),H=s["f"]?2118:70,z=function(e){function t(){var n=e.call(this,new V,{id:t.id,label:m["a"]("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:_["a"].and(c["a"].hasDefinitionProvider,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:H,weight:100},menuOpts:{group:"navigation",order:1.1}})||this;return C["a"].registerCommandAlias("editor.action.goToDeclaration",t.id),n}return F(t,e),t.id="editor.action.revealDefinition",t}(B),U=function(e){function t(){var n=e.call(this,new V(!0),{id:t.id,label:m["a"]("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:_["a"].and(c["a"].hasDefinitionProvider,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:Object(r["a"])(2089,H),weight:100}})||this;return C["a"].registerCommandAlias("editor.action.openDeclarationToTheSide",t.id),n}return F(t,e),t.id="editor.action.revealDefinitionAside",t}(B),K=function(e){function t(){var n=e.call(this,new V(void 0,!0,!1),{id:t.id,label:m["a"]("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:_["a"].and(c["a"].hasDefinitionProvider,p["b"].notInPeekEditor,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:582,linux:{primary:3140},weight:100},menuOpts:{group:"navigation",order:1.2}})||this;return C["a"].registerCommandAlias("editor.action.previewDeclaration",t.id),n}return F(t,e),t.id="editor.action.peekDefinition",t}(B),q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),t.prototype._getTargetLocationForPosition=function(e,t,n){return Object(w["a"])(e,t,n)},t.prototype._getNoResultFoundMessage=function(e){return e&&e.word?m["a"]("decl.noResultWord","No declaration found for '{0}'",e.word):m["a"]("decl.generic.noResults","No declaration found")},t.prototype._getMetaTitle=function(e){return e.references.length>1?m["a"]("decl.meta.title"," – {0} declarations",e.references.length):""},t}(B),G=function(e){function t(){return e.call(this,new V,{id:t.id,label:m["a"]("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:_["a"].and(c["a"].hasDeclarationProvider,c["a"].isInEmbeddedEditor.toNegated()),menuOpts:{group:"navigation",order:1.3}})||this}return F(t,e),t.prototype._getNoResultFoundMessage=function(e){return e&&e.word?m["a"]("decl.noResultWord","No declaration found for '{0}'",e.word):m["a"]("decl.generic.noResults","No declaration found")},t.prototype._getMetaTitle=function(e){return e.references.length>1?m["a"]("decl.meta.title"," – {0} declarations",e.references.length):""},t.id="editor.action.revealDeclaration",t}(q),Z=function(e){function t(){return e.call(this,new V(void 0,!0,!1),{id:"editor.action.peekDeclaration",label:m["a"]("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:_["a"].and(c["a"].hasDeclarationProvider,p["b"].notInPeekEditor,c["a"].isInEmbeddedEditor.toNegated()),menuOpts:{group:"navigation",order:1.31}})||this}return F(t,e),t}(q),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),t.prototype._getTargetLocationForPosition=function(e,t,n){return Object(w["c"])(e,t,n)},t.prototype._getNoResultFoundMessage=function(e){return e&&e.word?m["a"]("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):m["a"]("goToImplementation.generic.noResults","No implementation found")},t.prototype._getMetaTitle=function(e){return e.references.length>1?m["a"]("meta.implementations.title"," – {0} implementations",e.references.length):""},t}(B),X=function(e){function t(){return e.call(this,new V,{id:t.ID,label:m["a"]("actions.goToImplementation.label","Go to Implementation"),alias:"Go to Implementation",precondition:_["a"].and(c["a"].hasImplementationProvider,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:2118,weight:100}})||this}return F(t,e),t.ID="editor.action.goToImplementation",t}(Y),$=function(e){function t(){return e.call(this,new V(!1,!0,!1),{id:t.ID,label:m["a"]("actions.peekImplementation.label","Peek Implementation"),alias:"Peek Implementation",precondition:_["a"].and(c["a"].hasImplementationProvider,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:3142,weight:100}})||this}return F(t,e),t.ID="editor.action.peekImplementation",t}(Y),Q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),t.prototype._getTargetLocationForPosition=function(e,t,n){return Object(w["d"])(e,t,n)},t.prototype._getNoResultFoundMessage=function(e){return e&&e.word?m["a"]("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):m["a"]("goToTypeDefinition.generic.noResults","No type definition found")},t.prototype._getMetaTitle=function(e){return e.references.length>1?m["a"]("meta.typeDefinitions.title"," – {0} type definitions",e.references.length):""},t}(B),J=function(e){function t(){return e.call(this,new V,{id:t.ID,label:m["a"]("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:_["a"].and(c["a"].hasTypeDefinitionProvider,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:0,weight:100},menuOpts:{group:"navigation",order:1.4}})||this}return F(t,e),t.ID="editor.action.goToTypeDefinition",t}(Q),ee=function(e){function t(){return e.call(this,new V(!1,!0,!1),{id:t.ID,label:m["a"]("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:_["a"].and(c["a"].hasTypeDefinitionProvider,c["a"].isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:c["a"].editorTextFocus,primary:0,weight:100}})||this}return F(t,e),t.ID="editor.action.peekTypeDefinition",t}(Q);Object(a["f"])(z),Object(a["f"])(U),Object(a["f"])(K),Object(a["f"])(G),Object(a["f"])(Z),Object(a["f"])(X),Object(a["f"])($),Object(a["f"])(J),Object(a["f"])(ee),v["c"].appendMenuItem(16,{group:"4_symbol_nav",command:{id:"editor.action.goToDeclaration",title:m["a"]({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},order:2}),v["c"].appendMenuItem(16,{group:"4_symbol_nav",command:{id:"editor.action.goToTypeDefinition",title:m["a"]({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},order:3}),v["c"].appendMenuItem(16,{group:"4_symbol_nav",command:{id:"editor.action.goToImplementation",title:m["a"]({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementation")},order:4})},a007:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return i});var i,o=n("ef8e"),r=n("2e5d"),s=n("f85a"),a=n("d48d"),u=n("7061"),l=n("6a89"),c=function(){function e(){}return e.addCursorDown=function(e,t,n){for(var i=[],o=0,a=0,u=t.length;ac&&(d=c,h=e.model.getLineMaxColumn(d)),r["d"].fromModelState(new r["f"](new l["a"](s.lineNumber,1,d,h),0,new u["a"](d,h),0))}var p=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumberp){c=e.viewModel.getLineCount();var f=a.lineNumber+1,g=1;return f>c&&(f=c,g=e.viewModel.getLineMaxColumn(f)),r["d"].fromViewState(t.viewState.move(t.modelState.hasSelection(),f,g,0))}var m=t.modelState.selectionStart.getEndPosition();return r["d"].fromModelState(t.modelState.move(t.modelState.hasSelection(),m.lineNumber,m.column,0))},e.word=function(e,t,n,i){var o=e.model.validatePosition(i);return r["d"].fromModelState(a["a"].word(e.config,e.model,t.modelState,n,o))},e.cancelSelection=function(e,t){if(!t.modelState.hasSelection())return new r["d"](t.modelState,t.viewState);var n=t.viewState.position.lineNumber,i=t.viewState.position.column;return r["d"].fromViewState(new r["f"](new l["a"](n,i,n,i),0,new u["a"](n,i),0))},e.moveTo=function(e,t,n,i,o){var s=e.model.validatePosition(i),a=o?e.validateViewPosition(new u["a"](o.lineNumber,o.column),s):e.convertModelPositionToViewPosition(s);return r["d"].fromViewState(t.viewState.move(n,a.lineNumber,a.column,0))},e.move=function(e,t,n){var i=n.select,o=n.value;switch(n.direction){case 0:return 4===n.unit?this._moveHalfLineLeft(e,t,i):this._moveLeft(e,t,i,o);case 1:return 4===n.unit?this._moveHalfLineRight(e,t,i):this._moveRight(e,t,i,o);case 2:return 2===n.unit?this._moveUpByViewLines(e,t,i,o):this._moveUpByModelLines(e,t,i,o);case 3:return 2===n.unit?this._moveDownByViewLines(e,t,i,o):this._moveDownByModelLines(e,t,i,o);case 4:return this._moveToViewMinColumn(e,t,i);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,i);case 6:return this._moveToViewCenterColumn(e,t,i);case 7:return this._moveToViewMaxColumn(e,t,i);case 8:return this._moveToViewLastNonWhitespaceColumn(e,t,i);case 9:var r=t[0],s=e.getCompletelyVisibleModelRange(),a=this._firstLineNumberInRange(e.model,s,o),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,r,i,a,u)];case 11:r=t[0],s=e.getCompletelyVisibleModelRange(),a=this._lastLineNumberInRange(e.model,s,o),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,r,i,a,u)];case 10:r=t[0],s=e.getCompletelyVisibleModelRange(),a=Math.round((s.startLineNumber+s.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,r,i,a,u)];case 12:for(var l=e.getCompletelyVisibleViewRange(),c=[],d=0,h=t.length;dn.endLineNumber-1&&(o=n.endLineNumber-1),o=0?t+1:1},e.prototype.getCurrentMatchesPosition=function(t){for(var n=this._editor.getModel().getDecorationsInRange(t),i=0,o=n;i1e3){r=e._FIND_MATCH_NO_OVERVIEW_DECORATION;for(var a=i._editor.getModel().getLineCount(),u=i._editor.getLayoutInfo().height,l=u/a,c=Math.max(2,Math.ceil(3/l)),h=t[0].range.startLineNumber,p=t[0].range.endLineNumber,f=1,g=t.length;f=m.startLineNumber?m.endLineNumber>p&&(p=m.endLineNumber):(s.push({range:new d["a"](h,1,p,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,p=m.endLineNumber)}s.push({range:new d["a"](h,1,p,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}var v=new Array(t.length);for(f=0,g=t.length;f=0;t--){var n=this._decorations[t],i=this._editor.getModel().getDecorationRange(n);if(i&&!(i.endLineNumber>e.lineNumber)){if(i.endLineNumbere.column))return i}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])},e.prototype.matchAfterPosition=function(e){if(0===this._decorations.length)return null;for(var t=0,n=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){for(var n=[],i=0;i0){if(e=i)break;a=e.charCodeAt(n);if(36===a){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(48===a||38===a){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1);continue}if(49<=a&&a<=57){var r=a-48;if(n+1=i)break;var a=e.charCodeAt(n);switch(a){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic("\n",n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic("\t",n+1);break}}}return t.finalize()}var k=n("4fc3"),I=new k["d"]("findWidgetVisible",!1),E=new k["d"]("findInputFocussed",!1),M=new k["d"]("replaceInputFocussed",!1),T={primary:545,mac:{primary:2593}},P={primary:565,mac:{primary:2613}},R={primary:560,mac:{primary:2608}},A={primary:554,mac:{primary:2602}},F={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},j=19999,W=240,V=function(){function e(e,t){var n=this;this._toDispose=new r["b"],this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new o["e"],this._decorations=new _(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new o["d"](function(){return n.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(function(e){3!==e.reason&&5!==e.reason&&6!==e.reason||n._decorations.setStartPosition(n._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(function(e){n._ignoreModelContentChanged||(e.isFlush&&n._decorations.reset(),n._decorations.setStartPosition(n._editor.getPosition()),n._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(function(e){return n._onStateChanged(e)})),this.research(!1,this._state.searchScope)}return e.prototype.dispose=function(){this._isDisposed=!0,Object(r["f"])(this._startSearchingTimer),this._toDispose.dispose()},e.prototype._onStateChanged=function(e){var t=this;if(!this._isDisposed&&this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)){var n=this._editor.getModel();n.isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(function(){e.searchScope?t.research(e.moveCursor,t._state.searchScope):t.research(e.moveCursor)},W)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)}},e._getSearchRange=function(e,t){return t||e.getFullModelRange()},e.prototype.research=function(e,t){var n=null;n="undefined"!==typeof t?t:this._decorations.getFindScope(),null!==n&&n.startLineNumber!==n.endLineNumber&&(n=1===n.endColumn?new d["a"](n.startLineNumber,1,n.endLineNumber-1,this._editor.getModel().getLineMaxColumn(n.endLineNumber-1)):new d["a"](n.startLineNumber,1,n.endLineNumber,this._editor.getModel().getLineMaxColumn(n.endLineNumber)));var i=this._findMatches(n,!1,j);this._decorations.set(i,n),this._state.changeMatchInfo(this._decorations.getCurrentMatchesPosition(this._editor.getSelection()),this._decorations.getCount(),void 0),e&&this._moveToNextMatch(this._decorations.getStartPosition())},e.prototype._hasMatches=function(){return this._state.matchesCount>0},e.prototype._cannotFind=function(){if(!this._hasMatches()){var e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1},e.prototype._setCurrentFindMatch=function(e){var t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)},e.prototype._prevSearchPosition=function(e){var t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),n=e.lineNumber,i=e.column,o=this._editor.getModel();return t||1===i?(1===n?n=o.getLineCount():n--,i=o.getLineMaxColumn(n)):i--,new c["a"](n,i)},e.prototype._moveToPrevMatch=function(t,n){if(void 0===n&&(n=!1),this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0),n=e.lineNumber,i=e.column,o=this._editor.getModel();return t||i===o.getLineMaxColumn(n)?(n===o.getLineCount()?n=1:n++,i=1):i++,new c["a"](n,i)},e.prototype._moveToNextMatch=function(e){if(this._decorations.getCount()=j?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}},e.prototype._largeReplaceAll=function(){var e=new p["a"](this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null),t=e.parseSearchRequest();if(t){var n=t.regex;if(!n.multiline){var i="m";n.ignoreCase&&(i+="i"),n.global&&(i+="g"),n=new RegExp(n.source,i)}var o,r=this._editor.getModel(),s=r.getValue(1),a=r.getFullModelRange(),u=this._getReplacePattern(),c=this._state.preserveCase;o=u.hasReplacementPatterns||c?s.replace(n,function(){return u.buildReplaceString(arguments,c)}):s.replace(n,u.buildReplaceString(null,c));var d=new l["b"](a,o,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}},e.prototype._regularReplaceAll=function(e){for(var t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),i=[],o=0,r=n.length;ot&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,i.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,i.matchesCount=!0,o=!0),"undefined"!==typeof n&&(d["a"].equalsRange(this._currentMatch,n)||(this._currentMatch=n,i.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(i)},e.prototype.change=function(e,t,n){void 0===n&&(n=!0);var i={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},o=!1,r=this.isRegex,s=this.wholeWord,a=this.matchCase,u=this.preserveCase;"undefined"!==typeof e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,i.searchString=!0,o=!0),"undefined"!==typeof e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,i.replaceString=!0,o=!0),"undefined"!==typeof e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,i.isRevealed=!0,o=!0),"undefined"!==typeof e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,i.isReplaceRevealed=!0,o=!0),"undefined"!==typeof e.isRegex&&(this._isRegex=e.isRegex),"undefined"!==typeof e.wholeWord&&(this._wholeWord=e.wholeWord),"undefined"!==typeof e.matchCase&&(this._matchCase=e.matchCase),"undefined"!==typeof e.preserveCase&&(this._preserveCase=e.preserveCase),"undefined"!==typeof e.searchScope&&(d["a"].equalsRange(this._searchScope,e.searchScope)||(this._searchScope=e.searchScope,i.searchScope=!0,o=!0)),this._isRegexOverride="undefined"!==typeof e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride="undefined"!==typeof e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride="undefined"!==typeof e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride="undefined"!==typeof e.preserveCaseOverride?e.preserveCaseOverride:0,r!==this.isRegex&&(o=!0,i.isRegex=!0),s!==this.wholeWord&&(o=!0,i.wholeWord=!0),a!==this.matchCase&&(o=!0,i.matchCase=!0),u!==this.preserveCase&&(o=!0,i.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(i)},e}(),se=(n("01b0"),n("3813")),ae=n("70c3"),ue=n("fdcc"),le=n("30db"),ce=(n("caa1"),n("d3ef")),de=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),he=i["a"]("defaultLabel","input"),pe=function(e){function t(t,n,i,o){var r=e.call(this)||this;r._showOptionButtons=i,r.fixFocusOnOptionClickEnabled=!0,r._onDidOptionChange=r._register(new U["a"]),r.onDidOptionChange=r._onDidOptionChange.event,r._onKeyDown=r._register(new U["a"]),r.onKeyDown=r._onKeyDown.event,r._onMouseDown=r._register(new U["a"]),r.onMouseDown=r._onMouseDown.event,r._onInput=r._register(new U["a"]),r._onKeyUp=r._register(new U["a"]),r._onCaseSensitiveKeyDown=r._register(new U["a"]),r.onCaseSensitiveKeyDown=r._onCaseSensitiveKeyDown.event,r._onRegexKeyDown=r._register(new U["a"]),r.onRegexKeyDown=r._onRegexKeyDown.event,r._lastHighlightFindOptions=0,r.contextViewProvider=n,r.placeholder=o.placeholder||"",r.validation=o.validation,r.label=o.label||he,r.inputActiveOptionBorder=o.inputActiveOptionBorder,r.inputActiveOptionBackground=o.inputActiveOptionBackground,r.inputBackground=o.inputBackground,r.inputForeground=o.inputForeground,r.inputBorder=o.inputBorder,r.inputValidationInfoBorder=o.inputValidationInfoBorder,r.inputValidationInfoBackground=o.inputValidationInfoBackground,r.inputValidationInfoForeground=o.inputValidationInfoForeground,r.inputValidationWarningBorder=o.inputValidationWarningBorder,r.inputValidationWarningBackground=o.inputValidationWarningBackground,r.inputValidationWarningForeground=o.inputValidationWarningForeground,r.inputValidationErrorBorder=o.inputValidationErrorBorder,r.inputValidationErrorBackground=o.inputValidationErrorBackground,r.inputValidationErrorForeground=o.inputValidationErrorForeground;var s=o.appendCaseSensitiveLabel||"",a=o.appendWholeWordsLabel||"",u=o.appendRegexLabel||"",l=o.history||[],c=!!o.flexibleHeight,d=!!o.flexibleWidth,h=o.flexibleMaxHeight;r.domNode=document.createElement("div"),B["f"](r.domNode,"monaco-findInput"),r.inputBox=r._register(new ce["a"](r.domNode,r.contextViewProvider,{placeholder:r.placeholder||"",ariaLabel:r.label||"",validationOptions:{validation:r.validation},inputBackground:r.inputBackground,inputForeground:r.inputForeground,inputBorder:r.inputBorder,inputValidationInfoBackground:r.inputValidationInfoBackground,inputValidationInfoForeground:r.inputValidationInfoForeground,inputValidationInfoBorder:r.inputValidationInfoBorder,inputValidationWarningBackground:r.inputValidationWarningBackground,inputValidationWarningForeground:r.inputValidationWarningForeground,inputValidationWarningBorder:r.inputValidationWarningBorder,inputValidationErrorBackground:r.inputValidationErrorBackground,inputValidationErrorForeground:r.inputValidationErrorForeground,inputValidationErrorBorder:r.inputValidationErrorBorder,history:l,flexibleHeight:c,flexibleWidth:d,flexibleMaxHeight:h})),r.regex=r._register(new te({appendTitle:u,isChecked:!1,inputActiveOptionBorder:r.inputActiveOptionBorder,inputActiveOptionBackground:r.inputActiveOptionBackground})),r._register(r.regex.onChange(function(e){r._onDidOptionChange.fire(e),!e&&r.fixFocusOnOptionClickEnabled&&r.inputBox.focus(),r.validate()})),r._register(r.regex.onKeyDown(function(e){r._onRegexKeyDown.fire(e)})),r.wholeWords=r._register(new ee({appendTitle:a,isChecked:!1,inputActiveOptionBorder:r.inputActiveOptionBorder,inputActiveOptionBackground:r.inputActiveOptionBackground})),r._register(r.wholeWords.onChange(function(e){r._onDidOptionChange.fire(e),!e&&r.fixFocusOnOptionClickEnabled&&r.inputBox.focus(),r.validate()})),r.caseSensitive=r._register(new J({appendTitle:s,isChecked:!1,inputActiveOptionBorder:r.inputActiveOptionBorder,inputActiveOptionBackground:r.inputActiveOptionBackground})),r._register(r.caseSensitive.onChange(function(e){r._onDidOptionChange.fire(e),!e&&r.fixFocusOnOptionClickEnabled&&r.inputBox.focus(),r.validate()})),r._register(r.caseSensitive.onKeyDown(function(e){r._onCaseSensitiveKeyDown.fire(e)})),r._showOptionButtons&&(r.inputBox.paddingRight=r.caseSensitive.width()+r.wholeWords.width()+r.regex.width());var p=[r.caseSensitive.domNode,r.wholeWords.domNode,r.regex.domNode];r.onkeydown(r.domNode,function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=p.indexOf(document.activeElement);if(t>=0){var n=-1;e.equals(17)?n=(t+1)%p.length:e.equals(15)&&(n=0===t?p.length-1:t-1),e.equals(9)?p[t].blur():n>=0&&p[n].focus(),B["c"].stop(e,!0)}}});var f=document.createElement("div");return f.className="controls",f.style.display=r._showOptionButtons?"block":"none",f.appendChild(r.caseSensitive.domNode),f.appendChild(r.wholeWords.domNode),f.appendChild(r.regex.domNode),r.domNode.appendChild(f),t&&t.appendChild(r.domNode),r.onkeydown(r.inputBox.inputElement,function(e){return r._onKeyDown.fire(e)}),r.onkeyup(r.inputBox.inputElement,function(e){return r._onKeyUp.fire(e)}),r.oninput(r.inputBox.inputElement,function(e){return r._onInput.fire()}),r.onmousedown(r.inputBox.inputElement,function(e){return r._onMouseDown.fire(e)}),r}return de(t,e),t.prototype.enable=function(){B["I"](this.domNode,"disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()},t.prototype.disable=function(){B["f"](this.domNode,"disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()},t.prototype.setFocusInputOnOptionClick=function(e){this.fixFocusOnOptionClickEnabled=e},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.getValue=function(){return this.inputBox.value},t.prototype.setValue=function(e){this.inputBox.value!==e&&(this.inputBox.value=e)},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getCaseSensitive=function(){return this.caseSensitive.checked},t.prototype.setCaseSensitive=function(e){this.caseSensitive.checked=e},t.prototype.getWholeWords=function(){return this.wholeWords.checked},t.prototype.setWholeWords=function(e){this.wholeWords.checked=e},t.prototype.getRegex=function(){return this.regex.checked},t.prototype.setRegex=function(e){this.regex.checked=e,this.validate()},t.prototype.focusOnCaseSensitive=function(){this.caseSensitive.focus()},t.prototype.highlightFindOptions=function(){B["I"](this.domNode,"highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,B["f"](this.domNode,"highlight-"+this._lastHighlightFindOptions)},t.prototype.validate=function(){this.inputBox&&this.inputBox.validate()},t.prototype.clearMessage=function(){this.inputBox&&this.inputBox.hideMessage()},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t}(H["a"]),fe=n("9eb8"),ge=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),me=i["a"]("defaultLabel","input"),ve=i["a"]("label.preserveCaseCheckbox","Preserve Case"),_e=function(e){function t(t){return e.call(this,{actionClassName:"monaco-case-sensitive",title:ve+t.appendTitle,isChecked:t.isChecked,inputActiveOptionBorder:t.inputActiveOptionBorder})||this}return ge(t,e),t}(Z),be=function(e){function t(t,n,i,o){var r=e.call(this)||this;r._showOptionButtons=i,r.fixFocusOnOptionClickEnabled=!0,r.cachedOptionsWidth=0,r._onDidOptionChange=r._register(new U["a"]),r.onDidOptionChange=r._onDidOptionChange.event,r._onKeyDown=r._register(new U["a"]),r.onKeyDown=r._onKeyDown.event,r._onMouseDown=r._register(new U["a"]),r._onInput=r._register(new U["a"]),r._onKeyUp=r._register(new U["a"]),r._onPreserveCaseKeyDown=r._register(new U["a"]),r.onPreserveCaseKeyDown=r._onPreserveCaseKeyDown.event,r.contextViewProvider=n,r.placeholder=o.placeholder||"",r.validation=o.validation,r.label=o.label||me,r.inputActiveOptionBorder=o.inputActiveOptionBorder,r.inputBackground=o.inputBackground,r.inputForeground=o.inputForeground,r.inputBorder=o.inputBorder,r.inputValidationInfoBorder=o.inputValidationInfoBorder,r.inputValidationInfoBackground=o.inputValidationInfoBackground,r.inputValidationInfoForeground=o.inputValidationInfoForeground,r.inputValidationWarningBorder=o.inputValidationWarningBorder,r.inputValidationWarningBackground=o.inputValidationWarningBackground,r.inputValidationWarningForeground=o.inputValidationWarningForeground,r.inputValidationErrorBorder=o.inputValidationErrorBorder,r.inputValidationErrorBackground=o.inputValidationErrorBackground,r.inputValidationErrorForeground=o.inputValidationErrorForeground;var s=!!o.flexibleHeight,a=!!o.flexibleWidth,u=o.flexibleMaxHeight;return r.buildDomNode(o.history||[],s,a,u),t&&t.appendChild(r.domNode),r.onkeydown(r.inputBox.inputElement,function(e){return r._onKeyDown.fire(e)}),r.onkeyup(r.inputBox.inputElement,function(e){return r._onKeyUp.fire(e)}),r.oninput(r.inputBox.inputElement,function(e){return r._onInput.fire()}),r.onmousedown(r.inputBox.inputElement,function(e){return r._onMouseDown.fire(e)}),r}return ge(t,e),t.prototype.enable=function(){B["I"](this.domNode,"disabled"),this.inputBox.enable(),this.preserveCase.enable()},t.prototype.disable=function(){B["f"](this.domNode,"disabled"),this.inputBox.disable(),this.preserveCase.disable()},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder};this.preserveCase.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getPreserveCase=function(){return this.preserveCase.checked},t.prototype.setPreserveCase=function(e){this.preserveCase.checked=e},t.prototype.focusOnPreserve=function(){this.preserveCase.focus()},t.prototype.buildDomNode=function(e,t,n,i){var o=this;this.domNode=document.createElement("div"),B["f"](this.domNode,"monaco-findInput"),this.inputBox=this._register(new ce["a"](this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:e,flexibleHeight:t,flexibleWidth:n,flexibleMaxHeight:i})),this.preserveCase=this._register(new _e({appendTitle:"",isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder})),this._register(this.preserveCase.onChange(function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()})),this._register(this.preserveCase.onKeyDown(function(e){o._onPreserveCaseKeyDown.fire(e)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;var r=[this.preserveCase.domNode];this.onkeydown(this.domNode,function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=r.indexOf(document.activeElement);if(t>=0){var n=-1;e.equals(17)?n=(t+1)%r.length:e.equals(15)&&(n=0===t?r.length-1:t-1),e.equals(9)?r[t].blur():n>=0&&r[n].focus(),B["c"].stop(e,!0)}}});var s=document.createElement("div");s.className="controls",s.style.display=this._showOptionButtons?"block":"none",s.appendChild(this.preserveCase.domNode),this.domNode.appendChild(s)},t.prototype.validate=function(){this.inputBox&&this.inputBox.validate()},Object.defineProperty(t.prototype,"width",{set:function(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t}(H["a"]),ye=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),we=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Ce=function(e,t){return function(n,i){t(n,i,e)}},Se="historyNavigationWidget",Le="historyNavigationEnabled";function Oe(e,t,n){new k["d"](n,t).bindTo(e)}function xe(e,t){return e.createScoped(t.target)}function Ne(e,t){return e.getContext(document.activeElement).getValue(t)}function De(e,t){var n=xe(e,t);Oe(n,t,Se);var i=new k["d"](Le,!0).bindTo(n);return{scopedContextKeyService:n,historyNavigationEnablement:i}}var ke=function(e){function t(t,n,i,o,r){void 0===r&&(r=!1);var s=e.call(this,t,n,r,i)||this;return s._register(De(o,{target:s.inputBox.element,historyNavigator:s.inputBox}).scopedContextKeyService),s}return ye(t,e),t=we([Ce(3,k["c"])],t),t}(pe),Ie=function(e){function t(t,n,i,o,r){void 0===r&&(r=!1);var s=e.call(this,t,n,r,i)||this;return s._register(De(o,{target:s.inputBox.element,historyNavigator:s.inputBox}).scopedContextKeyService),s}return ye(t,e),t=we([Ce(3,k["c"])],t),t}(be);fe["a"].registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:k["a"].and(k["a"].has(Se),k["a"].equals(Le,!0)),primary:16,secondary:[528],handler:function(e,t){var n=Ne(e.get(k["c"]),Se);if(n){var i=n.historyNavigator;i.showPreviousValue()}}}),fe["a"].registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:k["a"].and(k["a"].has(Se),k["a"].equals(Le,!0)),primary:18,secondary:[530],handler:function(e,t){var n=Ne(e.get(k["c"]),Se);if(n){var i=n.historyNavigator;i.showNextValue()}}});var Ee=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Me=i["a"]("label.find","Find"),Te=i["a"]("placeholder.find","Find"),Pe=i["a"]("label.previousMatchButton","Previous match"),Re=i["a"]("label.nextMatchButton","Next match"),Ae=i["a"]("label.toggleSelectionFind","Find in selection"),Fe=i["a"]("label.closeButton","Close"),je=i["a"]("label.replace","Replace"),We=i["a"]("placeholder.replace","Replace"),Ve=i["a"]("label.replaceButton","Replace"),Be=i["a"]("label.replaceAllButton","Replace All"),He=i["a"]("label.toggleReplaceButton","Toggle Replace mode"),ze=i["a"]("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",j),Ue=i["a"]("label.matchesLocation","{0} of {1}"),Ke=i["a"]("label.noResults","No Results"),qe=419,Ge=275,Ze=Ge-54,Ye=69,Xe=17+(Ye+3+1)+92+2,$e=33,Qe="ctrlEnterReplaceAll.windows.donotask",Je=le["d"]?256:2048,et=function(){function e(e){this.afterLineNumber=e,this.heightInPx=$e,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}return e}();function tt(e,t,n){var i=!!t.match(/\n/);n&&i&&n.selectionStart>0&&e.stopPropagation()}function nt(e,t,n){var i=!!t.match(/\n/);n&&i&&n.selectionEnd=0?B["f"](this._domNode,"multipleline"):B["I"](this._domNode,"multipleline");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.getConfiguration().readOnly||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=B["B"](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.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){var t=this._state.searchString.length>0&&0===this._state.matchesCount;B["R"](this._domNode,"no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory()},t.prototype._delayedUpdateHistory=function(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this))},t.prototype._updateHistory=function(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()},t.prototype._updateMatchesCount=function(){var e;if(this._matchesCount.style.minWidth=Ye+"px",this._state.matchesCount>=j?this._matchesCount.title=ze:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){var t=String(this._state.matchesCount);this._state.matchesCount>=j&&(t+="+");var n=String(this._state.matchesPosition);"0"===n&&(n="?"),e=s["r"](Ue,n,t)}else e=Ke;this._matchesCount.appendChild(document.createTextNode(e)),Object(se["a"])(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString),!0),Ye=Math.max(Ye,this._matchesCount.clientWidth)},t.prototype._getAriaLabel=function(e,t,n){return e===Ke?""===n?i["a"]("ariaSearchNoResultEmpty","{0} found",e):i["a"]("ariaSearchNoResult","{0} found for {1}",e,n):t?i["a"]("ariaSearchNoResultWithLineNum","{0} found for {1} at {2}",e,n,t.startLineNumber+":"+t.startColumn):i["a"]("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for {1}",e,n)},t.prototype._updateToggleSelectionFindButton=function(){var e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),n=this._toggleSelectionFind.checked;this._toggleSelectionFind.setEnabled(this._isVisible&&(n||t))},t.prototype._updateButtons=function(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);var e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t),this._nextBtn.setEnabled(this._isVisible&&e&&t),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),B["R"](this._domNode,"replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);var n=!this._codeEditor.getConfiguration().readOnly;this._toggleReplaceBtn.setEnabled(this._isVisible&&n)},t.prototype._reveal=function(){var e=this;if(!this._isVisible){this._isVisible=!0;var t=this._codeEditor.getSelection(),n=!!t&&(t.startLineNumber!==t.endLineNumber||t.startColumn!==t.endColumn);n&&this._codeEditor.getConfiguration().contribInfo.find.autoFindInSelection?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._tryUpdateWidgetWidth(),this._updateButtons(),setTimeout(function(){B["f"](e._domNode,"visible"),e._domNode.setAttribute("aria-hidden","false")},0),setTimeout(function(){e._findInput.validate()},200),this._codeEditor.layoutOverlayWidget(this);var i=!0;if(this._codeEditor.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&t){var o=this._codeEditor.getDomNode();if(o){var r=B["x"](o),s=this._codeEditor.getScrolledVisiblePosition(t.getStartPosition()),a=r.left+(s?s.left:0),u=s?s.top:0;if(this._viewZone&&ut.startLineNumber&&(i=!1);var l=B["z"](this._domNode).left;a>l&&(i=!1);var c=this._codeEditor.getScrolledVisiblePosition(t.getEndPosition()),d=r.left+(c?c.left:0);d>l&&(i=!1)}}}this._showViewZone(i)}},t.prototype._hide=function(e){this._isVisible&&(this._isVisible=!1,this._updateButtons(),B["I"](this._domNode,"visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())},t.prototype._layoutViewZone=function(){var e=this,t=this._codeEditor.getConfiguration().contribInfo.find.addExtraSpaceOnTop;if(t){if(this._isVisible){var n=this._viewZone;void 0===this._viewZoneId&&n&&this._codeEditor.changeViewZones(function(t){n.heightInPx=e._getHeight(),e._viewZoneId=t.addZone(n),e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()+n.heightInPx)})}}else this._removeViewZone()},t.prototype._showViewZone=function(e){var t=this;if(void 0===e&&(e=!0),this._isVisible){var n=this._codeEditor.getConfiguration().contribInfo.find.addExtraSpaceOnTop;if(n){void 0===this._viewZone&&(this._viewZone=new et(0));var i=this._viewZone;this._codeEditor.changeViewZones(function(n){if(void 0!==t._viewZoneId){var o=t._getHeight();if(o===i.heightInPx)return;var r=o-i.heightInPx;return i.heightInPx=o,n.layoutZone(t._viewZoneId),void(e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+r))}r=t._getHeight();i.heightInPx=r,t._viewZoneId=n.addZone(i),e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+r)})}}},t.prototype._removeViewZone=function(){var e=this;this._codeEditor.changeViewZones(function(t){void 0!==e._viewZoneId&&(t.removeZone(e._viewZoneId),e._viewZoneId=void 0,e._viewZone&&(e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()-e._viewZone.heightInPx),e._viewZone=void 0))})},t.prototype._applyTheme=function(e){var t={inputActiveOptionBorder:e.getColor(m["V"]),inputActiveOptionBackground:e.getColor(m["U"]),inputBackground:e.getColor(m["W"]),inputForeground:e.getColor(m["Y"]),inputBorder:e.getColor(m["X"]),inputValidationInfoBackground:e.getColor(m["cb"]),inputValidationInfoForeground:e.getColor(m["eb"]),inputValidationInfoBorder:e.getColor(m["db"]),inputValidationWarningBackground:e.getColor(m["fb"]),inputValidationWarningForeground:e.getColor(m["hb"]),inputValidationWarningBorder:e.getColor(m["gb"]),inputValidationErrorBackground:e.getColor(m["Z"]),inputValidationErrorForeground:e.getColor(m["bb"]),inputValidationErrorBorder:e.getColor(m["ab"])};this._findInput.style(t),this._replaceInput.style(t)},t.prototype._tryUpdateWidgetWidth=function(){if(this._isVisible){var e=this._codeEditor.getConfiguration().layoutInfo.contentWidth;if(e<=0)B["f"](this._domNode,"hiddenEditor");else{B["C"](this._domNode,"hiddenEditor")&&B["I"](this._domNode,"hiddenEditor");var t=this._codeEditor.getConfiguration().layoutInfo.width,n=this._codeEditor.getConfiguration().layoutInfo.minimapWidth,i=!1,o=!1,r=!1;if(this._resized){var s=B["B"](this._domNode);if(s>qe)return this._domNode.style.maxWidth=t-28-n-15+"px",void(this._replaceInput.width=B["B"](this._findInput.domNode))}if(qe+28+n>=t&&(o=!0),qe+28+n-Ye>=t&&(r=!0),qe+28+n-Ye>=t+50&&(i=!0),B["R"](this._domNode,"collapsed-find-widget",i),B["R"](this._domNode,"narrow-find-widget",r),B["R"](this._domNode,"reduced-find-widget",o),r||i||(this._domNode.style.maxWidth=t-28-n-15+"px"),this._resized){this._findInput.inputBox.layout();var a=this._findInput.inputBox.width;a>0&&(this._replaceInput.width=a)}}}},t.prototype._getHeight=function(){var e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e},t.prototype._tryUpdateHeight=function(){var e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=e+"px",!0)},t.prototype.focusFindInput=function(){this._findInput.select(),this._findInput.focus()},t.prototype.focusReplaceInput=function(){this._replaceInput.select(),this._replaceInput.focus()},t.prototype.highlightFindOptions=function(){this._findInput.highlightFindOptions()},t.prototype._updateSearchScope=function(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){var e=this._codeEditor.getSelection();1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));var t=this._state.currentMatch;e.startLineNumber!==e.endLineNumber&&(d["a"].equalsRange(e,t)||this._state.change({searchScope:e},!0))}},t.prototype._onFindInputMouseDown=function(e){e.middleButton&&e.stopPropagation()},t.prototype._onFindInputKeyDown=function(e){if(e.equals(3|Je)){var t=this._findInput.inputBox.inputElement,n=t.selectionStart,i=t.selectionEnd,o=t.value;if(null!==n&&null!==i){var r=o.substr(0,n)+"\n"+o.substr(i);return this._findInput.inputBox.value=r,t.setSelectionRange(n+1,n+1),this._findInput.inputBox.layout(),void e.preventDefault()}}return e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?tt(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?nt(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0},t.prototype._onReplaceInputKeyDown=function(e){if(e.equals(3|Je)){le["g"]&&le["e"]&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(i["a"]("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(Qe,!0,0));var t=this._replaceInput.inputBox.inputElement,n=t.selectionStart,o=t.selectionEnd,r=t.value;if(null!==n&&null!==o){var s=r.substr(0,n)+"\n"+r.substr(o);return this._replaceInput.inputBox.value=s,t.setSelectionRange(n+1,n+1),this._replaceInput.inputBox.layout(),void e.preventDefault()}}return e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?tt(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?nt(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0},t.prototype.getHorizontalSashTop=function(e){return 0},t.prototype.getHorizontalSashLeft=function(e){return 0},t.prototype.getHorizontalSashWidth=function(e){return 500},t.prototype._keybindingLabelFor=function(e){var t=this._keybindingService.lookupKeybinding(e);return t?" ("+t.getLabel()+")":""},t.prototype._buildDomNode=function(){var e=this,t=!0,n=!0;this._findInput=this._register(new ke(null,this._contextViewProvider,{width:Ze,label:Me,placeholder:Te,appendCaseSensitiveLabel:this._keybindingLabelFor(F.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(F.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(F.ToggleRegexCommand),validation:function(t){if(0===t.length||!e._findInput.getRegex())return null;try{return new RegExp(t),null}catch(n){return{content:n.message}}},flexibleHeight:t,flexibleWidth:n,flexibleMaxHeight:118},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(function(t){return e._onFindInputKeyDown(t)})),this._register(this._findInput.inputBox.onDidChange(function(){e._ignoreChangeEvent||e._state.change({searchString:e._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(function(){e._state.change({isRegex:e._findInput.getRegex(),wholeWord:e._findInput.getWholeWords(),matchCase:e._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(function(t){t.equals(1026)&&e._isReplaceVisible&&(e._replaceInput.focus(),t.preventDefault())})),this._register(this._findInput.onRegexKeyDown(function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceInput.focusOnPreserve(),t.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(function(t){e._tryUpdateHeight()&&e._showViewZone()})),le["c"]&&this._register(this._findInput.onMouseDown(function(t){return e._onFindInputMouseDown(t)})),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new rt({label:Pe+this._keybindingLabelFor(F.PreviousMatchFindAction),className:"previous",onTrigger:function(){e._codeEditor.getAction(F.PreviousMatchFindAction).run().then(void 0,ue["e"])}})),this._nextBtn=this._register(new rt({label:Re+this._keybindingLabelFor(F.NextMatchFindAction),className:"next",onTrigger:function(){e._codeEditor.getAction(F.NextMatchFindAction).run().then(void 0,ue["e"])}}));var i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);var o=document.createElement("div");o.className="find-actions",i.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new ot({parent:o,title:Ae+this._keybindingLabelFor(F.ToggleSearchScopeCommand),onChange:function(){if(e._toggleSelectionFind.checked){if(e._codeEditor.hasModel()){var t=e._codeEditor.getSelection();1===t.endColumn&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,e._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()||e._state.change({searchScope:t},!0)}}else e._state.change({searchScope:null},!0)}})),this._closeBtn=this._register(new rt({label:Fe+this._keybindingLabelFor(F.CloseFindWidgetCommand),className:"close-fw",onTrigger:function(){e._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceBtn.isEnabled()?e._replaceBtn.focus():e._codeEditor.focus(),t.preventDefault())}})),o.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new Ie(null,void 0,{label:je,placeholder:We,history:[],flexibleHeight:t,flexibleWidth:n,flexibleMaxHeight:118},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(function(t){return e._onReplaceInputKeyDown(t)})),this._register(this._replaceInput.inputBox.onDidChange(function(){e._state.change({replaceString:e._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(function(t){e._isReplaceVisible&&e._tryUpdateHeight()&&e._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(function(){e._state.change({preserveCase:e._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(function(t){t.equals(2)&&(e._prevBtn.isEnabled()?e._prevBtn.focus():e._nextBtn.isEnabled()?e._nextBtn.focus():e._toggleSelectionFind.isEnabled()?e._toggleSelectionFind.focus():e._closeBtn.isEnabled()&&e._closeBtn.focus(),t.preventDefault())})),this._replaceBtn=this._register(new rt({label:Ve+this._keybindingLabelFor(F.ReplaceOneAction),className:"replace",onTrigger:function(){e._controller.replace()},onKeyDown:function(t){t.equals(1026)&&(e._closeBtn.focus(),t.preventDefault())}})),this._replaceAllBtn=this._register(new rt({label:Be+this._keybindingLabelFor(F.ReplaceAllAction),className:"replace-all",onTrigger:function(){e._controller.replaceAll()}}));var r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);var s=document.createElement("div");s.className="replace-actions",r.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new rt({label:He,className:"toggle left",onTrigger:function(){e._state.change({isReplaceRevealed:!e._isReplaceVisible},!1),e._isReplaceVisible&&(e._replaceInput.width=B["B"](e._findInput.domNode),e._replaceInput.inputBox.layout()),e._showViewZone()}})),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width=qe+"px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(r),this._resizeSash=new ae["a"](this._domNode,this,{orientation:0}),this._resized=!1;var a=qe;this._register(this._resizeSash.onDidStart(function(){a=B["B"](e._domNode)})),this._register(this._resizeSash.onDidChange(function(t){e._resized=!0;var n=a+t.startX-t.currentX;if(!(no||(e._domNode.style.width=n+"px",e._findInput.inputBox.width=i,e._isReplaceVisible&&(e._replaceInput.width=B["B"](e._findInput.domNode)),e._findInput.inputBox.layout(),e._tryUpdateHeight())}})),this._register(this._resizeSash.onDidReset(function(){var t=B["B"](e._domNode);if(!(t=0},Object.defineProperty(t.prototype,"checked",{get:function(){return this._checkbox.checked},set:function(e){this._checkbox.checked=e},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this._domNode.focus()},t.prototype.enable=function(){this._checkbox.removeAttribute("disabled")},t.prototype.disable=function(){this._checkbox.disabled=!0},t.prototype.setEnabled=function(e){e?(this.enable(),this.domNode.tabIndex=0):(this.disable(),this.domNode.tabIndex=-1)},t._COUNTER=0,t}(H["a"]),rt=function(e){function t(t){var n=e.call(this)||this;return n._opts=t,n._domNode=document.createElement("div"),n._domNode.title=n._opts.label,n._domNode.tabIndex=0,n._domNode.className="button "+n._opts.className,n._domNode.setAttribute("role","button"),n._domNode.setAttribute("aria-label",n._opts.label),n.onclick(n._domNode,function(e){n._opts.onTrigger(),e.preventDefault()}),n.onkeydown(n._domNode,function(e){if(e.equals(10)||e.equals(3))return n._opts.onTrigger(),void e.preventDefault();n._opts.onKeyDown&&n._opts.onKeyDown(e)}),n}return Ee(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),t.prototype.isEnabled=function(){return this._domNode.tabIndex>=0},t.prototype.focus=function(){this._domNode.focus()},t.prototype.setEnabled=function(e){B["R"](this._domNode,"disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1},t.prototype.setExpanded=function(e){this._domNode.setAttribute("aria-expanded",String(!!e))},t.prototype.toggleClass=function(e,t){B["R"](this._domNode,e,t)},t}(H["a"]);Object(v["f"])(function(e,t){var n=function(e,n){n&&t.addRule(".monaco-editor "+e+" { background-color: "+n+"; }")};n(".findMatch",e.getColor(m["t"])),n(".currentFindMatch",e.getColor(m["r"])),n(".findScope",e.getColor(m["v"]));var i=e.getColor(m["N"]);n(".find-widget",i);var o=e.getColor(m["Wb"]);o&&t.addRule(".monaco-editor .find-widget { box-shadow: 0 2px 8px "+o+"; }");var r=e.getColor(m["u"]);r&&t.addRule(".monaco-editor .findMatch { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+r+"; box-sizing: border-box; }");var s=e.getColor(m["s"]);s&&t.addRule(".monaco-editor .currentFindMatch { border: 2px solid "+s+"; padding: 1px; box-sizing: border-box; }");var a=e.getColor(m["w"]);a&&t.addRule(".monaco-editor .findScope { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+a+"; }");var u=e.getColor(m["e"]);u&&t.addRule(".monaco-editor .find-widget { border: 2px solid "+u+"; }");var l=e.getColor(m["P"]);l&&t.addRule(".monaco-editor .find-widget { color: "+l+"; }");var c=e.getColor(m["R"]);c&&t.addRule(".monaco-editor .find-widget.no-results .matchesCount { color: "+c+"; }");var d=e.getColor(m["Q"]);if(d)t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+d+"; width: 3px !important; margin-left: -4px;}");else{var h=e.getColor(m["O"]);h&&t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+h+"; width: 3px !important; margin-left: -4px;}")}var p=e.getColor(m["V"]);p&&t.addRule(".monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { border: 1px solid "+p.toString()+"; }");var f=e.getColor(m["U"]);f&&t.addRule(".monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { background-color: "+f.toString()+"; }");var g=e.getColor(m["S"]);g&&t.addRule(".monaco-workbench .monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: "+g+"; }")});var st=n("f577"),at=n("533b"),ut=n("0a0f"),lt=n("6dec"),ct=n("03e8"),dt=n("b0cd");n.d(t,"getSelectionSearchString",function(){return mt}),n.d(t,"CommonFindController",function(){return vt}),n.d(t,"FindController",function(){return _t}),n.d(t,"StartFindAction",function(){return bt}),n.d(t,"StartFindWithSelectionAction",function(){return yt}),n.d(t,"MatchFindAction",function(){return wt}),n.d(t,"NextMatchFindAction",function(){return Ct}),n.d(t,"NextMatchFindAction2",function(){return St}),n.d(t,"PreviousMatchFindAction",function(){return Lt}),n.d(t,"PreviousMatchFindAction2",function(){return Ot}),n.d(t,"SelectionMatchFindAction",function(){return xt}),n.d(t,"NextSelectionMatchFindAction",function(){return Nt}),n.d(t,"PreviousSelectionMatchFindAction",function(){return Dt}),n.d(t,"StartFindReplaceAction",function(){return kt});var ht=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pt=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},ft=function(e,t){return function(n,i){t(n,i,e)}},gt=524288;function mt(e){if(!e.hasModel())return null;var t=e.getSelection();if(t.startLineNumber===t.endLineNumber)if(t.isEmpty()){var n=e.getModel().getWordAtPosition(t.getStartPosition());if(n)return n.word}else if(e.getModel().getValueLengthInRange(t)e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()||this._state.change({searchScope:e},!0)}},t.prototype.setSearchString=function(e){this._state.isRegex&&(e=s["p"](e)),this._state.change({searchString:e},!1)},t.prototype.highlightFindOptions=function(){},t.prototype._start=function(e){if(this.disposeModel(),this._editor.hasModel()){var t={isRevealed:!0};if(e.seedSearchStringFromSelection){var n=mt(this._editor);n&&(this._state.isRegex?t.searchString=s["p"](n):t.searchString=n)}if(!t.searchString&&e.seedSearchStringFromGlobalClipboard){n=this.getGlobalBufferTerm();n&&(t.searchString=n)}if(e.forceRevealReplace?t.isReplaceRevealed=!0:this._findWidgetVisible.get()||(t.isReplaceRevealed=!1),e.updateSearchScope){var i=this._editor.getSelection();i.isEmpty()||(t.searchScope=i)}this._state.change(t,!1),this._model||(this._model=new V(this._editor,this._state))}},t.prototype.start=function(e){this._start(e)},t.prototype.moveToNextMatch=function(){return!!this._model&&(this._model.moveToNextMatch(),!0)},t.prototype.moveToPrevMatch=function(){return!!this._model&&(this._model.moveToPrevMatch(),!0)},t.prototype.replace=function(){return!!this._model&&(this._model.replace(),!0)},t.prototype.replaceAll=function(){return!!this._model&&(this._model.replaceAll(),!0)},t.prototype.selectAllMatches=function(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)},t.prototype.getGlobalBufferTerm=function(){return this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""},t.prototype.setGlobalBufferTerm=function(e){this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)},t.ID="editor.contrib.findController",t=pt([ft(1,k["c"]),ft(2,ct["a"]),ft(3,st["a"])],t),t}(r["a"]),_t=function(e){function t(t,n,i,o,r,s,a,u){var l=e.call(this,t,i,a,u)||this;return l._contextViewService=n,l._keybindingService=o,l._themeService=r,l._notificationService=s,l._widget=null,l._findOptionsWidget=null,l}return ht(t,e),t.prototype._start=function(t){this._widget||this._createFindWidget(),!this._widget.getPosition()&&this._editor.getConfiguration().contribInfo.find.autoFindInSelection&&(t.updateSearchScope=!0),e.prototype._start.call(this,t),2===t.shouldFocus?this._widget.focusReplaceInput():1===t.shouldFocus&&this._widget.focusFindInput()},t.prototype.highlightFindOptions=function(){this._widget||this._createFindWidget(),this._state.isRevealed?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()},t.prototype._createFindWidget=function(){this._widget=this._register(new it(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new ie(this._editor,this._state,this._keybindingService,this._themeService))},t=pt([ft(1,at["b"]),ft(2,k["c"]),ft(3,lt["a"]),ft(4,v["c"]),ft(5,dt["a"]),ft(6,ct["a"]),ft(7,Object(ut["d"])(st["a"]))],t),t}(vt),bt=function(e){function t(){return e.call(this,{id:F.StartFindAction,label:i["a"]("startFindAction","Find"),alias:"Find",precondition:void 0,kbOpts:{kbExpr:null,primary:2084,weight:100},menubarOpts:{menuId:14,group:"3_find",title:i["a"]({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}})||this}return ht(t,e),t.prototype.run=function(e,t){var n=vt.get(t);n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1})},t}(a["b"]),yt=function(e){function t(){return e.call(this,{id:F.StartFindWithSelection,label:i["a"]("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})||this}return ht(t,e),t.prototype.run=function(e,t){var n=vt.get(t);n&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:!0,seedSearchStringFromGlobalClipboard:!1,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1}),n.setGlobalBufferTerm(n.getState().searchString))},t}(a["b"]),wt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ht(t,e),t.prototype.run=function(e,t){var n=vt.get(t);n&&!this._run(n)&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1}),this._run(n))},t}(a["b"]),Ct=function(e){function t(){return e.call(this,{id:F.NextMatchFindAction,label:i["a"]("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:u["a"].focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100}})||this}return ht(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(wt),St=function(e){function t(){return e.call(this,{id:F.NextMatchFindAction,label:i["a"]("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:k["a"].and(u["a"].focus,E),primary:3,weight:100}})||this}return ht(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(wt),Lt=function(e){function t(){return e.call(this,{id:F.PreviousMatchFindAction,label:i["a"]("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:u["a"].focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100}})||this}return ht(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(wt),Ot=function(e){function t(){return e.call(this,{id:F.PreviousMatchFindAction,label:i["a"]("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:k["a"].and(u["a"].focus,E),primary:1027,weight:100}})||this}return ht(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(wt),xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ht(t,e),t.prototype.run=function(e,t){var n=vt.get(t);if(n){var i=mt(t);i&&n.setSearchString(i),this._run(n)||(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1}),this._run(n))}},t}(a["b"]),Nt=function(e){function t(){return e.call(this,{id:F.NextSelectionMatchFindAction,label:i["a"]("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:u["a"].focus,primary:2109,weight:100}})||this}return ht(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(xt),Dt=function(e){function t(){return e.call(this,{id:F.PreviousSelectionMatchFindAction,label:i["a"]("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:u["a"].focus,primary:3133,weight:100}})||this}return ht(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(xt),kt=function(e){function t(){return e.call(this,{id:F.StartFindReplaceAction,label:i["a"]("startReplace","Replace"),alias:"Replace",precondition:void 0,kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menubarOpts:{menuId:14,group:"3_find",title:i["a"]({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}})||this}return ht(t,e),t.prototype.run=function(e,t){if(t.hasModel()&&!t.getConfiguration().readOnly){var n=vt.get(t),i=t.getSelection(),o=n.isFindInputFocused(),r=!i.isEmpty()&&i.startLineNumber===i.endLineNumber&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&!o,s=o||r?2:1;n&&n.start({forceRevealReplace:!0,seedSearchStringFromSelection:r,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,shouldFocus:s,shouldAnimate:!0,updateSearchScope:!1})}},t}(a["b"]);Object(a["h"])(_t),Object(a["f"])(bt),Object(a["f"])(yt),Object(a["f"])(Ct),Object(a["f"])(St),Object(a["f"])(Lt),Object(a["f"])(Ot),Object(a["f"])(Nt),Object(a["f"])(Dt),Object(a["f"])(kt);var It=a["c"].bindToContribution(vt.get);Object(a["g"])(new It({id:F.CloseFindWidgetCommand,precondition:I,handler:function(e){return e.closeFindWidget()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:9,secondary:[1033]}})),Object(a["g"])(new It({id:F.ToggleCaseSensitiveCommand,precondition:void 0,handler:function(e){return e.toggleCaseSensitive()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:T.primary,mac:T.mac,win:T.win,linux:T.linux}})),Object(a["g"])(new It({id:F.ToggleWholeWordCommand,precondition:void 0,handler:function(e){return e.toggleWholeWords()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:P.primary,mac:P.mac,win:P.win,linux:P.linux}})),Object(a["g"])(new It({id:F.ToggleRegexCommand,precondition:void 0,handler:function(e){return e.toggleRegex()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:R.primary,mac:R.mac,win:R.win,linux:R.linux}})),Object(a["g"])(new It({id:F.ToggleSearchScopeCommand,precondition:void 0,handler:function(e){return e.toggleSearchScope()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:A.primary,mac:A.mac,win:A.win,linux:A.linux}})),Object(a["g"])(new It({id:F.ReplaceOneAction,precondition:I,handler:function(e){return e.replace()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:3094}})),Object(a["g"])(new It({id:F.ReplaceOneAction,precondition:I,handler:function(e){return e.replace()},kbOpts:{weight:105,kbExpr:k["a"].and(u["a"].focus,M),primary:3}})),Object(a["g"])(new It({id:F.ReplaceAllAction,precondition:I,handler:function(e){return e.replaceAll()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:2563}})),Object(a["g"])(new It({id:F.ReplaceAllAction,precondition:I,handler:function(e){return e.replaceAll()},kbOpts:{weight:105,kbExpr:k["a"].and(u["a"].focus,M),primary:void 0,mac:{primary:2051}}})),Object(a["g"])(new It({id:F.SelectAllMatchesAction,precondition:I,handler:function(e){return e.selectAllMatches()},kbOpts:{weight:105,kbExpr:u["a"].focus,primary:515}}))},a222:function(e,t,n){"use strict";n.r(t),n.d(t,"IPadShowKeyboard",function(){return u});n("722f9");var i=n("0f70"),o=n("11f7"),r=n("a666"),s=n("b2cc"),a=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),u=function(e){function t(t){var n=e.call(this)||this;return n.editor=t,n.widget=null,i["k"]&&(n._register(t.onDidChangeConfiguration(function(){return n.update()})),n.update()),n}return a(t,e),t.prototype.update=function(){var e=!this.editor.getConfiguration().readOnly;!this.widget&&e?this.widget=new l(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)},t.prototype.getId=function(){return t.ID},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.widget&&(this.widget.dispose(),this.widget=null)},t.ID="editor.contrib.iPadShowKeyboard",t}(r["a"]),l=function(e){function t(t){var n=e.call(this)||this;return n.editor=t,n._domNode=document.createElement("textarea"),n._domNode.className="iPadShowKeyboard",n._register(o["h"](n._domNode,"touchstart",function(e){n.editor.focus()})),n._register(o["h"](n._domNode,"focus",function(e){n.editor.focus()})),n.editor.addOverlayWidget(n),n}return a(t,e),t.prototype.dispose=function(){this.editor.removeOverlayWidget(this),e.prototype.dispose.call(this)},t.prototype.getId=function(){return t.ID},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getPosition=function(){return{preference:1}},t.ID="editor.contrib.ShowKeyboardWidget",t}(r["a"]);Object(s["h"])(u)},a40b:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("0a0f"),o="editorWorkerService",r=Object(i["c"])(o)},a60f:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return c});var i,o=n("e8e3"),r=n("a666"),s=n("11f7"),a=n("6424"),u=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};(function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"})(i||(i={}));var c=function(e){function t(){var t=e.call(this)||this;return t.dispatched=!1,t.activeTouches={},t.handle=null,t.targets=[],t._register(s["h"](document,"touchstart",function(e){return t.onTouchStart(e)})),t._register(s["h"](document,"touchend",function(e){return t.onTouchEnd(e)})),t._register(s["h"](document,"touchmove",function(e){return t.onTouchMove(e)})),t}return u(t,e),t.addTarget=function(e){t.isTouchDevice()&&(t.INSTANCE||(t.INSTANCE=new t),t.INSTANCE.targets.push(e))},t.isTouchDevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0},t.prototype.dispose=function(){this.handle&&(this.handle.dispose(),this.handle=null),e.prototype.dispose.call(this)},t.prototype.onTouchStart=function(e){var t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(var n=0,o=e.targetTouches.length;n=t.HOLD_DELAY&&Math.abs(c.initialPageX-o["s"](c.rollingPageX))<30&&Math.abs(c.initialPageY-o["s"](c.rollingPageY))<30){h=a.newGestureEvent(i.Contextmenu,c.initialTarget);h.pageX=o["s"](c.rollingPageX),h.pageY=o["s"](c.rollingPageY),a.dispatchEvent(h)}else if(1===r){var p=o["s"](c.rollingPageX),f=o["s"](c.rollingPageY),g=o["s"](c.rollingTimestamps)-c.rollingTimestamps[0],m=p-c.rollingPageX[0],v=f-c.rollingPageY[0],_=a.targets.filter(function(e){return c.initialTarget instanceof Node&&e.contains(c.initialTarget)});a.inertia(_,n,Math.abs(m)/g,m>0?1:-1,p,Math.abs(v)/g,v>0?1:-1,f)}a.dispatchEvent(a.newGestureEvent(i.End,c.initialTarget)),delete a.activeTouches[l.identifier]},a=this,u=0,l=e.changedTouches.length;u0&&(g=!1,p=r*o*h),u>0&&(g=!1,f=l*u*h);var m=d.newGestureEvent(i.Change);m.translationX=p,m.translationY=f,e.forEach(function(e){return e.dispatchEvent(m)}),g||d.inertia(e,s,o,r,a+p,u,l,c+f)})},t.prototype.onTouchMove=function(e){for(var t=Date.now(),n=0,r=e.changedTouches.length;n3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(s.pageX),a.rollingPageY.push(s.pageY),a.rollingTimestamps.push(t)}else console.warn("end of an UNKNOWN touch",s)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)},t.SCROLL_FRICTION=-.005,t.HOLD_DELAY=700,l([a["a"]],t,"isTouchDevice",null),t}(r["a"])},a65a:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"c",function(){return r}),n.d(t,"b",function(){return s});var i=n("3742"),o=function(){function e(e){this.value=e}return e.prototype.equals=function(e){return this.value===e.value},e.prototype.contains=function(t){return this.equals(t)||Object(i["J"])(t.value,this.value+e.sep)},e.prototype.intersects=function(e){return this.contains(e)||e.contains(this)},e.sep=".",e.Empty=new e(""),e.QuickFix=new e("quickfix"),e.Refactor=new e("refactor"),e.Source=new e("source"),e.SourceOrganizeImports=new e("source.organizeImports"),e.SourceFixAll=new e("source.fixAll"),e}();function r(e,t){return!(e.kind&&!e.kind.intersects(t))&&!(o.Source.contains(t)&&!e.includeSourceActions)}function s(e,t){var n=t.kind?new o(t.kind):void 0;return!!(!e.kind||n&&e.kind.contains(n))&&(!(!e.includeSourceActions&&n&&o.Source.contains(n))&&!(e.onlyIncludePreferredActions&&!t.isPreferred))}},a666:function(e,t,n){"use strict";n.d(t,"g",function(){return a}),n.d(t,"f",function(){return u}),n.d(t,"e",function(){return l}),n.d(t,"h",function(){return c}),n.d(t,"b",function(){return d}),n.d(t,"a",function(){return h}),n.d(t,"d",function(){return p}),n.d(t,"c",function(){return f});var i=!1,o="__is_disposable_tracked__";function r(e){if(i&&e&&e!==h.None)try{e[o]=!0}catch(t){}}function s(e){if(!i)return e;var t=new Error("Potentially leaked disposable").stack;return setTimeout(function(){e[o]||console.log(t)},3e3),e}function a(e){return"function"===typeof e.dispose&&0===e.dispose.length}function u(e){return Array.isArray(e)?(e.forEach(function(e){e&&(r(e),e.dispose())}),[]):e?(r(e),e.dispose(),e):void 0}function l(){for(var e=[],t=0;t0){var n=t.shift();for(var i in Object.freeze(n),n)if(s.call(n,i)){var o=n[i];"object"!==typeof o||Object.isFrozen(o)||t.push(o)}}return e}var s=Object.prototype.hasOwnProperty;function a(e,t){return u(e,t,new Set)}function u(e,t,n){if(Object(i["k"])(e))return e;var o=t(e);if("undefined"!==typeof o)return o;if(Object(i["c"])(e)){for(var r=[],a=0,l=e;a=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},m=function(e,t){return function(n,i){t(n,i,e)}},v=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},_=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)},enumerable:!0,configurable:!0}),e.prototype.selectNextColorPresentation=function(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)},e.prototype.guessColorPresentation=function(e,t){for(var n=0;n0;return t&&n}Object(s["e"])("_executeHoverProvider",function(e,t){return F(e,t,d["a"].None)});var W=n("5fe7"),V=function(){function e(e,t,n,i,o){var r=this;this._computer=e,this._state=0,this._hoverTime=o,this._firstWaitScheduler=new W["d"](function(){return r._triggerAsyncComputation()},0),this._secondWaitScheduler=new W["d"](function(){return r._triggerSyncComputation()},0),this._loadingMessageScheduler=new W["d"](function(){return r._showLoadingMessage()},0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=n,this._progressCallback=i}return e.prototype.setHoverTime=function(e){this._hoverTime=e},e.prototype._firstWaitTime=function(){return this._hoverTime/2},e.prototype._secondWaitTime=function(){return this._hoverTime/2},e.prototype._loadingMessageTime=function(){return 3*this._hoverTime},e.prototype._triggerAsyncComputation=function(){var e=this;this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=Object(W["f"])(function(t){return e._computer.computeAsync(t)}),this._asyncComputationPromise.then(function(t){e._asyncComputationPromiseDone=!0,e._withAsyncResult(t)},function(t){return e._onError(t)})):this._asyncComputationPromiseDone=!0},e.prototype._triggerSyncComputation=function(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))},e.prototype._showLoadingMessage=function(){3===this._state&&this._onProgress(this._computer.getResultWithLoadingMessage())},e.prototype._withAsyncResult=function(e){e&&this._computer.onResult(e,!1),3===this._state&&(this._state=0,this._onComplete(this._computer.getResult()))},e.prototype._onComplete=function(e){this._completeCallback&&this._completeCallback(e)},e.prototype._onError=function(e){this._errorCallback?this._errorCallback(e):Object(A["e"])(e)},e.prototype._onProgress=function(e){this._progressCallback&&this._progressCallback(e)},e.prototype.start=function(e){if(0===e)0===this._state&&(this._state=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}},e.prototype.cancel=function(){this._loadingMessageScheduler.cancel(),1===this._state&&this._firstWaitScheduler.cancel(),2===this._state&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),3===this._state&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0},e}(),B=n("1898"),H=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),z=function(e){function t(t,n){var i=e.call(this)||this;return i.allowEditorOverflow=!0,i._id=t,i._editor=n,i._isVisible=!1,i._stoleFocus=!1,i._containerDomNode=document.createElement("div"),i._containerDomNode.className="monaco-editor-hover hidden",i._containerDomNode.tabIndex=0,i._domNode=document.createElement("div"),i._domNode.className="monaco-editor-hover-content",i.scrollbar=new B["a"](i._domNode,{}),i._register(i.scrollbar),i._containerDomNode.appendChild(i.scrollbar.getDomNode()),i.onkeydown(i._containerDomNode,function(e){e.equals(9)&&i.hide()}),i._register(i._editor.onDidChangeConfiguration(function(e){e.fontInfo&&i.updateFont()})),i._editor.onDidLayoutChange(function(e){return i.layout()}),i.layout(),i._editor.addContentWidget(i),i._showAtPosition=null,i._showAtRange=null,i._stoleFocus=!1,i}return H(t,e),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible=e,Object(c["R"])(this._containerDomNode,"hidden",!this._isVisible)},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this._id},t.prototype.getDomNode=function(){return this._containerDomNode},t.prototype.showAt=function(e,t,n){this._showAtPosition=e,this._showAtRange=t,this.isVisible=!0,this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=n,n&&this._containerDomNode.focus()},t.prototype.hide=function(){this.isVisible&&(this.isVisible=!1,this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus())},t.prototype.getPosition=function(){return this.isVisible?{position:this._showAtPosition,range:this._showAtRange,preference:[1,2]}:null},t.prototype.dispose=function(){this._editor.removeContentWidget(this),e.prototype.dispose.call(this)},t.prototype.updateFont=function(){var e=this,t=Array.prototype.slice.call(this._domNode.getElementsByClassName("code"));t.forEach(function(t){return e._editor.applyFontInfo(t)})},t.prototype.updateContents=function(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont(),this._editor.layoutContentWidget(this),this.onContentsChange()},t.prototype.onContentsChange=function(){this.scrollbar.scanDomNode()},t.prototype.layout=function(){var e=Math.max(this._editor.getLayoutInfo().height/4,250),t=this._editor.getConfiguration().fontInfo,n=t.fontSize,i=t.lineHeight;this._domNode.style.fontSize=n+"px",this._domNode.style.lineHeight=i+"px",this._domNode.style.maxHeight=e+"px",this._domNode.style.maxWidth=Math.max(.66*this._editor.getLayoutInfo().width,500)+"px"},t}(S["a"]),U=function(e){function t(t,n){var i=e.call(this)||this;return i._id=t,i._editor=n,i._isVisible=!1,i._domNode=document.createElement("div"),i._domNode.className="monaco-editor-hover hidden",i._domNode.setAttribute("aria-hidden","true"),i._domNode.setAttribute("role","presentation"),i._showAtLineNumber=-1,i._register(i._editor.onDidChangeConfiguration(function(e){e.fontInfo&&i.updateFont()})),i._editor.addOverlayWidget(i),i}return H(t,e),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible=e,Object(c["R"])(this._domNode,"hidden",!this._isVisible)},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this._id},t.prototype.getDomNode=function(){return this._domNode},t.prototype.showAt=function(e){this._showAtLineNumber=e,this.isVisible||(this.isVisible=!0);var t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(this._showAtLineNumber),i=this._editor.getScrollTop(),o=this._editor.getConfiguration().lineHeight,r=this._domNode.clientHeight,s=n-i-(r-o)/2;this._domNode.style.left=t.glyphMarginLeft+t.glyphMarginWidth+"px",this._domNode.style.top=Math.max(Math.round(s),0)+"px"},t.prototype.hide=function(){this.isVisible&&(this.isVisible=!1)},t.prototype.getPosition=function(){return null},t.prototype.dispose=function(){this._editor.removeOverlayWidget(this),e.prototype.dispose.call(this)},t.prototype.updateFont=function(){var e=this,t=Array.prototype.slice.call(this._domNode.getElementsByTagName("code")),n=Array.prototype.slice.call(this._domNode.getElementsByClassName("code"));t.concat(n).forEach(function(t){return e._editor.applyFontInfo(t)})},t.prototype.updateContents=function(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont()},t}(S["a"]),K=n("dea0"),q=n("b400"),G=n("82c9"),Z=n("5bd7"),Y=n("958f"),X=n("8495"),$=n("0b54"),Q=n("a65a"),J=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ee=c["a"],te=function(){function e(e,t,n){this.range=e,this.color=t,this.provider=n}return e}(),ne=function(){function e(e,t){this.range=e,this.marker=t}return e}(),ie=function(){function e(e,t){this._markerDecorationsService=t,this._editor=e,this._result=[]}return e.prototype.setRange=function(e){this._range=e,this._result=[]},e.prototype.clearResult=function(){this._result=[]},e.prototype.computeAsync=function(e){if(!this._editor.hasModel()||!this._range)return Promise.resolve([]);var t=this._editor.getModel();return m["n"].has(t)?F(t,new f["a"](this._range.startLineNumber,this._range.startColumn),e):Promise.resolve([])},e.prototype.computeSync=function(){var e=this;if(!this._editor.hasModel()||!this._range)return[];var t=this._editor.getModel(),n=this._range.startLineNumber;if(n>this._editor.getModel().getLineCount())return[];var i=_["ColorDetector"].get(this._editor),o=t.getLineMaxColumn(n),r=this._editor.getLineDecorations(n),s=!1,u=this._range,l=r.map(function(r){var l=r.range.startLineNumber===n?r.range.startColumn:1,c=r.range.endLineNumber===n?r.range.endColumn:o;if(l>u.startColumn||u.endColumn>c)return null;var d=new a["a"](u.startLineNumber,l,u.startLineNumber,c),h=e._markerDecorationsService.getMarker(t,r);if(h)return new ne(d,h);var f=i.getColorData(r.range.getStartPosition());if(!s&&f){s=!0;var g=f.colorInfo,m=g.color,v=g.range;return new te(v,m,f.provider)}if(Object(p["b"])(r.options.hoverMessage))return null;var _=r.options.hoverMessage?Object(R["b"])(r.options.hoverMessage):[];return{contents:_,range:d}});return Object(R["d"])(l)},e.prototype.onResult=function(e,t){this._result=t?e.concat(this._result.sort(function(e,t){return e instanceof te?-1:t instanceof te?1:0})):this._result.concat(e)},e.prototype.getResult=function(){return this._result.slice(0)},e.prototype.getResultWithLoadingMessage=function(){return this._result.slice(0).concat([this._getLoadingMessage()])},e.prototype._getLoadingMessage=function(){return{range:this._range,contents:[(new p["a"]).appendText(i["a"]("modesContentHover.loading","Loading..."))]}},e}(),oe=function(e){function t(n,i,o,s,a,u){void 0===u&&(u=Z["b"]);var l=e.call(this,t.ID,n)||this;return l._themeService=o,l._keybindingService=s,l._modeService=a,l._openerService=u,l.renderDisposable=l._register(new r["d"]),l._messages=[],l._lastRange=null,l._computer=new ie(l._editor,i),l._highlightDecorations=[],l._isChangingDecorations=!1,l._shouldFocus=!1,l._colorPicker=null,l._hoverOperation=new V(l._computer,function(e){return l._withResult(e,!0)},null,function(e){return l._withResult(e,!1)},l._editor.getConfiguration().contribInfo.hover.delay),l._register(c["k"](l.getDomNode(),c["d"].FOCUS,function(){l._colorPicker&&c["f"](l.getDomNode(),"colorpicker-hover")})),l._register(c["k"](l.getDomNode(),c["d"].BLUR,function(){c["I"](l.getDomNode(),"colorpicker-hover")})),l._register(n.onDidChangeConfiguration(function(e){l._hoverOperation.setHoverTime(l._editor.getConfiguration().contribInfo.hover.delay)})),l}return J(t,e),t.prototype.dispose=function(){this._hoverOperation.cancel(),e.prototype.dispose.call(this)},t.prototype.onModelDecorationsChanged=function(){this._isChangingDecorations||this.isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._colorPicker||this._hoverOperation.start(0))},t.prototype.startShowingAt=function(e,t,n){if(!this._lastRange||!this._lastRange.equalsRange(e)){if(this._hoverOperation.cancel(),this.isVisible)if(this._showAtPosition&&this._showAtPosition.lineNumber===e.startLineNumber){for(var i=[],o=0,r=this._messages.length;o=e.endColumn&&i.push(s)}if(i.length>0){if(re(i,this._messages))return;this._renderMessages(e,i)}else this.hide()}else this.hide();this._lastRange=e,this._computer.setRange(e),this._shouldFocus=n,this._hoverOperation.start(t)}},t.prototype.hide=function(){this._lastRange=null,this._hoverOperation.cancel(),e.prototype.hide.call(this),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,[]),this._isChangingDecorations=!1,this.renderDisposable.clear(),this._colorPicker=null},t.prototype.isColorPickerVisible=function(){return!!this._colorPicker},t.prototype._withResult=function(e,t){this._messages=e,this._lastRange&&this._messages.length>0?this._renderMessages(this._lastRange,this._messages):t&&this.hide()},t.prototype._renderMessages=function(e,n){var i=this;this.renderDisposable.dispose(),this._colorPicker=null;var o=Number.MAX_VALUE,s=n[0].range?a["a"].lift(n[0].range):null,u=document.createDocumentFragment(),l=!0,g=!1,m=new r["b"],_=[];if(n.forEach(function(e){if(e.range)if(o=Math.min(o,e.range.startColumn),s=s?a["a"].plusRange(s,e.range):a["a"].lift(e.range),e instanceof te){g=!0;var t=e.color,n=t.red,f=t.green,b=t.blue,w=t.alpha,C=new h["c"](255*n,255*f,255*b,w),S=new h["a"](C);if(!i._editor.hasModel())return;var L=i._editor.getModel(),O=new a["a"](e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn),x={range:e.range,color:e.color},N=new y(S,[],0),D=new P(u,N,i._editor.getConfiguration().pixelRatio,i._themeService);Object(v["a"])(L,x,e.provider,d["a"].None).then(function(t){if(N.colorPresentations=t||[],i._editor.hasModel()){var n=i._editor.getModel().getValueInRange(e.range);N.guessColorPresentation(S,n);var o=function(){var e,t;N.presentation.textEdit?(e=[N.presentation.textEdit],t=new a["a"](N.presentation.textEdit.range.startLineNumber,N.presentation.textEdit.range.startColumn,N.presentation.textEdit.range.endLineNumber,N.presentation.textEdit.range.endColumn),t=t.setEndPosition(t.endLineNumber,t.startColumn+N.presentation.textEdit.text.length)):(e=[{identifier:null,range:O,text:N.presentation.label,forceMoveMarkers:!1}],t=O.setEndPosition(O.endLineNumber,O.startColumn+N.presentation.label.length)),i._editor.pushUndoStop(),i._editor.executeEdits("colorpicker",e),N.presentation.additionalTextEdits&&(e=N.presentation.additionalTextEdits.slice(),i._editor.executeEdits("colorpicker",e),i.hide()),i._editor.pushUndoStop(),O=t},s=function(t){return Object(v["a"])(L,{range:O,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},e.provider,d["a"].None).then(function(e){N.colorPresentations=e||[]})},l=N.onColorFlushed(function(e){s(e).then(o)}),c=N.onDidChangeColor(s);i._colorPicker=D,i.showAt(O.getStartPosition(),O,i._shouldFocus),i.updateContents(u),i._colorPicker.layout(),i.renderDisposable.value=Object(r["e"])(l,c,D,m)}})}else e instanceof ne?(_.push(e),l=!1):e.contents.filter(function(e){return!Object(p["b"])(e)}).forEach(function(e){var t=ee("div.hover-row.markdown-hover"),n=c["m"](t,ee("div.hover-contents")),o=m.add(new K["a"](i._editor,i._modeService,i._openerService));m.add(o.onDidRenderCodeBlock(function(){n.className="hover-contents code-hover-contents",i.onContentsChange()}));var r=m.add(o.render(e));n.appendChild(r.element),u.appendChild(t),l=!1})}),_.length){_.forEach(function(e){return u.appendChild(i.renderMarkerHover(e))});var b=1===_.length?_[0]:_.sort(function(e,t){return q["c"].compare(e.marker.severity,t.marker.severity)})[0];u.appendChild(this.renderMarkerStatusbar(b))}g||l||(this.showAt(new f["a"](e.startLineNumber,o),s,this._shouldFocus),this.updateContents(u)),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,s?[{range:s,options:t._DECORATION_OPTIONS}]:[]),this._isChangingDecorations=!1},t.prototype.renderMarkerHover=function(e){var t=this,n=ee("div.hover-row"),i=c["m"](n,ee("div.marker.hover-contents")),o=e.marker,r=o.source,s=o.message,a=o.code,u=o.relatedInformation;this._editor.applyFontInfo(i);var l=c["m"](i,ee("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,r||a){var d=c["m"](i,ee("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=r&&a?r+"("+a+")":r||"("+a+")"}if(Object(R["n"])(u))for(var h=function(e,n,o,r){var s=c["m"](i,ee("div"));s.style.marginTop="8px";var a=c["m"](s,ee("a"));a.innerText=Object(G["b"])(n)+"("+o+", "+r+"): ",a.style.cursor="pointer",a.onclick=function(e){e.stopPropagation(),e.preventDefault(),t._openerService&&t._openerService.open(n.with({fragment:o+","+r})).catch(A["e"])};var u=c["m"](s,ee("span"));u.innerText=e,p._editor.applyFontInfo(u)},p=this,f=0,g=u;f0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()},t.prototype._renderMessages=function(e,t){this._renderDisposeables.clear();for(var n=document.createDocumentFragment(),i=0,o=t;i=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},pe=function(e,t){return function(n,i){t(n,i,e)}},fe=function(){function e(e,t,n,i,o,s){var a=this;this._editor=e,this._openerService=t,this._modeService=n,this._markerDecorationsService=i,this._keybindingService=o,this._themeService=s,this._toUnhook=new r["b"],this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(function(e){e.contribInfo&&(a._hideWidgets(),a._unhookEvents(),a._hookEvents())})}return Object.defineProperty(e.prototype,"contentWidget",{get:function(){return this._contentWidget||this._createHoverWidgets(),this._contentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glyphWidget",{get:function(){return this._glyphWidget||this._createHoverWidgets(),this._glyphWidget},enumerable:!0,configurable:!0}),e.get=function(t){return t.getContribution(e.ID)},e.prototype._hookEvents=function(){var e=this,t=function(){return e._hideWidgets()},n=this._editor.getConfiguration().contribInfo.hover;this._isHoverEnabled=n.enabled,this._isHoverSticky=n.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(function(t){return e._onEditorMouseDown(t)})),this._toUnhook.add(this._editor.onMouseUp(function(t){return e._onEditorMouseUp(t)})),this._toUnhook.add(this._editor.onMouseMove(function(t){return e._onEditorMouseMove(t)})),this._toUnhook.add(this._editor.onKeyDown(function(t){return e._onKeyDown(t)})),this._toUnhook.add(this._editor.onDidChangeModelDecorations(function(){return e._onModelDecorationsChanged()}))):this._toUnhook.add(this._editor.onMouseMove(t)),this._toUnhook.add(this._editor.onMouseLeave(t)),this._toUnhook.add(this._editor.onDidChangeModel(t)),this._toUnhook.add(this._editor.onDidScrollChange(function(t){return e._onEditorScrollChanged(t)}))},e.prototype._unhookEvents=function(){this._toUnhook.clear()},e.prototype._onModelDecorationsChanged=function(){this.contentWidget.onModelDecorationsChanged(),this.glyphWidget.onModelDecorationsChanged()},e.prototype._onEditorScrollChanged=function(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()},e.prototype._onEditorMouseDown=function(e){this._isMouseDown=!0;var t=e.target.type;9!==t||e.target.detail!==oe.ID?12===t&&e.target.detail===ue.ID||(12!==t&&e.target.detail!==ue.ID&&(this._hoverClicked=!1),this._hideWidgets()):this._hoverClicked=!0},e.prototype._onEditorMouseUp=function(e){this._isMouseDown=!1},e.prototype._onEditorMouseMove=function(e){var t=e.target.type;if(!(this._isMouseDown&&this._hoverClicked&&this.contentWidget.isColorPickerVisible())&&(!this._isHoverSticky||9!==t||e.target.detail!==oe.ID)&&(!this._isHoverSticky||12!==t||e.target.detail!==ue.ID)){if(7===t){var n=this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth/2,i=e.target.detail;i&&!i.isAfterLines&&"number"===typeof i.horizontalDistanceToText&&i.horizontalDistanceToText0)},e.prototype.getChildren=function(e,t){var n=this.modelProvider.getModel();return Promise.resolve(n===t?n.entries:[])},e.prototype.getParent=function(e,t){return Promise.resolve(null)},e}(),c=function(){function e(e){this.modelProvider=e}return e.prototype.getAriaLabel=function(e,t){var n=this.modelProvider.getModel();return n.accessibilityProvider?n.accessibilityProvider.getAriaLabel(t):null},e.prototype.getPosInSet=function(e,t){var n=this.modelProvider.getModel(),i=0;if(n.filter)for(var o=0,r=n.entries;o=0;t--){var n=this._arr[t];if(e.toChord().equals(n.keybinding))return n.callback}return null},e}(),v=function(){function e(e){var t=this;void 0===e&&(e={clickBehavior:0,keyboardSupport:!0,openMode:0}),this.options=e,this.downKeyBindingDispatcher=new m,this.upKeyBindingDispatcher=new m,("boolean"!==typeof e.keyboardSupport||e.keyboardSupport)&&(this.downKeyBindingDispatcher.set(16,function(e,n){return t.onUp(e,n)}),this.downKeyBindingDispatcher.set(18,function(e,n){return t.onDown(e,n)}),this.downKeyBindingDispatcher.set(15,function(e,n){return t.onLeft(e,n)}),this.downKeyBindingDispatcher.set(17,function(e,n){return t.onRight(e,n)}),a["d"]&&(this.downKeyBindingDispatcher.set(2064,function(e,n){return t.onLeft(e,n)}),this.downKeyBindingDispatcher.set(300,function(e,n){return t.onDown(e,n)}),this.downKeyBindingDispatcher.set(302,function(e,n){return t.onUp(e,n)})),this.downKeyBindingDispatcher.set(11,function(e,n){return t.onPageUp(e,n)}),this.downKeyBindingDispatcher.set(12,function(e,n){return t.onPageDown(e,n)}),this.downKeyBindingDispatcher.set(14,function(e,n){return t.onHome(e,n)}),this.downKeyBindingDispatcher.set(13,function(e,n){return t.onEnd(e,n)}),this.downKeyBindingDispatcher.set(10,function(e,n){return t.onSpace(e,n)}),this.downKeyBindingDispatcher.set(9,function(e,n){return t.onEscape(e,n)}),this.upKeyBindingDispatcher.set(3,this.onEnter.bind(this)),this.upKeyBindingDispatcher.set(2051,this.onEnter.bind(this)))}return e.prototype.onMouseDown=function(e,t,n,i){if(void 0===i&&(i="mouse"),0===this.options.clickBehavior&&(n.leftButton||n.middleButton)){if(n.target){if(n.target.tagName&&"input"===n.target.tagName.toLowerCase())return!1;if(r["t"](n.target,"scrollbar","monaco-tree"))return!1;if(r["t"](n.target,"monaco-action-bar","row"))return!1}return this.onLeftClick(e,t,n,i)}return!1},e.prototype.onClick=function(e,t,n){var i=a["d"];return i&&n.ctrlKey?(n.preventDefault(),n.stopPropagation(),!1):(!n.target||!n.target.tagName||"input"!==n.target.tagName.toLowerCase())&&((0!==this.options.clickBehavior||!n.leftButton&&!n.middleButton)&&this.onLeftClick(e,t,n))},e.prototype.onLeftClick=function(e,t,n,i){void 0===i&&(i="mouse");var o=n,r={origin:i,originalEvent:n,didClickOnTwistie:this.isClickOnTwistie(o)};if(e.getInput()===t)e.clearFocus(r),e.clearSelection(r);else{var s=n&&o.browserEvent&&"mousedown"===o.browserEvent.type&&1===o.browserEvent.detail;s||n.preventDefault(),n.stopPropagation(),e.domFocus(),e.setSelection([t],r),e.setFocus(t,r),this.shouldToggleExpansion(t,o,i)&&(e.isExpanded(t)?e.collapse(t).then(void 0,f["e"]):e.expand(t).then(void 0,f["e"]))}return!0},e.prototype.shouldToggleExpansion=function(e,t,n){var i="mouse"===n&&2===t.detail;return this.openOnSingleClick||i||this.isClickOnTwistie(t)},Object.defineProperty(e.prototype,"openOnSingleClick",{get:function(){return 0===this.options.openMode},enumerable:!0,configurable:!0}),e.prototype.isClickOnTwistie=function(e){var t=e.target;if(!r["C"](t,"content"))return!1;var n=window.getComputedStyle(t,":before");if("none"===n.backgroundImage||"none"===n.display)return!1;var i=parseInt(n.width)+parseInt(n.paddingRight);return e.browserEvent.offsetX<=i},e.prototype.onContextMenu=function(e,t,n){return(!n.target||!n.target.tagName||"input"!==n.target.tagName.toLowerCase())&&(n&&(n.preventDefault(),n.stopPropagation()),!1)},e.prototype.onTap=function(e,t,n){var i=n.initialTarget;return(!i||!i.tagName||"input"!==i.tagName.toLowerCase())&&this.onLeftClick(e,t,n,"touch")},e.prototype.onKeyDown=function(e,t){return this.onKey(this.downKeyBindingDispatcher,e,t)},e.prototype.onKeyUp=function(e,t){return this.onKey(this.upKeyBindingDispatcher,e,t)},e.prototype.onKey=function(e,t,n){var i=e.dispatch(n.toKeybinding());return!(!i||!i(t,n))&&(n.preventDefault(),n.stopPropagation(),!0)},e.prototype.onUp=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusPrevious(1,n),e.reveal(e.getFocus()).then(void 0,f["e"])),!0},e.prototype.onPageUp=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusPreviousPage(n),e.reveal(e.getFocus()).then(void 0,f["e"])),!0},e.prototype.onDown=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusNext(1,n),e.reveal(e.getFocus()).then(void 0,f["e"])),!0},e.prototype.onPageDown=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusNextPage(n),e.reveal(e.getFocus()).then(void 0,f["e"])),!0},e.prototype.onHome=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusFirst(n),e.reveal(e.getFocus()).then(void 0,f["e"])),!0},e.prototype.onEnd=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusLast(n),e.reveal(e.getFocus()).then(void 0,f["e"])),!0},e.prototype.onLeft=function(e,t){var n={origin:"keyboard",originalEvent:t};if(e.getHighlight())e.clearHighlight(n);else{var i=e.getFocus();e.collapse(i).then(function(t){if(i&&!t)return e.focusParent(n),e.reveal(e.getFocus())}).then(void 0,f["e"])}return!0},e.prototype.onRight=function(e,t){var n={origin:"keyboard",originalEvent:t};if(e.getHighlight())e.clearHighlight(n);else{var i=e.getFocus();e.expand(i).then(function(t){if(i&&!t)return e.focusFirstChild(n),e.reveal(e.getFocus())}).then(void 0,f["e"])}return!0},e.prototype.onEnter=function(e,t){var n={origin:"keyboard",originalEvent:t};if(e.getHighlight())return!1;var i=e.getFocus();return i&&e.setSelection([i],n),!0},e.prototype.onSpace=function(e,t){if(e.getHighlight())return!1;var n=e.getFocus();return n&&e.toggleExpansion(n),!0},e.prototype.onEscape=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?(e.clearHighlight(n),!0):e.getSelection().length?(e.clearSelection(n),!0):!!e.getFocus()&&(e.clearFocus(n),!0)},e}(),_=function(){function e(){}return e.prototype.getDragURI=function(e,t){return null},e.prototype.onDragStart=function(e,t,n){},e.prototype.onDragOver=function(e,t,n,i){return null},e.prototype.drop=function(e,t,n,i){},e}(),b=function(){function e(){}return e.prototype.isVisible=function(e,t){return!0},e}(),y=function(){function e(){}return e.prototype.getAriaLabel=function(e,t){return null},e}(),w=function(){function e(e,t){this.styleElement=e,this.selectorSuffix=t}return e.prototype.style=function(e){var t=this.selectorSuffix?"."+this.selectorSuffix:"",n=[];e.listFocusBackground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { background-color: "+e.listFocusBackground+"; }"),e.listFocusForeground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { color: "+e.listFocusForeground+"; }"),e.listActiveSelectionBackground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: "+e.listActiveSelectionBackground+"; }"),e.listActiveSelectionForeground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: "+e.listActiveSelectionForeground+"; }"),e.listFocusAndSelectionBackground&&n.push("\n\t\t\t\t.monaco-tree-drag-image,\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { background-color: "+e.listFocusAndSelectionBackground+"; }\n\t\t\t"),e.listFocusAndSelectionForeground&&n.push("\n\t\t\t\t.monaco-tree-drag-image,\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { color: "+e.listFocusAndSelectionForeground+"; }\n\t\t\t"),e.listInactiveSelectionBackground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: "+e.listInactiveSelectionBackground+"; }"),e.listInactiveSelectionForeground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: "+e.listInactiveSelectionForeground+"; }"),e.listHoverBackground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { background-color: "+e.listHoverBackground+"; }"),e.listHoverForeground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { color: "+e.listHoverForeground+"; }"),e.listDropBackground&&n.push("\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-wrapper.drop-target,\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: "+e.listDropBackground+" !important; color: inherit !important; }\n\t\t\t"),e.listFocusOutline&&n.push("\n\t\t\t\t.monaco-tree-drag-image\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px solid "+e.listFocusOutline+"; background: #000; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row \t\t\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px solid transparent; }\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) \t\t\t\t\t\t{ border: 1px dotted "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) \t\t\t\t\t\t{ border: 1px solid "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) \t\t\t\t\t\t\t{ border: 1px solid "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) \t{ border: 1px dashed "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-wrapper.drop-target,\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.drop-target\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px dashed "+e.listFocusOutline+"; }\n\t\t\t");var i=n.join("\n");i!==this.styleElement.innerHTML&&(this.styleElement.innerHTML=i)},e}(),C=n("1569"),S=n("a666"),L=n("308f"),O=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),x=function(){function e(e){this._onDispose=new L["a"],this.onDispose=this._onDispose.event,this._item=e}return Object.defineProperty(e.prototype,"item",{get:function(){return this._item},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose&&(this._onDispose.fire(),this._onDispose.dispose(),this._onDispose=void 0)},e}(),N=function(){function e(){this.locks=Object.create({})}return e.prototype.isLocked=function(e){return!!this.locks[e.id]},e.prototype.run=function(e,t){var n,i=this,o=this.getLock(e);return o?new Promise(function(n,r){L["b"].once(o.onDispose)(function(){return i.run(e,t).then(n,r)})}):new Promise(function(o,r){if(e.isDisposed())return r(new Error("Item is disposed."));var s=i.locks[e.id]=new x(e);return n=t().then(function(t){return delete i.locks[e.id],s.dispose(),t}).then(o,r),n})},e.prototype.getLock=function(e){var t;for(t in this.locks){var n=this.locks[t];if(e.intersects(n.item))return n}return null},e}(),D=function(){function e(){this._isDisposed=!1,this._onDidRevealItem=new L["d"],this.onDidRevealItem=this._onDidRevealItem.event,this._onExpandItem=new L["d"],this.onExpandItem=this._onExpandItem.event,this._onDidExpandItem=new L["d"],this.onDidExpandItem=this._onDidExpandItem.event,this._onCollapseItem=new L["d"],this.onCollapseItem=this._onCollapseItem.event,this._onDidCollapseItem=new L["d"],this.onDidCollapseItem=this._onDidCollapseItem.event,this._onDidAddTraitItem=new L["d"],this.onDidAddTraitItem=this._onDidAddTraitItem.event,this._onDidRemoveTraitItem=new L["d"],this.onDidRemoveTraitItem=this._onDidRemoveTraitItem.event,this._onDidRefreshItem=new L["d"],this.onDidRefreshItem=this._onDidRefreshItem.event,this._onRefreshItemChildren=new L["d"],this.onRefreshItemChildren=this._onRefreshItemChildren.event,this._onDidRefreshItemChildren=new L["d"],this.onDidRefreshItemChildren=this._onDidRefreshItemChildren.event,this._onDidDisposeItem=new L["d"],this.onDidDisposeItem=this._onDidDisposeItem.event,this.items={}}return e.prototype.register=function(e){C["a"](!this.isRegistered(e.id),"item already registered: "+e.id);var t=Object(S["e"])(this._onDidRevealItem.add(e.onDidReveal),this._onExpandItem.add(e.onExpand),this._onDidExpandItem.add(e.onDidExpand),this._onCollapseItem.add(e.onCollapse),this._onDidCollapseItem.add(e.onDidCollapse),this._onDidAddTraitItem.add(e.onDidAddTrait),this._onDidRemoveTraitItem.add(e.onDidRemoveTrait),this._onDidRefreshItem.add(e.onDidRefresh),this._onRefreshItemChildren.add(e.onRefreshChildren),this._onDidRefreshItemChildren.add(e.onDidRefreshChildren),this._onDidDisposeItem.add(e.onDidDispose));this.items[e.id]={item:e,disposable:t}},e.prototype.deregister=function(e){C["a"](this.isRegistered(e.id),"item not registered: "+e.id),this.items[e.id].disposable.dispose(),delete this.items[e.id]},e.prototype.isRegistered=function(e){return this.items.hasOwnProperty(e)},e.prototype.getItem=function(e){var t=this.items[e];return t?t.item:null},e.prototype.dispose=function(){this.items=null,this._onDidRevealItem.dispose(),this._onExpandItem.dispose(),this._onDidExpandItem.dispose(),this._onCollapseItem.dispose(),this._onDidCollapseItem.dispose(),this._onDidAddTraitItem.dispose(),this._onDidRemoveTraitItem.dispose(),this._onDidRefreshItem.dispose(),this._onRefreshItemChildren.dispose(),this._onDidRefreshItemChildren.dispose(),this._isDisposed=!0},e.prototype.isDisposed=function(){return this._isDisposed},e}(),k=function(){function e(e,t,n,i,o){this._onDidCreate=new L["a"],this._onDidReveal=new L["a"],this.onDidReveal=this._onDidReveal.event,this._onExpand=new L["a"],this.onExpand=this._onExpand.event,this._onDidExpand=new L["a"],this.onDidExpand=this._onDidExpand.event,this._onCollapse=new L["a"],this.onCollapse=this._onCollapse.event,this._onDidCollapse=new L["a"],this.onDidCollapse=this._onDidCollapse.event,this._onDidAddTrait=new L["a"],this.onDidAddTrait=this._onDidAddTrait.event,this._onDidRemoveTrait=new L["a"],this.onDidRemoveTrait=this._onDidRemoveTrait.event,this._onDidRefresh=new L["a"],this.onDidRefresh=this._onDidRefresh.event,this._onRefreshChildren=new L["a"],this.onRefreshChildren=this._onRefreshChildren.event,this._onDidRefreshChildren=new L["a"],this.onDidRefreshChildren=this._onDidRefreshChildren.event,this._onDidDispose=new L["a"],this.onDidDispose=this._onDidDispose.event,this.registry=t,this.context=n,this.lock=i,this.element=o,this.id=e,this.registry.register(this),this.doesHaveChildren=this.context.dataSource.hasChildren(this.context.tree,this.element),this.needsChildrenRefresh=!0,this.parent=null,this.previous=null,this.next=null,this.firstChild=null,this.lastChild=null,this.traits={},this.depth=0,this.expanded=!(!this.context.dataSource.shouldAutoexpand||!this.context.dataSource.shouldAutoexpand(this.context.tree,o)),this._onDidCreate.fire(this),this.visible=this._isVisible(),this.height=this._getHeight(),this._isDisposed=!1}return e.prototype.getElement=function(){return this.element},e.prototype.hasChildren=function(){return this.doesHaveChildren},e.prototype.getDepth=function(){return this.depth},e.prototype.isVisible=function(){return this.visible},e.prototype.setVisible=function(e){this.visible=e},e.prototype.isExpanded=function(){return this.expanded},e.prototype._setExpanded=function(e){this.expanded=e},e.prototype.reveal=function(e){void 0===e&&(e=null);var t={item:this,relativeTop:e};this._onDidReveal.fire(t)},e.prototype.expand=function(){var e=this;if(this.isExpanded()||!this.doesHaveChildren||this.lock.isLocked(this))return Promise.resolve(!1);var t=this.lock.run(this,function(){if(e.isExpanded()||!e.doesHaveChildren)return Promise.resolve(!1);var t,n={item:e};return e._onExpand.fire(n),t=e.needsChildrenRefresh?e.refreshChildren(!1,!0,!0):Promise.resolve(null),t.then(function(){return e._setExpanded(!0),e._onDidExpand.fire(n),!0})});return t.then(function(t){return!e.isDisposed()&&(e.context.options.autoExpandSingleChildren&&t&&null!==e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.isVisible()?e.firstChild.expand().then(function(){return!0}):t)})},e.prototype.collapse=function(e){var t=this;if(void 0===e&&(e=!1),e){var n=Promise.resolve(null);return this.forEachChild(function(e){n=n.then(function(){return e.collapse(!0)})}),n.then(function(){return t.collapse(!1)})}return!this.isExpanded()||this.lock.isLocked(this)?Promise.resolve(!1):this.lock.run(this,function(){var e={item:t};return t._onCollapse.fire(e),t._setExpanded(!1),t._onDidCollapse.fire(e),Promise.resolve(!0)})},e.prototype.addTrait=function(e){var t={item:this,trait:e};this.traits[e]=!0,this._onDidAddTrait.fire(t)},e.prototype.removeTrait=function(e){var t={item:this,trait:e};delete this.traits[e],this._onDidRemoveTrait.fire(t)},e.prototype.hasTrait=function(e){return this.traits[e]||!1},e.prototype.getAllTraits=function(){var e,t=[];for(e in this.traits)this.traits.hasOwnProperty(e)&&this.traits[e]&&t.push(e);return t},e.prototype.getHeight=function(){return this.height},e.prototype.refreshChildren=function(t,n,i){var o=this;if(void 0===n&&(n=!1),void 0===i&&(i=!1),!i&&!this.isExpanded()){var r=function(e){e.needsChildrenRefresh=!0,e.forEachChild(r)};return r(this),Promise.resolve(this)}this.needsChildrenRefresh=!1;var s=function(){var i,r={item:o,isNested:n};o._onRefreshChildren.fire(r),i=o.doesHaveChildren?o.context.dataSource.getChildren(o.context.tree,o.element):Promise.resolve([]);var s=i.then(function(n){if(o.isDisposed()||o.registry.isDisposed())return Promise.resolve(null);if(!Array.isArray(n))return Promise.reject(new Error("Please return an array of children."));n=n?n.slice(0):[],n=o.sort(n);var i={};while(null!==o.firstChild)i[o.firstChild.id]=o.firstChild,o.removeChild(o.firstChild);for(var r=0,s=n.length;r=0;o--)this.onInsertItem(l[o]);for(o=this.heightMap.length-1;o>=i;o--)this.onRefreshItem(this.heightMap[o]);return a},e.prototype.onInsertItem=function(e){},e.prototype.onRemoveItems=function(e){var t,n=null,i=null,o=0,r=0;while(n=e.next()){if(o=this.indexes[n],t=this.heightMap[o],!t)return void console.error("view item doesnt exist");r-=t.height,delete this.indexes[n],this.onRemoveItem(t),null===i&&(i=o)}if(0!==r&&null!==i)for(this.heightMap.splice(i,o-i+1),o=i;o=n.top+n.height))return t;if(i===t)break;i=t}return this.heightMap.length},e.prototype.indexAfter=function(e){return Math.min(this.indexAt(e)+1,this.heightMap.length)},e.prototype.itemAtIndex=function(e){return this.heightMap[e]},e.prototype.itemAfter=function(e){return this.heightMap[this.indexes[e.model.id]+1]||null},e.prototype.createViewItem=function(e){throw new Error("not implemented")},e.prototype.dispose=function(){this.heightMap=[],this.indexes={}},e}(),K=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),q=function(){function e(e,t,n){this._posx=e,this._posy=t,this._target=n}return e.prototype.preventDefault=function(){},e.prototype.stopPropagation=function(){},Object.defineProperty(e.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),e}(),G=function(e){function t(t){var n=e.call(this,t.posx,t.posy,t.target)||this;return n.originalEvent=t,n}return K(t,e),t.prototype.preventDefault=function(){this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.originalEvent.stopPropagation()},t}(q),Z=function(e){function t(t,n,i){var o=e.call(this,t,n,i.target)||this;return o.originalEvent=i,o}return K(t,e),t.prototype.preventDefault=function(){this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.originalEvent.stopPropagation()},t}(q),Y=n("650e"),X=n("5fe7"),$=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Q(e){try{e.parentElement.removeChild(e)}catch(t){}}var J=function(){function e(e){this.context=e,this._cache={"":[]}}return e.prototype.alloc=function(e){var t=this.cache(e).pop();if(!t){var n=document.createElement("div");n.className="content";var i=document.createElement("div");i.appendChild(n);var o=null;try{o=this.context.renderer.renderTemplate(this.context.tree,e,n)}catch(r){console.error("Tree usage error: exception while rendering template"),console.error(r)}t={element:i,templateId:e,templateData:o}}return t},e.prototype.release=function(e,t){Q(t.element),this.cache(e).push(t)},e.prototype.cache=function(e){return this._cache[e]||(this._cache[e]=[])},e.prototype.garbageCollect=function(){var e=this;this._cache&&Object.keys(this._cache).forEach(function(t){e._cache[t].forEach(function(n){e.context.renderer.disposeTemplate(e.context.tree,t,n.templateData),n.element=null,n.templateData=null}),delete e._cache[t]})},e.prototype.dispose=function(){this.garbageCollect(),this._cache=null},e}(),ee=function(){function e(e,t){var n=this;this.width=0,this.needsRender=!1,this.uri=null,this.unbindDragStart=S["a"].None,this._draggable=!1,this.context=e,this.model=t,this.id=this.model.id,this.row=null,this.top=0,this.height=t.getHeight(),this._styles={},t.getAllTraits().forEach(function(e){return n._styles[e]=!0}),t.isExpanded()&&this.addClass("expanded")}return Object.defineProperty(e.prototype,"expanded",{set:function(e){e?this.addClass("expanded"):this.removeClass("expanded")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loading",{set:function(e){e?this.addClass("loading"):this.removeClass("loading")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"draggable",{get:function(){return this._draggable},set:function(e){this._draggable=e,this.render(!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropTarget",{set:function(e){e?this.addClass("drop-target"):this.removeClass("drop-target")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.row&&this.row.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"templateId",{get:function(){return this._templateId||(this._templateId=this.context.renderer.getTemplateId&&this.context.renderer.getTemplateId(this.context.tree,this.model.getElement()))},enumerable:!0,configurable:!0}),e.prototype.addClass=function(e){this._styles[e]=!0,this.render(!0)},e.prototype.removeClass=function(e){delete this._styles[e],this.render(!0)},e.prototype.render=function(e){var t=this;if(void 0===e&&(e=!1),this.model&&this.element){var n=["monaco-tree-row"];n.push.apply(n,Object.keys(this._styles)),this.model.hasChildren()&&n.push("has-children"),this.element.className=n.join(" "),this.element.draggable=this.draggable,this.element.style.height=this.height+"px",this.element.setAttribute("role","treeitem");var i=this.context.accessibilityProvider,o=i.getAriaLabel(this.context.tree,this.model.getElement());if(o&&this.element.setAttribute("aria-label",o),i.getPosInSet&&i.getSetSize&&(this.element.setAttribute("aria-setsize",i.getSetSize()),this.element.setAttribute("aria-posinset",i.getPosInSet(this.context.tree,this.model.getElement()))),this.model.hasTrait("focused")){var s=A["H"](this.model.id);this.element.setAttribute("aria-selected","true"),this.element.setAttribute("id",s)}else this.element.setAttribute("aria-selected","false"),this.element.removeAttribute("id");this.model.hasChildren()?this.element.setAttribute("aria-expanded",String(!!this._styles["expanded"])):this.element.removeAttribute("aria-expanded"),this.element.setAttribute("aria-level",String(this.model.getDepth())),this.context.options.paddingOnRow?this.element.style.paddingLeft=this.context.options.twistiePixels+(this.model.getDepth()-1)*this.context.options.indentPixels+"px":(this.element.style.paddingLeft=(this.model.getDepth()-1)*this.context.options.indentPixels+"px",this.row.element.firstElementChild.style.paddingLeft=this.context.options.twistiePixels+"px");var a=this.context.dnd.getDragURI(this.context.tree,this.model.getElement());if(a!==this.uri&&(this.unbindDragStart&&this.unbindDragStart.dispose(),a?(this.uri=a,this.draggable=!0,this.unbindDragStart=r["h"](this.element,"dragstart",function(e){t.onDragStart(e)})):this.uri=null),!e&&this.element){var u=0;if(this.context.horizontalScrolling){var l=window.getComputedStyle(this.element);u=parseFloat(l.paddingLeft)}this.context.horizontalScrolling&&(this.element.style.width="fit-content");try{this.context.renderer.renderElement(this.context.tree,this.model.getElement(),this.templateId,this.row.templateData)}catch(c){console.error("Tree usage error: exception while rendering element"),console.error(c)}this.context.horizontalScrolling&&(this.width=r["w"](this.element)+u,this.element.style.width="")}}},e.prototype.insertInDOM=function(e,t){if(this.row||(this.row=this.context.cache.alloc(this.templateId),this.element[ie.BINDING]=this),!this.element.parentElement){if(null===t)e.appendChild(this.element);else try{e.insertBefore(this.element,t)}catch(n){console.warn("Failed to locate previous tree element"),e.appendChild(this.element)}this.render()}},e.prototype.removeFromDOM=function(){this.row&&(this.unbindDragStart.dispose(),this.uri=null,this.element[ie.BINDING]=null,this.context.cache.release(this.templateId,this.row),this.row=null)},e.prototype.dispose=function(){this.row=null},e}(),te=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.row={element:i,templateData:null,templateId:null},o}return $(t,e),t.prototype.render=function(){if(this.model&&this.element){var e=["monaco-tree-wrapper"];e.push.apply(e,Object.keys(this._styles)),this.model.hasChildren()&&e.push("has-children"),this.element.className=e.join(" ")}},t.prototype.insertInDOM=function(e,t){},t.prototype.removeFromDOM=function(){},t}(ee);function ne(e,t){return!e&&!t||!(!e||!t)&&(e.accept===t.accept&&(e.bubble===t.bubble&&e.effect===t.effect))}var ie=function(e){function t(n,i){var o=e.call(this)||this;o.model=null,o.lastPointerType="",o.lastClickTimeStamp=0,o.contentWidthUpdateDelayer=new X["a"](50),o.isRefreshing=!1,o.refreshingPreviousChildrenIds={},o.currentDragAndDropData=null,o.currentDropTarget=null,o.currentDropTargets=null,o.currentDropDisposable=S["a"].None,o.dragAndDropScrollInterval=null,o.dragAndDropScrollTimeout=null,o.dragAndDropMouseY=null,o.highlightedItemWasDraggable=!1,o.onHiddenScrollTop=null,o._onDOMFocus=new L["a"],o.onDOMFocus=o._onDOMFocus.event,o._onDOMBlur=new L["a"],o._onDidScroll=new L["a"],t.counter++,o.instance=t.counter;var s="undefined"===typeof n.options.horizontalScrollMode?2:n.options.horizontalScrollMode;o.horizontalScrolling=2!==s,o.context={dataSource:n.dataSource,renderer:n.renderer,controller:n.controller,dnd:n.dnd,filter:n.filter,sorter:n.sorter,tree:n.tree,accessibilityProvider:n.accessibilityProvider,options:n.options,cache:new J(n),horizontalScrolling:o.horizontalScrolling},o.modelListeners=[],o.viewListeners=[],o.items={},o.domNode=document.createElement("div"),o.domNode.className="monaco-tree no-focused-item monaco-tree-instance-"+o.instance,o.domNode.tabIndex=n.options.preventRootFocus?-1:0,o.styleElement=r["s"](o.domNode),o.treeStyler=n.styler||new w(o.styleElement,"monaco-tree-instance-"+o.instance),o.domNode.setAttribute("role","tree"),o.context.options.ariaLabel&&o.domNode.setAttribute("aria-label",o.context.options.ariaLabel),o.context.options.alwaysFocused&&r["f"](o.domNode,"focused"),o.context.options.paddingOnRow||r["f"](o.domNode,"no-row-padding"),o.wrapper=document.createElement("div"),o.wrapper.className="monaco-tree-wrapper",o.scrollableElement=new z["b"](o.wrapper,{alwaysConsumeMouseWheel:!0,horizontal:s,vertical:"undefined"!==typeof n.options.verticalScrollMode?n.options.verticalScrollMode:1,useShadows:n.options.useShadows}),o.scrollableElement.onScroll(function(e){o.render(e.scrollTop,e.height,e.scrollLeft,e.width,e.scrollWidth),o._onDidScroll.fire()}),T["j"]?(o.wrapper.style.msTouchAction="none",o.wrapper.style.msContentZooming="none"):R["b"].addTarget(o.wrapper),o.rowsContainer=document.createElement("div"),o.rowsContainer.className="monaco-tree-rows",n.options.showTwistie&&(o.rowsContainer.className+=" show-twisties");var a=r["S"](o.domNode);return o.viewListeners.push(a.onDidFocus(function(){return o.onFocus()})),o.viewListeners.push(a.onDidBlur(function(){return o.onBlur()})),o.viewListeners.push(a),o.viewListeners.push(r["h"](o.domNode,"keydown",function(e){return o.onKeyDown(e)})),o.viewListeners.push(r["h"](o.domNode,"keyup",function(e){return o.onKeyUp(e)})),o.viewListeners.push(r["h"](o.domNode,"mousedown",function(e){return o.onMouseDown(e)})),o.viewListeners.push(r["h"](o.domNode,"mouseup",function(e){return o.onMouseUp(e)})),o.viewListeners.push(r["h"](o.wrapper,"auxclick",function(e){e&&1===e.button&&o.onMouseMiddleClick(e)})),o.viewListeners.push(r["h"](o.wrapper,"click",function(e){return o.onClick(e)})),o.viewListeners.push(r["h"](o.domNode,"contextmenu",function(e){return o.onContextMenu(e)})),o.viewListeners.push(r["h"](o.wrapper,R["a"].Tap,function(e){return o.onTap(e)})),o.viewListeners.push(r["h"](o.wrapper,R["a"].Change,function(e){return o.onTouchChange(e)})),T["j"]&&(o.viewListeners.push(r["h"](o.wrapper,"MSPointerDown",function(e){return o.onMsPointerDown(e)})),o.viewListeners.push(r["h"](o.wrapper,"MSGestureTap",function(e){return o.onMsGestureTap(e)})),o.viewListeners.push(r["j"](o.wrapper,"MSGestureChange",function(e){return o.onThrottledMsGestureChange(e)},function(e,t){t.stopPropagation(),t.preventDefault();var n={translationY:t.translationY,translationX:t.translationX};return e&&(n.translationY+=e.translationY,n.translationX+=e.translationX),n}))),o.viewListeners.push(r["h"](window,"dragover",function(e){return o.onDragOver(e)})),o.viewListeners.push(r["h"](o.wrapper,"drop",function(e){return o.onDrop(e)})),o.viewListeners.push(r["h"](window,"dragend",function(e){return o.onDragEnd(e)})),o.viewListeners.push(r["h"](window,"dragleave",function(e){return o.onDragOver(e)})),o.wrapper.appendChild(o.rowsContainer),o.domNode.appendChild(o.scrollableElement.getDomNode()),i.appendChild(o.domNode),o.lastRenderTop=0,o.lastRenderHeight=0,o.didJustPressContextMenuKey=!1,o.currentDropTarget=null,o.currentDropTargets=[],o.shouldInvalidateDropReaction=!1,o.dragAndDropScrollInterval=null,o.dragAndDropScrollTimeout=null,o.onRowsChanged(),o.layout(),o.setupMSGesture(),o.applyStyles(n.options),o}return $(t,e),t.prototype.applyStyles=function(e){this.treeStyler.style(e)},t.prototype.createViewItem=function(e){return new ee(this.context,e)},t.prototype.getHTMLElement=function(){return this.domNode},t.prototype.focus=function(){this.domNode.focus()},t.prototype.isFocused=function(){return document.activeElement===this.domNode},t.prototype.blur=function(){this.domNode.blur()},t.prototype.setupMSGesture=function(){var e=this;window.MSGesture&&(this.msGesture=new MSGesture,setTimeout(function(){return e.msGesture.target=e.wrapper},100))},t.prototype.isTreeVisible=function(){return null===this.onHiddenScrollTop},t.prototype.layout=function(e,t){this.isTreeVisible()&&(this.viewHeight=e||r["v"](this.wrapper),this.scrollHeight=this.getContentHeight(),this.horizontalScrolling&&(this.viewWidth=t||r["w"](this.wrapper)))},t.prototype.render=function(e,t,n,i,o){var r,s,a=e,u=e+t,l=this.lastRenderTop+this.lastRenderHeight;for(r=this.indexAfter(u)-1,s=this.indexAt(Math.max(l,a));r>=s;r--)this.insertItemInDOM(this.itemAtIndex(r));for(r=Math.min(this.indexAt(this.lastRenderTop),this.indexAfter(u))-1,s=this.indexAt(a);r>=s;r--)this.insertItemInDOM(this.itemAtIndex(r));for(r=this.indexAt(this.lastRenderTop),s=Math.min(this.indexAt(a),this.indexAfter(l));r1e3,l=[],c=!1;if(!u){var d=new P["a"]({getLength:function(){return o.length},getElementAtIndex:function(e){return o[e]}},{getLength:function(){return r.length},getElementAtIndex:function(e){return r[e].id}},null);l=d.ComputeDiff(!1),c=l.some(function(e){if(e.modifiedLength>0)for(var n=e.modifiedStart,i=e.modifiedStart+e.modifiedLength;n0&&this.onRemoveItems(new H["a"](o,f.originalStart,f.originalStart+f.originalLength)),f.modifiedLength>0){var g=r[f.modifiedStart-1]||n;g=g.getDepth()>0?g:null,this.onInsertItems(new H["a"](r,f.modifiedStart,f.modifiedStart+f.modifiedLength),g?g.id:null)}}else(u||l.length)&&(this.onRemoveItems(new H["a"](o)),this.onInsertItems(new H["a"](r),n.getDepth()>0?n.id:null));(u||l.length)&&this.onRowsChanged()}},t.prototype.onItemRefresh=function(e){this.onItemsRefresh([e])},t.prototype.onItemsRefresh=function(e){var t=this;this.onRefreshItemSet(e.filter(function(e){return t.items.hasOwnProperty(e.id)})),this.onRowsChanged()},t.prototype.onItemExpanding=function(e){var t=this.items[e.item.id];t&&(t.expanded=!0)},t.prototype.onItemExpanded=function(e){var t=e.item,n=this.items[t.id];if(n){n.expanded=!0;var i=this.onInsertItems(t.getNavigator(),t.id)||0,o=this.scrollTop;n.top+n.height<=this.scrollTop&&(o+=i),this.onRowsChanged(o)}},t.prototype.onItemCollapsing=function(e){var t=e.item,n=this.items[t.id];n&&(n.expanded=!1,this.onRemoveItems(new H["e"](t.getNavigator(),function(e){return e&&e.id})),this.onRowsChanged())},t.prototype.onItemReveal=function(e){var t=e.item,n=e.relativeTop,i=this.items[t.id];if(i)if(null!==n){n=n<0?0:n,n=n>1?1:n;var o=i.height-this.viewHeight;this.scrollTop=o*n+i.top}else{var r=i.top+i.height,s=this.scrollTop+this.viewHeight;i.top=s&&(this.scrollTop=r-this.viewHeight)}},t.prototype.onItemAddTrait=function(e){var t=e.item,n=e.trait,i=this.items[t.id];i&&i.addClass(n),"highlighted"===n&&(r["f"](this.domNode,n),i&&(this.highlightedItemWasDraggable=!!i.draggable,i.draggable&&(i.draggable=!1)))},t.prototype.onItemRemoveTrait=function(e){var t=e.item,n=e.trait,i=this.items[t.id];i&&i.removeClass(n),"highlighted"===n&&(r["I"](this.domNode,n),this.highlightedItemWasDraggable&&(i.draggable=!0),this.highlightedItemWasDraggable=!1)},t.prototype.onModelFocusChange=function(){var e=this.model&&this.model.getFocus();r["R"](this.domNode,"no-focused-item",!e),e?this.domNode.setAttribute("aria-activedescendant",A["H"](this.context.dataSource.getId(this.context.tree,e))):this.domNode.removeAttribute("aria-activedescendant")},t.prototype.onInsertItem=function(e){var t=this;e.onDragStart=function(n){t.onDragStart(e,n)},e.needsRender=!0,this.refreshViewItem(e),this.items[e.id]=e},t.prototype.onRefreshItem=function(e,t){void 0===t&&(t=!1),e.needsRender=e.needsRender||t,this.refreshViewItem(e)},t.prototype.onRemoveItem=function(e){this.removeItemFromDOM(e),e.dispose(),delete this.items[e.id]},t.prototype.refreshViewItem=function(e){e.render(),this.shouldBeRendered(e)?this.insertItemInDOM(e):this.removeItemFromDOM(e)},t.prototype.onClick=function(e){if(!this.lastPointerType||"mouse"===this.lastPointerType){var t=new F["b"](e),n=this.getItemAround(t.target);n&&(T["j"]&&Date.now()-this.lastClickTimeStamp<300&&(t.detail=2),this.lastClickTimeStamp=Date.now(),this.context.controller.onClick(this.context.tree,n.model.getElement(),t))}},t.prototype.onMouseMiddleClick=function(e){if(this.context.controller.onMouseMiddleClick){var t=new F["b"](e),n=this.getItemAround(t.target);n&&this.context.controller.onMouseMiddleClick(this.context.tree,n.model.getElement(),t)}},t.prototype.onMouseDown=function(e){if(this.didJustPressContextMenuKey=!1,this.context.controller.onMouseDown&&(!this.lastPointerType||"mouse"===this.lastPointerType)){var t=new F["b"](e);if(!(t.ctrlKey&&a["e"]&&a["d"])){var n=this.getItemAround(t.target);n&&this.context.controller.onMouseDown(this.context.tree,n.model.getElement(),t)}}},t.prototype.onMouseUp=function(e){if(this.context.controller.onMouseUp&&(!this.lastPointerType||"mouse"===this.lastPointerType)){var t=new F["b"](e);if(!(t.ctrlKey&&a["e"]&&a["d"])){var n=this.getItemAround(t.target);n&&this.context.controller.onMouseUp(this.context.tree,n.model.getElement(),t)}}},t.prototype.onTap=function(e){var t=this.getItemAround(e.initialTarget);t&&this.context.controller.onTap(this.context.tree,t.model.getElement(),e)},t.prototype.onTouchChange=function(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY},t.prototype.onContextMenu=function(e){var t,n;if(e instanceof KeyboardEvent||this.didJustPressContextMenuKey){this.didJustPressContextMenuKey=!1;var i=new j["a"](e);n=this.model.getFocus();var o=void 0;if(n){var s=this.context.dataSource.getId(this.context.tree,n),a=this.items[s];o=r["x"](a.element)}else n=this.model.getInput(),o=r["x"](this.inputItem.element);t=new Z(o.left+o.width,o.top,i)}else{var u=new F["b"](e),l=this.getItemAround(u.target);if(!l)return;n=l.model.getElement(),t=new G(u)}this.context.controller.onContextMenu(this.context.tree,n,t)},t.prototype.onKeyDown=function(e){var t=new j["a"](e);this.didJustPressContextMenuKey=58===t.keyCode||t.shiftKey&&68===t.keyCode,t.target&&t.target.tagName&&"input"===t.target.tagName.toLowerCase()||(this.didJustPressContextMenuKey&&(t.preventDefault(),t.stopPropagation()),this.context.controller.onKeyDown(this.context.tree,t))},t.prototype.onKeyUp=function(e){this.didJustPressContextMenuKey&&this.onContextMenu(e),this.didJustPressContextMenuKey=!1,this.context.controller.onKeyUp(this.context.tree,new j["a"](e))},t.prototype.onDragStart=function(e,t){if(!this.model.getHighlight()){var n,i=e.model.getElement(),o=this.model.getSelection();if(n=o.indexOf(i)>-1?o:[i],t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setData(Y["a"].RESOURCES,JSON.stringify([e.uri])),t.dataTransfer.setDragImage){var r=void 0;r=this.context.dnd.getDragLabel?this.context.dnd.getDragLabel(this.context.tree,n):String(n.length);var s=document.createElement("div");s.className="monaco-tree-drag-image",s.textContent=r,document.body.appendChild(s),t.dataTransfer.setDragImage(s,-10,-10),setTimeout(function(){return document.body.removeChild(s)},0)}this.currentDragAndDropData=new W(n),Y["c"].CurrentDragAndDropData=new V(n),this.context.dnd.onDragStart(this.context.tree,this.currentDragAndDropData,new F["a"](t))}},t.prototype.setupDragAndDropScrollInterval=function(){var e=this,t=r["z"](this.wrapper).top;this.dragAndDropScrollInterval||(this.dragAndDropScrollInterval=window.setInterval(function(){if(null!==e.dragAndDropMouseY){var n=e.dragAndDropMouseY-t,i=0,o=e.viewHeight-35;n<35?i=Math.max(-14,.2*(n-35)):n>o&&(i=Math.min(14,.2*(n-o))),e.scrollTop+=i}},10),this.cancelDragAndDropScrollTimeout(),this.dragAndDropScrollTimeout=window.setTimeout(function(){e.cancelDragAndDropScrollInterval(),e.dragAndDropScrollTimeout=null},1e3))},t.prototype.cancelDragAndDropScrollInterval=function(){this.dragAndDropScrollInterval&&(window.clearInterval(this.dragAndDropScrollInterval),this.dragAndDropScrollInterval=null),this.cancelDragAndDropScrollTimeout()},t.prototype.cancelDragAndDropScrollTimeout=function(){this.dragAndDropScrollTimeout&&(window.clearTimeout(this.dragAndDropScrollTimeout),this.dragAndDropScrollTimeout=null)},t.prototype.onDragOver=function(e){var t=this;e.preventDefault();var n,i=new F["a"](e),o=this.getItemAround(i.target);if(!o||0===i.posx&&0===i.posy&&i.browserEvent.type===r["d"].DRAG_LEAVE)return this.currentDropTarget&&(this.currentDropTargets.forEach(function(e){return e.dropTarget=!1}),this.currentDropTargets=[],this.currentDropDisposable.dispose()),this.cancelDragAndDropScrollInterval(),this.currentDropTarget=null,this.currentDropElement=null,this.dragAndDropMouseY=null,!1;if(this.setupDragAndDropScrollInterval(),this.dragAndDropMouseY=i.posy,!this.currentDragAndDropData)if(Y["c"].CurrentDragAndDropData)this.currentDragAndDropData=Y["c"].CurrentDragAndDropData;else{if(!i.dataTransfer.types)return!1;this.currentDragAndDropData=new B}this.currentDragAndDropData.update(i.browserEvent.dataTransfer);var s,a=o.model;do{if(n=a?a.getElement():this.model.getInput(),s=this.context.dnd.onDragOver(this.context.tree,this.currentDragAndDropData,n,i),!s||1!==s.bubble)break;a=a&&a.parent}while(a);if(!a)return this.currentDropElement=null,!1;var u=s&&s.accept;u?(this.currentDropElement=a.getElement(),i.preventDefault(),i.dataTransfer.dropEffect=0===s.effect?"copy":"move"):this.currentDropElement=null;var l=a.id===this.inputItem.id?this.inputItem:this.items[a.id];if((this.shouldInvalidateDropReaction||this.currentDropTarget!==l||!ne(this.currentDropElementReaction,s))&&(this.shouldInvalidateDropReaction=!1,this.currentDropTarget&&(this.currentDropTargets.forEach(function(e){return e.dropTarget=!1}),this.currentDropTargets=[],this.currentDropDisposable.dispose()),this.currentDropTarget=l,this.currentDropElementReaction=s,u)){if(this.currentDropTarget&&(this.currentDropTarget.dropTarget=!0,this.currentDropTargets.push(this.currentDropTarget)),0===s.bubble){var c=a.getNavigator(),d=void 0;while(d=c.next())o=this.items[d.id],o&&(o.dropTarget=!0,this.currentDropTargets.push(o))}if(s.autoExpand){var h=Object(X["l"])(500);this.currentDropDisposable=S["h"](function(){return h.cancel()}),h.then(function(){return t.context.tree.expand(t.currentDropElement)}).then(function(){return t.shouldInvalidateDropReaction=!0})}}return!0},t.prototype.onDrop=function(e){if(this.currentDropElement){var t=new F["a"](e);t.preventDefault(),this.currentDragAndDropData.update(t.browserEvent.dataTransfer),this.context.dnd.drop(this.context.tree,this.currentDragAndDropData,this.currentDropElement,t),this.onDragEnd(e)}this.cancelDragAndDropScrollInterval()},t.prototype.onDragEnd=function(e){this.currentDropTarget&&(this.currentDropTargets.forEach(function(e){return e.dropTarget=!1}),this.currentDropTargets=[]),this.currentDropDisposable.dispose(),this.cancelDragAndDropScrollInterval(),this.currentDragAndDropData=null,Y["c"].CurrentDragAndDropData=void 0,this.currentDropElement=null,this.currentDropTarget=null,this.dragAndDropMouseY=null},t.prototype.onFocus=function(){this.context.options.alwaysFocused||r["f"](this.domNode,"focused"),this._onDOMFocus.fire()},t.prototype.onBlur=function(){this.context.options.alwaysFocused||r["I"](this.domNode,"focused"),this.domNode.removeAttribute("aria-activedescendant"),this._onDOMBlur.fire()},t.prototype.onMsPointerDown=function(e){if(this.msGesture){var t=e.pointerType;t!==(e.MSPOINTER_TYPE_MOUSE||"mouse")?t===(e.MSPOINTER_TYPE_TOUCH||"touch")&&(this.lastPointerType="touch",e.stopPropagation(),e.preventDefault(),this.msGesture.addPointer(e.pointerId)):this.lastPointerType="mouse"}},t.prototype.onThrottledMsGestureChange=function(e){this.scrollTop-=e.translationY},t.prototype.onMsGestureTap=function(e){e.initialTarget=document.elementFromPoint(e.clientX,e.clientY),this.onTap(e)},t.prototype.insertItemInDOM=function(e){var t=null,n=this.itemAfter(e);n&&n.element&&(t=n.element),e.insertInDOM(this.rowsContainer,t)},t.prototype.removeItemFromDOM=function(e){e&&e.removeFromDOM()},t.prototype.shouldBeRendered=function(e){return e.topthis.lastRenderTop},t.prototype.getItemAround=function(e){var n=this.inputItem,i=e;do{if(i[t.BINDING]&&(n=i[t.BINDING]),i===this.wrapper||i===this.domNode)return n;if(i===this.scrollableElement.getDomNode()||i===document.body)return}while(i=i.parentElement)},t.prototype.releaseModel=function(){this.model&&(this.modelListeners=S["f"](this.modelListeners),this.model=null)},t.prototype.dispose=function(){var t=this;this.scrollableElement.dispose(),this.releaseModel(),this.viewListeners=S["f"](this.viewListeners),this._onDOMFocus.dispose(),this._onDOMBlur.dispose(),this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.items&&Object.keys(this.items).forEach(function(e){return t.items[e].removeFromDOM()}),this.context.cache&&this.context.cache.dispose(),e.prototype.dispose.call(this)},t.BINDING="monaco-tree-row",t.LOADING_DECORATION_DELAY=800,t.counter=0,t}(U),oe=n("ceb8"),re=n("aa3d"),se=function(){function e(e,t,n){if(void 0===n&&(n={}),this.tree=e,this.configuration=t,this.options=n,!t.dataSource)throw new Error("You must provide a Data Source to the tree.");this.dataSource=t.dataSource,this.renderer=t.renderer,this.controller=t.controller||new v({clickBehavior:1,keyboardSupport:"boolean"!==typeof n.keyboardSupport||n.keyboardSupport}),this.dnd=t.dnd||new _,this.filter=t.filter||new b,this.sorter=t.sorter,this.accessibilityProvider=t.accessibilityProvider||new y,this.styler=t.styler}return e}(),ae={listFocusBackground:oe["a"].fromHex("#073655"),listActiveSelectionBackground:oe["a"].fromHex("#0E639C"),listActiveSelectionForeground:oe["a"].fromHex("#FFFFFF"),listFocusAndSelectionBackground:oe["a"].fromHex("#094771"),listFocusAndSelectionForeground:oe["a"].fromHex("#FFFFFF"),listInactiveSelectionBackground:oe["a"].fromHex("#3F3F46"),listHoverBackground:oe["a"].fromHex("#2A2D2E"),listDropBackground:oe["a"].fromHex("#383B3D")},ue=function(){function e(e,t,n){void 0===n&&(n={}),this._onDidChangeFocus=new L["f"],this.onDidChangeFocus=this._onDidChangeFocus.event,this._onDidChangeSelection=new L["f"],this.onDidChangeSelection=this._onDidChangeSelection.event,this._onHighlightChange=new L["f"],this._onDidExpandItem=new L["f"],this._onDidCollapseItem=new L["f"],this._onDispose=new L["a"],this.onDidDispose=this._onDispose.event,this.container=e,Object(re["g"])(n,ae,!1),n.twistiePixels="number"===typeof n.twistiePixels?n.twistiePixels:32,n.showTwistie=!1!==n.showTwistie,n.indentPixels="number"===typeof n.indentPixels?n.indentPixels:12,n.alwaysFocused=!0===n.alwaysFocused,n.useShadows=!1!==n.useShadows,n.paddingOnRow=!1!==n.paddingOnRow,n.showLoading=!1!==n.showLoading,this.context=new se(this,t,n),this.model=new M(this.context),this.view=new ie(this.context,this.container),this.view.setModel(this.model),this._onDidChangeFocus.input=this.model.onDidFocus,this._onDidChangeSelection.input=this.model.onDidSelect,this._onHighlightChange.input=this.model.onDidHighlight,this._onDidExpandItem.input=this.model.onDidExpandItem,this._onDidCollapseItem.input=this.model.onDidCollapseItem}return e.prototype.style=function(e){this.view.applyStyles(e)},Object.defineProperty(e.prototype,"onDidFocus",{get:function(){return this.view&&this.view.onDOMFocus},enumerable:!0,configurable:!0}),e.prototype.getHTMLElement=function(){return this.view.getHTMLElement()},e.prototype.layout=function(e,t){this.view.layout(e,t)},e.prototype.domFocus=function(){this.view.focus()},e.prototype.isDOMFocused=function(){return this.view.isFocused()},e.prototype.domBlur=function(){this.view.blur()},e.prototype.setInput=function(e){return this.model.setInput(e)},e.prototype.getInput=function(){return this.model.getInput()},e.prototype.expand=function(e){return this.model.expand(e)},e.prototype.collapse=function(e,t){return void 0===t&&(t=!1),this.model.collapse(e,t)},e.prototype.toggleExpansion=function(e,t){return void 0===t&&(t=!1),this.model.toggleExpansion(e,t)},e.prototype.isExpanded=function(e){return this.model.isExpanded(e)},e.prototype.reveal=function(e,t){return void 0===t&&(t=null),this.model.reveal(e,t)},e.prototype.getHighlight=function(){return this.model.getHighlight()},e.prototype.clearHighlight=function(e){this.model.setHighlight(null,e)},e.prototype.setSelection=function(e,t){this.model.setSelection(e,t)},e.prototype.getSelection=function(){return this.model.getSelection()},e.prototype.clearSelection=function(e){this.model.setSelection([],e)},e.prototype.setFocus=function(e,t){this.model.setFocus(e,t)},e.prototype.getFocus=function(){return this.model.getFocus()},e.prototype.focusNext=function(e,t){this.model.focusNext(e,t)},e.prototype.focusPrevious=function(e,t){this.model.focusPrevious(e,t)},e.prototype.focusParent=function(e){this.model.focusParent(e)},e.prototype.focusFirstChild=function(e){this.model.focusFirstChild(e)},e.prototype.focusFirst=function(e,t){this.model.focusFirst(e,t)},e.prototype.focusNth=function(e,t){this.model.focusNth(e,t)},e.prototype.focusLast=function(e,t){this.model.focusLast(e,t)},e.prototype.focusNextPage=function(e){this.view.focusNextPage(e)},e.prototype.focusPreviousPage=function(e){this.view.focusPreviousPage(e)},e.prototype.clearFocus=function(e){this.model.setFocus(null,e)},e.prototype.dispose=function(){this._onDispose.fire(),null!==this.model&&(this.model.dispose(),this.model=null),null!==this.view&&(this.view.dispose(),this.view=null),this._onDidChangeFocus.dispose(),this._onDidChangeSelection.dispose(),this._onHighlightChange.dispose(),this._onDidExpandItem.dispose(),this._onDidCollapseItem.dispose(),this._onDispose.dispose()},e}(),le=(n("1f26"),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),ce="done",de="active",he="infinite",pe="discrete",fe="monaco-progress-container",ge="progress-bit",me={progressBarBackground:oe["a"].fromHex("#0E70C0")},ve=function(e){function t(t,n){var i=e.call(this)||this;return i.options=n||Object.create(null),Object(re["g"])(i.options,me,!1),i.workedVal=0,i.progressBarBackground=i.options.progressBarBackground,i._register(i.showDelayedScheduler=new X["d"](function(){return Object(r["Q"])(i.element)},0)),i.create(t),i}return le(t,e),t.prototype.create=function(e){this.element=document.createElement("div"),Object(r["f"])(this.element,fe),e.appendChild(this.element),this.bit=document.createElement("div"),Object(r["f"])(this.bit,ge),this.element.appendChild(this.bit),this.applyStyles()},t.prototype.off=function(){this.bit.style.width="inherit",this.bit.style.opacity="1",Object(r["J"])(this.element,de,he,pe),this.workedVal=0,this.totalWork=void 0},t.prototype.stop=function(){return this.doDone(!1)},t.prototype.doDone=function(e){var t=this;return Object(r["f"])(this.element,ce),Object(r["C"])(this.element,he)?(this.bit.style.opacity="0",e?setTimeout(function(){return t.off()},200):this.off()):(this.bit.style.width="inherit",e?setTimeout(function(){return t.off()},200):this.off()),this},t.prototype.hide=function(){Object(r["D"])(this.element),this.showDelayedScheduler.cancel()},t.prototype.style=function(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()},t.prototype.applyStyles=function(){if(this.bit){var e=this.progressBarBackground?this.progressBarBackground.toString():null;this.bit.style.backgroundColor=e}},t}(S["a"]),_e=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _e(t,e),t.prototype.onContextMenu=function(t,n,i){return a["d"]?this.onLeftClick(t,n,i):e.prototype.onContextMenu.call(this,t,n,i)},t}(v),ye={background:oe["a"].fromHex("#1E1E1E"),foreground:oe["a"].fromHex("#CCCCCC"),pickerGroupForeground:oe["a"].fromHex("#0097FB"),pickerGroupBorder:oe["a"].fromHex("#3F3F46"),widgetShadow:oe["a"].fromHex("#000000"),progressBarBackground:oe["a"].fromHex("#0E70C0")},we=s["a"]("quickOpenAriaLabel","Quick picker. Type to narrow down results."),Ce=function(e){function t(t,n,i){var o=e.call(this)||this;return o.isDisposed=!1,o.container=t,o.callbacks=n,o.options=i,o.styles=i||Object.create(null),Object(re["g"])(o.styles,ye,!1),o.model=null,o}return _e(t,e),t.prototype.getModel=function(){return this.model},t.prototype.create=function(){var e=this;this.element=document.createElement("div"),r["f"](this.element,"monaco-quick-open-widget"),this.container.appendChild(this.element),this._register(r["h"](this.element,r["d"].CONTEXT_MENU,function(e){return r["c"].stop(e,!0)})),this._register(r["h"](this.element,r["d"].FOCUS,function(t){return e.gainingFocus()},!0)),this._register(r["h"](this.element,r["d"].BLUR,function(t){return e.loosingFocus(t)},!0)),this._register(r["h"](this.element,r["d"].KEY_DOWN,function(t){var n=new j["a"](t);if(9===n.keyCode)r["c"].stop(t,!0),e.hide(2);else if(2===n.keyCode&&!n.altKey&&!n.ctrlKey&&!n.metaKey){var i=t.currentTarget.querySelectorAll("input, .monaco-tree, .monaco-tree-row.focused .action-label.icon");n.shiftKey&&n.target===i[0]?(r["c"].stop(t,!0),i[i.length-1].focus()):n.shiftKey||n.target!==i[i.length-1]||(r["c"].stop(t,!0),i[0].focus())}})),this.progressBar=this._register(new ve(this.element,{progressBarBackground:this.styles.progressBarBackground})),this.progressBar.hide(),this.inputContainer=document.createElement("div"),r["f"](this.inputContainer,"quick-open-input"),this.element.appendChild(this.inputContainer),this.inputBox=this._register(new p["b"](this.inputContainer,void 0,{placeholder:this.options.inputPlaceHolder||"",ariaLabel:we,inputBackground:this.styles.inputBackground,inputForeground:this.styles.inputForeground,inputBorder:this.styles.inputBorder,inputValidationInfoBackground:this.styles.inputValidationInfoBackground,inputValidationInfoForeground:this.styles.inputValidationInfoForeground,inputValidationInfoBorder:this.styles.inputValidationInfoBorder,inputValidationWarningBackground:this.styles.inputValidationWarningBackground,inputValidationWarningForeground:this.styles.inputValidationWarningForeground,inputValidationWarningBorder:this.styles.inputValidationWarningBorder,inputValidationErrorBackground:this.styles.inputValidationErrorBackground,inputValidationErrorForeground:this.styles.inputValidationErrorForeground,inputValidationErrorBorder:this.styles.inputValidationErrorBorder})),this.inputElement=this.inputBox.inputElement,this.inputElement.setAttribute("role","combobox"),this.inputElement.setAttribute("aria-haspopup","false"),this.inputElement.setAttribute("aria-autocomplete","list"),this._register(r["h"](this.inputBox.inputElement,r["d"].INPUT,function(t){return e.onType()})),this._register(r["h"](this.inputBox.inputElement,r["d"].KEY_DOWN,function(t){var n=new j["a"](t),i=e.shouldOpenInBackground(n);if(2!==n.keyCode)if(18===n.keyCode||16===n.keyCode||12===n.keyCode||11===n.keyCode)r["c"].stop(t,!0),e.navigateInTree(n.keyCode,n.shiftKey),e.inputBox.inputElement.selectionStart===e.inputBox.inputElement.selectionEnd&&(e.inputBox.inputElement.selectionStart=e.inputBox.value.length);else if(3===n.keyCode||i){r["c"].stop(t,!0);var o=e.tree.getFocus();o&&e.elementSelected(o,t,i?2:1)}})),this.resultCount=document.createElement("div"),r["f"](this.resultCount,"quick-open-result-count"),this.resultCount.setAttribute("aria-live","polite"),this.resultCount.setAttribute("aria-atomic","true"),this.element.appendChild(this.resultCount),this.treeContainer=document.createElement("div"),r["f"](this.treeContainer,"quick-open-tree"),this.element.appendChild(this.treeContainer);var t=this.options.treeCreator||function(e,t,n){return new ue(e,t,n)};return this.tree=this._register(t(this.treeContainer,{dataSource:new l(this),controller:new be({clickBehavior:1,keyboardSupport:this.options.keyboardSupport}),renderer:this.renderer=new h(this,this.styles),filter:new d(this),accessibilityProvider:new c(this)},{twistiePixels:11,indentPixels:0,alwaysFocused:!0,verticalScrollMode:3,horizontalScrollMode:2,ariaLabel:s["a"]("treeAriaLabel","Quick Picker"),keyboardSupport:this.options.keyboardSupport,preventRootFocus:!1})),this.treeElement=this.tree.getHTMLElement(),this._register(this.tree.onDidChangeFocus(function(t){e.elementFocused(t.focus,t)})),this._register(this.tree.onDidChangeSelection(function(t){if(t.selection&&t.selection.length>0){var n=t.payload&&t.payload.originalEvent instanceof F["b"]?t.payload.originalEvent:void 0,i=!!n&&e.shouldOpenInBackground(n);e.elementSelected(t.selection[0],t,i?2:1)}})),this._register(r["h"](this.treeContainer,r["d"].KEY_DOWN,function(t){var n=new j["a"](t);e.quickNavigateConfiguration&&(18!==n.keyCode&&16!==n.keyCode&&12!==n.keyCode&&11!==n.keyCode||(r["c"].stop(t,!0),e.navigateInTree(n.keyCode)))})),this._register(r["h"](this.treeContainer,r["d"].KEY_UP,function(t){var n=new j["a"](t),i=n.keyCode;if(e.quickNavigateConfiguration){var o=e.quickNavigateConfiguration.keybindings,r=3===i||o.some(function(e){var t=e.getParts(),o=t[0],r=t[1];return!r&&(o.shiftKey&&4===i?!(n.ctrlKey||n.altKey||n.metaKey):!(!o.altKey||6!==i)||(!(!o.ctrlKey||5!==i)||!(!o.metaKey||57!==i)))});if(r){var s=e.tree.getFocus();s&&e.elementSelected(s,t)}}})),this.layoutDimensions&&this.layout(this.layoutDimensions),this.applyStyles(),this._register(r["h"](this.treeContainer,r["d"].KEY_DOWN,function(t){var n=new j["a"](t);e.quickNavigateConfiguration||18!==n.keyCode&&16!==n.keyCode&&12!==n.keyCode&&11!==n.keyCode||(r["c"].stop(t,!0),e.navigateInTree(n.keyCode,n.shiftKey),e.treeElement.focus())})),this.element},t.prototype.style=function(e){this.styles=e,this.applyStyles()},t.prototype.applyStyles=function(){if(this.element){var e=this.styles.foreground?this.styles.foreground.toString():null,t=this.styles.background?this.styles.background.toString():null,n=this.styles.borderColor?this.styles.borderColor.toString():null,i=this.styles.widgetShadow?this.styles.widgetShadow.toString():null;this.element.style.color=e,this.element.style.backgroundColor=t,this.element.style.borderColor=n,this.element.style.borderWidth=n?"1px":null,this.element.style.borderStyle=n?"solid":null,this.element.style.boxShadow=i?"0 5px 8px "+i:null}this.progressBar&&this.progressBar.style({progressBarBackground:this.styles.progressBarBackground}),this.inputBox&&this.inputBox.style({inputBackground:this.styles.inputBackground,inputForeground:this.styles.inputForeground,inputBorder:this.styles.inputBorder,inputValidationInfoBackground:this.styles.inputValidationInfoBackground,inputValidationInfoForeground:this.styles.inputValidationInfoForeground,inputValidationInfoBorder:this.styles.inputValidationInfoBorder,inputValidationWarningBackground:this.styles.inputValidationWarningBackground,inputValidationWarningForeground:this.styles.inputValidationWarningForeground,inputValidationWarningBorder:this.styles.inputValidationWarningBorder,inputValidationErrorBackground:this.styles.inputValidationErrorBackground,inputValidationErrorForeground:this.styles.inputValidationErrorForeground,inputValidationErrorBorder:this.styles.inputValidationErrorBorder}),this.tree&&!this.options.treeCreator&&this.tree.style(this.styles),this.renderer&&this.renderer.updateStyles(this.styles)},t.prototype.shouldOpenInBackground=function(e){if(e instanceof j["a"]){if(17!==e.keyCode)return!1;if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;var t=this.inputBox.inputElement;return t.selectionEnd===this.inputBox.value.length&&t.selectionStart===t.selectionEnd}return e.middleButton},t.prototype.onType=function(){var e=this.inputBox.value;this.helpText&&(e?r["D"](this.helpText):r["Q"](this.helpText)),this.callbacks.onType(e)},t.prototype.navigateInTree=function(e,t){var n=this.tree.getInput(),i=n?n.entries:[],o=this.tree.getFocus();switch(e){case 18:this.tree.focusNext();break;case 16:this.tree.focusPrevious();break;case 12:this.tree.focusNextPage();break;case 11:this.tree.focusPreviousPage();break;case 2:t?this.tree.focusPrevious():this.tree.focusNext();break}var r=this.tree.getFocus();i.length>1&&o===r&&(16===e||2===e&&t?this.tree.focusLast():(18===e||2===e&&!t)&&this.tree.focusFirst()),r=this.tree.getFocus(),r&&this.tree.reveal(r)},t.prototype.elementFocused=function(e,t){if(e&&this.isVisible()){var n=this.treeElement.getAttribute("aria-activedescendant");n?this.inputElement.setAttribute("aria-activedescendant",n):this.inputElement.removeAttribute("aria-activedescendant");var i={event:t,keymods:this.extractKeyMods(t),quickNavigateConfiguration:this.quickNavigateConfiguration};this.model.runner.run(e,0,i)}},t.prototype.elementSelected=function(e,t,n){var i=!0;if(this.isVisible()){var o=n||1,r={event:t,keymods:this.extractKeyMods(t),quickNavigateConfiguration:this.quickNavigateConfiguration};i=this.model.runner.run(e,o,r)}i&&this.hide(0)},t.prototype.extractKeyMods=function(e){return{ctrlCmd:e&&(e.ctrlKey||e.metaKey||e.payload&&e.payload.originalEvent&&(e.payload.originalEvent.ctrlKey||e.payload.originalEvent.metaKey)),alt:e&&(e.altKey||e.payload&&e.payload.originalEvent&&e.payload.originalEvent.altKey)}},t.prototype.show=function(e,t){this.visible=!0,this.isLoosingFocus=!1,this.quickNavigateConfiguration=t?t.quickNavigateConfiguration:void 0,this.quickNavigateConfiguration?(r["D"](this.inputContainer),r["Q"](this.element),this.tree.domFocus()):(r["Q"](this.inputContainer),r["Q"](this.element),this.inputBox.focus()),this.helpText&&(this.quickNavigateConfiguration||u["i"](e)?r["D"](this.helpText):r["Q"](this.helpText)),u["i"](e)?this.doShowWithPrefix(e):(t&&t.value&&this.restoreLastInput(t.value),this.doShowWithInput(e,t&&t.autoFocus?t.autoFocus:{})),t&&t.inputSelection&&!this.quickNavigateConfiguration&&this.inputBox.select(t.inputSelection),this.callbacks.onShow&&this.callbacks.onShow()},t.prototype.restoreLastInput=function(e){this.inputBox.value=e,this.inputBox.select(),this.callbacks.onType(e)},t.prototype.doShowWithPrefix=function(e){this.inputBox.value=e,this.callbacks.onType(e)},t.prototype.doShowWithInput=function(e,t){this.setInput(e,t)},t.prototype.setInputAndLayout=function(e,t){var n=this;this.treeContainer.style.height=this.getHeight(e)+"px",this.tree.setInput(null).then(function(){return n.model=e,n.inputElement.setAttribute("aria-haspopup",String(e&&e.entries&&e.entries.length>0)),n.tree.setInput(e)}).then(function(){n.tree.layout();var i=e?e.entries.filter(function(t){return n.isElementVisible(e,t)}):[];n.updateResultCount(i.length),i.length&&n.autoFocus(e,i,t)})},t.prototype.isElementVisible=function(e,t){return!e.filter||e.filter.isVisible(t)},t.prototype.autoFocus=function(e,t,n){if(void 0===n&&(n={}),n.autoFocusPrefixMatch){for(var i=void 0,o=void 0,r=n.autoFocusPrefixMatch,s=r.toLowerCase(),a=0,u=t;an.autoFocusIndex&&(this.tree.focusNth(n.autoFocusIndex),this.tree.reveal(this.tree.getFocus())):n.autoFocusSecondEntry?t.length>1&&this.tree.focusNth(1):n.autoFocusLastEntry&&t.length>1&&this.tree.focusLast()},t.prototype.getHeight=function(e){var n=this,i=e.renderer;if(!e){var o=i.getHeight(null);return this.options.minItemsToShow?this.options.minItemsToShow*o:0}var r,s=0;this.layoutDimensions&&this.layoutDimensions.height&&(r=.4*(this.layoutDimensions.height-50)),(!r||r>t.MAX_ITEMS_HEIGHT)&&(r=t.MAX_ITEMS_HEIGHT);for(var a=e.entries.filter(function(t){return n.isElementVisible(e,t)}),u=this.options.maxItemsToShow||a.length,l=0;l=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},ke=function(e,t){return function(n,i){t(n,i,e)}},Ie=function(){function e(e,t){this.themeService=t,this.widget=null,this.rangeHighlightDecorationId=null,this.lastKnownEditorSelection=null,this.editor=e}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this.widget&&(this.widget.destroy(),this.widget=null)},e.prototype.run=function(e){var t=this;this.widget&&(this.widget.destroy(),this.widget=null);var n=function(e){t.clearDecorations(),e&&t.lastKnownEditorSelection&&(t.editor.setSelection(t.lastKnownEditorSelection),t.editor.revealRangeInCenterIfOutsideViewport(t.lastKnownEditorSelection,0)),t.lastKnownEditorSelection=null,document.activeElement!==document.body&&e||t.editor.focus()};this.widget=new Oe(this.editor,function(){return n(!1)},function(){return n(!0)},function(n){t.widget.setInput(e.getModel(n),e.getAutoFocus(n))},{inputAriaLabel:e.inputAriaLabel},this.themeService),this.lastKnownEditorSelection||(this.lastKnownEditorSelection=this.editor.getSelection()),this.widget.show("")},e.prototype.decorateLine=function(t,n){var i=[];this.rangeHighlightDecorationId&&(i.push(this.rangeHighlightDecorationId),this.rangeHighlightDecorationId=null);var o=[{range:t,options:e._RANGE_HIGHLIGHT_DECORATION}],r=n.deltaDecorations(i,o);this.rangeHighlightDecorationId=r[0]},e.prototype.clearDecorations=function(){this.rangeHighlightDecorationId&&(this.editor.deltaDecorations([this.rangeHighlightDecorationId],[]),this.rangeHighlightDecorationId=null)},e.ID="editor.controller.quickOpenController",e._RANGE_HIGHLIGHT_DECORATION=o["a"].register({className:"rangeHighlight",isWholeLine:!0}),e=De([ke(1,xe["c"])],e),e}(),Ee=function(e){function t(t,n){var i=e.call(this,n)||this;return i._inputAriaLabel=t,i}return Ne(t,e),t.prototype.getController=function(e){return Ie.get(e)},t.prototype._show=function(e,t){e.run({inputAriaLabel:this._inputAriaLabel,getModel:function(e){return t.getModel(e)},getAutoFocus:function(e){return t.getAutoFocus(e)}})},t}(i["b"]);Object(i["h"])(Ie)},af40:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i=function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1),this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}return e}()},b055:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("8ae8");function o(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===i["a"].ICodeEditor}},b0cd:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return s});var i=n("4b76"),o=n("0a0f"),r=(i["a"],Object(o["c"])("notificationService")),s=function(){function e(){}return e}()},b1ca:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("0a0f"),o=Object(i["c"])("themeService")},b223:function(e,t,n){},b272:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("3742"),o=n("2c29"),r=n("2e5d"),s=n("f85a"),a=n("6a89"),u=function(){function e(){}return e.deleteRight=function(e,t,n,i){for(var r=[],u=3!==e,l=0,c=i.length;l1){var m=n.getLineContent(g.lineNumber),v=i["q"](m),_=-1===v?m.length+1:v+1;if(g.column<=_){var b=r["a"].visibleColumnFromColumn2(t,n,g),y=r["a"].prevIndentTabStop(b,t.indentSize),w=r["a"].columnFromVisibleColumn2(t,n,g.lineNumber,y);f=new a["a"](g.lineNumber,w,g.lineNumber,g.column)}else f=new a["a"](g.lineNumber,g.column-1,g.lineNumber,g.column)}else{var C=s["a"].left(t,n,g.lineNumber,g.column);f=new a["a"](C.lineNumber,C.column,g.lineNumber,g.column)}}f.isEmpty()?l[d]=null:(f.startLineNumber!==f.endLineNumber&&(c=!0),l[d]=new o["a"](f,""))}return[c,l]},e.cut=function(e,t,n){for(var i=[],s=0,u=n.length;s1?(d=c.lineNumber-1,h=t.getLineMaxColumn(c.lineNumber-1),p=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,h=1,p=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));var g=new a["a"](d,h,p,f);g.isEmpty()?i[s]=null:i[s]=new o["a"](g,"")}else i[s]=null;else i[s]=new o["a"](l,"")}return new r["e"](0,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})},e}()},b2cc:function(e,t,n){"use strict";n.d(t,"a",function(){return _}),n.d(t,"c",function(){return b}),n.d(t,"b",function(){return y}),n.d(t,"j",function(){return w}),n.d(t,"e",function(){return C}),n.d(t,"g",function(){return S}),n.d(t,"f",function(){return L}),n.d(t,"i",function(){return O}),n.d(t,"h",function(){return x}),n.d(t,"d",function(){return i});var i,o=n("fdcc"),r=n("6d8e"),s=n("5717"),a=n("7061"),u=n("1b69"),l=n("b78f"),c=n("7e32"),d=n("9e74"),h=n("4fc3"),p=n("9eb8"),f=n("89cd"),g=n("5d75"),m=n("ef8e"),v=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_=function(){function e(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menubarOpts=e.menubarOpts,this._description=e.description}return e.prototype.register=function(){var e=this;if(this._menubarOpts&&c["c"].appendMenuItem(this._menubarOpts.menuId,{group:this._menubarOpts.group,command:{id:this.id,title:this._menubarOpts.title},when:this._menubarOpts.when,order:this._menubarOpts.order}),this._kbOpts){var t=this._kbOpts.kbExpr;this.precondition&&(t=t?h["a"].and(t,this.precondition):this.precondition),p["a"].registerCommandAndKeybindingRule({id:this.id,handler:function(t,n){return e.runCommand(t,n)},weight:this._kbOpts.weight,when:t,primary:this._kbOpts.primary,secondary:this._kbOpts.secondary,win:this._kbOpts.win,linux:this._kbOpts.linux,mac:this._kbOpts.mac,description:this._description})}else d["a"].registerCommand({id:this.id,handler:function(t,n){return e.runCommand(t,n)},description:this._description})},e}(),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.bindToContribution=function(e){return function(t){function n(e){var n=t.call(this,e)||this;return n._callback=e.handler,n}return v(n,t),n.prototype.runEditorCommand=function(t,n,i){var o=e(n);o&&this._callback(e(n),i)},n}(t)},t.prototype.runCommand=function(e,t){var n=this,i=e.get(s["a"]),o=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(o)return o.invokeWithinContext(function(e){var i=e.get(h["c"]);if(i.contextMatchesRules(Object(m["m"])(n.precondition)))return n.runEditorCommand(e,o,t)})},t}(_),y=function(e){function t(t){var n=e.call(this,t)||this;return n.label=t.label,n.alias=t.alias,n.menuOpts=t.menuOpts,n}return v(t,e),t.prototype.register=function(){this.menuOpts&&c["c"].appendMenuItem(7,{command:{id:this.id,title:this.label},when:h["a"].and(this.precondition,this.menuOpts.when),group:this.menuOpts.group,order:this.menuOpts.order}),e.prototype.register.call(this)},t.prototype.runEditorCommand=function(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})},t.prototype.reportTelemetry=function(e,t){e.get(g["a"]).publicLog2("editorActionInvoked",{name:this.label,id:this.id})},t}(b);function w(e,t){d["a"].registerCommand(e,function(e,n){return t(e,n||{})})}function C(e,t){w(e,function(e,n){var i=n.resource,s=n.position;if(!(i instanceof r["a"]))throw Object(o["b"])("resource");if(!a["a"].isIPosition(s))throw Object(o["b"])("position");var c=e.get(u["a"]).getModel(i);if(c){var d=a["a"].lift(s);return t(c,d,n)}return e.get(l["a"]).createModelReference(i).then(function(e){return new Promise(function(i,o){try{var r=t(e.object.textEditorModel,a["a"].lift(s),n);i(r)}catch(u){o(u)}}).finally(function(){e.dispose()})})})}function S(e){return D.INSTANCE.registerEditorCommand(e),e}function L(e){D.INSTANCE.registerEditorAction(new e)}function O(e){D.INSTANCE.registerEditorAction(e)}function x(e){D.INSTANCE.registerEditorContribution(e)}(function(e){function t(e){return D.INSTANCE.getEditorCommand(e)}function n(){return D.INSTANCE.getEditorActions()}function i(){return D.INSTANCE.getEditorContributions()}e.getEditorCommand=t,e.getEditorActions=n,e.getEditorContributions=i})(i||(i={}));var N={EditorCommonContributions:"editor.contributions"},D=function(){function e(){this.editorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}return e.prototype.registerEditorContribution=function(e){this.editorContributions.push(e)},e.prototype.registerEditorAction=function(e){e.register(),this.editorActions.push(e)},e.prototype.getEditorContributions=function(){return this.editorContributions.slice(0)},e.prototype.getEditorActions=function(){return this.editorActions.slice(0)},e.prototype.registerEditorCommand=function(e){e.register(),this.editorCommands[e.id]=e},e.prototype.getEditorCommand=function(e){return this.editorCommands[e]||null},e.INSTANCE=new e,e}();f["a"].add(N.EditorCommonContributions,D.INSTANCE)},b329:function(e,t,n){},b3b2:function(e,t,n){"use strict";n.r(t),n.d(t,"MoveWordCommand",function(){return m}),n.d(t,"WordLeftCommand",function(){return v}),n.d(t,"WordRightCommand",function(){return _}),n.d(t,"CursorWordStartLeft",function(){return b}),n.d(t,"CursorWordEndLeft",function(){return y}),n.d(t,"CursorWordLeft",function(){return w}),n.d(t,"CursorWordStartLeftSelect",function(){return C}),n.d(t,"CursorWordEndLeftSelect",function(){return S}),n.d(t,"CursorWordLeftSelect",function(){return L}),n.d(t,"CursorWordAccessibilityLeft",function(){return O}),n.d(t,"CursorWordAccessibilityLeftSelect",function(){return x}),n.d(t,"CursorWordStartRight",function(){return N}),n.d(t,"CursorWordEndRight",function(){return D}),n.d(t,"CursorWordRight",function(){return k}),n.d(t,"CursorWordStartRightSelect",function(){return I}),n.d(t,"CursorWordEndRightSelect",function(){return E}),n.d(t,"CursorWordRightSelect",function(){return M}),n.d(t,"CursorWordAccessibilityRight",function(){return T}),n.d(t,"CursorWordAccessibilityRightSelect",function(){return P}),n.d(t,"DeleteWordCommand",function(){return R}),n.d(t,"DeleteWordLeftCommand",function(){return A}),n.d(t,"DeleteWordRightCommand",function(){return F}),n.d(t,"DeleteWordStartLeft",function(){return j}),n.d(t,"DeleteWordEndLeft",function(){return W}),n.d(t,"DeleteWordLeft",function(){return V}),n.d(t,"DeleteWordStartRight",function(){return B}),n.d(t,"DeleteWordEndRight",function(){return H}),n.d(t,"DeleteWordRight",function(){return z});var i=n("b2cc"),o=n("2c29"),r=n("2e5d"),s=n("d48d"),a=n("e6ff"),u=n("7061"),l=n("6a89"),c=n("8025"),d=n("c101"),h=n("4779"),p=n("4fc3"),f=n("fd49"),g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),m=function(e){function t(t){var n=e.call(this,t)||this;return n._inSelectionMode=t.inSelectionMode,n._wordNavigationType=t.wordNavigationType,n}return g(t,e),t.prototype.runEditorCommand=function(e,t,n){var i=this;if(t.hasModel()){var o=t.getConfiguration(),s=Object(a["a"])(o.wordSeparators),l=t.getModel(),c=t.getSelections(),d=c.map(function(e){var t=new u["a"](e.positionLineNumber,e.positionColumn),n=i._move(s,l,t,i._wordNavigationType);return i._moveTo(e,n,i._inSelectionMode)});if(t._getCursors().setStates("moveWordCommand",0,d.map(function(e){return r["d"].fromModelSelection(e)})),1===d.length){var h=new u["a"](d[0].positionLineNumber,d[0].positionColumn);t.revealPosition(h,0)}}},t.prototype._moveTo=function(e,t,n){return n?new c["a"](e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new c["a"](t.lineNumber,t.column,t.lineNumber,t.column)},t}(i["c"]),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype._move=function(e,t,n,i){return s["a"].moveWordLeft(e,t,n,i)},t}(m),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype._move=function(e,t,n,i){return s["a"].moveWordRight(e,t,n,i)},t}(m),b=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0,kbOpts:{kbExpr:d["a"].textInputFocus,primary:2063,mac:{primary:527},weight:100}})||this}return g(t,e),t}(v),y=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})||this}return g(t,e),t}(v),w=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0})||this}return g(t,e),t}(v),C=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0,kbOpts:{kbExpr:d["a"].textInputFocus,primary:3087,mac:{primary:1551},weight:100}})||this}return g(t,e),t}(v),S=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})||this}return g(t,e),t}(v),L=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0})||this}return g(t,e),t}(v),O=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0,kbOpts:{kbExpr:p["a"].and(d["a"].textInputFocus,h["a"]),primary:2063,mac:{primary:527},weight:101}})||this}return g(t,e),t.prototype._move=function(t,n,i,o){return e.prototype._move.call(this,Object(a["a"])(f["a"].wordSeparators),n,i,o)},t}(v),x=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0,kbOpts:{kbExpr:p["a"].and(d["a"].textInputFocus,h["a"]),primary:3087,mac:{primary:1551},weight:101}})||this}return g(t,e),t.prototype._move=function(t,n,i,o){return e.prototype._move.call(this,Object(a["a"])(f["a"].wordSeparators),n,i,o)},t}(v),N=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})||this}return g(t,e),t}(_),D=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:d["a"].textInputFocus,primary:2065,mac:{primary:529},weight:100}})||this}return g(t,e),t}(_),k=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})||this}return g(t,e),t}(_),I=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})||this}return g(t,e),t}(_),E=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:d["a"].textInputFocus,primary:3089,mac:{primary:1553},weight:100}})||this}return g(t,e),t}(_),M=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})||this}return g(t,e),t}(_),T=function(e){function t(){return e.call(this,{inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0,kbOpts:{kbExpr:p["a"].and(d["a"].textInputFocus,h["a"]),primary:2065,mac:{primary:529},weight:101}})||this}return g(t,e),t.prototype._move=function(t,n,i,o){return e.prototype._move.call(this,Object(a["a"])(f["a"].wordSeparators),n,i,o)},t}(_),P=function(e){function t(){return e.call(this,{inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0,kbOpts:{kbExpr:p["a"].and(d["a"].textInputFocus,h["a"]),primary:3089,mac:{primary:1553},weight:101}})||this}return g(t,e),t.prototype._move=function(t,n,i,o){return e.prototype._move.call(this,Object(a["a"])(f["a"].wordSeparators),n,i,o)},t}(_),R=function(e){function t(t){var n=e.call(this,t)||this;return n._whitespaceHeuristics=t.whitespaceHeuristics,n._wordNavigationType=t.wordNavigationType,n}return g(t,e),t.prototype.runEditorCommand=function(e,t,n){var i=this;if(t.hasModel()){var r=t.getConfiguration(),s=Object(a["a"])(r.wordSeparators),u=t.getModel(),l=t.getSelections(),c=l.map(function(e){var t=i._delete(s,u,e,i._whitespaceHeuristics,i._wordNavigationType);return new o["a"](t,"")});t.pushUndoStop(),t.executeCommands(this.id,c),t.pushUndoStop()}},t}(i["c"]),A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype._delete=function(e,t,n,i,o){var r=s["a"].deleteWordLeft(e,t,n,i,o);return r||new l["a"](1,1,1,1)},t}(R),F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype._delete=function(e,t,n,i,o){var r=s["a"].deleteWordRight(e,t,n,i,o);if(r)return r;var a=t.getLineCount(),u=t.getLineMaxColumn(a);return new l["a"](a,u,a,u)},t}(R),j=function(e){function t(){return e.call(this,{whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:d["a"].writable})||this}return g(t,e),t}(A),W=function(e){function t(){return e.call(this,{whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:d["a"].writable})||this}return g(t,e),t}(A),V=function(e){function t(){return e.call(this,{whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:d["a"].writable,kbOpts:{kbExpr:d["a"].textInputFocus,primary:2049,mac:{primary:513},weight:100}})||this}return g(t,e),t}(A),B=function(e){function t(){return e.call(this,{whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:d["a"].writable})||this}return g(t,e),t}(F),H=function(e){function t(){return e.call(this,{whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:d["a"].writable})||this}return g(t,e),t}(F),z=function(e){function t(){return e.call(this,{whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:d["a"].writable,kbOpts:{kbExpr:d["a"].textInputFocus,primary:2068,mac:{primary:532},weight:100}})||this}return g(t,e),t}(F);Object(i["g"])(new b),Object(i["g"])(new y),Object(i["g"])(new w),Object(i["g"])(new C),Object(i["g"])(new S),Object(i["g"])(new L),Object(i["g"])(new N),Object(i["g"])(new D),Object(i["g"])(new k),Object(i["g"])(new I),Object(i["g"])(new E),Object(i["g"])(new M),Object(i["g"])(new O),Object(i["g"])(new x),Object(i["g"])(new T),Object(i["g"])(new P),Object(i["g"])(new j),Object(i["g"])(new W),Object(i["g"])(new V),Object(i["g"])(new B),Object(i["g"])(new H),Object(i["g"])(new z)},b400:function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return u});var i,o,r=n("0a0f"),s=n("dff7"),a=n("4b76");(function(e){e[e["Hint"]=1]="Hint",e[e["Info"]=2]="Info",e[e["Warning"]=4]="Warning",e[e["Error"]=8]="Error"})(i||(i={})),function(e){function t(e,t){return t-e}e.compare=t;var n=Object.create(null);function i(e){return n[e]||""}function o(t){switch(t){case a["a"].Error:return e.Error;case a["a"].Warning:return e.Warning;case a["a"].Info:return e.Info;case a["a"].Ignore:return e.Hint}}function r(t){switch(t){case e.Error:return a["a"].Error;case e.Warning:return a["a"].Warning;case e.Info:return a["a"].Info;case e.Hint:return a["a"].Ignore}}n[e.Error]=Object(s["a"])("sev.error","Error"),n[e.Warning]=Object(s["a"])("sev.warning","Warning"),n[e.Info]=Object(s["a"])("sev.info","Info"),e.toString=i,e.fromSeverity=o,e.toSeverity=r}(i||(i={})),function(e){var t="";function n(e){return o(e,!0)}function o(e,n){var o=[t];return e.source?o.push(e.source.replace("¦","¦")):o.push(t),e.code?o.push(e.code.replace("¦","¦")):o.push(t),void 0!==e.severity&&null!==e.severity?o.push(i.toString(e.severity)):o.push(t),e.message&&n?o.push(e.message.replace("¦","¦")):o.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?o.push(e.startLineNumber.toString()):o.push(t),void 0!==e.startColumn&&null!==e.startColumn?o.push(e.startColumn.toString()):o.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?o.push(e.endLineNumber.toString()):o.push(t),void 0!==e.endColumn&&null!==e.endColumn?o.push(e.endColumn.toString()):o.push(t),o.push(t),o.join("¦")}e.makeKey=n,e.makeKeyOptionalMessage=o}(o||(o={}));var u=Object(r["c"])("markerService")},b539:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("0a0f"),o=Object(i["c"])("editorProgressService")},b574:function(e,t,n){"use strict";n.r(t);var i=n("a666"),o=n("3742"),r=n("b2cc"),s=n("6a89"),a=n("8025"),u=n("c101"),l=n("4153"),c=n("4fc3"),d=n("d3d7"),h=n("e8e3"),p=(n("7457"),n("d3f49")),f=n("b57f"),g=n("f577"),m=n("1165"),v=n("0a0f"),_=n("b800"),b=n("dff7"),y=n("32b8"),w=n("82c9"),C=n("70cb"),S=n("6d8e"),L="code-workspace";function O(e){return e instanceof S["a"]}function x(e){return e.configuration?{configPath:e.configuration,id:e.id}:1===e.folders.length?e.folders[0].uri:void 0}var N=function(){function e(e){this._delegates=e}return e.prototype.resolve=function(e){for(var t=0,n=this._delegates;t=0){for(var i=[],o=0,r=this._placeholderGroups[this._placeholderGroupsIdx];o0&&this._editor.executeEdits("snippet.placeholderTransform",i)}var d=!1;!0===t&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,d=!0);var h=this._editor.getModel().changeDecorations(function(t){for(var i=new Set,o=[],r=0,s=n._placeholderGroups[n._placeholderGroupsIdx];r0)return!0}t=t.parent}return!1},Object.defineProperty(e.prototype,"isAtFirstPlaceholder",{get:function(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAtLastPlaceholder",{get:function(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPlaceholder",{get:function(){return this._snippet.placeholders.length>0},enumerable:!0,configurable:!0}),e.prototype.computePossibleSelections=function(){for(var e=new Map,t=0,n=this._placeholderGroups;t0&&S!==d.getLineFirstNonWhitespaceColumn(R.positionLineNumber))&&e.adjustWhitespace(d,z,H),H.resolveVariables(new N([f,new I(u,j,L.length),new D(d,R),new E(d),new M,new T(h)]));var U=d.getOffsetAt(z)+y;y+=H.toString().length-d.getValueLengthInRange(B),l[j]=p["a"].replace(B,H.toString()),c[j]=new F(t,H,U)}return{edits:l,snippets:c}},e.prototype.dispose=function(){Object(i["f"])(this._snippets)},e.prototype._logInfo=function(){return'template="'+this._template+'", merged_templates="'+this._templateMerges.join(" -> ")+'"'},e.prototype.insert=function(){var t=this;if(this._editor.hasModel()){var n=e.createEditsAndSnippets(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText),i=n.edits,o=n.snippets;this._snippets=o,this._editor.executeEdits("snippet",i,function(e){return t._snippets[0].hasPlaceholder?t._move(!0):e.map(function(e){return a["a"].fromPositions(e.range.getEndPosition())})}),this._editor.revealRange(this._editor.getSelections()[0])}},e.prototype.merge=function(t,n){var i=this;if(void 0===n&&(n=j),this._editor.hasModel()){this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,t]);var o=e.createEditsAndSnippets(this._editor,t,n.overwriteBefore,n.overwriteAfter,!0,n.adjustWhitespace,n.clipboardText),r=o.edits,s=o.snippets;this._editor.executeEdits("snippet",r,function(e){for(var t=0,n=i._snippets;t0},e}();n.d(t,"SnippetController2",function(){return U});var V=function(){return V=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},H=function(e,t){return function(n,i){t(n,i,e)}},z={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0},U=function(){function e(t,n,o){this._editor=t,this._logService=n,this._snippetListener=new i["b"],this._modelVersionId=-1,this._inSnippet=e.InSnippetMode.bindTo(o),this._hasNextTabstop=e.HasNextTabstop.bindTo(o),this._hasPrevTabstop=e.HasPrevTabstop.bindTo(o)}return e.get=function(e){return e.getContribution("snippetController2")},e.prototype.dispose=function(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),Object(i["f"])(this._session),this._snippetListener.dispose()},e.prototype.getId=function(){return"snippetController2"},e.prototype.insert=function(e,t){try{this._doInsert(e,"undefined"===typeof t?z:V({},z,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():"")}},e.prototype._doInsert=function(e,t){var n=this;this._editor.hasModel()&&(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new W(this._editor,e,t),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(function(e){return e.isFlush&&n.cancel()})),this._snippetListener.add(this._editor.onDidChangeModel(function(){return n.cancel()})),this._snippetListener.add(this._editor.onDidChangeCursorSelection(function(){return n._updateState()})))},e.prototype._updateState=function(){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.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}},e.prototype._handleChoice=function(){var e=this;if(this._session&&this._editor.hasModel()){var t=this._session.choice;if(t){if(this._currentChoice!==t){this._currentChoice=t,this._editor.setSelections(this._editor.getSelections().map(function(e){return a["a"].fromPositions(e.getStartPosition())}));var n=t.options[0];Object(l["f"])(this._editor,t.options.map(function(t,i){return{kind:13,label:t.value,insertText:t.value,sortText:Object(o["F"])("a",i+1),range:s["a"].fromPositions(e._editor.getPosition(),e._editor.getPosition().delta(0,n.value.length))}}))}}else this._currentChoice=void 0}else this._currentChoice=void 0},e.prototype.finish=function(){while(this._inSnippet.get())this.next()},e.prototype.cancel=function(e){void 0===e&&(e=!1),this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),Object(i["f"])(this._session),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])},e.prototype.prev=function(){this._session&&this._session.prev(),this._updateState()},e.prototype.next=function(){this._session&&this._session.next(),this._updateState()},e.prototype.isInSnippet=function(){return Boolean(this._inSnippet.get())},e.InSnippetMode=new c["d"]("inSnippetMode",!1),e.HasNextTabstop=new c["d"]("hasNextTabstop",!1),e.HasPrevTabstop=new c["d"]("hasPrevTabstop",!1),e=B([H(1,d["a"]),H(2,c["c"])],e),e}();Object(r["h"])(U);var K=r["c"].bindToContribution(U.get);Object(r["g"])(new K({id:"jumpToNextSnippetPlaceholder",precondition:c["a"].and(U.InSnippetMode,U.HasNextTabstop),handler:function(e){return e.next()},kbOpts:{weight:130,kbExpr:u["a"].editorTextFocus,primary:2}})),Object(r["g"])(new K({id:"jumpToPrevSnippetPlaceholder",precondition:c["a"].and(U.InSnippetMode,U.HasPrevTabstop),handler:function(e){return e.prev()},kbOpts:{weight:130,kbExpr:u["a"].editorTextFocus,primary:1026}})),Object(r["g"])(new K({id:"leaveSnippet",precondition:U.InSnippetMode,handler:function(e){return e.cancel(!0)},kbOpts:{weight:130,kbExpr:u["a"].editorTextFocus,primary:9,secondary:[1033]}})),Object(r["g"])(new K({id:"acceptSnippet",precondition:U.InSnippetMode,handler:function(e){return e.finish()}}))},b57f:function(e,t,n){"use strict";var i=n("fdcc"),o=n("308f"),r=n("a666"),s=n("3742"),a=n("6d8e"),u=n("fd49"),l=n("7061"),c=n("6a89"),d=n("8025"),h=n("3352"),p=function(){function e(e,t){this.beforeVersionId=e,this.beforeCursorState=t,this.afterCursorState=null,this.afterVersionId=-1,this.editOperations=[]}return e.prototype.undo=function(e){for(var t=this.editOperations.length-1;t>=0;t--)this.editOperations[t]={operations:e.applyEdits(this.editOperations[t].operations)}},e.prototype.redo=function(e){for(var t=0;t0){var e=this.past.pop();try{e.undo(this.model)}catch(t){return Object(i["e"])(t),this.clear(),null}return this.future.push(e),{selections:e.beforeCursorState,recordedVersionId:e.beforeVersionId}}return null},e.prototype.canUndo=function(){return this.past.length>0||null!==this.currentOpenStackElement},e.prototype.redo=function(){if(this.future.length>0){var e=this.future.pop();try{e.redo(this.model)}catch(t){return Object(i["e"])(t),this.clear(),null}return this.past.push(e),{selections:e.afterCursorState,recordedVersionId:e.afterVersionId}}return null},e.prototype.canRedo=function(){return this.future.length>0},e}(),v=function(){function e(){this.spacesDiff=0,this.looksLikeAlignment=!1}return e}();function _(e,t,n,i,o){var r;for(o.spacesDiff=0,o.looksLikeAlignment=!1,r=0;r0&&l>0)&&!(d>0&&h>0)){var p=Math.abs(l-h),f=Math.abs(u-d);if(0===p)return o.spacesDiff=f,void(f>0&&0<=d-1&&d-10?o++:y>1&&r++,_(s,a,f,b,d),!d.looksLikeAlignment||n&&t===d.spacesDiff)){var O=d.spacesDiff;O<=l&&c[O]++,s=f,a=b}}var x=n;o!==r&&(x=oD&&(D=t,N=e)}),4===N&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(N=2)}return{insertSpaces:x,tabSize:N}}function y(e){return(1&e.metadata)>>>0}function w(e,t){e.metadata=254&e.metadata|t<<0}function C(e){return(2&e.metadata)>>>1===1}function S(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function L(e){return(4&e.metadata)>>>2===1}function O(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function x(e){return(8&e.metadata)>>>3===1}function N(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function D(e){return(48&e.metadata)>>>4}function k(e,t){e.metadata=207&e.metadata|t<<4}function I(e){return(64&e.metadata)>>>6===1}function E(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}var M=function(){function e(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,w(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,O(this,!1),k(this,1),N(this,!1),E(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,S(this,!1)}return e.prototype.reset=function(e,t,n,i){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=i},e.prototype.setOptions=function(e){this.options=e;var t=this.options.className;O(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),k(this,this.options.stickiness),N(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),E(this,this.options.collapseOnReplaceEdit)},e.prototype.setCachedOffsets=function(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),T=new M(null,0,0);T.parent=T,T.left=T,T.right=T,w(T,0);var P=function(){function e(){this.root=T,this.requestNormalizeDelta=!1}return e.prototype.intervalSearch=function(e,t,n,i,o){return this.root===T?[]:z(this,e,t,n,i,o)},e.prototype.search=function(e,t,n){return this.root===T?[]:H(this,e,t,n)},e.prototype.collectNodesFromOwner=function(e){return V(this,e)},e.prototype.collectNodesPostOrder=function(){return B(this)},e.prototype.insert=function(e){U(this,e),this._normalizeDeltaIfNecessary()},e.prototype.delete=function(e){q(this,e),this._normalizeDeltaIfNecessary()},e.prototype.resolveNode=function(e,t){var n=e,i=0;while(e!==this.root)e===e.parent.right&&(i+=e.parent.delta),e=e.parent;var o=n.start+i,r=n.end+i;n.setCachedOffsets(o,r,t)},e.prototype.acceptReplace=function(e,t,n,i){for(var o=j(this,e,e+t),r=0,s=o.length;rn)&&(1!==i&&(2===i||t))}function F(e,t,n,i,o){var r=D(e),s=0===r||2===r,a=1===r||2===r,u=n-t,l=i,c=Math.min(u,l),d=e.start,h=!1,p=e.end,f=!1;t<=d&&p<=n&&I(e)&&(e.start=t,h=!0,e.end=t,f=!0);var g=o?1:u>0?2:0;if(!h&&A(d,s,t,g)&&(h=!0),!f&&A(p,a,t,g)&&(f=!0),c>0&&!o){g=u>l?2:0;!h&&A(d,s,t+c,g)&&(h=!0),!f&&A(p,a,t+c,g)&&(f=!0)}g=o?1:0;!h&&A(d,s,n,g)&&(e.start=t+l,h=!0),!f&&A(p,a,n,g)&&(e.end=t+l,f=!0);var m=l-u;h||(e.start=Math.max(0,d+m)),f||(e.end=Math.max(0,p+m)),e.start>e.end&&(e.end=e.start)}function j(e,t,n){var i=e.root,o=0,r=0,s=0,a=0,u=[],l=0;while(i!==T)if(C(i))S(i.left,!1),S(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;else{if(!C(i.left)){if(r=o+i.maxEnd,rn?S(i,!0):(a=o+i.end,a>=t&&(i.setCachedOffsets(s,a,0),u[l++]=i),S(i,!0),i.right===T||C(i.right)||(o+=i.delta,i=i.right))}return S(e.root,!1),u}function W(e,t,n,i){var o=e.root,r=0,s=0,a=0,u=i-(n-t);while(o!==T)if(C(o))S(o.left,!1),S(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),Q(o),o=o.parent;else{if(!C(o.left)){if(s=r+o.maxEnd,sn?(o.start+=u,o.end+=u,o.delta+=u,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),S(o,!0)):(S(o,!0),o.right===T||C(o.right)||(r+=o.delta,o=o.right))}S(e.root,!1)}function V(e,t){var n=e.root,i=[],o=0;while(n!==T)C(n)?(S(n.left,!1),S(n.right,!1),n=n.parent):n.left===T||C(n.left)?(n.ownerId===t&&(i[o++]=n),S(n,!0),n.right===T||C(n.right)||(n=n.right)):n=n.left;return S(e.root,!1),i}function B(e){var t=e.root,n=[],i=0;while(t!==T)C(t)?(S(t.left,!1),S(t.right,!1),t=t.parent):t.left===T||C(t.left)?t.right===T||C(t.right)?(n[i++]=t,S(t,!0)):t=t.right:t=t.left;return S(e.root,!1),n}function H(e,t,n,i){var o=e.root,r=0,s=0,a=0,u=[],l=0;while(o!==T)if(C(o))S(o.left,!1),S(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;else if(o.left===T||C(o.left)){s=r+o.start,a=r+o.end,o.setCachedOffsets(s,a,i);var c=!0;t&&o.ownerId&&o.ownerId!==t&&(c=!1),n&&L(o)&&(c=!1),c&&(u[l++]=o),S(o,!0),o.right===T||C(o.right)||(r+=o.delta,o=o.right)}else o=o.left;return S(e.root,!1),u}function z(e,t,n,i,o,r){var s=e.root,a=0,u=0,l=0,c=0,d=[],h=0;while(s!==T)if(C(s))S(s.left,!1),S(s.right,!1),s===s.parent.right&&(a-=s.parent.delta),s=s.parent;else{if(!C(s.left)){if(u=a+s.maxEnd,un)S(s,!0);else{if(c=a+s.end,c>=t){s.setCachedOffsets(l,c,r);var p=!0;i&&s.ownerId&&s.ownerId!==i&&(p=!1),o&&L(s)&&(p=!1),p&&(d[h++]=s)}S(s,!0),s.right===T||C(s.right)||(a+=s.delta,s=s.right)}}return S(e.root,!1),d}function U(e,t){if(e.root===T)return t.parent=T,t.left=T,t.right=T,w(t,0),e.root=t,e.root;K(e,t),J(t.parent);var n=t;while(n!==e.root&&1===y(n.parent))if(n.parent===n.parent.parent.left){var i=n.parent.parent.right;1===y(i)?(w(n.parent,0),w(i,0),w(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&(n=n.parent,Y(e,n)),w(n.parent,0),w(n.parent.parent,1),X(e,n.parent.parent))}else{i=n.parent.parent.left;1===y(i)?(w(n.parent,0),w(i,0),w(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&(n=n.parent,X(e,n)),w(n.parent,0),w(n.parent.parent,1),Y(e,n.parent.parent))}return w(e.root,0),t}function K(e,t){var n=0,i=e.root,o=t.start,r=t.end;while(1){var s=ee(o,r,i.start+n,i.end+n);if(s<0){if(i.left===T){t.start-=n,t.end-=n,t.maxEnd-=n,i.left=t;break}i=i.left}else{if(i.right===T){t.start-=n+i.delta,t.end-=n+i.delta,t.maxEnd-=n+i.delta,i.right=t;break}n+=i.delta,i=i.right}}t.parent=i,t.left=T,t.right=T,w(t,1)}function q(e,t){var n,i;if(t.left===T?(n=t.right,i=t,n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta):t.right===T?(n=t.left,i=t):(i=G(t.right),n=i.right,n.start+=i.delta,n.end+=i.delta,n.delta+=i.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,i.delta=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0)),i===e.root)return e.root=n,w(n,0),t.detach(),Z(),Q(n),void(e.root.parent=T);var o,r=1===y(i);if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===t?n.parent=i.parent:(i.parent===t?n.parent=i:n.parent=i.parent,i.left=t.left,i.right=t.right,i.parent=t.parent,w(i,y(t)),t===e.root?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left!==T&&(i.left.parent=i),i.right!==T&&(i.right.parent=i)),t.detach(),r)return J(n.parent),i!==t&&(J(i),J(i.parent)),void Z();J(n),J(n.parent),i!==t&&(J(i),J(i.parent));while(n!==e.root&&0===y(n))n===n.parent.left?(o=n.parent.right,1===y(o)&&(w(o,0),w(n.parent,1),Y(e,n.parent),o=n.parent.right),0===y(o.left)&&0===y(o.right)?(w(o,1),n=n.parent):(0===y(o.right)&&(w(o.left,0),w(o,1),X(e,o),o=n.parent.right),w(o,y(n.parent)),w(n.parent,0),w(o.right,0),Y(e,n.parent),n=e.root)):(o=n.parent.left,1===y(o)&&(w(o,0),w(n.parent,1),X(e,n.parent),o=n.parent.left),0===y(o.left)&&0===y(o.right)?(w(o,1),n=n.parent):(0===y(o.left)&&(w(o.right,0),w(o,1),Y(e,o),o=n.parent.left),w(o,y(n.parent)),w(n.parent,0),w(o.left,0),X(e,n.parent),n=e.root));w(n,0),Z()}function G(e){while(e.left!==T)e=e.left;return e}function Z(){T.parent=T,T.delta=0,T.start=0,T.end=0}function Y(e,t){var n=t.right;n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,t.right=n.left,n.left!==T&&(n.left.parent=t),n.parent=t.parent,t.parent===T?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,Q(t),Q(n)}function X(e,t){var n=t.left;t.delta-=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=n.delta,t.end-=n.delta,t.left=n.right,n.right!==T&&(n.right.parent=t),n.parent=t.parent,t.parent===T?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n,Q(t),Q(n)}function $(e){var t=e.end;if(e.left!==T){var n=e.left.maxEnd;n>t&&(t=n)}if(e.right!==T){var i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function Q(e){e.maxEnd=$(e)}function J(e){while(e!==T){var t=$(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function ee(e,t,n,i){return e===n?t-i:e-n}var te=function(){function e(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}return e.prototype.next=function(){if(this.right!==ne)return ie(this.right);var e=this;while(e.parent!==ne){if(e.parent.left===e)break;e=e.parent}return e.parent===ne?ne:e.parent},e.prototype.prev=function(){if(this.left!==ne)return oe(this.left);var e=this;while(e.parent!==ne){if(e.parent.right===e)break;e=e.parent}return e.parent===ne?ne:e.parent},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),ne=new te(null,0);function ie(e){while(e.left!==ne)e=e.left;return e}function oe(e){while(e.right!==ne)e=e.right;return e}function re(e){return e===ne?0:e.size_left+e.piece.length+re(e.right)}function se(e){return e===ne?0:e.lf_left+e.piece.lineFeedCnt+se(e.right)}function ae(){ne.parent=ne}function ue(e,t){var n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==ne&&(n.left.parent=t),n.parent=t.parent,t.parent===ne?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function le(e,t){var n=t.left;t.left=n.right,n.right!==ne&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===ne?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function ce(e,t){var n,i;if(t.left===ne?(i=t,n=i.right):t.right===ne?(i=t,n=i.left):(i=ie(t.right),n=i.right),i===e.root)return e.root=n,n.color=0,t.detach(),ae(),void(e.root.parent=ne);var o=1===i.color;if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===t?(n.parent=i.parent,pe(e,n)):(i.parent===t?n.parent=i:n.parent=i.parent,pe(e,n),i.left=t.left,i.right=t.right,i.parent=t.parent,i.color=t.color,t===e.root?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left!==ne&&(i.left.parent=i),i.right!==ne&&(i.right.parent=i),i.size_left=t.size_left,i.lf_left=t.lf_left,pe(e,i)),t.detach(),n.parent.left===n){var r=re(n),s=se(n);if(r!==n.parent.size_left||s!==n.parent.lf_left){var a=r-n.parent.size_left,u=s-n.parent.lf_left;n.parent.size_left=r,n.parent.lf_left=s,he(e,n.parent,a,u)}}if(pe(e,n.parent),o)ae();else{var l;while(n!==e.root&&0===n.color)n===n.parent.left?(l=n.parent.right,1===l.color&&(l.color=0,n.parent.color=1,ue(e,n.parent),l=n.parent.right),0===l.left.color&&0===l.right.color?(l.color=1,n=n.parent):(0===l.right.color&&(l.left.color=0,l.color=1,le(e,l),l=n.parent.right),l.color=n.parent.color,n.parent.color=0,l.right.color=0,ue(e,n.parent),n=e.root)):(l=n.parent.left,1===l.color&&(l.color=0,n.parent.color=1,le(e,n.parent),l=n.parent.left),0===l.left.color&&0===l.right.color?(l.color=1,n=n.parent):(0===l.left.color&&(l.right.color=0,l.color=1,ue(e,l),l=n.parent.left),l.color=n.parent.color,n.parent.color=0,l.left.color=0,le(e,n.parent),n=e.root));n.color=0,ae()}}function de(e,t){pe(e,t);while(t!==e.root&&1===t.parent.color)if(t.parent===t.parent.parent.left){var n=t.parent.parent.right;1===n.color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&(t=t.parent,ue(e,t)),t.parent.color=0,t.parent.parent.color=1,le(e,t.parent.parent))}else{n=t.parent.parent.left;1===n.color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&(t=t.parent,le(e,t)),t.parent.color=0,t.parent.parent.color=1,ue(e,t.parent.parent))}e.root.color=0}function he(e,t,n,i){while(t!==e.root&&t!==ne)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=i),t=t.parent}function pe(e,t){var n=0,i=0;if(t!==e.root){if(0===n){while(t!==e.root&&t===t.parent.right)t=t.parent;if(t===e.root)return;t=t.parent,n=re(t.left)-t.size_left,i=se(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=i}while(t!==e.root&&(0!==n||0!==i))t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=i),t=t.parent}}ne.parent=ne,ne.left=ne,ne.right=ne,ne.color=0;var fe=n("8c02"),ge=65535;function me(e){var t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}var ve=function(){function e(e,t,n,i,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=i,this.isBasicASCII=o}return e}();function _e(e,t){void 0===t&&(t=!0);for(var n=[0],i=1,o=0,r=e.length;o126)&&(s=!1)}var c=new ve(me(e),i,o,r,s);return e.length=0,c}var ye=function(){function e(e,t,n,i,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=i,this.length=o}return e}(),we=function(){function e(e,t){this.buffer=e,this.lineStarts=t}return e}(),Ce=function(){function e(e){this._limit=e,this._cache=[]}return e.prototype.get=function(e){for(var t=this._cache.length-1;t>=0;t--){var n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null},e.prototype.get2=function(e){for(var t=this._cache.length-1;t>=0;t--){var n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null},e.prototype.set=function(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)},e.prototype.valdiate=function(e){for(var t=!1,n=this._cache,i=0;i=e)&&(n[i]=null,t=!0)}if(t){for(var r=[],s=0,a=n;s0){e[o].lineStarts||(e[o].lineStarts=_e(e[o].buffer));var s=new ye(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),i=this.rbInsertRight(i,s)}this._searchCache=new Ce(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()},e.prototype.normalizeEOL=function(e){var t=this,n=ge,i=n-Math.floor(n/3),o=2*i,r="",s=0,a=[];if(this.iterate(this.root,function(n){var u=t.getNodeContent(n),l=u.length;if(s<=i||s+l0){var u=r.replace(/\r\n|\r|\n/g,e);a.push(new we(u,_e(u)))}this.create(a,e,!0)},e.prototype.getEOL=function(){return this._EOL},e.prototype.setEOL=function(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)},e.prototype.getOffsetAt=function(e,t){var n=0,i=this.root;while(i!==ne)if(i.left!==ne&&i.lf_left+1>=e)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt+1>=e){n+=i.size_left;var o=this.getAccumulatedValue(i,e-i.lf_left-2);return n+(o+t-1)}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}return n},e.prototype.getPositionAt=function(e){e=Math.floor(e),e=Math.max(0,e);var t=this.root,n=0,i=e;while(t!==ne)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){var o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,0===o.index){var r=this.getOffsetAt(n+1,1),s=i-r;return new l["a"](n+1,s+1)}return new l["a"](n+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===ne){r=this.getOffsetAt(n+1,1),s=i-e-r;return new l["a"](n+1,s+1)}t=t.right}return new l["a"](1,1)},e.prototype.getValueInRange=function(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";var n=this.nodeAt2(e.startLineNumber,e.startColumn),i=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,i);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o},e.prototype.getValueInRange2=function(e,t){if(e.node===t.node){var n=e.node,i=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i.substring(o+e.remainder,o+t.remainder)}var r=e.node,s=this._buffers[r.piece.bufferIndex].buffer,a=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start),u=s.substring(a+e.remainder,a+r.piece.length);r=r.next();while(r!==ne){var l=this._buffers[r.piece.bufferIndex].buffer,c=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(r===t.node){u+=l.substring(c,c+t.remainder);break}u+=l.substr(c,r.piece.length),r=r.next()}return u},e.prototype.getLinesContent=function(){return this.getContentOfSubTree(this.root).split(/\r\n|\r|\n/)},e.prototype.getLength=function(){return this._length},e.prototype.getLineCount=function(){return this._lineCnt},e.prototype.getLineContent=function(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)},e.prototype.getLineCharCode=function(e,t){var n=this.nodeAt2(e,t+1);if(n.remainder===n.node.piece.length){var i=n.node.next();if(!i)return 0;var o=this._buffers[i.piece.bufferIndex],r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o.buffer.charCodeAt(r)}o=this._buffers[n.node.piece.bufferIndex],r=this.offsetInBuffer(n.node.piece.bufferIndex,n.node.piece.start);var s=r+n.remainder;return o.buffer.charCodeAt(s)},e.prototype.getLineLength=function(e){if(e===this.getLineCount()){var t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength},e.prototype.findMatchesInNode=function(e,t,n,i,o,r,s,a,u,l,d){var h,p=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,r);t.reset(g);var v={line:0,column:0};do{if(h=t.next(p.buffer),h){if(h.index>=m)return l;this.positionInBuffer(e,h.index-f,v);var _=this.getLineFeedCnt(e.piece.bufferIndex,o,v),b=v.line===o.line?v.column-o.column+i:v.column+1,y=b+h[0].length;if(d[l++]=Object(fe["d"])(new c["a"](n+_,b,n+_,y),h,a),h.index+h[0].length>=m)return l;if(l>=u)return l}}while(h);return l},e.prototype.findMatchesLineByLine=function(e,t,n,i){var o=[],r=0,s=new fe["b"](t.wordSeparators,t.regex),a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];var u=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===u)return[];var l=this.positionInBuffer(a.node,a.remainder),c=this.positionInBuffer(u.node,u.remainder);if(a.node===u.node)return this.findMatchesInNode(a.node,s,e.startLineNumber,e.startColumn,l,c,t,n,i,r,o),o;var d=e.startLineNumber,h=a.node;while(h!==u.node){var p=this.getLineFeedCnt(h.piece.bufferIndex,l,h.piece.end);if(p>=1){var f=this._buffers[h.piece.bufferIndex].lineStarts,g=this.offsetInBuffer(h.piece.bufferIndex,h.piece.start),m=f[l.line+p],v=d===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(h,s,d,v,l,this.positionInBuffer(h,m-g),t,n,i,r,o),r>=i)return o;d+=p}var _=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){var b=this.getLineContent(d).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,s,b,e.endLineNumber,_,r,o,n,i),o}if(r=this._findMatchesInLine(t,s,this.getLineContent(d).substr(_),d,_,r,o,n,i),r>=i)return o;d++,a=this.nodeAt2(d,1),h=a.node,l=this.positionInBuffer(a.node,a.remainder)}if(d===e.endLineNumber){var y=d===e.startLineNumber?e.startColumn-1:0;b=this.getLineContent(d).substring(y,e.endColumn-1);return r=this._findMatchesInLine(t,s,b,e.endLineNumber,y,r,o,n,i),o}var w=d===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(u.node,s,d,w,l,c,t,n,i,r,o),o},e.prototype._findMatchesInLine=function(e,t,n,i,o,r,s,a,u){var l,d=e.wordSeparators;if(!a&&e.simpleSearch){var p=e.simpleSearch,f=p.length,g=n.length,m=-f;while(-1!==(m=n.indexOf(p,m+f)))if((!d||Object(fe["e"])(d,n,g,m,f))&&(s[r++]=new h["b"](new c["a"](i,m+1+o,i,m+1+f+o),null),r>=u))return r;return r}t.reset(0);do{if(l=t.next(n),l&&(s[r++]=Object(fe["d"])(new c["a"](i,l.index+1+o,i,l.index+1+l[0].length+o),l,a),r>=u))return r}while(l);return r},e.prototype.insert=function(e,t,n){if(void 0===n&&(n=!1),this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==ne){var i=this.nodeAt(e),o=i.node,r=i.remainder,s=i.nodeStartOffset,a=o.piece,u=a.bufferIndex,l=this.positionInBuffer(o,r);if(0===o.piece.bufferIndex&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.lengthe){var c=[],d=new ye(a.bufferIndex,l,a.end,this.getLineFeedCnt(a.bufferIndex,l,a.end),this.offsetInBuffer(u,a.end)-this.offsetInBuffer(u,l));if(this.shouldCheckCRLF()&&this.endWithCR(t)){var h=this.nodeCharCodeAt(o,r);if(10===h){var p={line:d.start.line+1,column:0};d=new ye(d.bufferIndex,p,d.end,this.getLineFeedCnt(d.bufferIndex,p,d.end),d.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){var f=this.nodeCharCodeAt(o,r-1);if(13===f){var g=this.positionInBuffer(o,r-1);this.deleteNodeTail(o,g),t="\r"+t,0===o.piece.length&&c.push(o)}else this.deleteNodeTail(o,l)}else this.deleteNodeTail(o,l);var m=this.createNewPieces(t);d.length>0&&this.rbInsertRight(o,d);for(var v=o,_=0;_=0;u--)a=this.rbInsertLeft(a,s[u]);this.validateCRLFWithPrevNode(a),this.deleteNodes(n)},e.prototype.insertContentToNodeRight=function(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");for(var n=this.createNewPieces(e),i=this.rbInsertRight(t,n[0]),o=i,r=1;r=d))break;u=c+1}}return n?(n.line=c,n.column=a-h,null):{line:c,column:a-h}},e.prototype.getLineFeedCnt=function(e,t,n){if(0===n.column)return n.line-t.line;var i=this._buffers[e].lineStarts;if(n.line===i.length-1)return n.line-t.line;var o=i[n.line+1],r=i[n.line]+n.column;if(o>r+1)return n.line-t.line;var s=r-1,a=this._buffers[e].buffer;return 13===a.charCodeAt(s)?n.line-t.line+1:n.line-t.line},e.prototype.offsetInBuffer=function(e,t){var n=this._buffers[e].lineStarts;return n[t.line]+t.column},e.prototype.deleteNodes=function(e){for(var t=0;tge){var t=[];while(e.length>ge){var n=e.charCodeAt(ge-1),i=void 0;13===n||n>=55296&&n<=56319?(i=e.substring(0,ge-1),e=e.substring(ge-1)):(i=e.substring(0,ge),e=e.substring(ge));var o=_e(i);t.push(new ye(this._buffers.length,{line:0,column:0},{line:o.length-1,column:i.length-o[o.length-1]},o.length-1,i.length)),this._buffers.push(new we(i,o))}var r=_e(e);return t.push(new ye(this._buffers.length,{line:0,column:0},{line:r.length-1,column:e.length-r[r.length-1]},r.length-1,e.length)),this._buffers.push(new we(e,r)),t}var s=this._buffers[0].buffer.length,a=_e(e,!1),u=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===s&&0!==s&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},u=this._lastChangeBufferPos;for(var l=0;l=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){r=this.getAccumulatedValue(n,e-n.lf_left-2),u=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return l+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:l,nodeStartLineNumber:c-(e-1-n.lf_left)}),s.substring(a+r,a+u-t)}if(n.lf_left+n.piece.lineFeedCnt===e-1){r=this.getAccumulatedValue(n,e-n.lf_left-2),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i=s.substring(a+r,a+n.piece.length);break}e-=n.lf_left+n.piece.lineFeedCnt,l+=n.size_left+n.piece.length,n=n.right}}n=n.next();while(n!==ne){s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){u=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=s.substring(a,a+u-t),i}a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i+=s.substr(a,n.piece.length),n=n.next()}return i},e.prototype.computeBufferMetadata=function(){var e=this.root,t=1,n=0;while(e!==ne)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.valdiate(this._length)},e.prototype.getIndexOf=function(e,t){var n=e.piece,i=this.positionInBuffer(e,t),o=i.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){var r=this.getLineFeedCnt(e.piece.bufferIndex,n.start,i);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:i.column}},e.prototype.getAccumulatedValue=function(e,t){if(t<0)return 0;var n=e.piece,i=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?i[n.end.line]+n.end.column-i[n.start.line]-n.start.column:i[o]-i[n.start.line]-n.start.column},e.prototype.deleteNodeTail=function(e,t){var n=e.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),r=t,s=this.offsetInBuffer(n.bufferIndex,r),a=this.getLineFeedCnt(n.bufferIndex,n.start,r),u=a-i,l=s-o,c=n.length+l;e.piece=new ye(n.bufferIndex,n.start,r,a,c),he(this,e,l,u)},e.prototype.deleteNodeHead=function(e,t){var n=e.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),r=t,s=this.getLineFeedCnt(n.bufferIndex,r,n.end),a=this.offsetInBuffer(n.bufferIndex,r),u=s-i,l=o-a,c=n.length+l;e.piece=new ye(n.bufferIndex,r,n.end,s,c),he(this,e,l,u)},e.prototype.shrinkNode=function(e,t,n){var i=e.piece,o=i.start,r=i.end,s=i.length,a=i.lineFeedCnt,u=t,l=this.getLineFeedCnt(i.bufferIndex,i.start,u),c=this.offsetInBuffer(i.bufferIndex,t)-this.offsetInBuffer(i.bufferIndex,o);e.piece=new ye(i.bufferIndex,i.start,u,l,c),he(this,e,c-s,l-a);var d=new ye(i.bufferIndex,n,r,this.getLineFeedCnt(i.bufferIndex,n,r),this.offsetInBuffer(i.bufferIndex,r)-this.offsetInBuffer(i.bufferIndex,n)),h=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(h)},e.prototype.appendToNode=function(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");var n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),i=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;for(var o=_e(t,!1),r=0;re)t=t.left;else{if(t.size_left+t.piece.length>=e){i+=t.size_left;var o={node:t,remainder:e-t.size_left,nodeStartOffset:i};return this._searchCache.set(o),o}e-=t.size_left+t.piece.length,i+=t.size_left+t.piece.length,t=t.right}return null},e.prototype.nodeAt2=function(e,t){var n=this.root,i=0;while(n!==ne)if(n.left!==ne&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){var o=this.getAccumulatedValue(n,e-n.lf_left-2),r=this.getAccumulatedValue(n,e-n.lf_left-1);return i+=n.size_left,{node:n,remainder:Math.min(o+t-1,r),nodeStartOffset:i}}if(n.lf_left+n.piece.lineFeedCnt===e-1){o=this.getAccumulatedValue(n,e-n.lf_left-2);if(o+t-1<=n.piece.length)return{node:n,remainder:o+t-1,nodeStartOffset:i};t-=n.piece.length-o;break}e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}n=n.next();while(n!==ne){if(n.piece.lineFeedCnt>0){r=this.getAccumulatedValue(n,0);var s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,r),nodeStartOffset:s}}if(n.piece.length>=t-1){var a=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:a}}t-=n.piece.length,n=n.next()}return null},e.prototype.nodeCharCodeAt=function(e,t){if(e.piece.lineFeedCnt<1)return-1;var n=this._buffers[e.piece.bufferIndex],i=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(i)},e.prototype.offsetOfNode=function(e){if(!e)return 0;var t=e.size_left;while(e!==this.root)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t},e.prototype.shouldCheckCRLF=function(){return!(this._EOLNormalized&&"\n"===this._EOL)},e.prototype.startWithLF=function(e){if("string"===typeof e)return 10===e.charCodeAt(0);if(e===ne||0===e.piece.lineFeedCnt)return!1;var t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,i=t.start.line,o=n[i]+t.start.column;if(i===n.length-1)return!1;var r=n[i+1];return!(r>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)},e.prototype.endWithCR=function(e){return"string"===typeof e?13===e.charCodeAt(e.length-1):e!==ne&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)},e.prototype.validateCRLFWithPrevNode=function(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){var t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}},e.prototype.validateCRLFWithNextNode=function(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){var t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}},e.prototype.fixCRLF=function(e,t){var n,i=[],o=this._buffers[e.piece.bufferIndex].lineStarts;n=0===e.piece.end.column?{line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};var r=e.piece.length-1,s=e.piece.lineFeedCnt-1;e.piece=new ye(e.piece.bufferIndex,e.piece.start,n,s,r),he(this,e,-1,-1),0===e.piece.length&&i.push(e);var a={line:t.piece.start.line+1,column:0},u=t.piece.length-1,l=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new ye(t.piece.bufferIndex,a,t.piece.end,l,u),he(this,t,-1,-1),0===t.piece.length&&i.push(t);var c=this.createNewPieces("\r\n");this.rbInsertRight(e,c[0]);for(var d=0;d0){v.sort(function(e,t){return t.lineNumber-e.lineNumber}),S=[];u=0;for(var L=v.length;u0&&v[u-1].lineNumber===b)){var O=v[u].oldContent,x=this.getLineContent(b);0!==x.length&&x!==O&&-1===s["q"](x)&&S.push(b)}}}return new h["a"](w,C,S)},e.prototype._reduceOperations=function(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]},e.prototype._toSingleEditOperation=function(e){for(var t=!1,n=e[0].range,i=e[e.length-1].range,o=new c["a"](n.startLineNumber,n.startColumn,i.endLineNumber,i.endColumn),r=n.startLineNumber,s=n.startColumn,a=[],u=0,l=e.length;u0){var h=a.lines.length,p=a.lines[0],f=a.lines[h-1];d=1===h?new c["a"](u,l,u,l+p.length):new c["a"](u,l,u+h-1,f.length+1)}else d=new c["a"](u,l,u,l);n=d.endLineNumber,i=d.endColumn,t.push(d),o=a}return t},e._sortOpsAscending=function(e,t){var n=c["a"].compareRangesUsingEnds(e.range,t.range);return 0===n?e.sortIndex-t.sortIndex:n},e._sortOpsDescending=function(e,t){var n=c["a"].compareRangesUsingEnds(e.range,t.range);return 0===n?t.sortIndex-e.sortIndex:-n},e}(),Oe=function(){function e(e,t,n,i,o,r,s,a){this._chunks=e,this._bom=t,this._cr=n,this._lf=i,this._crlf=o,this._containsRTL=r,this._isBasicASCII=s,this._normalizeEOL=a}return e.prototype._getEOL=function(e){var t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":n>t/2?"\r\n":"\n"},e.prototype.create=function(e){var t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(var i=0,o=n.length;i=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)}},e.prototype._acceptChunk1=function(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))},e.prototype._acceptChunk2=function(e){var t=be(this._tmpLineStarts,e);this.chunks.push(new we(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=s["h"](e))},e.prototype.finish=function(e){return void 0===e&&(e=!0),this._finish(),new Oe(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.isBasicASCII,e)},e.prototype._finish=function(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;var e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);var t=_e(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}},e}(),Ne=function(){function e(){this.changeType=1}return e}(),De=function(){function e(e,t){this.changeType=2,this.lineNumber=e,this.detail=t}return e}(),ke=function(){function e(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}return e}(),Ie=function(){function e(e,t,n){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}return e}(),Ee=function(){function e(){this.changeType=5}return e}(),Me=function(){function e(e,t,n,i){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=i}return e.prototype.containsEvent=function(e){for(var t=0,n=this.changes.length;t>>0}var Be=new Uint32Array(0).buffer,He=function(){function e(){this.tokens=[]}return e.prototype.add=function(e,t){if(this.tokens.length>0){var n=this.tokens[this.tokens.length-1],i=n.startLineNumber+n.tokens.length-1;if(i+1===e)return void n.tokens.push(t)}this.tokens.push(new ze(e,[t]))},e}(),ze=function(){function e(e,t){this.startLineNumber=e,this.tokens=t}return e}();function Ue(e){return e instanceof Uint32Array?e:new Uint32Array(e)}var Ke=function(){function e(){this._lineTokens=[],this._len=0}return e.prototype.flush=function(){this._lineTokens=[],this._len=0},e.prototype.getTokens=function(e,t,n){var i=null;if(t1&&(o=Ae["x"].getLanguageId(i[1])!==e),!o)return Be}if(!i||0===i.length){var r=new Uint32Array(2);return r[0]=t,r[1]=Ve(e),r.buffer}return i[i.length-2]=t,0===i.byteOffset&&i.byteLength===i.buffer.byteLength?i.buffer:i},e.prototype._ensureLine=function(e){while(e>=this._len)this._lineTokens[this._len]=null,this._len++},e.prototype._deleteLines=function(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)},e.prototype._insertLines=function(e,t){if(0!==t){for(var n=[],i=0;i=this._len))if(t.startLineNumber!==t.endLineNumber){this._lineTokens[n]=e._deleteEnding(this._lineTokens[n],t.startColumn-1);var i=t.endLineNumber-1,o=null;i=this._len||(0!==n?(this._lineTokens[o]=e._deleteEnding(this._lineTokens[o],t.column-1),this._lineTokens[o]=e._insert(this._lineTokens[o],t.column-1,i),this._insertLines(t.lineNumber,n)):this._lineTokens[o]=e._insert(this._lineTokens[o],t.column-1,i))}},e._deleteBeginning=function(t,n){return null===t||t===Be?t:e._delete(t,0,n)},e._deleteEnding=function(t,n){if(null===t||t===Be)return t;var i=Ue(t),o=i[i.length-2];return e._delete(t,n,o)},e._delete=function(e,t,n){if(null===e||e===Be||t===n)return e;var i=Ue(e),o=i.length>>>1;if(0===t&&i[i.length-2]===n)return Be;var r,s,a=Re["a"].findIndexInTokensArray(i,t),u=a>0?i[a-1<<1]:0,l=i[a<<1];if(ns&&(i[r++]=f,i[r++]=i[1+(p<<1)],s=f)}if(r===i.length)return e;var g=new Uint32Array(r);return g.set(i.subarray(0,r),0),g.buffer},e._append=function(e,t){if(t===Be)return e;if(e===Be)return t;if(null===e)return e;if(null===t)return null;var n=Ue(e),i=Ue(t),o=i.length>>>1,r=new Uint32Array(n.length+i.length);r.set(n,0);for(var s=n.length,a=n[n.length-2],u=0;u>>1,r=Re["a"].findIndexInTokensArray(i,t);if(r>0){var s=i[r-1<<1];s===t&&r--}for(var a=r;a=this._len)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++},e.prototype._deleteLines=function(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)},e.prototype._insertLines=function(e,t){if(0!==t){for(var n=[],i=[],o=0;o=0;r--)this._invalidateLine(e.startLineNumber+r-1);this._acceptDeleteRange(e),this._acceptInsertText(new l["a"](e.startLineNumber,e.startColumn),t)},e.prototype._acceptDeleteRange=function(e){var t=e.startLineNumber-1;t>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)},e.prototype._acceptInsertText=function(e,t){var n=e.lineNumber-1;n>=this._len||this._insertLines(e.lineNumber,t)},e}(),Ze=function(e){function t(t){var n=e.call(this)||this;return n._textModel=t,n._tokenizationStateStore=new Ge,n._revalidateTokensTimeout=-1,n._tokenizationSupport=null,n._register(Ae["y"].onDidChange(function(e){var t=n._textModel.getLanguageIdentifier();-1!==e.changedLanguages.indexOf(t.language)&&(n._resetTokenizationState(),n._textModel.clearTokens())})),n._register(n._textModel.onDidChangeRawContentFast(function(e){e.containsEvent(1)&&n._resetTokenizationState()})),n._register(n._textModel.onDidChangeContentFast(function(e){for(var t=0,i=e.changes.length;tt)break;var o=this._tokenizeOneInvalidLine(n);if(o>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(n.tokens)},t.prototype.tokenizeViewport=function(e,t){var n=new He;this._tokenizeViewport(n,e,t),this._textModel.setTokens(n.tokens)},t.prototype.reset=function(){this._resetTokenizationState(),this._textModel.clearTokens()},t.prototype.forceTokenization=function(e){var t=new He;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)},t.prototype.isCheapToTokenize=function(e){if(!this._tokenizationSupport)return!0;var t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e0&&s>=1;s--){var a=this._textModel.getLineFirstNonWhitespaceColumn(s);if(0!==a&&a=0;s--){var c=Xe(u,this._tokenizationSupport,o[s],l);l=c.endState}for(var d=t;d<=n;d++){var h=this._textModel.getLineContent(d);c=Xe(u,this._tokenizationSupport,h,l);e.add(d,c.tokens),this._tokenizationStateStore.setFakeTokens(d-1),l=c.endState}}},t}(r["a"]);function Ye(e){var t=e.getLanguageIdentifier(),n=e.isTooLargeForTokenization()?null:Ae["y"].get(t.language),o=null;if(n)try{o=n.getInitialState()}catch(r){Object(i["e"])(r),n=null}return[n,o]}function Xe(e,t,n,o){var r=null;if(t)try{r=t.tokenize2(n,o.clone(),0)}catch(s){Object(i["e"])(s)}return r||(r=Object(Fe["e"])(e.id,n,o,0)),Re["a"].convertToEndOffset(r.tokens,n.length),r}var $e=n("d093"),Qe=n("70cb"),Je=n("045b"),et=n("1080"),tt=n("ef8e"),nt=n("ceb8");n.d(t,"b",function(){return dt}),n.d(t,"a",function(){return vt});var it=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ot(){return new xe}function rt(e){var t=ot();return t.acceptChunk(e),t.finish()}function st(e,t){var n="string"===typeof e?rt(e):e;return n.create(t)}var at=0,ut=999,lt=1e4,ct=function(){throw new Error("Invalid change accessor")},dt=function(e){function t(n,i,r,u){void 0===u&&(u=null);var l=e.call(this)||this;l._onWillDispose=l._register(new o["a"]),l.onWillDispose=l._onWillDispose.event,l._onDidChangeDecorations=l._register(new yt),l.onDidChangeDecorations=l._onDidChangeDecorations.event,l._onDidChangeLanguage=l._register(new o["a"]),l.onDidChangeLanguage=l._onDidChangeLanguage.event,l._onDidChangeLanguageConfiguration=l._register(new o["a"]),l.onDidChangeLanguageConfiguration=l._onDidChangeLanguageConfiguration.event,l._onDidChangeTokens=l._register(new o["a"]),l.onDidChangeTokens=l._onDidChangeTokens.event,l._onDidChangeOptions=l._register(new o["a"]),l.onDidChangeOptions=l._onDidChangeOptions.event,l._onDidChangeAttached=l._register(new o["a"]),l.onDidChangeAttached=l._onDidChangeAttached.event,l._eventEmitter=l._register(new wt),at++,l.id="$model"+at,l.isForSimpleWidget=i.isForSimpleWidget,l._associatedResource="undefined"===typeof u||null===u?a["a"].parse("inmemory://model/"+at):u,l._attachedEditorCount=0,l._buffer=st(n,i.defaultEOL),l._options=t.resolveOptions(l._buffer,i);var d=l._buffer.getLineCount(),h=l._buffer.getValueLengthInRange(new c["a"](1,1,d,l._buffer.getLineLength(d)+1),0);return i.largeFileOptimizations?l._isTooLargeForTokenization=h>t.LARGE_FILE_SIZE_THRESHOLD||d>t.LARGE_FILE_LINE_COUNT_THRESHOLD:l._isTooLargeForTokenization=!1,l._isTooLargeForSyncing=h>t.MODEL_SYNC_LIMIT,l._versionId=1,l._alternativeVersionId=1,l._isDisposed=!1,l._isDisposing=!1,l._languageIdentifier=r||Fe["a"],l._languageRegistryListener=Qe["a"].onDidChange(function(e){e.languageIdentifier.id===l._languageIdentifier.id&&l._onDidChangeLanguageConfiguration.fire({})}),l._instanceId=s["I"](at),l._lastDecorationId=0,l._decorations=Object.create(null),l._decorationsTree=new ht,l._commandManager=new m(l),l._isUndoing=!1,l._isRedoing=!1,l._trimAutoWhitespaceLines=null,l._tokens=new Ke,l._tokenization=new Ze(l),l}return it(t,e),t.createFromString=function(e,n,i,o){return void 0===n&&(n=t.DEFAULT_CREATION_OPTIONS),void 0===i&&(i=null),void 0===o&&(o=null),new t(e,n,i,o)},t.resolveOptions=function(e,t){if(t.detectIndentation){var n=b(e,t.tabSize,t.insertSpaces);return new h["e"]({tabSize:n.tabSize,indentSize:n.tabSize,insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new h["e"]({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})},t.prototype.onDidChangeRawContentFast=function(e){return this._eventEmitter.fastEvent(function(t){return e(t.rawContentChangedEvent)})},t.prototype.onDidChangeRawContent=function(e){return this._eventEmitter.slowEvent(function(t){return e(t.rawContentChangedEvent)})},t.prototype.onDidChangeContentFast=function(e){return this._eventEmitter.fastEvent(function(t){return e(t.contentChangedEvent)})},t.prototype.onDidChangeContent=function(e){return this._eventEmitter.slowEvent(function(t){return e(t.contentChangedEvent)})},t.prototype.dispose=function(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,e.prototype.dispose.call(this),this._isDisposing=!1},t.prototype._assertNotDisposed=function(){if(this._isDisposed)throw new Error("Model is disposed!")},t.prototype._emitContentChangedEvent=function(e,t){this._isDisposing||this._eventEmitter.fire(new Te(e,t))},t.prototype.setValue=function(e){if(this._assertNotDisposed(),null!==e){var t=st(e,this._options.defaultEOL);this.setValueFromTextBuffer(t)}},t.prototype._createContentChanged2=function(e,t,n,i,o,r,s){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:i}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:s}},t.prototype.setValueFromTextBuffer=function(e){if(this._assertNotDisposed(),null!==e){var t=this.getFullModelRange(),n=this.getValueLengthInRange(t),i=this.getLineCount(),o=this.getLineMaxColumn(i);this._buffer=e,this._increaseVersionId(),this._tokens.flush(),this._decorations=Object.create(null),this._decorationsTree=new ht,this._commandManager=new m(this),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Me([new Ne],this._versionId,!1,!1),this._createContentChanged2(new c["a"](1,1,i,o),0,n,this.getValue(),!1,!1,!0))}},t.prototype.setEOL=function(e){this._assertNotDisposed();var t=1===e?"\r\n":"\n";if(this._buffer.getEOL()!==t){var n=this.getFullModelRange(),i=this.getValueLengthInRange(n),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Me([new Ee],this._versionId,!1,!1),this._createContentChanged2(new c["a"](1,1,o,r),0,i,this.getValue(),!1,!1,!1))}},t.prototype._onBeforeEOLChange=function(){var e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)},t.prototype._onAfterEOLChange=function(){for(var e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder(),n=0,i=t.length;n0},t.prototype.getAttachedEditorCount=function(){return this._attachedEditorCount},t.prototype.isTooLargeForSyncing=function(){return this._isTooLargeForSyncing},t.prototype.isTooLargeForTokenization=function(){return this._isTooLargeForTokenization},t.prototype.isDisposed=function(){return this._isDisposed},t.prototype.isDominatedByLongLines=function(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;for(var e=0,t=0,n=this._buffer.getLineCount(),i=1;i<=n;i++){var o=this._buffer.getLineLength(i);o>=lt?t+=o:e+=o}return t>e},Object.defineProperty(t.prototype,"uri",{get:function(){return this._associatedResource},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return this._assertNotDisposed(),this._options},t.prototype.getFormattingOptions=function(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}},t.prototype.updateOptions=function(e){this._assertNotDisposed();var t="undefined"!==typeof e.tabSize?e.tabSize:this._options.tabSize,n="undefined"!==typeof e.indentSize?e.indentSize:this._options.indentSize,i="undefined"!==typeof e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o="undefined"!==typeof e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=new h["e"]({tabSize:t,indentSize:n,insertSpaces:i,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o});if(!this._options.equals(r)){var s=this._options.createChangeEvent(r);this._options=r,this._onDidChangeOptions.fire(s)}},t.prototype.detectIndentation=function(e,t){this._assertNotDisposed();var n=b(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})},t._normalizeIndentationFromWhitespace=function(e,t,n){for(var i=0,o=0;othis.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)},t.prototype.getLineLength=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)},t.prototype.getLinesContent=function(){return this._assertNotDisposed(),this._buffer.getLinesContent()},t.prototype.getEOL=function(){return this._assertNotDisposed(),this._buffer.getEOL()},t.prototype.getLineMinColumn=function(e){return this._assertNotDisposed(),1},t.prototype.getLineMaxColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1},t.prototype.getLineFirstNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)},t.prototype.getLineLastNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)},t.prototype._validateRangeRelaxedNoAllocations=function(e){var t,n,i=this._buffer.getLineCount(),o=e.startLineNumber,r=e.startColumn;if(o<1)t=1,n=1;else if(o>i)t=i,n=this.getLineMaxColumn(t);else if(t=0|o,r<=1)n=1;else{var s=this.getLineMaxColumn(t);n=r>=s?s:0|r}var a,u,l=e.endLineNumber,h=e.endColumn;if(l<1)a=1,u=1;else if(l>i)a=i,u=this.getLineMaxColumn(a);else if(a=0|l,h<=1)u=1;else{s=this.getLineMaxColumn(a);u=h>=s?s:0|h}return o===t&&r===n&&l===a&&h===u&&e instanceof c["a"]&&!(e instanceof d["a"])?e:new c["a"](t,n,a,u)},t.prototype._isValidPosition=function(e,t,n){if("number"!==typeof e||"number"!==typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;var i=this._buffer.getLineCount();if(e>i)return!1;var o=this.getLineMaxColumn(e);if(t>o)return!1;if(n&&t>1){var r=this._buffer.getLineCharCode(e,t-2);if(s["w"](r))return!1}return!0},t.prototype._validatePosition=function(e,t,n){var i=Math.floor("number"!==typeof e||isNaN(e)?1:e),o=Math.floor("number"!==typeof t||isNaN(t)?1:t),r=this._buffer.getLineCount();if(i<1)return new l["a"](1,1);if(i>r)return new l["a"](r,this.getLineMaxColumn(r));if(o<=1)return new l["a"](i,1);var a=this.getLineMaxColumn(i);if(o>=a)return new l["a"](i,a);if(n){var u=this._buffer.getLineCharCode(i,o-2);if(s["w"](u))return new l["a"](i,o-1)}return new l["a"](i,o)},t.prototype.validatePosition=function(e){return this._assertNotDisposed(),e instanceof l["a"]&&this._isValidPosition(e.lineNumber,e.column,!0)?e:this._validatePosition(e.lineNumber,e.column,!0)},t.prototype._isValidRange=function(e,t){var n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(n,i,!1))return!1;if(!this._isValidPosition(o,r,!1))return!1;if(t){var a=i>1?this._buffer.getLineCharCode(n,i-2):0,u=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,l=s["w"](a),c=s["w"](u);return!l&&!c}return!0},t.prototype.validateRange=function(e){if(this._assertNotDisposed(),e instanceof c["a"]&&!(e instanceof d["a"])&&this._isValidRange(e,!0))return e;var t=this._validatePosition(e.startLineNumber,e.startColumn,!1),n=this._validatePosition(e.endLineNumber,e.endColumn,!1),i=t.lineNumber,o=t.column,r=n.lineNumber,a=n.column,u=o>1?this._buffer.getLineCharCode(i,o-2):0,l=a>1&&a<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,a-2):0,h=s["w"](u),p=s["w"](l);return h||p?i===r&&o===a?new c["a"](i,o-1,r,a-1):h&&p?new c["a"](i,o-1,r,a+1):h?new c["a"](i,o-1,r,a):new c["a"](i,o,r,a+1):new c["a"](i,o,r,a)},t.prototype.modifyPosition=function(e,t){this._assertNotDisposed();var n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))},t.prototype.getFullModelRange=function(){this._assertNotDisposed();var e=this.getLineCount();return new c["a"](1,1,e,this.getLineMaxColumn(e))},t.prototype.findMatchesLineByLine=function(e,t,n,i){return this._buffer.findMatchesLineByLine(e,t,n,i)},t.prototype.findMatches=function(e,t,n,i,o,r,s){var a;if(void 0===s&&(s=ut),this._assertNotDisposed(),a=c["a"].isIRange(t)?this.validateRange(t):this.getFullModelRange(),!n&&e.indexOf("\n")<0){var u=new fe["a"](e,n,i,o),l=u.parseSearchRequest();return l?this.findMatchesLineByLine(a,l,r,s):[]}return fe["c"].findMatches(this,new fe["a"](e,n,i,o),a,r,s)},t.prototype.findNextMatch=function(e,t,n,i,o,r){this._assertNotDisposed();var s=this.validatePosition(t);if(!n&&e.indexOf("\n")<0){var a=new fe["a"](e,n,i,o),u=a.parseSearchRequest();if(!u)return null;var l=this.getLineCount(),d=new c["a"](s.lineNumber,s.column,l,this.getLineMaxColumn(l)),h=this.findMatchesLineByLine(d,u,r,1);return fe["c"].findNextMatch(this,new fe["a"](e,n,i,o),s,r),h.length>0?h[0]:(d=new c["a"](1,1,s.lineNumber,this.getLineMaxColumn(s.lineNumber)),h=this.findMatchesLineByLine(d,u,r,1),h.length>0?h[0]:null)}return fe["c"].findNextMatch(this,new fe["a"](e,n,i,o),s,r)},t.prototype.findPreviousMatch=function(e,t,n,i,o,r){this._assertNotDisposed();var s=this.validatePosition(t);return fe["c"].findPreviousMatch(this,new fe["a"](e,n,i,o),s,r)},t.prototype.pushStackElement=function(){this._commandManager.pushStackElement()},t.prototype.pushEOL=function(e){var t="\n"===this.getEOL()?0:1;if(t!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype.pushEditOperations=function(e,t,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,t,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._pushEditOperations=function(e,t,n){var i=this;if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){for(var o=t.map(function(e){return{range:i.validateRange(e.range),text:e.text}}),r=!0,s=0,a=e.length;su.endLineNumber,g=u.startLineNumber>p.endLineNumber;if(!f&&!g){l=!0;break}}if(!l){r=!1;break}}if(r)for(s=0,a=this._trimAutoWhitespaceLines.length;sp.endLineNumber)&&(!(m===p.startLineNumber&&p.startColumn===v&&p.isEmpty()&&b&&b.length>0&&"\n"===b.charAt(0))&&!(m===p.startLineNumber&&1===p.startColumn&&p.isEmpty()&&b&&b.length>0&&"\n"===b.charAt(b.length-1)))){_=!1;break}}_&&t.push({range:new c["a"](m,1,m,v),text:null})}this._trimAutoWhitespaceLines=null}return this._commandManager.pushEditOperation(e,t,n)},t.prototype.applyEdits=function(e){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._applyEdits(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._applyEdits=function(e){for(var t=0,n=e.length;t=0;b--){var y=p+b,w=r-u-_+y;a.push(new De(y,this.getLineContent(w)))}if(vthis.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)},t.prototype.getLinesDecorations=function(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),s=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(s);return this._getDecorationsInRange(new c["a"](r,1,s,a),n,i)},t.prototype.getDecorationsInRange=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=!1);var i=this.validateRange(e);return this._getDecorationsInRange(i,t,n)},t.prototype.getOverviewRulerDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),i=this._decorationsTree.search(e,t,!0,n);return this._ensureNodesHaveRanges(i)},t.prototype.getAllDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),i=this._decorationsTree.search(e,t,!1,n);return this._ensureNodesHaveRanges(i)},t.prototype._getDecorationsInRange=function(e,t,n){var i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),r=this.getVersionId(),s=this._decorationsTree.intervalSearch(i,o,t,n,r);return this._ensureNodesHaveRanges(s)},t.prototype._ensureNodesHaveRanges=function(e){for(var t=0,n=e.length;tthis.getLineCount())throw new Error("Illegal value for lineNumber");this._tokens.setTokens(this._languageIdentifier.id,e-1,this._buffer.getLineLength(e),t)},t.prototype.setTokens=function(e){if(0!==e.length){for(var t=[],n=0,i=e.length;nthis.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)},t.prototype.isCheapToTokenize=function(e){return this._tokenization.isCheapToTokenize(e)},t.prototype.tokenizeIfCheap=function(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)},t.prototype.getLineTokens=function(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)},t.prototype._getLineTokens=function(e){var t=this.getLineContent(e);return this._tokens.getTokens(this._languageIdentifier.id,e-1,t)},t.prototype.getLanguageIdentifier=function(){return this._languageIdentifier},t.prototype.getModeId=function(){return this._languageIdentifier.language},t.prototype.setMode=function(e){if(this._languageIdentifier.id!==e.id){var t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}},t.prototype.getLanguageIdAtPosition=function(e,t){var n=this.validatePosition(new l["a"](e,t)),i=this.getLineTokens(n.lineNumber);return i.getLanguageId(i.findTokenIndexAtOffset(n.column-1))},t.prototype.getWordAtPosition=function(e){this._assertNotDisposed();var n=this.validatePosition(e),i=this.getLineContent(n.lineNumber),o=this._getLineTokens(n.lineNumber),r=o.findTokenIndexAtOffset(n.column-1),s=t._findLanguageBoundaries(o,r),a=s[0],u=s[1],l=Object($e["d"])(n.column,Qe["a"].getWordDefinition(o.getLanguageId(r)),i.substring(a,u),a);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&a===n.column-1){var c=t._findLanguageBoundaries(o,r-1),d=c[0],h=c[1],p=Object($e["d"])(n.column,Qe["a"].getWordDefinition(o.getLanguageId(r-1)),i.substring(d,h),d);if(p&&p.startColumn<=e.column&&e.column<=p.endColumn)return p}return null},t._findLanguageBoundaries=function(e,t){for(var n=e.getLanguageId(t),i=0,o=t;o>=0&&e.getLanguageId(o)===n;o--)i=e.getStartOffset(o);for(var r=e.getLineContent().length,s=(o=t,e.getCount());o0&&n.getStartOffset(o)===e.column-1){a=n.getStartOffset(o);o--;var h=Qe["a"].getBracketsSupport(n.getLanguageId(o));if(h&&!Object(Je["b"])(n.getStandardTokenType(o))){s=Math.max(n.getStartOffset(o),e.column-1-h.maxBracketLength),l=et["a"].findPrevBracketInToken(h.reversedRegex,t,i,s,a);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn){c=i.substring(l.startColumn-1,l.endColumn-1);c=c.toLowerCase();d=this._matchFoundBracket(l,h.textIsBracket[c],h.textIsOpenBracket[c]);if(d)return d}}}return null},t.prototype._matchFoundBracket=function(e,t,n){if(!t)return null;if(n){var i=this._findMatchingBracketDown(t,e.getEndPosition());if(i)return[e,i]}else{i=this._findMatchingBracketUp(t,e.getStartPosition());if(i)return[e,i]}return null},t.prototype._findMatchingBracketUp=function(e,t){for(var n=e.languageIdentifier.id,i=e.reversedRegex,o=-1,r=t.lineNumber;r>=1;r--){var s=this._getLineTokens(r),a=s.getCount(),u=this._buffer.getLineContent(r),l=a-1,c=-1;for(r===t.lineNumber&&(l=s.findTokenIndexAtOffset(t.column-1),c=t.column-1);l>=0;l--){var d=s.getLanguageId(l),h=s.getStandardTokenType(l),p=s.getStartOffset(l),f=s.getEndOffset(l);if(-1===c&&(c=f),d===n&&!Object(Je["b"])(h))while(1){var g=et["a"].findPrevBracketInToken(i,r,u,p,c);if(!g)break;var m=u.substring(g.startColumn-1,g.endColumn-1);if(m=m.toLowerCase(),m===e.open?o++:m===e.close&&o--,0===o)return g;c=g.startColumn-1}c=-1}}return null},t.prototype._findMatchingBracketDown=function(e,t){for(var n=e.languageIdentifier.id,i=e.forwardRegex,o=1,r=t.lineNumber,s=this.getLineCount();r<=s;r++){var a=this._getLineTokens(r),u=a.getCount(),l=this._buffer.getLineContent(r),c=0,d=0;for(r===t.lineNumber&&(c=a.findTokenIndexAtOffset(t.column-1),d=t.column-1);c=1;o--){var r=this._getLineTokens(o),s=r.getCount(),a=this._buffer.getLineContent(o),u=s-1,l=-1;for(o===t.lineNumber&&(u=r.findTokenIndexAtOffset(t.column-1),l=t.column-1);u>=0;u--){var c=r.getLanguageId(u),d=r.getStandardTokenType(u),h=r.getStartOffset(u),p=r.getEndOffset(u);if(-1===l&&(l=p),n!==c&&(n=c,i=Qe["a"].getBracketsSupport(n)),i&&!Object(Je["b"])(d)){var f=et["a"].findPrevBracketInToken(i.reversedRegex,o,a,h,l);if(f)return this._toFoundBracket(i,f)}l=-1}}return null},t.prototype.findNextBracket=function(e){for(var t=this.validatePosition(e),n=-1,i=null,o=t.lineNumber,r=this.getLineCount();o<=r;o++){var s=this._getLineTokens(o),a=s.getCount(),u=this._buffer.getLineContent(o),l=0,c=0;for(o===t.lineNumber&&(l=s.findTokenIndexAtOffset(t.column-1),c=t.column-1);lo)throw new Error("Illegal value for lineNumber");for(var r=Qe["a"].getFoldingRules(this._languageIdentifier.id),s=Boolean(r&&r.offSide),a=-2,u=-1,l=-2,c=-1,d=function(e){if(-1!==a&&(-2===a||a>e-1)){a=-1,u=-1;for(var t=e-2;t>=0;t--){var n=i._computeIndentLevel(t);if(n>=0){a=t,u=n;break}}}if(-2===l){l=-1,c=-1;for(t=e;t=0){l=t,c=r;break}}}},h=-2,p=-1,f=-2,g=-1,m=function(e){if(-2===h){h=-1,p=-1;for(var t=e-2;t>=0;t--){var n=i._computeIndentLevel(t);if(n>=0){h=t,p=n;break}}}if(-1!==f&&(-2===f||f=0){f=t,g=r;break}}}},v=0,_=!0,b=0,y=!0,w=0,C=0;_||y;C++){var S=e-C,L=e+C;if(0!==C&&(S<1||So||L>n)&&(y=!1),C>5e4&&(_=!1,y=!1),_){var O=void 0,x=this._computeIndentLevel(S-1);if(x>=0?(l=S-1,c=x,O=Math.ceil(x/this._options.indentSize)):(d(S),O=this._getIndentLevelForWhitespaceLine(s,u,c)),0===C){if(v=S,b=L,w=O,0===w)return{startLineNumber:v,endLineNumber:b,indent:w};continue}O>=w?v=S:_=!1}if(y){var N=void 0;x=this._computeIndentLevel(L-1);x>=0?(h=L-1,p=x,N=Math.ceil(x/this._options.indentSize)):(m(L),N=this._getIndentLevelForWhitespaceLine(s,p,g)),N>=w?b=L:y=!1}}return{startLineNumber:v,endLineNumber:b,indent:w}},t.prototype.getLinesIndentGuides=function(e,t){this._assertNotDisposed();var n=this.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");for(var i=Qe["a"].getFoldingRules(this._languageIdentifier.id),o=Boolean(i&&i.offSide),r=new Array(t-e+1),s=-2,a=-1,u=-2,l=-1,c=e;c<=t;c++){var d=c-e,h=this._computeIndentLevel(c-1);if(h>=0)s=c-1,a=h,r[d]=Math.ceil(h/this._options.indentSize);else{if(-2===s){s=-1,a=-1;for(var p=c-2;p>=0;p--){var f=this._computeIndentLevel(p);if(f>=0){s=p,a=f;break}}}if(-1!==u&&(-2===u||u=0){u=p,l=f;break}}}r[d]=this._getIndentLevelForWhitespaceLine(o,a,l)}}return r},t.prototype._getIndentLevelForWhitespaceLine=function(e,t,n){return-1===t||-1===n?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))},t}(r["a"])},b589:function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return a});var i,o=n("6d8e"),r=n("30db");(function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.userData="vscode-userdata"})(i||(i={}));var s=function(){function e(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http"}return e.prototype.setPreferredWebSchema=function(e){this._preferredWebSchema=e},e.prototype.rewrite=function(e,t){var n=this._hosts[e],s=this._ports[e],a=this._connectionTokens[e];return o["a"].from({scheme:r["f"]?this._preferredWebSchema:i.vscodeRemoteResource,authority:n+":"+s,path:"/vscode-remote-resource",query:"path="+encodeURIComponent(t)+"&tkn="+encodeURIComponent(a)})},e}(),a=new s},b707:function(e,t,n){"use strict";var i=n("ef8e"),o=n("6d8e"),r=n("6a89"),s=n("308f"),a=n("a666"),u=n("9768");function l(e,t,n,i){if(Array.isArray(e)){for(var o=0,r=0,s=e;ro&&(o=c)}return o}if("string"===typeof e)return i?"*"===e?5:e===n?10:0:0;if(e){var d=e.language,h=e.pattern,p=e.scheme,f=e.hasAccessToAllModels;if(!i&&!f)return 0;o=0;if(p)if(p===t.scheme)o=10;else{if("*"!==p)return 0;o=5}if(d)if(d===n)o=10;else{if("*"!==d)return 0;o=Math.max(o,5)}if(h){if(h!==t.fsPath&&!Object(u["a"])(h,t.fsPath))return 0;o=10}return o}return 0}var c=n("1b69");function d(e){return"string"!==typeof e&&(Array.isArray(e)?e.every(d):!!e.exclusive)}var h=function(){function e(){this._clock=0,this._entries=[],this._onDidChange=new s["a"]}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this,i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Object(a["h"])(function(){if(i){var e=n._entries.indexOf(i);e>=0&&(n._entries.splice(e,1),n._lastCandidate=void 0,n._onDidChange.fire(n._entries.length),i=void 0)}})},e.prototype.has=function(e){return this.all(e).length>0},e.prototype.all=function(e){if(!e)return[];this._updateScores(e);for(var t=[],n=0,i=this._entries;n0&&t.push(o.provider)}return t},e.prototype.ordered=function(e){var t=[];return this._orderedForEach(e,function(e){return t.push(e.provider)}),t},e.prototype.orderedGroups=function(e){var t,n,i=[];return this._orderedForEach(e,function(e){t&&n===e._score?t.push(e.provider):(n=e._score,t=[e.provider],i.push(t))}),i},e.prototype._orderedForEach=function(e,t){if(e){this._updateScores(e);for(var n=0,i=this._entries;n0&&t(o)}}},e.prototype._updateScores=function(t){var n={uri:t.uri.toString(),language:t.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==n.language||this._lastCandidate.uri!==n.uri){this._lastCandidate=n;for(var i=0,o=this._entries;i0){for(var s=0,a=this._entries;st._score?-1:e._timet._time?-1:0},e}(),p=n("4035"),f=function(){function e(){this._map=new Map,this._promises=new Map,this._onDidChange=new s["a"],this.onDidChange=this._onDidChange.event,this._colorMap=null}return e.prototype.fire=function(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})},e.prototype.register=function(e,t){var n=this;return this._map.set(e,t),this.fire([e]),Object(a["h"])(function(){n._map.get(e)===t&&(n._map.delete(e),n.fire([e]))})},e.prototype.registerPromise=function(e,t){var n=this,i=null,o=!1;return this._promises.set(e,t.then(function(t){n._promises.delete(e),!o&&t&&(i=n.register(e,t))})),Object(a["h"])(function(){o=!0,i&&i.dispose()})},e.prototype.getPromise=function(e){var t=this,n=this.get(e);if(n)return Promise.resolve(n);var i=this._promises.get(e);return i?i.then(function(n){return t.get(e)}):null},e.prototype.get=function(e){return Object(i["n"])(this._map.get(e))},e.prototype.setColorMap=function(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Object(p["d"])(this._map),changedColorMap:!0})},e.prototype.getColorMap=function(){return this._colorMap},e.prototype.getDefaultBackground=function(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null},e}();n.d(t,"p",function(){return v}),n.d(t,"x",function(){return _}),n.d(t,"B",function(){return b}),n.d(t,"A",function(){return y}),n.d(t,"w",function(){return g}),n.d(t,"h",function(){return m}),n.d(t,"C",function(){return w}),n.d(t,"E",function(){return C}),n.d(t,"l",function(){return S}),n.d(t,"D",function(){return L}),n.d(t,"s",function(){return O}),n.d(t,"t",function(){return x}),n.d(t,"d",function(){return N}),n.d(t,"v",function(){return D}),n.d(t,"n",function(){return k}),n.d(t,"k",function(){return I}),n.d(t,"i",function(){return E}),n.d(t,"f",function(){return M}),n.d(t,"e",function(){return T}),n.d(t,"o",function(){return P}),n.d(t,"z",function(){return R}),n.d(t,"b",function(){return A}),n.d(t,"a",function(){return F}),n.d(t,"g",function(){return j}),n.d(t,"j",function(){return W}),n.d(t,"r",function(){return V}),n.d(t,"q",function(){return B}),n.d(t,"c",function(){return H}),n.d(t,"u",function(){return z}),n.d(t,"m",function(){return U}),n.d(t,"y",function(){return K});var g,m,v=function(){function e(e,t){this.language=e,this.id=t}return e}(),_=function(){function e(){}return e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(1792&e)>>>8},e.getFontStyle=function(e){return(14336&e)>>>11},e.getForeground=function(e){return(8372224&e)>>>14},e.getBackground=function(e){return(4286578688&e)>>>23},e.getClassNameFromMetadata=function(e){var t=this.getForeground(e),n="mtk"+t,i=this.getFontStyle(e);return 1&i&&(n+=" mtki"),2&i&&(n+=" mtkb"),4&i&&(n+=" mtku"),n},e.getInlineStyleFromMetadata=function(e,t){var n=this.getForeground(e),i=this.getFontStyle(e),o="color: "+t[n]+";";return 1&i&&(o+="font-style: italic;"),2&i&&(o+="font-weight: bold;"),4&i&&(o+="text-decoration: underline;"),o},e}(),b=function(){var e=Object.create(null);return e[0]="method",e[1]="function",e[2]="constructor",e[3]="field",e[4]="variable",e[5]="class",e[6]="struct",e[7]="interface",e[8]="module",e[9]="property",e[10]="event",e[11]="operator",e[12]="unit",e[13]="value",e[14]="constant",e[15]="enum",e[16]="enum-member",e[17]="keyword",e[25]="snippet",e[18]="text",e[19]="color",e[20]="file",e[21]="reference",e[22]="customcolor",e[23]="folder",e[24]="type-parameter",function(t){return e[t]||"property"}}(),y=function(){var e=Object.create(null);return e["method"]=0,e["function"]=1,e["constructor"]=2,e["field"]=3,e["variable"]=4,e["class"]=5,e["struct"]=6,e["interface"]=7,e["module"]=8,e["property"]=9,e["event"]=10,e["operator"]=11,e["unit"]=12,e["value"]=13,e["constant"]=14,e["enum"]=15,e["enum-member"]=16,e["enumMember"]=16,e["keyword"]=17,e["snippet"]=25,e["text"]=18,e["color"]=19,e["file"]=20,e["reference"]=21,e["customcolor"]=22,e["folder"]=23,e["type-parameter"]=24,e["typeParameter"]=24,function(t,n){var i=e[t];return"undefined"!==typeof i||n||(i=9),i}}();function w(e){return e&&o["a"].isUri(e.uri)&&r["a"].isIRange(e.range)&&(r["a"].isIRange(e.originSelectionRange)||r["a"].isIRange(e.targetSelectionRange))}(function(e){e[e["Invoke"]=1]="Invoke",e[e["TriggerCharacter"]=2]="TriggerCharacter",e[e["ContentChange"]=3]="ContentChange"})(g||(g={})),function(e){e[e["Text"]=0]="Text",e[e["Read"]=1]="Read",e[e["Write"]=2]="Write"}(m||(m={}));var C=function(){var e=Object.create(null);return e[0]="file",e[1]="module",e[2]="namespace",e[3]="package",e[4]="class",e[5]="method",e[6]="property",e[7]="field",e[8]="constructor",e[9]="enum",e[10]="interface",e[11]="function",e[12]="variable",e[13]="constant",e[14]="string",e[15]="number",e[16]="boolean",e[17]="array",e[18]="object",e[19]="key",e[20]="null",e[21]="enum-member",e[22]="struct",e[23]="event",e[24]="operator",e[25]="type-parameter",function(t,n){return"symbol-icon "+(n?"inline":"block")+" "+(e[t]||"property")}}(),S=function(){function e(e){this.value=e}return e.Comment=new e("comment"),e.Imports=new e("imports"),e.Region=new e("region"),e}();function L(e){return Object(i["h"])(e)&&e.resource&&Array.isArray(e.edits)}var O=new h,x=new h,N=new h,D=new h,k=new h,I=new h,E=new h,M=new h,T=new h,P=new h,R=new h,A=new h,F=new h,j=new h,W=new h,V=new h,B=new h,H=new h,z=new h,U=new h,K=new f},b768:function(e,t,n){},b78f:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("0a0f"),o=Object(i["c"])("textModelService")},b7d0:function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"g",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"b",function(){return d}),n.d(t,"e",function(){return h}),n.d(t,"a",function(){return p}),n.d(t,"f",function(){return m});var i=n("0a0f"),o=n("a666"),r=n("89cd"),s=n("308f"),a=Object(i["c"])("themeService");function u(e){return{id:e}}var l="dark",c="light",d="hc";function h(e){switch(e){case l:return"vs-dark";case d:return"hc-black";default:return"vs"}}var p={ThemingContribution:"base.contributions.theming"},f=function(){function e(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new s["a"]}return e.prototype.onThemeChange=function(e){var t=this;return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Object(o["h"])(function(){var n=t.themingParticipants.indexOf(e);t.themingParticipants.splice(n,1)})},e.prototype.getThemingParticipants=function(){return this.themingParticipants},e}(),g=new f;function m(e){return g.onThemeChange(e)}r["a"].add(p.ThemingContribution,g)},b800:function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return m});var i,o=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=function(){function e(){this.value="",this.pos=0}return e.isDigitCharacter=function(e){return e>=48&&e<=57},e.isVariableCharacter=function(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90},e.prototype.text=function(e){this.value=e,this.pos=0},e.prototype.tokenText=function(e){return this.value.substr(e.pos,e.len)},e.prototype.next=function(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};var t,n=this.pos,i=0,o=this.value.charCodeAt(n);if(t=e._table[o],"number"===typeof t)return this.pos+=1,{type:t,pos:n,len:1};if(e.isDigitCharacter(o)){t=8;do{i+=1,o=this.value.charCodeAt(n+i)}while(e.isDigitCharacter(o));return this.pos+=i,{type:t,pos:n,len:i}}if(e.isVariableCharacter(o)){t=9;do{o=this.value.charCodeAt(n+ ++i)}while(e.isVariableCharacter(o)||e.isDigitCharacter(o));return this.pos+=i,{type:t,pos:n,len:i}}t=10;do{i+=1,o=this.value.charCodeAt(n+i)}while(!isNaN(o)&&"undefined"===typeof e._table[o]&&!e.isDigitCharacter(o)&&!e.isVariableCharacter(o));return this.pos+=i,{type:t,pos:n,len:i}},e._table=(i={},i[36]=0,i[58]=1,i[44]=2,i[123]=3,i[125]=4,i[92]=5,i[47]=6,i[124]=7,i[43]=11,i[45]=12,i[63]=13,i),e}(),s=function(){function e(){this._children=[]}return e.prototype.appendChild=function(e){return e instanceof a&&this._children[this._children.length-1]instanceof a?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this},e.prototype.replace=function(e,t){var n=e.parent,i=n.children.indexOf(e),o=n.children.slice(0);o.splice.apply(o,[i,1].concat(t)),n._children=o,function e(t,n){for(var i=0,o=t;it.index?1:0},Object.defineProperty(t.prototype,"isFinalTabstop",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"choice",{get:function(){return 1===this._children.length&&this._children[0]instanceof c?this._children[0]:void 0},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(function(e){return e.clone()}),e},t}(u),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.options=[],t}return o(t,e),t.prototype.appendChild=function(e){return e instanceof a&&(e.parent=this,this.options.push(e)),this},t.prototype.toString=function(){return this.options[0].value},t.prototype.len=function(){return this.options[0].len()},t.prototype.clone=function(){var e=new t;return this.options.forEach(e.appendChild,e),e},t}(s),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.regexp=new RegExp(""),t}return o(t,e),t.prototype.resolve=function(e){var t=this,n=!1,i=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(function(e){return e instanceof h&&Boolean(e.elseValue)})&&(i=this._replace([])),i},t.prototype._replace=function(e){for(var t="",n=0,i=this._children;n0){var i=n.shift(),o=t(i);if(!o)break;n.unshift.apply(n,i.children)}}var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),Object.defineProperty(t.prototype,"placeholderInfo",{get:function(){if(!this._placeholders){var e,t=[];this.walk(function(n){return n instanceof l&&(t.push(n),e=!e||e.index0?o.set(e.index,e.children):r.push(e)),!0});for(var a=0,u=r;a0&&t),!o.has(0)&&n&&i.appendChild(new l(0)),i},e.prototype._accept=function(e,t){if(void 0===e||this._token.type===e){var n=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),n}return!1},e.prototype._backTo=function(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1},e.prototype._until=function(e){if(14===this._token.type)return!1;var t="",n=this._token.pos,i={type:14,pos:0,len:0};while(this._token.type!==e||5===i.type)if(this._token.type===e&&(t+=this._scanner.value.substring(n,i.pos),n=this._token.pos),i=this._token,this._token=this._scanner.next(),14===this._token.type)return!1;return t+=this._scanner.value.substring(n,this._token.pos),this._token=this._scanner.next(),t},e.prototype._parse=function(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)},e.prototype._parseEscaped=function(e){var t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new a(t)),!0)},e.prototype._parseTabstopOrVariableName=function(e){var t,n=this._token,i=this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0));return i?(e.appendChild(/^\d+$/.test(t)?new l(Number(t)):new p(t)),!0):this._backTo(n)},e.prototype._parseComplexPlaceholder=function(e){var t,n=this._token,i=this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0));if(!i)return this._backTo(n);var o=new l(Number(t));if(this._accept(1))while(1){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new a("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else{if(!(o.index>0&&this._accept(7)))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);var r=new c;while(1){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(n),!1}}},e.prototype._parseChoiceElement=function(e){var t=this._token,n=[];while(1){if(2===this._token.type||7===this._token.type)break;var i=void 0;if(i=(i=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||i:this._accept(void 0,!0),!i)return this._backTo(t),!1;n.push(i)}return 0===n.length?(this._backTo(t),!1):(e.appendChild(new a(n.join(""))),!0)},e.prototype._parseComplexVariable=function(e){var t,n=this._token,i=this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0));if(!i)return this._backTo(n);var o=new p(t);if(!this._accept(1))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);while(1){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new a("${"+t+":")),o.children.forEach(e.appendChild,e),!0}},e.prototype._parseTransform=function(e){var t=new d,n="",i="";while(1){if(this._accept(6))break;var o=void 0;if(o=this._accept(5,!0))o=this._accept(6,!0)||o,n+=o;else{if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}}while(1){if(this._accept(6))break;o=void 0;if(o=this._accept(5,!0))o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new a(o));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}while(1){if(this._accept(4))break;if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}try{t.regexp=new RegExp(n,i)}catch(r){return!1}return e.transform=t,!0},e.prototype._parseFormatString=function(e){var t=this._token;if(!this._accept(0))return!1;var n=!1;this._accept(3)&&(n=!0);var i=this._accept(8,!0);if(!i)return this._backTo(t),!1;if(!n)return e.appendChild(new h(Number(i))),!0;if(this._accept(4))return e.appendChild(new h(Number(i))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){var o=this._accept(9,!0);return o&&this._accept(4)?(e.appendChild(new h(Number(i),o)),!0):(this._backTo(t),!1)}if(this._accept(11)){var r=this._until(4);if(r)return e.appendChild(new h(Number(i),void 0,r,void 0)),!0}else if(this._accept(12)){var s=this._until(4);if(s)return e.appendChild(new h(Number(i),void 0,void 0,s)),!0}else if(this._accept(13)){r=this._until(1);if(r){s=this._until(4);if(s)return e.appendChild(new h(Number(i),void 0,r,s)),!0}}else{s=this._until(4);if(s)return e.appendChild(new h(Number(i),void 0,void 0,s)),!0}return this._backTo(t),!1},e.prototype._parseAnything=function(e){return 14!==this._token.type&&(e.appendChild(new a(this._scanner.tokenText(this._token))),this._accept(void 0),!0)},e}()},b805:function(e,t,n){},b835:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n("0f70"),o=n("fe45"),r=n("30db"),s=new Array(230),a=new Array(112);function u(e){if(e.charCode){var t=String.fromCharCode(e.charCode).toUpperCase();return o["b"].fromString(t)}return s[e.keyCode]||0}(function(){for(var e=0;e0){n=o[0].getStartPosition();var r=t.getTopForPosition(n.lineNumber,n.column);i=t.getScrollTop()-r}}return new e(n,i)},e.prototype.restore=function(e){if(this._visiblePosition){var t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}},e}()},bcc1:function(e,t,n){},bd50:function(e,t,n){"use strict";n.r(t);var i=n("b2cc"),o=n("b1ca"),r=n("03d9"),s=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),a=function(e){function t(){var t=e.call(this,{id:"editor.action.toggleHighContrast",label:r["h"].toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0})||this;return t._originalThemeName=null,t}return s(t,e),t.prototype.run=function(e,t){var n=e.get(o["a"]);this._originalThemeName?(n.setTheme(this._originalThemeName),this._originalThemeName=null):(this._originalThemeName=n.getTheme().themeName,n.setTheme("hc-black"))},t}(i["b"]);Object(i["f"])(a)},be5f:function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"b",function(){return r}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return a});var i=Object.prototype.hasOwnProperty;function o(e){var t=[];for(var n in e)i.call(e,n)&&t.push(e[n]);return t}function r(e){for(var t in e)if(i.call(e,t))return e[t]}function s(e,t){var n=function(n){if(i.call(e,n)){var o=t({key:n,value:e[n]},function(){delete e[n]});if(!1===o)return{value:void 0}}};for(var o in e){var r=n(o);if("object"===typeof r)return r.value}}var a=function(){function e(){this.map=new Map}return e.prototype.add=function(e,t){var n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)},e.prototype.delete=function(e,t){var n=this.map.get(e);n&&(n.delete(t),0===n.size&&this.map.delete(e))},e.prototype.forEach=function(e,t){var n=this.map.get(e);n&&n.forEach(t)},e}()},bfe0:function(e,t,n){"use strict";n.r(t),n.d(t,"EditorActionCommandEntry",function(){return f}),n.d(t,"QuickCommandAction",function(){return g});var i=n("3742"),o=n("0f70"),r=n("fdcc"),s=n("7e93"),a=n("469c"),u=n("b2cc"),l=n("c101"),c=n("af33"),d=n("6dec"),h=n("03d9"),p=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),f=function(e){function t(t,n,i,o,r){var s=e.call(this)||this;return s.key=t,s.keyAriaLabel=n,s.setHighlights(i),s.action=o,s.editor=r,s}return p(t,e),t.prototype.getLabel=function(){return this.action.label},t.prototype.getAriaLabel=function(){return this.keyAriaLabel?i["r"](h["d"].ariaLabelEntryWithKey,this.getLabel(),this.keyAriaLabel):i["r"](h["d"].ariaLabelEntry,this.getLabel())},t.prototype.getGroupLabel=function(){return this.key},t.prototype.run=function(e,t){var n=this;return 1===e&&(setTimeout(function(){n.editor.focus();try{var e=n.action.run()||Promise.resolve();e.then(void 0,r["e"])}catch(t){Object(r["e"])(t)}},50),!0)},t}(a["b"]),g=function(e){function t(){return e.call(this,h["d"].quickCommandActionInput,{id:"editor.action.quickCommand",label:h["d"].quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:l["a"].focus,primary:o["j"]?571:59,weight:100},menuOpts:{group:"z_commands",order:1}})||this}return p(t,e),t.prototype.run=function(e,t){var n=this,i=e.get(d["a"]);this._show(this.getController(t),{getModel:function(e){return new a["c"](n._editorActionsToEntries(i,t,e))},getAutoFocus:function(e){return{autoFocusFirstEntry:!0,autoFocusPrefixMatch:e}}})},t.prototype._sort=function(e,t){var n=(e.getLabel()||"").toLowerCase(),i=(t.getLabel()||"").toLowerCase();return n.localeCompare(i)},t.prototype._editorActionsToEntries=function(e,t,n){for(var i=t.getSupportedActions(),o=[],r=0,a=i;r1){var y=o["a"].visibleColumnFromColumn(_,b+1,d);if(y%h!==0&&t.isCheapToTokenize(v-1)){var w=a["a"].getRawEnterActionAtPosition(t,v-1,t.getLineMaxColumn(v-1));if(w){if(m=g,w.appendText)for(var C=0,S=w.appendText.length;C0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){case n:u=(i-o)/d+(i1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},e.toRGBA=function(t){var n,i,r,s=t.h/360,a=t.s,u=t.l,l=t.a;if(0===a)n=i=r=u;else{var c=u<.5?u*(1+a):u+a-u*a,d=2*u-c;n=e._hue2rgb(d,c,s+1/3),i=e._hue2rgb(d,c,s),r=e._hue2rgb(d,c,s-1/3)}return new o(Math.round(255*n),Math.round(255*i),Math.round(255*r),l)},e}(),s=function(){function e(e,t,n,o){this.h=0|Math.max(Math.min(360,e),0),this.s=i(Math.max(Math.min(1,t),0),3),this.v=i(Math.max(Math.min(1,n),0),3),this.a=i(Math.max(Math.min(1,o),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a},e.fromRGBA=function(t){var n,i=t.r/255,o=t.g/255,r=t.b/255,s=Math.max(i,o,r),a=Math.min(i,o,r),u=s-a,l=0===s?0:u/s;return n=0===u?0:s===i?((o-r)/u%6+6)%6:s===o?(r-i)/u+2:(i-o)/u+4,new e(Math.round(60*n),l,s,t.a)},e.toRGBA=function(e){var t=e.h,n=e.s,i=e.v,r=e.a,s=i*n,a=s*(1-Math.abs(t/60%2-1)),u=i-s,l=[0,0,0],c=l[0],d=l[1],h=l[2];return t<60?(c=s,d=a):t<120?(c=a,d=s):t<180?(d=s,h=a):t<240?(d=a,h=s):t<300?(c=a,h=s):t<360&&(c=s,h=a),c=Math.round(255*(c+u)),d=Math.round(255*(d+u)),h=Math.round(255*(h+u)),new o(c,d,h,r)},e}(),a=function(){function e(e){if(!e)throw new Error("Color needs a value");if(e instanceof o)this.rgba=e;else if(e instanceof r)this._hsla=e,this.rgba=r.toRGBA(e);else{if(!(e instanceof s))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=s.toRGBA(e)}}return e.fromHex=function(t){return e.Format.CSS.parseHex(t)||e.red},Object.defineProperty(e.prototype,"hsla",{get:function(){return this._hsla?this._hsla:r.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hsva",{get:function(){return this._hsva?this._hsva:s.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){return!!e&&o.equals(this.rgba,e.rgba)&&r.equals(this.hsla,e.hsla)&&s.equals(this.hsva,e.hsva)},e.prototype.getRelativeLuminance=function(){var t=e._relativeLuminanceForComponent(this.rgba.r),n=e._relativeLuminanceForComponent(this.rgba.g),o=e._relativeLuminanceForComponent(this.rgba.b),r=.2126*t+.7152*n+.0722*o;return i(r,4)},e._relativeLuminanceForComponent=function(e){var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},e.prototype.isLighter=function(){var e=(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3;return e>=128},e.prototype.isLighterThan=function(e){var t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t>n},e.prototype.isDarkerThan=function(e){var t=this.getRelativeLuminance(),n=e.getRelativeLuminance();return t/?";function o(e){void 0===e&&(e="");for(var t="(-?\\d*\\.\\d\\w*)|([^",n=0,o=i;n=0||(t+="\\"+r)}return t+="\\s]+)",new RegExp(t,"g")}var r=o();function s(e){var t=r;if(e&&e instanceof RegExp)if(e.global)t=e;else{var n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}function a(e,t,n,i){var o,r=e-1-i,s=n.lastIndexOf(" ",r-1)+1;t.lastIndex=s;while(o=t.exec(n)){var a=o.index||0;if(a<=r&&t.lastIndex>=r)return{word:o[0],startColumn:i+1+a,endColumn:i+1+t.lastIndex}}return null}function u(e,t,n,i){var o,r=e-1-i;t.lastIndex=0;while(o=t.exec(n)){var s=o.index||0;if(s>r)return null;if(t.lastIndex>=r)return{word:o[0],startColumn:i+1+s,endColumn:i+1+t.lastIndex}}return null}function l(e,t,n,i){t.lastIndex=0;var o=t.exec(n);if(!o)return null;var r=o[0].indexOf(" ")>=0?u(e,t,n,i):a(e,t,n,i);return t.lastIndex=0,r}},d379:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n("aa3d"),o=n("5717"),r=n("9c1d"),s=n("9e74"),a=n("4fc3"),u=n("0a0f"),l=n("b0cd"),c=n("b7d0"),d=n("4779"),h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},f=function(e,t){return function(n,i){t(n,i,e)}},g=function(e){function t(t,n,i,o,r,s,a,u,l,c){var d=e.call(this,t,i.getRawConfiguration(),{},o,r,s,a,u,l,c)||this;return d._parentEditor=i,d._overwriteOptions=n,e.prototype.updateOptions.call(d,d._overwriteOptions),d._register(i.onDidChangeConfiguration(function(e){return d._onParentConfigurationChanged(e)})),d}return h(t,e),t.prototype.getParentEditor=function(){return this._parentEditor},t.prototype._onParentConfigurationChanged=function(t){e.prototype.updateOptions.call(this,this._parentEditor.getRawConfiguration()),e.prototype.updateOptions.call(this,this._overwriteOptions)},t.prototype.updateOptions=function(t){i["g"](this._overwriteOptions,t,!0),e.prototype.updateOptions.call(this,this._overwriteOptions)},t=p([f(3,u["a"]),f(4,o["a"]),f(5,s["b"]),f(6,a["c"]),f(7,c["c"]),f(8,l["a"]),f(9,d["b"])],t),t}(r["a"])},d3d7:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r});var i=n("0a0f"),o=Object(i["c"])("logService"),r=function(){function e(){}return e.prototype.trace=function(e){for(var t=[],n=1;nthis._limit&&this._initialize(e.slice(e.length-this._limit))},e.prototype._initialize=function(e){this._history=new Set;for(var t=0,n=e;t=0;o--){var r=e.charCodeAt(o),s=t.get(r);if(0===s){if(2===i)return this._createWord(e,i,s,o+1,this._findEndOfWord(e,t,i,o+1));i=1}else if(2===s){if(1===i)return this._createWord(e,i,s,o+1,this._findEndOfWord(e,t,i,o+1));i=2}else if(1===s&&0!==i)return this._createWord(e,i,s,o+1,this._findEndOfWord(e,t,i,o+1))}return 0!==i?this._createWord(e,i,1,0,this._findEndOfWord(e,t,i,0)):null},e._findEndOfWord=function(e,t,n,i){for(var o=e.length,r=i;r=0;o--){var r=e.charCodeAt(o),s=t.get(r);if(1===s)return o+1;if(1===n&&2===s)return o+1;if(2===n&&0===s)return o+1}return 0},e.moveWordLeft=function(t,n,i,o){var r=i.lineNumber,a=i.column,u=!1;1===a&&r>1&&(u=!0,r-=1,a=n.getLineMaxColumn(r));var l=e._findPreviousWordOnLine(t,n,new s["a"](r,a));if(0===o){if(l&&!u){var c=n.getLineLastNonWhitespaceColumn(r);if(c1?new s["a"](n-1,e.getLineMaxColumn(n-1)):t;for(var r=e.getLineContent(n),a=t.column-1;a>1;a--){var u=r.charCodeAt(a-2),l=r.charCodeAt(a-1);if(95!==u&&95===l)return new s["a"](n,a);if(i["y"](u)&&i["z"](l))return new s["a"](n,a);if(i["z"](u)&&i["z"](l)&&a+1=l.start+1&&(l=e._findNextWordOnLine(t,n,new s["a"](r,l.end+1))),a=l?l.start+1:n.getLineMaxColumn(r);return new s["a"](r,a)},e._moveWordPartRight=function(e,t){var n=t.lineNumber,o=e.getLineMaxColumn(n);if(t.column===o)return n1?c=1:(l--,c=n.getLineMaxColumn(l)):(h&&c<=h.end+1&&(h=e._findPreviousWordOnLine(t,n,new s["a"](l,h.start+1))),h?c=h.end+1:c>1?c=1:(l--,c=n.getLineMaxColumn(l))),new a["a"](l,c,u.lineNumber,u.column)},e._deleteWordPartLeft=function(t,n){if(!n.isEmpty())return n;var i=n.getPosition(),o=e._moveWordPartLeft(t,i);return new a["a"](i.lineNumber,i.column,o.lineNumber,o.column)},e._findFirstNonWhitespaceChar=function(e,t){for(var n=e.length,i=t;i=f.start+1&&(f=e._findNextWordOnLine(t,n,new s["a"](l,f.end+1))),f?c=f.start+1:co,d=i>r,h=ir)continue;if(bi)continue;if(_1&&o--,e.columnSelect(t,n,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,o)},e.columnSelectRight=function(e,t,n){for(var i=0,o=Math.min(n.fromViewLineNumber,n.toViewLineNumber),r=Math.max(n.fromViewLineNumber,n.toViewLineNumber),s=o;s<=r;s++){var l=t.getLineMaxColumn(s),c=a["a"].visibleColumnFromColumn2(e,t,new u["a"](s,l));i=Math.max(i,c)}var d=n.toViewVisualColumn;return d1)for(var r=n.modelState?n.modelState.position:null,s=n.viewState?n.viewState.position:null,a=0,u=o.length;ao&&(i=o);var r=new l["a"](i,1,i,e.context.model.getLineMaxColumn(i)),s=0;if(n.at)switch(n.at){case _.RawAtArgument.Top:s=3;break;case _.RawAtArgument.Center:s=1;break;case _.RawAtArgument.Bottom:s=4;break;default:break}var a=e.context.convertModelRangeToViewRange(r);e.revealRange(!1,a,s,0)},t}(S))),e.SelectAll=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"selectAll",precondition:void 0})||this}return w(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[h["b"].selectAll(e.context,e.getPrimaryCursor())])},t}(S))),e.SetSelection=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"setSelection",precondition:void 0})||this}return w(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[a["d"].fromModelSelection(t.selection)])},t}(S)))}(b||(b={})),function(e){var t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.runEditorCommand=function(e,t,n){var i=t._getCursors();i&&this.runCoreEditingCommand(t,i,n||{})},t}(r["c"]);e.CoreEditingCommand=t,e.LineBreakInsert=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"lineBreakInsert",precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:g["a"].textInputFocus,primary:0,mac:{primary:301}}})||this}return w(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,p["a"].lineBreakInsert(t.context.config,t.context.model,t.getAll().map(function(e){return e.modelState.selection})))},t}(t))),e.Outdent=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"outdent",precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:m["a"].and(g["a"].editorTextFocus,g["a"].tabDoesNotMoveFocus),primary:1026}})||this}return w(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,p["a"].outdent(t.context.config,t.context.model,t.getAll().map(function(e){return e.modelState.selection}))),e.pushUndoStop()},t}(t))),e.Tab=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"tab",precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:m["a"].and(g["a"].editorTextFocus,g["a"].tabDoesNotMoveFocus),primary:2}})||this}return w(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,p["a"].tab(t.context.config,t.context.model,t.getAll().map(function(e){return e.modelState.selection}))),e.pushUndoStop()},t}(t))),e.DeleteLeft=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"deleteLeft",precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:g["a"].textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})||this}return w(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var i=d["a"].deleteLeft(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map(function(e){return e.modelState.selection})),o=i[0],r=i[1];o&&e.pushUndoStop(),e.executeCommands(this.id,r),t.setPrevEditOperationType(2)},t}(t))),e.DeleteRight=Object(r["g"])(new(function(e){function t(){return e.call(this,{id:"deleteRight",precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:g["a"].textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})||this}return w(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var i=d["a"].deleteRight(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map(function(e){return e.modelState.selection})),o=i[0],r=i[1];o&&e.pushUndoStop(),e.executeCommands(this.id,r),t.setPrevEditOperationType(3)},t}(t)))}(y||(y={}));var O=function(e){function t(t){var n=e.call(this,t)||this;return n._editorHandler=t.editorHandler,n._inputHandler=t.inputHandler,n}return w(t,e),t.prototype.runCommand=function(e,t){var n=e.get(s["a"]).getFocusedCodeEditor();if(n&&n.hasTextFocus())return this._runEditorHandler(e,n,t);var i=document.activeElement;if(!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)){var o=e.get(s["a"]).getActiveCodeEditor();return o?(o.focus(),this._runEditorHandler(e,o,t)):void 0}document.execCommand(this._inputHandler)},t.prototype._runEditorHandler=function(e,t,n){var i=this._editorHandler;"string"===typeof i?t.trigger("keyboard",i,n):(n=n||{},n.source="keyboard",i.runEditorCommand(e,t,n))},t}(r["a"]),x=function(e){function t(t,n,i){var o=e.call(this,{id:t,precondition:void 0,description:i})||this;return o._handlerId=n,o}return w(t,e),t.prototype.runCommand=function(e,t){var n=e.get(s["a"]).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)},t}(r["a"]);function N(e,t){L(new x("default:"+e,e)),L(new x(e,e,t))}L(new O({editorHandler:b.SelectAll,inputHandler:"selectAll",id:"editor.action.selectAll",precondition:g["a"].textInputFocus,kbOpts:{weight:C,kbExpr:null,primary:2079},menubarOpts:{menuId:22,group:"1_basic",title:i["a"]({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1}})),L(new O({editorHandler:f["b"].Undo,inputHandler:"undo",id:f["b"].Undo,precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:g["a"].textInputFocus,primary:2104},menubarOpts:{menuId:14,group:"1_do",title:i["a"]({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1}})),L(new x("default:"+f["b"].Undo,f["b"].Undo)),L(new O({editorHandler:f["b"].Redo,inputHandler:"redo",id:f["b"].Redo,precondition:g["a"].writable,kbOpts:{weight:C,kbExpr:g["a"].textInputFocus,primary:2103,secondary:[3128],mac:{primary:3128}},menubarOpts:{menuId:14,group:"1_do",title:i["a"]({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2}})),L(new x("default:"+f["b"].Redo,f["b"].Redo)),N(f["b"].Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),N(f["b"].ReplacePreviousChar),N(f["b"].CompositionStart),N(f["b"].CompositionEnd),N(f["b"].Paste),N(f["b"].Cut)},d741:function(e,t,n){"use strict";n.r(t);var i=n("e8e3"),o=n("2504"),r=n("b2cc"),s=n("7061"),a=n("6a89"),u=n("8025"),l=n("c101"),c=n("b707"),d=n("dff7"),h=n("a666"),p=n("3742"),f=function(){function e(){}return e.prototype.provideSelectionRanges=function(e,t){for(var n=[],i=0,o=t;i=0;u--){var d=o.charCodeAt(u);if(95===d||45===d)break;if(Object(p["y"])(d)&&Object(p["z"])(c))break;c=d}for(u+=1;l0&&0===t.getLineFirstNonWhitespaceColumn(n.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(n.lineNumber)&&e.push({range:new a["a"](n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})},e}(),g=n("67b4"),m=n("9e74"),v=n("fdcc");n.d(t,"provideSelectionRanges",function(){return x});var _=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},y=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=this.ranges.length)return this;var i=new e(n,this.ranges);return i.ranges[n].equalsRange(this.ranges[this.index])?i.mov(t):i},e}(),C=function(){function e(e){this._ignoreSelection=!1,this._editor=e}return e.get=function(t){return t.getContribution(e._id)},e.prototype.dispose=function(){Object(h["f"])(this._selectionListener)},e.prototype.getId=function(){return e._id},e.prototype.run=function(e){var t=this;if(this._editor.hasModel()){var n=this._editor.getSelections(),r=this._editor.getModel();if(c["u"].has(r)){var s=Promise.resolve(void 0);return this._state||(s=x(r,n.map(function(e){return e.getPosition()}),o["a"].None).then(function(e){if(i["n"](e)&&e.length===n.length&&t._editor.hasModel()&&i["g"](t._editor.getSelections(),n,function(e,t){return e.equalsSelection(t)})){for(var o=function(t){e[t]=e[t].filter(function(e){return e.containsPosition(n[t].getStartPosition())&&e.containsPosition(n[t].getEndPosition())}),e[t].unshift(n[t])},r=0;r0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},T=function(e,t){return function(n,i){t(n,i,e)}},P=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},R=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}var a=function(){function e(){this._onDidChangeSchema=new o["a"],this.schemasById={}}return e.prototype.registerSchema=function(e,t){this.schemasById[s(e)]=t,this._onDidChangeSchema.fire(e)},e.prototype.notifySchemaChanged=function(e){this._onDidChangeSchema.fire(e)},e}(),u=new a;i["a"].add(r.JSONContribution,u)},dde9:function(e,t,n){},dea0:function(e,t,n){"use strict";var i,o=n("11f7"),r=n("31df"),s=n("fdcc"),a=n("78bc"),u=n("9c3e");(function(e){var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:v,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:v,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:v,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||C.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=h(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d{1,9}\.)/,t.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,t.item=h(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=h(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=//,t.html=h(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=h(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=h(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=_({},t),t.gfm=_({},t.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=h(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=_({},t.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),t.pedantic=_({},t.normal,{html:h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){var i=new n(t);return i.lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var i,o,r,s,a,u,l,c,d,h,p,f,g,m,v,_;e=e.replace(/^ +$/gm,"");while(e)if((r=this.rules.newline.exec(e))&&(e=e.substring(r[0].length),r[0].length>1&&this.tokens.push({type:"space"})),r=this.rules.code.exec(e))e=e.substring(r[0].length),r=r[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?r:y(r,"\n")});else if(r=this.rules.fences.exec(e))e=e.substring(r[0].length),this.tokens.push({type:"code",lang:r[2]?r[2].trim():r[2],text:r[3]||""});else if(r=this.rules.heading.exec(e))e=e.substring(r[0].length),this.tokens.push({type:"heading",depth:r[1].length,text:r[2]});else if((r=this.rules.nptable.exec(e))&&(u={type:"table",header:b(r[1].replace(/^ *| *\| *$/g,"")),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3]?r[3].replace(/\n$/,"").split("\n"):[]},u.header.length===u.align.length)){for(e=e.substring(r[0].length),p=0;p ?/gm,""),this.token(r,n),this.tokens.push({type:"blockquote_end"});else if(r=this.rules.list.exec(e)){for(e=e.substring(r[0].length),s=r[2],m=s.length>1,l={type:"list_start",ordered:m,start:m?+s:"",loose:!1},this.tokens.push(l),r=r[0].match(this.rules.item),c=[],i=!1,g=r.length,p=0;p1?1===a.length:a.length>1||this.options.smartLists&&a!==s)&&(e=r.slice(p+1).join("\n")+e,p=g-1)),o=i||/\n\n(?!\s*$)/.test(u),p!==g-1&&(i="\n"===u.charAt(u.length-1),o||(o=i)),o&&(l.loose=!0),v=/^\[[ xX]\] /.test(u),_=void 0,v&&(_=" "!==u[1],u=u.replace(/^\[[ xX]\] +/,"")),d={type:"list_item_start",task:v,checked:_,loose:o},c.push(d),this.tokens.push(d),this.token(u,!1),this.tokens.push({type:"list_item_end"});if(l.loose)for(g=c.length,p=0;p?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:v,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:v,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~",o.em=h(o.em).replace(/punctuation/g,o._punctuation).getRegex(),o._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,o._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,o._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,o.autolink=h(o.autolink).replace("scheme",o._scheme).replace("email",o._email).getRegex(),o._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,o.tag=h(o.tag).replace("comment",t._comment).replace("attribute",o._attribute).getRegex(),o._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,o._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,o._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,o.link=h(o.link).replace("label",o._label).replace("href",o._href).replace("title",o._title).getRegex(),o.reflink=h(o.reflink).replace("label",o._label).getRegex(),o.normal=_({},o),o.pedantic=_({},o.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",o._label).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",o._label).getRegex()}),o.gfm=_({},o.normal,{escape:h(o.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(s[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.inRawBlock=!1),e=e.substring(s[0].length),u+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0];else if(s=this.rules.link.exec(e)){var l=w(s[2],"()");if(l>-1){var d=s[0].length-(s[2].length-l)-(s[3]||"").length;s[2]=s[2].substring(0,l),s[0]=s[0].substring(0,d).trim(),s[3]=""}e=e.substring(s[0].length),this.inLink=!0,i=s[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i),t?(i=t[1],o=t[3]):o=""):o=s[3]?s[3].slice(1,-1):"",i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),u+=this.outputLink(s,{href:r.escapes(i),title:r.escapes(o)}),this.inLink=!1}else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){u+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,u+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),u+=this.renderer.strong(this.output(s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),u+=this.renderer.em(this.output(s[6]||s[5]||s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),u+=this.renderer.codespan(c(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),u+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),u+=this.renderer.del(this.output(s[1]));else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),"@"===s[2]?(n=c(this.mangle(s[1])),i="mailto:"+n):(n=c(s[1]),i=n),u+=this.renderer.link(i,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.inRawBlock?u+=this.renderer.text(s[0]):u+=this.renderer.text(c(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===s[2])n=c(s[0]),i="mailto:"+n;else{do{a=s[0],s[0]=this.rules._backpedal.exec(s[0])[0]}while(a!==s[0]);n=c(s[0]),i="www."===s[1]?"http://"+n:n}e=e.substring(s[0].length),u+=this.renderer.link(i,null,n)}return u},r.escapes=function(e){return e?e.replace(r.rules._escapes,"$1"):e},r.prototype.outputLink=function(e,t){var n=t.href,i=t.title?c(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,i,this.output(e[1])):this.renderer.image(n,i,c(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",i=e.length,o=0;o.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},s.prototype.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,i);null!=o&&o!==e&&(n=!0,e=o)}return i?'
'+(n?e:c(e,!0))+"
\n":"
"+(n?e:c(e,!0))+"
"},s.prototype.blockquote=function(e){return"
\n"+e+"
\n"},s.prototype.html=function(e){return e},s.prototype.heading=function(e,t,n,i){return this.options.headerIds?"'+e+"\n":""+e+"\n"},s.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},s.prototype.list=function(e,t,n){var i=t?"ol":"ul",o=t&&1!==n?' start="'+n+'"':"";return"<"+i+o+">\n"+e+"\n"},s.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},s.prototype.checkbox=function(e){return" "},s.prototype.paragraph=function(e){return"

    "+e+"

    \n"},s.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},s.prototype.tablerow=function(e){return"\n"+e+"\n"},s.prototype.tablecell=function(e,t){var n=t.header?"th":"td",i=t.align?"<"+n+' align="'+t.align+'">':"<"+n+">";return i+e+"\n"},s.prototype.strong=function(e){return""+e+""},s.prototype.em=function(e){return""+e+""},s.prototype.codespan=function(e){return""+e+""},s.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},s.prototype.del=function(e){return""+e+""},s.prototype.link=function(e,t,n){if(e=p(this.options.sanitize,this.options.baseUrl,e),null===e)return n;var i='",i},s.prototype.image=function(e,t,n){if(e=p(this.options.sanitize,this.options.baseUrl,e),null===e)return n;var i=''+n+'":">",i},s.prototype.text=function(e){return e},a.prototype.strong=a.prototype.em=a.prototype.codespan=a.prototype.del=a.prototype.text=function(e){return e},a.prototype.link=a.prototype.image=function(e,t,n){return""+n},a.prototype.br=function(){return""},u.parse=function(e,t){var n=new u(t);return n.parse(e)},u.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.inlineText=new r(e.links,_({},this.options,{renderer:new a})),this.tokens=e.reverse();var t="";while(this.next())t+=this.tok();return t},u.prototype.next=function(){return this.token=this.tokens.pop()},u.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},u.prototype.parseText=function(){var e=this.token.text;while("text"===this.peek().type)e+="\n"+this.next().text;return this.inline.output(e)},u.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,d(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,i,o="",r="";for(n="",e=0;e?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},c.escapeTest=/[&<>"']/,c.escapeReplace=/[&<>"']/g,c.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},c.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,c.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var g={},m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(){}function _(e){for(var t,n,i=1;i=0&&"\\"===n[o])i=!i;return i?"|":" |"}),i=n.split(/ \|/),o=0;if(i.length>t)i.splice(t);else while(i.lengthAn error occurred:

    "+c(d.message+"",!0)+"
    ";throw d}}v.exec=v,C.options=C.setOptions=function(e){return _(C.defaults,e),C},C.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new s,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},C.defaults=C.getDefaults(),C.Parser=u,C.parser=u.parse,C.Renderer=s,C.TextRenderer=a,C.Lexer=n,C.lexer=n.lex,C.InlineLexer=r,C.inlineLexer=r.output,C.Slugger=l,C.parse=C,i=C}).call(void 0);i.Parser,i.parser;var l,c=i.Renderer,d=(i.TextRenderer,i.Lexer,i.lexer,i.InlineLexer,i.inlineLexer,i.parse);let h;(function(){function e(t,n,i){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof l&&l;if(!a&&u)return l(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[s]={exports:{}};t[s][0].call(d.exports,function(e){var n=t[s][1][e];return o(n||e)},d,d.exports,e,t,n,i)}return n[s].exports}for(var r="function"==typeof l&&l,s=0;s\s]+))?)*)\s*(\/?)\s*>/,a=/^<\s*\/\s*([\w:-]+)[^>]*>/,u=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,l=/^=0&&(t.comment&&t.comment(e.substring(4,i)),e=e.substring(i+3),n=!1)}function _(){if(n){var i,o=e.indexOf("<");o>=0?(i=e.substring(0,o),e=e.substring(o)):(i=e,e=""),t.chars&&t.chars(i)}}function b(e,n,s,a){var l={},c=o(n),d=r.voids[c]||!!a;function p(e,t,n,o,r){l[t]=void 0===n&&void 0===o&&void 0===r?void 0:i.decode(n||o||r||"")}s.replace(u,p),d||h.push(c),t.start&&t.start(c,l,d)}function y(e,n){var i,r=0,s=o(n);if(s)for(r=h.length-1;r>=0;r--)if(h[r]===s)break;if(r>=0){for(i=h.length-1;i>=r;i--)t.end&&t.end(h[i]);h.length=r}}y()}t.exports=h},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],8:[function(e,t,n){var i=e("he"),o=e("./lowercase"),r=e("./attributes"),s=e("./elements");function a(e,t){var n,a=t||{};return g(),{start:l,end:c,chars:h};function u(t){e.push(t)}function l(e,t,s){var l=o(e);function c(e){var n,s=t[e],c=(a.allowedClasses||{})[l]||[],h=(a.allowedAttributes||{})[l]||[];h=h.concat((a.allowedAttributes||{})["*"]||[]);var p=o(e);function f(e){return c&&-1!==c.indexOf(e)}"class"===p&&-1===h.indexOf(p)?(s=s.split(" ").filter(f).join(" ").trim(),n=s.length):n=-1!==h.indexOf(p)&&(!0!==r.uris[p]||d(s)),n&&(u(" "),u(e),"string"===typeof s&&(u('="'),u(i.encode(s)),u('"')))}n.ignoring?p(l):-1!==(a.allowedTags||[]).indexOf(l)&&(!a.filter||a.filter({tag:l,attrs:t}))?(u("<"),u(l),Object.keys(t).forEach(c),u(s?"/>":">")):p(l)}function c(e){var t=o(e),i=-1!==(a.allowedTags||[]).indexOf(t);i&&!1===n.ignoring?(u("")):f(t)}function d(e){var t=e[0];if("#"===t||"/"===t)return!0;var n=e.indexOf(":");if(-1===n)return!0;var i=e.indexOf("?");if(-1!==i&&n>i)return!0;var o=e.indexOf("#");return-1!==o&&n>o||a.allowedSchemes.some(r);function r(t){return 0===e.indexOf(t+":")}}function h(e){!1===n.ignoring&&u(a.transformText?a.transformText(e):e)}function p(e){s.voids[e]||(!1===n.ignoring?n={ignoring:e,depth:1}:n.ignoring===e&&n.depth++)}function f(e){n.ignoring===e&&--n.depth<=0&&g()}function g(){n={ignoring:!1,depth:0}}}t.exports=a},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],9:[function(e,t,n){var i={"&":"&","<":"<",">":">",'"':""","'":"'"},o={"&":"&","<":"<",">":">",""":'"',"'":"'"},r=/(&|<|>|"|')/g,s=/[&<>"']/g;function a(e){return i[e]}function u(e){return o[e]}function l(e){return null==e?"":String(e).replace(s,a)}function c(e){return null==e?"":String(e).replace(r,u)}l.options=c.options={},t.exports={encode:l,escape:l,decode:c,unescape:c,version:"1.0.0-browser"}},{}],10:[function(e,t,n){function i(e){return e.reduce(o,{})}function o(e,t){return e[t]=!0,e}t.exports=i},{}]},{},[4]);var p=h,f=n("438a"),g=n("aa3d"),m=n("3742"),v=n("6d8e");function _(e,t){void 0===t&&(t={});var n,i=Object(r["a"])(t),l=function(t){var n;try{n=Object(f["a"])(decodeURIComponent(t))}catch(i){}return n?(n=Object(g["b"])(n,function(t){return e.uris&&e.uris[t]?v["a"].revive(e.uris[t]):void 0}),encodeURIComponent(JSON.stringify(n))):t},h=function(t,n){var i=e.uris&&e.uris[t];if(!i)return t;var r=v["a"].revive(i);return n&&(r=o["o"](r)),r.query&&(r=r.with({query:l(r.query)})),i&&(t=r.toString(!0)),t},_=new Promise(function(e){return n=e}),b=new c;b.image=function(e,t,n){var i,o=[],r=[];return e&&(i=Object(a["d"])(e),e=i.href,o=i.dimensions,e=h(e,!0),r.push('src="'+e+'"')),n&&r.push('alt="'+n+'"'),t&&r.push('title="'+t+'"'),o.length&&(r=r.concat(o)),""},b.link=function(t,n,i){return t===i&&(i=Object(a["e"])(i)),t=h(t,!1),n=Object(a["e"])(n),t=Object(a["e"])(t),!t||t.match(/^data:|javascript:/i)||t.match(/^command:/i)&&!e.isTrusted||t.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)?i:(t=t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),'
    '+i+"")},b.paragraph=function(e){return"

    "+e+"

    "},t.codeBlockRenderer&&(b.code=function(e,n){var o=t.codeBlockRenderer(n,e),r=u["b"].nextId(),s=Promise.all([o,_]).then(function(e){var t=e[0],n=i.querySelector('div[data-code="'+r+'"]');n&&(n.innerHTML=t)}).catch(function(e){});return t.codeBlockRenderCallback&&s.then(t.codeBlockRenderCallback),'
    '+Object(m["o"])(e)+"
    "});var y=t.actionHandler;y&&y.disposeables.add(o["k"](i,"click",function(e){var t=e.target;if("A"===t.tagName||(t=t.parentElement,t&&"A"===t.tagName))try{var n=t.dataset["href"];n&&y.callback(n,e)}catch(i){Object(s["e"])(i)}finally{e.preventDefault()}}));var w={sanitize:!0,renderer:b},C=["http","https","mailto","data"];e.isTrusted&&C.push("command");var S=d(e.value,w);return i.innerHTML=p(S,{allowedSchemes:C,allowedAttributes:{a:["href","name","target","data-href"],iframe:["allowfullscreen","frameborder","src"],img:["src","title","alt","width","height"],div:["class","data-code"]}}),n(),i}var b=n("5bd7"),y=n("5818"),w=n("4d05"),C=n("0a0f"),S=n("308f"),L=n("a666"),O=n("b707");n.d(t,"a",function(){return k});var x=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),N=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},D=function(e,t){return function(n,i){t(n,i,e)}},k=function(e){function t(t,n,i){void 0===i&&(i=b["b"]);var o=e.call(this)||this;return o._editor=t,o._modeService=n,o._openerService=i,o._onDidRenderCodeBlock=o._register(new S["a"]),o.onDidRenderCodeBlock=o._onDidRenderCodeBlock.event,o}return x(t,e),t.prototype.getOptions=function(e){var t=this;return{codeBlockRenderer:function(e,n){var i=null;if(e)i=t._modeService.getModeIdForLanguageName(e);else{var o=t._editor.getModel();o&&(i=o.getLanguageIdentifier().language)}return t._modeService.triggerMode(i||""),Promise.resolve(!0).then(function(e){var t=O["y"].getPromise(i||"");return t?t.then(function(e){return Object(w["b"])(n,e)}):Object(w["b"])(n,void 0)}).then(function(e){return''+e+""})},codeBlockRenderCallback:function(){return t._onDidRenderCodeBlock.fire()},actionHandler:{callback:function(e){var n;try{n=v["a"].parse(e)}catch(i){}n&&t._openerService&&t._openerService.open(n).catch(s["e"])},disposeables:e}}},t.prototype.render=function(e){var t,n=new L["b"];return t=e?_(e,this.getOptions(n)):document.createElement("span"),{element:t,dispose:function(){return n.dispose()}}},t=N([D(1,y["a"]),D(2,Object(C["d"])(b["a"]))],t),t}(L["a"])},debc:function(e,t,n){"use strict";n.d(t,"b",function(){return l}),n.d(t,"a",function(){return c});var i=n("6d8e"),o=n("32b8"),r=n("3742"),s=n("b589"),a=n("30db"),u=n("82c9");function l(e,t,n){if("string"===typeof e&&(e=i["a"].file(e)),n){var r=n.getWorkspaceFolder(e);if(r){var l=n.getWorkspace().folders.length>1,c=void 0;if(c=Object(u["e"])(r.uri,e)?"":Object(u["h"])(r.uri,e),l){var p=r&&r.name?r.name:Object(u["b"])(r.uri);c=c?p+" • "+c:p}return c}}if(e.scheme!==s["b"].file&&e.scheme!==s["b"].untitled)return e.with({query:null,fragment:null}).toString(!0);if(d(e.fsPath))return Object(o["normalize"])(h(e.fsPath));var g=Object(o["normalize"])(e.fsPath);return!a["g"]&&t&&(g=f(g,t.userHome)),g}function c(e){if(e){"string"===typeof e&&(e=i["a"].file(e));var t=Object(u["b"])(e)||(e.scheme===s["b"].file?e.fsPath:e.path);return d(t)?h(t):t}}function d(e){return!(!a["g"]||!e||":"!==e[1])}function h(e){return d(e)?e.charAt(0).toUpperCase()+e.slice(1):e}var p=Object.create(null);function f(e,t){if(a["g"]||!e||!t)return e;var n=p.original===t?p.normalized:void 0;return n||(n=""+Object(r["G"])(t,o["posix"].sep)+o["posix"].sep,p={original:t,normalized:n}),(a["c"]?Object(r["J"])(e,n):Object(r["K"])(e,n))&&(e="~/"+e.substr(n.length)),e}},dff7:function(e,t,n){"use strict";function i(e,t){var n;return n=0===t.length?e:e.replace(/\{(\d+)\}/g,function(e,n){var i=n[0];return"undefined"!==typeof t[i]?t[i]:e}),n}function o(e,t){for(var n=[],o=2;o>>1,this._text=t}return e.prototype.equals=function(t){return t instanceof e&&this.slicedEquals(t,0,this._tokensCount)},e.prototype.slicedEquals=function(e,t,n){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;for(var i=t<<1,o=i+(n<<1),r=i;r0?this._tokens[e-1<<1]:0},e.prototype.getLanguageId=function(e){var t=this._tokens[1+(e<<1)];return i["x"].getLanguageId(t)},e.prototype.getStandardTokenType=function(e){var t=this._tokens[1+(e<<1)];return i["x"].getTokenType(t)},e.prototype.getForeground=function(e){var t=this._tokens[1+(e<<1)];return i["x"].getForeground(t)},e.prototype.getClassName=function(e){var t=this._tokens[1+(e<<1)];return i["x"].getClassNameFromMetadata(t)},e.prototype.getInlineStyle=function(e,t){var n=this._tokens[1+(e<<1)];return i["x"].getInlineStyleFromMetadata(n,t)},e.prototype.getEndOffset=function(e){return this._tokens[e<<1]},e.prototype.findTokenIndexAtOffset=function(t){return e.findIndexInTokensArray(this._tokens,t)},e.prototype.inflate=function(){return this},e.prototype.sliceAndInflate=function(e,t,n){return new r(this,e,t,n)},e.convertToEndOffset=function(e,t){for(var n=e.length>>>1,i=n-1,o=0;o>>1)-1;while(nt&&(i=o)}return n},e}(),r=function(){function e(e,t,n,i){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=i,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(var o=this._firstTokenIndex,r=e.getCount();o=n)break;this._tokensCount++}}return e.prototype.equals=function(t){return t instanceof e&&(this._startOffset===t._startOffset&&this._endOffset===t._endOffset&&this._deltaOffset===t._deltaOffset&&this._source.slicedEquals(t._source,this._firstTokenIndex,this._tokensCount))},e.prototype.getCount=function(){return this._tokensCount},e.prototype.getForeground=function(e){return this._source.getForeground(this._firstTokenIndex+e)},e.prototype.getEndOffset=function(e){var t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset},e.prototype.getClassName=function(e){return this._source.getClassName(this._firstTokenIndex+e)},e.prototype.getInlineStyle=function(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)},e.prototype.findTokenIndexAtOffset=function(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex},e}()},e2b8:function(e,t,n){},e2c2:function(e,t,n){"use strict";n.r(t),n.d(t,"StandaloneReferencesController",function(){return f});var i=n("b2cc"),o=n("5717"),r=n("aa43"),s=n("fbba"),a=n("4fc3"),u=n("0a0f"),l=n("b0cd"),c=n("03e8"),d=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),h=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},p=function(e,t){return function(n,i){t(n,i,e)}},f=function(e){function t(t,n,i,o,r,s,a){return e.call(this,!0,t,n,i,o,r,s,a)||this}return d(t,e),t=h([p(1,a["c"]),p(2,o["a"]),p(3,l["a"]),p(4,u["a"]),p(5,c["a"]),p(6,s["a"])],t),t}(r["a"]);Object(i["h"])(f)},e32d:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r});var i=n("308f"),o=function(e,t,n){var o=function(e){return r.fire(e)},r=new i["a"]({onFirstListenerAdd:function(){e.addEventListener(t,o,n)},onLastListenerRemove:function(){e.removeEventListener(t,o,n)}});return r.event};function r(e){return i["b"].map(e,function(e){return e.preventDefault(),e.stopPropagation(),e})}},e431:function(e,t,n){},e516:function(e,t,n){"use strict";n.r(t),n.d(t,"CursorUndoController",function(){return l}),n.d(t,"CursorUndo",function(){return c});var i=n("dff7"),o=n("a666"),r=n("b2cc"),s=n("c101"),a=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),u=function(){function e(e){this.selections=e}return e.prototype.equals=function(e){var t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(var i=0;i50&&n._undoStack.shift()),n._prevState=n._readState()})),n}return a(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype._readState=function(){return this._editor.hasModel()?new u(this._editor.getSelections()):null},t.prototype.getId=function(){return t.ID},t.prototype.cursorUndo=function(){if(this._editor.hasModel()){var e=new u(this._editor.getSelections());while(this._undoStack.length>0){var t=this._undoStack.pop();if(!t.equals(e))return this._isCursorUndo=!0,this._editor.setSelections(t.selections),this._editor.revealRangeInCenterIfOutsideViewport(t.selections[0],0),void(this._isCursorUndo=!1)}}},t.ID="editor.contrib.cursorUndoController",t}(o["a"]),c=function(e){function t(){return e.call(this,{id:"cursorUndo",label:i["a"]("cursor.undo","Soft Undo"),alias:"Soft Undo",precondition:void 0,kbOpts:{kbExpr:s["a"].textInputFocus,primary:2099,weight:100}})||this}return a(t,e),t.prototype.run=function(e,t,n){l.get(t).cursorUndo()},t}(r["b"]);Object(r["h"])(l),Object(r["f"])(c)},e53c:function(e,t,n){"use strict";n.d(t,"a",function(){return p}),n.d(t,"b",function(){return f});var i=n("0f70"),o=n("11f7"),r=n("5fe7"),s=n("308f"),a=n("a666"),u=n("30db"),l=n("3742"),c=n("0a89"),d=n("8025"),h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p={forceCopyWithSyntaxHighlighting:!1},f=function(e){function t(t,n){var a=e.call(this)||this;a._onFocus=a._register(new s["a"]),a.onFocus=a._onFocus.event,a._onBlur=a._register(new s["a"]),a.onBlur=a._onBlur.event,a._onKeyDown=a._register(new s["a"]),a.onKeyDown=a._onKeyDown.event,a._onKeyUp=a._register(new s["a"]),a.onKeyUp=a._onKeyUp.event,a._onCut=a._register(new s["a"]),a.onCut=a._onCut.event,a._onPaste=a._register(new s["a"]),a.onPaste=a._onPaste.event,a._onType=a._register(new s["a"]),a.onType=a._onType.event,a._onCompositionStart=a._register(new s["a"]),a.onCompositionStart=a._onCompositionStart.event,a._onCompositionUpdate=a._register(new s["a"]),a.onCompositionUpdate=a._onCompositionUpdate.event,a._onCompositionEnd=a._register(new s["a"]),a.onCompositionEnd=a._onCompositionEnd.event,a._onSelectionChangeRequest=a._register(new s["a"]),a.onSelectionChangeRequest=a._onSelectionChangeRequest.event,a._host=t,a._textArea=a._register(new m(n)),a._lastTextAreaEvent=0,a._asyncTriggerCut=a._register(new r["d"](function(){return a._onCut.fire()},0)),a._textAreaState=c["b"].EMPTY,a._selectionChangeListener=null,a.writeScreenReaderContent("ctor"),a._hasFocus=!1,a._isDoingComposition=!1,a._nextCommand=0,a._register(o["k"](n.domNode,"keydown",function(e){!a._isDoingComposition||109!==e.keyCode&&1!==e.keyCode||e.stopPropagation(),e.equals(9)&&e.preventDefault(),a._onKeyDown.fire(e)})),a._register(o["k"](n.domNode,"keyup",function(e){a._onKeyUp.fire(e)})),a._register(o["h"](n.domNode,"compositionstart",function(e){a._lastTextAreaEvent=1,a._isDoingComposition||(a._isDoingComposition=!0,i["g"]||a._setAndWriteTextAreaState("compositionstart",c["b"].EMPTY),a._onCompositionStart.fire())}));var d=function(e,t){var n=a._textAreaState,i=c["b"].readFromTextArea(a._textArea);return[i,c["b"].deduceInput(n,i,e,t)]},h=function(e){var t=a._textAreaState,n=c["b"].selectedText(e),i={text:n.value,replaceCharCnt:t.selectionEnd-t.selectionStart};return[n,i]},p=function(e){return!(!i["g"]||"ja"!==e)||!(!i["j"]||0!==e.indexOf("zh-Han"))};return a._register(o["h"](n.domNode,"compositionupdate",function(e){if(a._lastTextAreaEvent=2,p(e.locale)){var t=d(!1,!1),n=t[0],i=t[1];return a._textAreaState=n,a._onType.fire(i),void a._onCompositionUpdate.fire(e)}var o=h(e.data),r=o[0],s=o[1];a._textAreaState=r,a._onType.fire(s),a._onCompositionUpdate.fire(e)})),a._register(o["h"](n.domNode,"compositionend",function(e){if(a._lastTextAreaEvent=3,p(e.locale)){var t=d(!1,!1),n=t[0],o=t[1];a._textAreaState=n,a._onType.fire(o)}else{var r=h(e.data);n=r[0],o=r[1];a._textAreaState=n,a._onType.fire(o)}(i["g"]||i["e"])&&(a._textAreaState=c["b"].readFromTextArea(a._textArea)),a._isDoingComposition&&(a._isDoingComposition=!1,a._onCompositionEnd.fire())})),a._register(o["h"](n.domNode,"input",function(){var e=8===a._lastTextAreaEvent;if(a._lastTextAreaEvent=4,a._textArea.setIgnoreSelectionChangeTime("received input event"),!a._isDoingComposition){var t=d(u["d"],e&&u["d"]),n=t[0],i=t[1];0===i.replaceCharCnt&&1===i.text.length&&l["w"](i.text.charCodeAt(0))||(a._textAreaState=n,0===a._nextCommand?""!==i.text&&a._onType.fire(i):(""!==i.text&&a._onPaste.fire({text:i.text}),a._nextCommand=0))}})),a._register(o["h"](n.domNode,"cut",function(e){a._lastTextAreaEvent=5,a._textArea.setIgnoreSelectionChangeTime("received cut event"),a._ensureClipboardGetsEditorSelection(e),a._asyncTriggerCut.schedule()})),a._register(o["h"](n.domNode,"copy",function(e){a._lastTextAreaEvent=6,a._ensureClipboardGetsEditorSelection(e)})),a._register(o["h"](n.domNode,"paste",function(e){if(a._lastTextAreaEvent=7,a._textArea.setIgnoreSelectionChangeTime("received paste event"),g.canUseTextData(e)){var t=g.getTextData(e);""!==t&&a._onPaste.fire({text:t})}else a._textArea.getSelectionStart()!==a._textArea.getSelectionEnd()&&a._setAndWriteTextAreaState("paste",c["b"].EMPTY),a._nextCommand=1})),a._register(o["h"](n.domNode,"focus",function(){a._lastTextAreaEvent=8,a._setHasFocus(!0)})),a._register(o["h"](n.domNode,"blur",function(){a._lastTextAreaEvent=9,a._setHasFocus(!1)})),a}return h(t,e),t.prototype._installSelectionChangeListener=function(){var e=this,t=0;return o["h"](document,"selectionchange",function(n){if(e._hasFocus&&!e._isDoingComposition&&i["e"]&&u["g"]){var o=Date.now(),r=o-t;if(t=o,!(r<5)){var s=o-e._textArea.getIgnoreSelectionChangeTime();if(e._textArea.resetSelectionChangeTime(),!(s<100)&&e._textAreaState.selectionStartPosition&&e._textAreaState.selectionEndPosition){var a=e._textArea.getValue();if(e._textAreaState.value===a){var l=e._textArea.getSelectionStart(),c=e._textArea.getSelectionEnd();if(e._textAreaState.selectionStart!==l||e._textAreaState.selectionEnd!==c){var h=e._textAreaState.deduceEditorPosition(l),p=e._host.deduceModelPosition(h[0],h[1],h[2]),f=e._textAreaState.deduceEditorPosition(c),g=e._host.deduceModelPosition(f[0],f[1],f[2]),m=new d["a"](p.lineNumber,p.column,g.lineNumber,g.column);e._onSelectionChangeRequest.fire(m)}}}}}})},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)},t.prototype.focusTextArea=function(){this._setHasFocus(!0)},t.prototype.isFocused=function(){return this._hasFocus},t.prototype._setHasFocus=function(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&(i["f"]?this._setAndWriteTextAreaState("focusgain",c["b"].EMPTY):this.writeScreenReaderContent("focusgain")),this._hasFocus?this._onFocus.fire():this._onBlur.fire())},t.prototype._setAndWriteTextAreaState=function(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t},t.prototype.writeScreenReaderContent=function(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))},t.prototype._ensureClipboardGetsEditorSelection=function(e){var t=this._host.getPlainTextToCopy();if(g.canUseTextData(e)){var n=null;i["d"]()&&(t.length<65536||p.forceCopyWithSyntaxHighlighting)&&(n=this._host.getHTMLToCopy()),g.setTextData(e,t,n)}else this._setAndWriteTextAreaState("copy or cut",c["b"].selectedText(t))},t}(a["a"]),g=function(){function e(){}return e.canUseTextData=function(e){return!!e.clipboardData||!!window.clipboardData},e.getTextData=function(e){if(e.clipboardData)return e.preventDefault(),e.clipboardData.getData("text/plain");if(window.clipboardData)return e.preventDefault(),window.clipboardData.getData("Text");throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")},e.setTextData=function(e,t,n){if(e.clipboardData)return e.clipboardData.setData("text/plain",t),null!==n&&e.clipboardData.setData("text/html",n),void e.preventDefault();if(window.clipboardData)return window.clipboardData.setData("Text",t),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")},e}(),m=function(e){function t(t){var n=e.call(this)||this;return n._actual=t,n._ignoreSelectionChangeTime=0,n}return h(t,e),t.prototype.setIgnoreSelectionChangeTime=function(e){this._ignoreSelectionChangeTime=Date.now()},t.prototype.getIgnoreSelectionChangeTime=function(){return this._ignoreSelectionChangeTime},t.prototype.resetSelectionChangeTime=function(){this._ignoreSelectionChangeTime=0},t.prototype.getValue=function(){return this._actual.domNode.value},t.prototype.setValue=function(e,t){var n=this._actual.domNode;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)},t.prototype.getSelectionStart=function(){return this._actual.domNode.selectionStart},t.prototype.getSelectionEnd=function(){return this._actual.domNode.selectionEnd},t.prototype.setSelectionRange=function(e,t,n){var r=this._actual.domNode,s=document.activeElement===r,a=r.selectionStart,u=r.selectionEnd;if(s&&a===t&&u===n)i["i"]&&window.parent!==window&&r.focus();else{if(s)return this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),void(i["i"]&&window.parent!==window&&r.focus());try{var l=o["O"](r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),o["M"](r,l)}catch(c){}}},t}(a["a"])},e58e:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("30db"),o=i["b"].performance&&"function"===typeof i["b"].performance.now,r=function(){function e(e){this._highResolution=o&&e,this._startTime=this._now(),this._stopTime=-1}return e.create=function(t){return void 0===t&&(t=!0),new e(t)},e.prototype.stop=function(){this._stopTime=this._now()},e.prototype.elapsed=function(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime},e.prototype._now=function(){return this._highResolution?i["b"].performance.now():(new Date).getTime()},e}()},e5aa:function(e,t,n){"use strict";var i=n("11f7"),o=n("5aa5"),r=n("f070"),s=n("ceb8"),a=n("308f"),u=n("aa3d"),l=n("3742"),c=(n("dde9"),n("5717")),d=n("d379"),h=(n("b968"),n("70c3")),p=n("9c3e"),f=n("a666"),g=n("6a89"),m=n("b57f"),v=new s["a"](new s["c"](0,122,204)),_={showArrow:!0,showFrame:!0,className:"",frameColor:v,arrowColor:v,keepEditorSelection:!1},b="vs.editor.contrib.zoneWidget",y=function(){function e(e,t,n,i,o,r){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=i,this._onDomNodeTop=o,this._onComputedHeight=r}return e.prototype.onDomNodeTop=function(e){this._onDomNodeTop(e)},e.prototype.onComputedHeight=function(e){this._onComputedHeight(e)},e}(),w=function(){function e(e,t){this._id=e,this._domNode=t}return e.prototype.getId=function(){return this._id},e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return null},e}(),C=function(){function e(t){this._editor=t,this._ruleName=e._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}return e.prototype.dispose=function(){this.hide(),i["H"](this._ruleName)},Object.defineProperty(e.prototype,"color",{set:function(e){this._color!==e&&(this._color=e,this._updateStyle())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{set:function(e){this._height!==e&&(this._height=e,this._updateStyle())},enumerable:!0,configurable:!0}),e.prototype._updateStyle=function(){i["H"](this._ruleName),i["r"](".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; ")},e.prototype.show=function(e){this._decorations=this._editor.deltaDecorations(this._decorations,[{range:g["a"].fromPositions(e),options:{className:this._ruleName,stickiness:1}}])},e.prototype.hide=function(){this._editor.deltaDecorations(this._decorations,[])},e._IdGenerator=new p["a"](".arrow-decoration-"),e}(),S=function(){function e(e,t){var n=this;void 0===t&&(t={}),this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new f["b"],this.container=null,this._isShowing=!1,this.editor=e,this.options=u["c"](t),u["g"](this.options,_,!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(function(e){var t=n._getWidth(e);n.domNode.style.width=t+"px",n.domNode.style.left=n._getLeft(e)+"px",n._onWidth(t)}))}return e.prototype.dispose=function(){var e=this;this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(function(t){e._viewZone&&t.removeZone(e._viewZone.id),e._viewZone=null}),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()},e.prototype.create=function(){i["f"](this.domNode,"zone-widget"),this.options.className&&i["f"](this.domNode,this.options.className),this.container=document.createElement("div"),i["f"](this.container,"zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new C(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()},e.prototype.style=function(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()},e.prototype._applyStyles=function(){if(this.container&&this.options.frameColor){var e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){var t=this.options.arrowColor.toString();this._arrow.color=t}},e.prototype._getWidth=function(e){return e.width-e.minimapWidth-e.verticalScrollbarWidth},e.prototype._getLeft=function(e){return e.minimapWidth>0&&0===e.minimapLeft?e.minimapWidth:0},e.prototype._onViewZoneTop=function(e){this.domNode.style.top=e+"px"},e.prototype._onViewZoneHeight=function(e){if(this.domNode.style.height=e+"px",this.container){var t=e-this._decoratingElementsHeight();this.container.style.height=t+"px";var n=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(n))}this._resizeSash&&this._resizeSash.layout()},Object.defineProperty(e.prototype,"position",{get:function(){var e=this._positionMarkerId[0];if(e){var t=this.editor.getModel();if(t){var n=t.getDecorationRange(e);if(n)return n.getStartPosition()}}},enumerable:!0,configurable:!0}),e.prototype.show=function(e,t){var n=g["a"].isIRange(e)?e:new g["a"](e.lineNumber,e.column,e.lineNumber,e.column);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:n,options:m["a"].EMPTY}])},e.prototype.hide=function(){var e=this;this._viewZone&&(this.editor.changeViewZones(function(t){e._viewZone&&t.removeZone(e._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()},e.prototype._decoratingElementsHeight=function(){var e=this.editor.getConfiguration().lineHeight,t=0;if(this.options.showArrow){var n=Math.round(e/3);t+=2*n}if(this.options.showFrame){var i=Math.round(e/9);t+=2*i}return t},e.prototype._showImpl=function(e,t){var n=this,i={lineNumber:e.startLineNumber,column:e.startColumn},o=this.editor.getLayoutInfo(),r=this._getWidth(o);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(o)+"px";var s=document.createElement("div");s.style.overflow="hidden";var a=this.editor.getConfiguration().lineHeight,u=this.editor.getLayoutInfo().height/a*.8;t>=u&&(t=u);var l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(function(e){n._viewZone&&e.removeZone(n._viewZone.id),n._overlayWidget&&(n.editor.removeOverlayWidget(n._overlayWidget),n._overlayWidget=null),n.domNode.style.top="-1000px",n._viewZone=new y(s,i.lineNumber,i.column,t,function(e){return n._onViewZoneTop(e)},function(e){return n._onViewZoneHeight(e)}),n._viewZone.id=e.addZone(n._viewZone),n._overlayWidget=new w(b+n._viewZone.id,n.domNode),n.editor.addOverlayWidget(n._overlayWidget)}),this.container&&this.options.showFrame){var d=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=d+"px",this.container.style.borderBottomWidth=d+"px"}var h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,r),this.options.keepEditorSelection||this.editor.setSelection(e);var p=this.editor.getModel();if(p){var f=Math.min(p.getLineCount(),Math.max(1,e.endLineNumber+1));this.revealLine(f)}},e.prototype.revealLine=function(e){this.editor.revealLine(e,0)},e.prototype.setCssClass=function(e,t){this.container&&(t&&this.container.classList.remove(t),i["f"](this.container,e))},e.prototype._onWidth=function(e){},e.prototype._doLayout=function(e,t){},e.prototype._relayout=function(e){var t=this;this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(function(n){t._viewZone&&(t._viewZone.heightInLines=e,n.layoutZone(t._viewZone.id))})},e.prototype._initSash=function(){var e,t=this;this._resizeSash||(this._resizeSash=this._disposables.add(new h["a"](this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.hide(),this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart(function(n){t._viewZone&&(e={startY:n.startY,heightInLines:t._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(function(){e=void 0})),this._disposables.add(this._resizeSash.onDidChange(function(n){if(e){var i=(n.currentY-e.startY)/t.editor.getConfiguration().lineHeight,o=i<0?Math.ceil(i):Math.floor(i),r=e.heightInLines+o;r>5&&r<35&&t._relayout(r)}})))},e.prototype.getHorizontalSashLeft=function(){return 0},e.prototype.getHorizontalSashTop=function(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2},e.prototype.getHorizontalSashWidth=function(){var e=this.editor.getLayoutInfo();return e.width-e.minimapWidth},e}(),L=n("dff7"),O=n("4fc3"),x=n("0a0f"),N=n("f5f3");n.d(t,"a",function(){return I}),n.d(t,"b",function(){return D}),n.d(t,"d",function(){return E}),n.d(t,"c",function(){return T});var D,k=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),I=Object(x["c"])("IPeekViewService");function E(e){var t=e.get(c["a"]).getFocusedCodeEditor();return t instanceof d["a"]?t.getParentEditor():t}Object(N["b"])(I,function(){function e(){this._widgets=new Map}return e.prototype.addExclusiveWidget=function(e,t){var n=this,i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose());var o=function(){var i=n._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),n._widgets.delete(e))};this._widgets.set(e,{widget:t,listener:t.onDidClose(o)})},e}()),function(e){e.inPeekEditor=new O["d"]("inReferenceSearchEditor",!0),e.notInPeekEditor=e.inPeekEditor.toNegated()}(D||(D={}));var M={headerBackgroundColor:s["a"].white,primaryHeadingColor:s["a"].fromHex("#333333"),secondaryHeadingColor:s["a"].fromHex("#6c6c6cb3")},T=function(e){function t(t,n){void 0===n&&(n={});var i=e.call(this,t,n)||this;return i._onDidClose=new a["a"],u["g"](i.options,M,!1),i}return k(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._onDidClose.fire(this)},Object.defineProperty(t.prototype,"onDidClose",{get:function(){return this._onDidClose.event},enumerable:!0,configurable:!0}),t.prototype.style=function(t){var n=this.options;t.headerBackgroundColor&&(n.headerBackgroundColor=t.headerBackgroundColor),t.primaryHeadingColor&&(n.primaryHeadingColor=t.primaryHeadingColor),t.secondaryHeadingColor&&(n.secondaryHeadingColor=t.secondaryHeadingColor),e.prototype.style.call(this,t)},t.prototype._applyStyles=function(){e.prototype._applyStyles.call(this);var t=this.options;this._headElement&&t.headerBackgroundColor&&(this._headElement.style.backgroundColor=t.headerBackgroundColor.toString()),this._primaryHeading&&t.primaryHeadingColor&&(this._primaryHeading.style.color=t.primaryHeadingColor.toString()),this._secondaryHeading&&t.secondaryHeadingColor&&(this._secondaryHeading.style.color=t.secondaryHeadingColor.toString()),this._bodyElement&&t.frameColor&&(this._bodyElement.style.borderColor=t.frameColor.toString())},t.prototype._fillContainer=function(e){this.setCssClass("peekview-widget"),this._headElement=i["a"](".head"),this._bodyElement=i["a"](".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)},t.prototype._fillHead=function(e){var t=this,n=i["a"](".peekview-title");i["m"](this._headElement,n),i["k"](n,"click",function(e){return t._onTitleClick(e)}),this._fillTitleIcon(n),this._primaryHeading=i["a"]("span.filename"),this._secondaryHeading=i["a"]("span.dirname"),this._metaHeading=i["a"]("span.meta"),i["m"](n,this._primaryHeading,this._secondaryHeading,this._metaHeading);var s=i["a"](".peekview-actions");i["m"](this._headElement,s);var a=this._getActionBarOptions();this._actionbarWidget=new o["a"](s,a),this._disposables.add(this._actionbarWidget),this._actionbarWidget.push(new r["a"]("peekview.close",L["a"]("label.close","Close"),"close-peekview-action",!0,function(){return t.dispose(),Promise.resolve()}),{label:!1,icon:!0})},t.prototype._fillTitleIcon=function(e){},t.prototype._getActionBarOptions=function(){return{}},t.prototype._onTitleClick=function(e){},t.prototype.setTitle=function(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerHTML=l["o"](e),this._primaryHeading.setAttribute("aria-label",e),t?this._secondaryHeading.innerHTML=l["o"](t):i["p"](this._secondaryHeading))},t.prototype.setMetaTitle=function(e){this._metaHeading&&(e?this._metaHeading.innerHTML=l["o"](e):i["p"](this._metaHeading))},t.prototype._doLayout=function(e,t){if(!this._isShowing&&e<0)this.dispose();else{var n=Math.ceil(1.2*this.editor.getConfiguration().lineHeight),i=e-(n+2);this._doLayoutHead(n,t),this._doLayoutBody(i,t)}},t.prototype._doLayoutHead=function(e,t){this._headElement&&(this._headElement.style.height=e+"px",this._headElement.style.lineHeight=this._headElement.style.height)},t.prototype._doLayoutBody=function(e,t){this._bodyElement&&(this._bodyElement.style.height=e+"px")},t}(S)},e6ff:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("3170"),o=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=function(e){function t(t){for(var n=e.call(this,0)||this,i=0,o=t.length;i0))return r;o=r-1}}return-(i+1)}function a(e,t){var n=0,i=e.length;if(0===i)return 0;while(ni?e[u]=r[a++]:a>o?e[u]=r[s++]:t(r[a],r[s])<0?e[u]=r[a++]:e[u]=r[s++]}function c(e,t,n,i,o){if(!(i<=n)){var r=n+(i-n)/2|0;c(e,t,n,r,o),c(e,t,r+1,i,o),t(e[r],e[r+1])<=0||l(e,t,n,r,i,o)}}function d(e,t){for(var n=[],i=void 0,o=0,r=u(e.slice(0),t);o0}function g(e,t){if(!t)return e.filter(function(t,n){return e.indexOf(t)===n});var n=Object.create(null);return e.filter(function(e){var i=t(e);return!n[i]&&(n[i]=!0,!0)})}function m(e){var t=new Set;return e.filter(function(e){return!t.has(e)&&(t.add(e),!0)})}function v(e,t){for(var n=0;nt;o--)i.push(o);return i}function w(e,t,n){var i=e.slice(0,t),o=e.slice(t);return i.concat(n,o)}function C(e,t){var n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function S(e,t){var n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function L(e){return Array.isArray(e)?e:[e]}n.d(t,"s",function(){return i}),n.d(t,"t",function(){return o}),n.d(t,"g",function(){return r}),n.d(t,"c",function(){return s}),n.d(t,"h",function(){return a}),n.d(t,"o",function(){return u}),n.d(t,"l",function(){return d}),n.d(t,"d",function(){return h}),n.d(t,"m",function(){return p}),n.d(t,"n",function(){return f}),n.d(t,"e",function(){return g}),n.d(t,"f",function(){return m}),n.d(t,"j",function(){return v}),n.d(t,"i",function(){return _}),n.d(t,"k",function(){return b}),n.d(t,"r",function(){return y}),n.d(t,"a",function(){return w}),n.d(t,"q",function(){return C}),n.d(t,"p",function(){return S}),n.d(t,"b",function(){return L})},ee56:function(e,t,n){"use strict";var i=n("aa3d"),o=n("3742");function r(e){return Object(o["o"])(e)}n.d(t,"a",function(){return s});var s=function(){function e(e,t){this.supportOcticons=t,this.domNode=document.createElement("span"),this.domNode.className="monaco-highlighted-label",this.didEverRender=!1,e.appendChild(this.domNode)}return Object.defineProperty(e.prototype,"element",{get:function(){return this.domNode},enumerable:!0,configurable:!0}),e.prototype.set=function(t,n,o,r){void 0===n&&(n=[]),void 0===o&&(o=""),t||(t=""),r&&(t=e.escapeNewLines(t,n)),this.didEverRender&&this.text===t&&this.title===o&&i["e"](this.highlights,n)||(Array.isArray(n)||(n=[]),this.text=t,this.title=o,this.highlights=n,this.render())},e.prototype.render=function(){for(var e="",t=0,n=0,i=this.highlights;n";var a=this.text.substring(t,s.start);e+=this.supportOcticons?r(a):Object(o["o"])(a),e+="",t=s.end}e+='';var u=this.text.substring(s.start,s.end);e+=this.supportOcticons?r(u):Object(o["o"])(u),e+="",t=s.end}}if(t";u=this.text.substring(t);e+=this.supportOcticons?r(u):Object(o["o"])(u),e+=""}this.domNode.innerHTML=e,this.domNode.title=this.title,this.didEverRender=!0},e.escapeNewLines=function(e,t){var n=0,i=0;return e.replace(/\r\n|\r|\n/g,function(e,o){i="\r\n"===e?-1:0,o+=n;for(var r=0,s=t;r=o&&(a.start+=i),a.end>=o&&(a.end+=i))}return n+=i,"⏎"})},e}()},ef37:function(e,t,n){},ef8e:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"i",function(){return r}),n.d(t,"h",function(){return s}),n.d(t,"g",function(){return a}),n.d(t,"d",function(){return u}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return c}),n.d(t,"e",function(){return h}),n.d(t,"f",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"b",function(){return v}),n.d(t,"a",function(){return _}),n.d(t,"m",function(){return b}),n.d(t,"n",function(){return y});var i={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function o(e){return Array.isArray?Array.isArray(e):!(!e||typeof e.length!==i.number||e.constructor!==Array)}function r(e){return typeof e===i.string||e instanceof String}function s(e){return typeof e===i.object&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function a(e){return(typeof e===i.number||e instanceof Number)&&!isNaN(e)}function u(e){return!0===e||!1===e}function l(e){return typeof e===i.undefined}function c(e){return l(e)||null===e}var d=Object.prototype.hasOwnProperty;function h(e){if(!s(e))return!1;for(var t in e)if(d.call(e,t))return!1;return!0}function p(e){return typeof e===i.function}function f(e,t){for(var n=Math.min(e.length,t.length),i=0;i0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]1&&n.push(new c["a"](e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}},t.prototype.run=function(e,t){var n=this;if(t.hasModel()){var i=t.getModel(),o=t.getSelections(),r=[];o.forEach(function(e){return n.getCursorsForSelection(e,i,r)}),r.length>0&&t.setSelections(r)}},t}(a["b"]),C=function(e){function t(){return e.call(this,{id:"editor.action.addCursorsToBottom",label:i["a"]("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})||this}return _(t,e),t.prototype.run=function(e,t){if(t.hasModel()){for(var n=t.getSelections(),i=t.getModel().getLineCount(),o=[],r=n[0].startLineNumber;r<=i;r++)o.push(new c["a"](r,n[0].startColumn,r,n[0].endColumn));o.length>0&&t.setSelections(o)}},t}(a["b"]),S=function(e){function t(){return e.call(this,{id:"editor.action.addCursorsToTop",label:i["a"]("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})||this}return _(t,e),t.prototype.run=function(e,t){if(t.hasModel()){for(var n=t.getSelections(),i=[],o=n[0].startLineNumber;o>=1;o--)i.push(new c["a"](o,n[0].startColumn,o,n[0].endColumn));i.length>0&&t.setSelections(i)}},t}(a["b"]),L=function(){function e(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}return e}(),O=function(){function e(e,t,n,i,o,r,s){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=i,this.wholeWord=o,this.matchCase=r,this.currentMatch=s}return e.create=function(t,n){if(!t.hasModel())return null;var i=n.getState();if(!t.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new e(t,n,!1,i.searchString,i.wholeWord,i.matchCase,null);var o,r,s=!1,a=t.getSelections();1===a.length&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);var u,l=t.getSelection(),d=null;if(l.isEmpty()){var h=t.getModel().getWordAtPosition(l.getStartPosition());if(!h)return null;u=h.word,d=new c["a"](l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else u=t.getModel().getValueInRange(l).replace(/\r\n/g,"\n");return new e(t,n,s,u,o,r,d)},e.prototype.addSelectionToNextFindMatch=function(){if(!this._editor.hasModel())return null;var e=this._getNextMatch();if(!e)return null;var t=this._editor.getSelections();return new L(t.concat(e),e,0)},e.prototype.moveSelectionToNextFindMatch=function(){if(!this._editor.hasModel())return null;var e=this._getNextMatch();if(!e)return null;var t=this._editor.getSelections();return new L(t.slice(0,t.length-1).concat(e),e,0)},e.prototype._getNextMatch=function(){if(!this._editor.hasModel())return null;if(this.currentMatch){var e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();var t=this._editor.getSelections(),n=t[t.length-1],i=this._editor.getModel().findNextMatch(this.searchText,n.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1);return i?new c["a"](i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null},e.prototype.addSelectionToPreviousFindMatch=function(){if(!this._editor.hasModel())return null;var e=this._getPreviousMatch();if(!e)return null;var t=this._editor.getSelections();return new L(t.concat(e),e,0)},e.prototype.moveSelectionToPreviousFindMatch=function(){if(!this._editor.hasModel())return null;var e=this._getPreviousMatch();if(!e)return null;var t=this._editor.getSelections();return new L(t.slice(0,t.length-1).concat(e),e,0)},e.prototype._getPreviousMatch=function(){if(!this._editor.hasModel())return null;if(this.currentMatch){var e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();var t=this._editor.getSelections(),n=t[t.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,n.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1);return i?new c["a"](i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null},e.prototype.selectAll=function(){return this._editor.hasModel()?(this.findController.highlightFindOptions(),this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1,1073741824)):[]},e}(),x=function(e){function t(t){var n=e.call(this)||this;return n._sessionDispose=n._register(new s["b"]),n._editor=t,n._ignoreSelectionChange=!1,n._session=null,n}return _(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.dispose=function(){this._endSession(),e.prototype.dispose.call(this)},t.prototype.getId=function(){return t.ID},t.prototype._beginSessionIfNeeded=function(e){var t=this;if(!this._session){var n=O.create(this._editor,e);if(!n)return;this._session=n;var i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(function(e){t._ignoreSelectionChange||t._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(function(){t._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(function(e){(e.matchCase||e.wholeWord)&&t._endSession()}))}},t.prototype._endSession=function(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){var e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null},t.prototype._setSelections=function(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1},t.prototype._expandEmptyToWord=function(e,t){if(!t.isEmpty())return t;var n=e.getWordAtPosition(t.getStartPosition());return n?new c["a"](t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t},t.prototype._applySessionResult=function(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))},t.prototype.getSession=function(e){return this._session},t.prototype.addSelectionToNextFindMatch=function(e){if(this._editor.hasModel()){if(!this._session){var t=this._editor.getSelections();if(t.length>1){var n=e.getState(),i=n.matchCase,o=A(this._editor.getModel(),t,i);if(!o){for(var r=this._editor.getModel(),s=[],a=0,u=t.length;a0&&n.isRegex)t=this._editor.getModel().findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1,1073741824);else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll()}if(t.length>0){for(var i=this._editor.getSelection(),o=0,r=t.length;o1){var a=o.getState(),u=a.matchCase,l=A(t.getModel(),s,u);if(!l)return null}r=O.create(t,o)}if(!r)return null;if(r.currentMatch)return null;if(/^[ \t]+$/.test(r.searchText))return null;if(r.searchText.length>200)return null;var c=o.getState(),d=c.matchCase;if(c.isRevealed){var h=c.searchString;d||(h=h.toLowerCase());var p=r.searchText;if(d||(p=p.toLowerCase()),h===p&&r.matchCase===c.matchCase&&r.wholeWord===c.wholeWord&&!c.isRegex)return null}return new P(r.searchText,r.matchCase,r.wholeWord?t.getConfiguration().wordSeparators:null)},t.prototype._setState=function(e){if(P.softEquals(this.state,e))this.state=e;else if(this.state=e,this.state){if(this.editor.hasModel()){var n=this.editor.getModel();if(!n.isTooLargeForTokenization()){var i=f["i"].has(n),o=n.findMatches(this.state.searchText,!0,!1,this.state.matchCase,this.state.wordSeparators,!1).map(function(e){return e.range});o.sort(l["a"].compareRangesUsingStarts);var r=this.editor.getSelections();r.sort(l["a"].compareRangesUsingStarts);for(var s=[],a=0,u=0,c=o.length,d=r.length;a=d)s.push(h),a++;else{var p=l["a"].compareRangesUsingStarts(h,r[u]);p<0?(!r[u].isEmpty()&&l["a"].areIntersecting(h,r[u])||s.push(h),a++):p>0?u++:(a++,u++)}}var g=s.map(function(e){return{range:e,options:i?t._SELECTION_HIGHLIGHT:t._SELECTION_HIGHLIGHT_OVERVIEW}});this.decorations=this.editor.deltaDecorations(this.decorations,g)}}}else this.decorations=this.editor.deltaDecorations(this.decorations,[])},t.prototype.dispose=function(){this._setState(null),e.prototype.dispose.call(this)},t.ID="editor.contrib.selectionHighlighter",t._SELECTION_HIGHLIGHT_OVERVIEW=p["a"].register({stickiness:1,className:"selectionHighlight",overviewRuler:{color:Object(v["g"])(m["Gb"]),position:h["d"].Center}}),t._SELECTION_HIGHLIGHT=p["a"].register({stickiness:1,className:"selectionHighlight"}),t}(s["a"]);function A(e,t,n){for(var i=F(e,t[0],!n),o=1,r=t.length;o=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},te=function(e,t){return function(n,i){t(n,i,e)}},ne=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{u(i.next(e))}catch(t){r(t)}}function a(e){try{u(i["throw"](e))}catch(t){r(t)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},ie=function(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return u([e,t])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));var n=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{var i=n.range.getStartPosition();this._editor.setPosition(i),this._editor.revealPositionInCenter(i,t)}finally{this.ignoreSelectionChange=!1}}},t.prototype.canNavigate=function(){return this.ranges&&this.ranges.length>0},t.prototype.next=function(e){void 0===e&&(e=0),this._move(!0,e)},t.prototype.previous=function(e){void 0===e&&(e=0),this._move(!1,e)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.ranges=[],this.disposed=!0},t}(q["a"]),ce=n("fb71"),de=n("8ae8"),he=n("3352"),pe=n("b707"),fe=n("8bf1"),ge=n("a40b"),me=n("b78f"),ve=n("5fe7"),_e=n("fdcc"),be=n("30db"),ye=n("ef8e"),we=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ce="$initialize",Se=!1;function Le(e){be["f"]&&(Se||(Se=!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(e.message))}var Oe=function(){function e(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}return e.prototype.setWorkerId=function(e){this._workerId=e},e.prototype.sendMessage=function(e,t){var n=this,i=String(++this._lastSentReq);return new Promise(function(o,r){n._pendingReplies[i]={resolve:o,reject:r},n._send({vsWorker:n._workerId,req:i,method:e,args:t})})},e.prototype.handleMessage=function(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))},e.prototype._handleMessage=function(e){var t=this;if(e.seq){var n=e;if(!this._pendingReplies[n.seq])return void console.warn("Got reply to unknown seq");var i=this._pendingReplies[n.seq];if(delete this._pendingReplies[n.seq],n.err){var o=n.err;return n.err.$isError&&(o=new Error,o.name=n.err.name,o.message=n.err.message,o.stack=n.err.stack),void i.reject(o)}i.resolve(n.res)}else{var r=e,s=r.req,a=this._handler.handleMessage(r.method,r.args);a.then(function(e){t._send({vsWorker:t._workerId,seq:s,res:e,err:void 0})},function(e){e.detail instanceof Error&&(e.detail=Object(_e["g"])(e.detail)),t._send({vsWorker:t._workerId,seq:s,res:void 0,err:Object(_e["g"])(e)})})}},e.prototype._send=function(e){var t=[];if(e.req)for(var n=e,i=0;i1&&f>1){var g=d.charCodeAt(p-2),m=h.charCodeAt(f-2);if(g!==m)break;p--,f--}(p>1||f>1)&&this._pushTrimWhitespaceCharChange(o,r+1,1,p,s+1,1,f);var v=je._getLastNonBlankColumn(d,1),_=je._getLastNonBlankColumn(h,1),b=d.length+1,y=h.length+1;while(vt&&(t=a),s>n&&(n=s),u>n&&(n=u)}t++,n++;var l=new Ze["a"](n,t,0);for(i=0,o=e.length;i=this._maxCharCode?0:this._states.get(e,t)},e}(),Xe=null;function $e(){return null===Xe&&(Xe=new Ye([[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]])),Xe}var Qe=null;function Je(){if(null===Qe){Qe=new Ge["a"](0);for(var e=" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…",t=0;ti);if(i>0){var u=t.charCodeAt(i-1),l=t.charCodeAt(r);(40===u&&41===l||91===u&&93===l||123===u&&125===l)&&r--}return{range:{startLineNumber:n,startColumn:i+1,endLineNumber:n,endColumn:r+2},url:t.substring(i,r+1)}},e.computeLinks=function(t,n){void 0===n&&(n=$e());for(var i=Je(),o=[],r=1,s=t.getLineCount();r<=s;r++){var a=t.getLineContent(r),u=a.length,l=0,c=0,d=0,h=1,p=!1,f=!1,g=!1;while(l=0?(i+=n?1:-1,i<0?i=e.length-1:i%=e.length,e[i]):null},e.INSTANCE=new e,e}(),it=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ot=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return it(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._versionId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eol",{get:function(){return this._eol},enumerable:!0,configurable:!0}),t.prototype.getValue=function(){return this.getText()},t.prototype.getLinesContent=function(){return this._lines.slice(0)},t.prototype.getLineCount=function(){return this._lines.length},t.prototype.getLineContent=function(e){return this._lines[e-1]},t.prototype.getWordAtPosition=function(e,t){var n=Object(qe["d"])(e.column,Object(qe["c"])(t),this._lines[e.lineNumber-1],0);return n?new W["a"](e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null},t.prototype.getWordUntilPosition=function(e,t){var n=this.getWordAtPosition(e,t);return n?{word:this._lines[e.lineNumber-1].substring(n.startColumn-1,e.column-1),startColumn:n.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}},t.prototype.createWordIterator=function(e){var t,n,i=this,o=0,r=0,s=[],a=function(){if(r=i._lines.length?Pe["c"]:(n=i._lines[o],s=i._wordenize(n,e),r=0,o+=1,a())};return{next:a}},t.prototype.getLineWords=function(e,t){for(var n=this._lines[e-1],i=this._wordenize(n,t),o=[],r=0,s=i;rthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,i=!0;else{var o=this._lines[t-1].length+1;n<1?(n=1,i=!0):n>o&&(n=o,i=!0)}return i?{lineNumber:t,column:n}:e},t}(Ke),rt=function(){function e(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}return e.prototype.dispose=function(){this._models=Object.create(null)},e.prototype._getModel=function(e){return this._models[e]},e.prototype._getModels=function(){var e=this,t=[];return Object.keys(this._models).forEach(function(n){return t.push(e._models[n])}),t},e.prototype.acceptNewModel=function(e){this._models[e.url]=new ot(F["a"].parse(e.url),e.lines,e.EOL,e.versionId)},e.prototype.acceptModelChanged=function(e,t){if(this._models[e]){var n=this._models[e];n.onEvents(t)}},e.prototype.acceptRemovedModel=function(e){this._models[e]&&delete this._models[e]},e.prototype.computeDiff=function(e,t,n){var i=this._getModel(e),o=this._getModel(t);if(!i||!o)return Promise.resolve(null);var r=i.getLinesContent(),s=o.getLinesContent(),a=new ze(r,s,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0}),u=a.computeDiff(),l=!(u.length>0)&&this._modelsAreIdentical(i,o);return Promise.resolve({identical:l,changes:u})},e.prototype._modelsAreIdentical=function(e,t){var n=e.getLineCount(),i=t.getLineCount();if(n!==i)return!1;for(var o=1;o<=n;o++){var r=e.getLineContent(o),s=t.getLineContent(o);if(r!==s)return!1}return!0},e.prototype.computeMoreMinimalEdits=function(t,n){var i=this._getModel(t);if(!i)return Promise.resolve(n);var o=[],r=void 0;n=Object(Me["o"])(n,function(e,t){if(e.range&&t.range)return W["a"].compareRangesUsingStarts(e.range,t.range);var n=e.range?0:1,i=t.range?0:1;return n-i});for(var s=0,a=n;se._diffLimit)o.push({range:l,text:c});else for(var p=Object(Te["b"])(h,c,!1),f=i.offsetAt(W["a"].lift(l).getStartPosition()),g=0,m=p;g=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},ft=function(e,t){return function(n,i){t(n,i,e)}},gt=6e4,mt=3e5;function vt(e,t){var n=e.getModel(t);return!!n&&!n.isTooLargeForSyncing()}var _t=function(e){function t(t,n,i){var o=e.call(this)||this;return o._modelService=t,o._workerManager=o._register(new yt(o._modelService)),o._logService=i,o._register(pe["q"].register("*",{provideLinks:function(e,t){return vt(o._modelService,e.uri)?o._workerManager.withWorker().then(function(t){return t.computeLinks(e.uri)}).then(function(e){return e&&{links:e}}):Promise.resolve({links:[]})}})),o._register(pe["d"].register("*",new bt(o._workerManager,n,o._modelService))),o}return ht(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.canComputeDiff=function(e,t){return vt(this._modelService,e)&&vt(this._modelService,t)},t.prototype.computeDiff=function(e,t,n){return this._workerManager.withWorker().then(function(i){return i.computeDiff(e,t,n)})},t.prototype.computeMoreMinimalEdits=function(e,t){var n=this;if(Object(Me["n"])(t)){if(!vt(this._modelService,e))return Promise.resolve(t);var i=dt["a"].create(!0),o=this._workerManager.withWorker().then(function(n){return n.computeMoreMinimalEdits(e,t)});return o.finally(function(){return n._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())}),o}return Promise.resolve(void 0)},t.prototype.canNavigateValueSet=function(e){return vt(this._modelService,e)},t.prototype.navigateValueSet=function(e,t,n){return this._workerManager.withWorker().then(function(i){return i.navigateValueSet(e,t,n)})},t.prototype.canComputeWordRanges=function(e){return vt(this._modelService,e)},t.prototype.computeWordRanges=function(e,t){return this._workerManager.withWorker().then(function(n){return n.computeWordRanges(e,t)})},t=pt([ft(0,st["a"]),ft(1,ut),ft(2,ct["a"])],t),t}(q["a"]),bt=function(){function e(e,t,n){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}return e.prototype.provideCompletionItems=function(e,t){var n=this._configurationService.getValue(e.uri,t,"editor").wordBasedSuggestions;if(n&&vt(this._modelService,e.uri))return this._workerManager.withWorker().then(function(n){return n.textualSuggest(e.uri,t)})},e}(),yt=function(e){function t(t){var n=e.call(this)||this;n._modelService=t,n._editorWorkerClient=null,n._lastWorkerUsedTime=(new Date).getTime();var i=n._register(new ve["c"]);return i.cancelAndSet(function(){return n._checkStopIdleWorker()},Math.round(mt/2)),n._register(n._modelService.onModelRemoved(function(e){return n._checkStopEmptyWorker()})),n}return ht(t,e),t.prototype.dispose=function(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),e.prototype.dispose.call(this)},t.prototype._checkStopEmptyWorker=function(){if(this._editorWorkerClient){var e=this._modelService.getModels();0===e.length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}},t.prototype._checkStopIdleWorker=function(){if(this._editorWorkerClient){var e=(new Date).getTime()-this._lastWorkerUsedTime;e>mt&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}},t.prototype.withWorker=function(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Lt(this._modelService,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)},t}(q["a"]),wt=function(e){function t(t,n,i){var o=e.call(this)||this;if(o._syncedModels=Object.create(null),o._syncedModelsLastUsedTime=Object.create(null),o._proxy=t,o._modelService=n,!i){var r=new ve["c"];r.cancelAndSet(function(){return o._checkStopModelSync()},Math.round(gt/2)),o._register(r)}return o}return ht(t,e),t.prototype.dispose=function(){for(var t in this._syncedModels)Object(q["f"])(this._syncedModels[t]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),e.prototype.dispose.call(this)},t.prototype.ensureSyncedResources=function(e){for(var t=0,n=e;tgt&&t.push(n)}for(var o=0,r=t;o'"_]/g,"-")}function jt(e,t){console.log(e.languageId+": "+t)}function Wt(e,t){return new Error(e.languageId+": "+t)}function Vt(e,t,n,i,o){var r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,s=null;return t.replace(r,function(t,r,a,u,l,c,d,h,p){return Rt(a)?Rt(u)?!Rt(l)&&l0){var i=e.tokenizer[n];if(i)return i;var o=n.lastIndexOf(".");n=o<0?null:n.substr(0,o)}return null}function Ht(e,t){var n=t;while(n&&n.length>0){var i=e.stateNames[n];if(i)return!0;var o=n.lastIndexOf(".");n=o<0?null:n.substr(0,o)}return!1}var zt=5,Ut=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new Kt(e,t);var n=Kt.getStackElementId(e);n.length>0&&(n+="|"),n+=t;var i=this._entries[n];return i||(i=new Kt(e,t),this._entries[n]=i,i)},e._INSTANCE=new e(zt),e}(),Kt=function(){function e(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}return e.getStackElementId=function(e){var t="";while(null!==e)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t},e._equals=function(e,t){while(null!==e&&null!==t){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t},e.prototype.equals=function(t){return e._equals(this,t)},e.prototype.push=function(e){return Ut.create(this,e)},e.prototype.pop=function(){return this.parent},e.prototype.popall=function(){var e=this;while(e.parent)e=e.parent;return e},e.prototype.switchTo=function(e){return Ut.create(this.parent,e)},e}(),qt=function(){function e(e,t){this.modeId=e,this.state=t}return e.prototype.equals=function(e){return this.modeId===e.modeId&&this.state.equals(e.state)},e.prototype.clone=function(){var t=this.state.clone();return t===this.state?this:new e(this.modeId,this.state)},e}(),Gt=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==t)return new Zt(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new Zt(e,t);var n=Kt.getStackElementId(e),i=this._entries[n];return i||(i=new Zt(e,null),this._entries[n]=i,i)},e._INSTANCE=new e(zt),e}(),Zt=function(){function e(e,t){this.stack=e,this.embeddedModeData=t}return e.prototype.clone=function(){var e=this.embeddedModeData?this.embeddedModeData.clone():null;return e===this.embeddedModeData?this:Gt.create(this.stack,this.embeddedModeData)},e.prototype.equals=function(t){return t instanceof e&&(!!this.stack.equals(t.stack)&&(null===this.embeddedModeData&&null===t.embeddedModeData||null!==this.embeddedModeData&&null!==t.embeddedModeData&&this.embeddedModeData.equals(t.embeddedModeData)))},e}(),Yt=function(){function e(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}return e.prototype.enterMode=function(e,t){this._language=t},e.prototype.emit=function(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language,this._tokens.push(new B["a"](e,t,this._language)))},e.prototype.nestedModeTokenize=function(e,t,n){var i=t.modeId,o=t.state,r=pe["y"].get(i);if(!r)return this.enterMode(n,i),this.emit(n,""),o;var s=r.tokenize(e,o,n);return this._tokens=this._tokens.concat(s.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,s.endState},e.prototype.finalize=function(e){return new B["b"](this._tokens,e)},e}(),Xt=function(){function e(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}return e.prototype.enterMode=function(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id},e.prototype.emit=function(e,t){var n=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))},e._merge=function(e,t,n){var i=null!==e?e.length:0,o=t.length,r=null!==n?n.length:0;if(0===i&&0===o&&0===r)return new Uint32Array(0);if(0===i&&0===o)return n;if(0===o&&0===r)return e;var s=new Uint32Array(i+o+r);null!==e&&s.set(e);for(var a=0;a0&&i.nestedModeTokenize(s,t.embeddedModeData,n);var a=e.substring(o);return this._myTokenize(a,t,n+o,i)},e.prototype._safeRuleName=function(e){return e?e.name:"(unknown)"},e.prototype._myTokenize=function(e,t,n,i){i.enterMode(n,this._modeId);var o=e.length,r=t.embeddedModeData,s=t.stack,a=0,u=null,l=!0;while(l||a=o)break;l=!1;var y=this._lexer.tokenizer[p];if(!y&&(y=Bt(this._lexer,p),!y))throw Wt(this._lexer,"tokenizer state is not defined: "+p);for(var w=e.substr(a),C=0,S=y;C=this._lexer.maxStack)throw Wt(this._lexer,"maximum tokenizer stack size reached: ["+s.state+","+s.parent.state+",...]");s=s.push(p)}else if("@pop"===m.next){if(s.depth<=1)throw Wt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));s=s.pop()}else if("@popall"===m.next)s=s.popall();else{x=Vt(this._lexer,m.next,g,f,p);if("@"===x[0]&&(x=x.substr(1)),!Bt(this._lexer,x))throw Wt(this._lexer,"trying to set a next state '"+x+"' that is undefined in rule: "+this._safeRuleName(v));s=s.push(x)}}m.log&&"string"===typeof m.log&&jt(this._lexer,this._lexer.languageId+": "+Vt(this._lexer,m.log,g,f,p))}if(null===O)throw Wt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));if(Array.isArray(O)){if(u&&u.groups.length>0)throw Wt(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(f.length!==O.length+1)throw Wt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));for(var N=0,D=1;D=0&&a()})})},e.colorizeLine=function(e,t,n,i,o){void 0===o&&(o=4);var r=It["d"].isBasicASCII(e,t),s=It["d"].containsRTL(e,r,n),a=Object(kt["e"])(new kt["c"](!1,!0,e,!1,r,s,0,i,[],o,0,-1,"none",!1,!1,null));return a.html},e.colorizeModelLine=function(e,t,n){void 0===n&&(n=4);var i=e.getLineContent(t);e.forceTokenization(t);var o=e.getLineTokens(t),r=o.inflate();return this.colorizeLine(i,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,n)},e}();function tn(e,t,n){return new Promise(function(i,o){var r=function(){var s=on(e,t,n);if(n instanceof $t){var a=n.getLoadStatus();if(!1===a.loaded)return void a.promise.then(r,o)}i(s)};r()})}function nn(e,t){var n=[],i=16793600,o=new Uint32Array(2);o[0]=0,o[1]=i;for(var r=0,s=e.length;r")}return n.join("")}function on(e,t,n){for(var i=[],o=n.getInitialState(),r=0,s=e.length;r"),o=u.endState}return i.join("")}var rn=n("b835"),sn=n("4b76"),an=n("b055"),un=n("8830"),ln=n("d3f49"),cn=n("fbba"),dn=n("4035"),hn=n("0910"),pn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fn=function(){function e(e,t,n){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===n&&(n=[]),this._contents=e,this._keys=t,this._overrides=n,this.isFrozen=!1}return Object.defineProperty(e.prototype,"contents",{get:function(){return this.checkAndFreeze(this._contents)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overrides",{get:function(){return this.checkAndFreeze(this._overrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keys",{get:function(){return this.checkAndFreeze(this._keys)},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length},e.prototype.getValue=function(e){return e?Object(cn["d"])(this.contents,e):this.contents},e.prototype.override=function(t){var n=this.getContentsForOverrideIdentifer(t);if(!n||"object"!==typeof n||!Object.keys(n).length)return this;for(var i={},o=0,r=Me["e"](Object.keys(this.contents).concat(Object.keys(n)));o5e3&&n._leaveChordMode():n._leaveChordMode()},500)},t.prototype._leaveChordMode=function(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null},t.prototype._dispatch=function(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t)},t.prototype._doDispatch=function(e,t){var n=this,i=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;var o=e.getDispatchParts()[0];if(null===o)return i;var r=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null,a=e.getLabel(),u=this._getResolver().resolve(r,s,o);return u&&u.enterChord?(i=!0,this._enterChordMode(o,a),i):(this._currentChord&&(u&&u.commandId||(this._notificationService.status(vn["a"]("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),i=!0)),this._leaveChordMode(),u&&u.commandId&&(u.bubble||(i=!0),"undefined"===typeof u.commandArgs?this._commandService.executeCommand(u.commandId).then(void 0,function(e){return n._notificationService.warn(e)}):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,function(e){return n._notificationService.warn(e)}),this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding"})),i)},t.prototype.mightProducePrintableCharacter=function(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)},t}(q["a"]),yn=n("4fc3"),wn=function(){function e(t,n){this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(var i=0,o=t.length;i=0;c--)this._isTargetedForRemoval(e[c],a,u,s,l)&&e.splice(c,1);else n.push(r)}return e.concat(n)},e.prototype._addKeyPress=function(t,n){var i=this._map.get(t);if("undefined"===typeof i)return this._map.set(t,[n]),void this._addToLookupMap(n);for(var o=i.length-1;o>=0;o--){var r=i[o];if(r.command!==n.command){var s=r.keypressParts.length>1,a=n.keypressParts.length>1;s&&a&&r.keypressParts[1]!==n.keypressParts[1]||e.whenIsEntirelyIncluded(r.when,n.when)&&this._removeFromLookupMap(r)}}i.push(n),this._addToLookupMap(n)},e.prototype._addToLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);"undefined"===typeof t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}},e.prototype._removeFromLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);if("undefined"!==typeof t)for(var n=0,i=t.length;n1&&null!==u.keypressParts[1]?{enterChord:!0,commandId:null,commandArgs:null,bubble:!1}:{enterChord:!1,commandId:u.command,commandArgs:u.commandArgs,bubble:u.bubble}:null},e.prototype._findCommand=function(t,n){for(var i=n.length-1;i>=0;i--){var o=n[i];if(e.contextMatchesRules(t,o.when))return o}return null},e.contextMatchesRules=function(e,t){return!t||t.evaluate(e)},e}(),Cn=n("9eb8"),Sn=function(){function e(e,t,n,i,o){this.resolvedKeybinding=e,this.keypressParts=e?Ln(e.getDispatchParts()):[],this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=i,this.isDefault=o}return e}();function Ln(e){for(var t=[],n=0,i=e.length;n1},t.prototype.getParts=function(){var e=this;return this._parts.map(function(t){return e._getPart(t)})},t.prototype._getPart=function(e){return new A["d"](e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))},t.prototype.getDispatchParts=function(){var e=this;return this._parts.map(function(t){return e._getDispatchPart(t)})},t}(A["c"]),Dn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kn=function(e){function t(t,n){return e.call(this,n,t.parts)||this}return Dn(t,e),t.prototype._keyCodeToUILabel=function(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return A["b"].toString(e)},t.prototype._getLabel=function(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)},t.prototype._getAriaLabel=function(e){return e.isDuplicateModifierCase()?"":A["b"].toString(e.keyCode)},t.prototype._getDispatchPart=function(e){return t.getDispatchStr(e)},t.getDispatchStr=function(e){if(e.isModifierKey())return null;var t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=A["b"].toString(e.keyCode),t},t}(Nn),In=n("b0cd"),En=n("1165"),Mn=n("03d9"),Tn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Pn=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Rn=function(e,t){return function(n,i){t(n,i,e)}},An=function(){function e(e){this.model=e,this._onDispose=new R["a"]}return Object.defineProperty(e.prototype,"textEditorModel",{get:function(){return this.model},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose.fire()},e}();function Fn(e,t,n){return Object(an["a"])(e)?t(e):n(e)}var jn=function(){function e(){}return e.prototype.setEditor=function(e){this.editor=e},e.prototype.createModelReference=function(e){var t=this,n=null;return this.editor&&(n=Fn(this.editor,function(n){return t.findModel(n,e)},function(n){return t.findModel(n.getOriginalEditor(),e)||t.findModel(n.getModifiedEditor(),e)})),n?Promise.resolve(new q["c"](new An(n))):Promise.reject(new Error("Model not found"))},e.prototype.findModel=function(e,t){var n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n},e}(),Wn=function(){function e(){}return e.prototype.showWhile=function(e,t){return Promise.resolve(void 0)},e}(),Vn=function(){function e(){}return e}(),Bn=function(){function e(){}return e.prototype.info=function(e){return this.notify({severity:sn["a"].Info,message:e})},e.prototype.warn=function(e){return this.notify({severity:sn["a"].Warning,message:e})},e.prototype.error=function(e){return this.notify({severity:sn["a"].Error,message:e})},e.prototype.notify=function(t){switch(t.severity){case sn["a"].Error:console.error(t.message);break;case sn["a"].Warning:console.warn(t.message);break;default:console.log(t.message);break}return e.NO_OP},e.prototype.status=function(e,t){return q["a"].None},e.NO_OP=new In["b"],e}(),Hn=function(){function e(e){this._onWillExecuteCommand=new R["a"],this._onDidExecuteCommand=new R["a"],this._instantiationService=e,this._dynamicCommands=Object.create(null)}return e.prototype.addCommand=function(e){var t=this,n=e.id;return this._dynamicCommands[n]=e,Object(q["h"])(function(){delete t._dynamicCommands[n]})},e.prototype.executeCommand=function(e){for(var t=[],n=1;n0){var _=e[r-1];m=0===_.originalEndLineNumber?_.originalStartLineNumber+1:_.originalEndLineNumber+1,v=0===_.modifiedEndLineNumber?_.modifiedStartLineNumber+1:_.modifiedEndLineNumber+1}var b=f-gi+1,y=g-gi+1;if(bL){w=L-N;N+=w,D+=w}if(D>O){w=O-D;N+=w,D+=w}h[p++]=new mi(C,N,S,D),i[o++]=new vi(h)}var k=i[0].entries,I=[],E=0;for(r=1,s=i.length;rd)&&(d=_),0!==b&&(0===h||bp)&&(p=y)}var w=document.createElement("div");w.className="diff-review-row";var C=document.createElement("div");C.className="diff-review-cell diff-review-summary";var S=d-c+1,L=p-h+1;C.appendChild(document.createTextNode(a+1+"/"+this._diffs.length+": @@ -"+c+","+S+" +"+h+","+L+" @@")),w.setAttribute("data-line",String(h));var O=function(e){return 0===e?vn["a"]("no_lines","no lines"):1===e?vn["a"]("one_line","1 line"):vn["a"]("more_lines","{0} lines",e)},x=O(S),N=O(L);w.setAttribute("aria-label",vn["a"]({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines", "1 line" or "X lines", localized separately.']},"Difference {0} of {1}: original {2}, {3}, modified {4}, {5}",a+1,this._diffs.length,c,x,h,N)),w.appendChild(C),w.setAttribute("role","listitem"),l.appendChild(w);var D=h;for(f=0,g=u.length;f0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]o.modifiedStartLineNumber?vn["a"]("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):vn["a"]("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,function(){return ki(a,void 0,void 0,function(){return Ii(this,function(e){switch(e.label){case 0:return[4,this._clipboardService.writeText(o.originalContent.join(l)+l)];case 1:return e.sent(),[2]}})})}));var d=0,h=void 0;o.originalEndLineNumber>o.modifiedStartLineNumber&&(h=new li["a"]("diff.clipboard.copyDeletedLineContent",vn["a"]("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.originalStartLineNumber),void 0,!0,function(){return ki(a,void 0,void 0,function(){return Ii(this,function(e){switch(e.label){case 0:return[4,this._clipboardService.writeText(o.originalContent[d])];case 1:return e.sent(),[2]}})})}),c.push(h));var p=i.getConfiguration().readOnly;return p||c.push(new li["a"]("diff.inline.revertChange",vn["a"]("diff.inline.revertChange.label","Revert this change"),void 0,!0,function(){return ki(a,void 0,void 0,function(){var e;return Ii(this,function(t){return 0===o.modifiedEndLineNumber?(e=i.getModel().getLineMaxColumn(o.modifiedStartLineNumber),i.executeEdits("diffEditor",[{range:new W["a"](o.modifiedStartLineNumber,e,o.modifiedStartLineNumber,e),text:l+o.originalContent.join(l)}])):(e=i.getModel().getLineMaxColumn(o.modifiedEndLineNumber),i.executeEdits("diffEditor",[{range:new W["a"](o.modifiedStartLineNumber,1,o.modifiedEndLineNumber,e),text:o.originalContent.join(l)}])),[2]})})})),a._register(K["k"](a._diffActions,"mousedown",function(e){var t=K["x"](a._diffActions),n=t.top,i=t.height,r=Math.floor(u/3);e.preventDefault(),a._contextMenuService.showContextMenu({getAnchor:function(){return{x:e.posx,y:n+i+r}},getActions:function(){return h&&(h.label=vn["a"]("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.originalStartLineNumber+d)),c},autoSelectFirstItem:!0})})),a._register(i.onMouseMove(function(e){if(8===e.target.type||5===e.target.type){var t=e.target.detail.viewZoneId;t===a._viewZoneId?(a.visibility=!0,d=a._updateLightBulbPosition(a._marginDomNode,e.event.browserEvent.y,u)):a.visibility=!1}else a.visibility=!1})),a}return Di(t,e),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")},enumerable:!0,configurable:!0}),t.prototype._updateLightBulbPosition=function(e,t,n){var i=K["x"](e).top,o=t-i,r=Math.floor(o/n),s=r*n;return this._diffActions.style.top=s+"px",r},t}(q["a"]),Mi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ti=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Pi=function(e,t){return function(n,i){t(n,i,e)}},Ri=function(){function e(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this.inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}return e.prototype.getForeignViewZones=function(e){var t=this;return e.filter(function(e){return!t._zonesMap[String(e.id)]})},e.prototype.clean=function(e){var t=this;this._zones.length>0&&e.changeViewZones(function(e){for(var n=0,i=t._zones.length;n0?o/n:0,s=Math.max(0,Math.floor(e.contentHeight*r)),a=Math.floor(t*r);return{height:s,top:a}},t.prototype._createDataSource=function(){var e=this;return{getWidth:function(){return e._width},getHeight:function(){return e._height-e._reviewHeight},getContainerDomNode:function(){return e._containerDomElement},relayoutEditors:function(){e._doLayout()},getOriginalEditor:function(){return e.originalEditor},getModifiedEditor:function(){return e.modifiedEditor}}},t.prototype._setStrategy=function(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getTheme()),this._diffComputationResult&&this._updateDecorations(),this._measureDomElement(!0)},t.prototype._getLineChangeAtOrBeforeLineNumber=function(e,t){var n=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===n.length||e=a?i=r+1:(i=r,o=r)}return n[i]},t.prototype._getEquivalentLineForOriginalLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,function(e){return e.originalStartLineNumber});if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),i=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-n;return s<=o?i+Math.min(s,r):i+r-o+s},t.prototype._getEquivalentLineForModifiedLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,function(e){return e.modifiedStartLineNumber});if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),i=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-i;return s<=r?n+Math.min(s,o):n+o-r+s},t.prototype.getDiffLineInformationForOriginal=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null},t.prototype.getDiffLineInformationForModified=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null},t.ONE_OVERVIEW_WIDTH=15,t.ENTIRE_DIFF_OVERVIEW_WIDTH=30,t.UPDATE_DIFF_DECORATIONS_DELAY=200,t=Ti([Pi(3,ge["a"]),Pi(4,yn["c"]),Pi(5,at["a"]),Pi(6,U["a"]),Pi(7,pi["c"]),Pi(8,In["a"]),Pi(9,Ni["a"])],t),t}(q["a"]),ji=function(e){function t(t){var n=e.call(this)||this;return n._dataSource=t,n._insertColor=null,n._removeColor=null,n}return Mi(t,e),t.prototype.applyColors=function(e){var t=(e.getColor(hi["j"])||hi["g"]).transparent(2),n=(e.getColor(hi["l"])||hi["h"]).transparent(2),i=!t.equals(this._insertColor)||!n.equals(this._removeColor);return this._insertColor=t,this._removeColor=n,i},t.prototype.getEditorsDiffDecorations=function(e,t,n,i,o,r,s){o=o.sort(function(e,t){return e.afterLineNumber-t.afterLineNumber}),i=i.sort(function(e,t){return e.afterLineNumber-t.afterLineNumber});var a=this._getViewZones(e,i,o,r,s,n),u=this._getOriginalEditorDecorations(e,t,n,r,s),l=this._getModifiedEditorDecorations(e,t,n,r,s);return{original:{decorations:u.decorations,overviewZones:u.overviewZones,zones:a.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:a.modified}}},t}(q["a"]),Wi=function(){function e(e){this._source=e,this._index=-1,this.current=null,this.advance()}return e.prototype.advance=function(){this._index++,this._index0){var n=e[e.length-1];if(n.afterLineNumber===t.afterLineNumber&&null===n.domNode)return void(n.heightInLines+=t.heightInLines)}e.push(t)},c=new Wi(this.modifiedForeignVZ),d=new Wi(this.originalForeignVZ),h=0,p=this.lineChanges.length;h<=p;h++){var f=h0?-1:0),r=f.modifiedStartLineNumber+(f.modifiedEndLineNumber>0?-1:0),i=f.originalEndLineNumber>0?f.originalEndLineNumber-f.originalStartLineNumber+1:0,n=f.modifiedEndLineNumber>0?f.modifiedEndLineNumber-f.modifiedStartLineNumber+1:0,s=Math.max(f.originalStartLineNumber,f.originalEndLineNumber),a=Math.max(f.modifiedStartLineNumber,f.modifiedEndLineNumber)):(o+=1e7+i,r+=1e7+n,s=o,a=r);var g=[],m=[];while(c.current&&c.current.afterLineNumber<=a){var v=void 0;v=c.current.afterLineNumber<=r?o-r+c.current.afterLineNumber:s;var _=null;f&&f.modifiedStartLineNumber<=c.current.afterLineNumber&&c.current.afterLineNumber<=f.modifiedEndLineNumber&&(_=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),g.push({afterLineNumber:v,heightInLines:c.current.heightInLines,domNode:null,marginDomNode:_}),c.advance()}while(d.current&&d.current.afterLineNumber<=s){v=void 0;v=d.current.afterLineNumber<=o?r-o+d.current.afterLineNumber:a,m.push({afterLineNumber:v,heightInLines:d.current.heightInLines,domNode:null}),d.advance()}if(null!==f&&Gi(f)){var b=this._produceOriginalFromDiff(f,i,n);b&&g.push(b)}if(null!==f&&Zi(f)){b=this._produceModifiedFromDiff(f,i,n);b&&m.push(b)}var y=0,w=0;g=g.sort(u),m=m.sort(u);while(y=S.heightInLines?(C.heightInLines-=S.heightInLines,w++):(S.heightInLines-=C.heightInLines,y++)}while(y2*t.MINIMUM_EDITOR_WIDTH?(oi-t.MINIMUM_EDITOR_WIDTH&&(o=i-t.MINIMUM_EDITOR_WIDTH)):o=r,this._sashPosition!==o&&(this._sashPosition=o,this._sash.layout()),this._sashPosition},t.prototype.onSashDragStart=function(){this._startSashPosition=this._sashPosition},t.prototype.onSashDrag=function(e){var t=this._dataSource.getWidth(),n=t-Fi.ENTIRE_DIFF_OVERVIEW_WIDTH,i=this.layout((this._startSashPosition+(e.currentX-e.startX))/n);this._sashRatio=i/n,this._dataSource.relayoutEditors()},t.prototype.onSashDragEnd=function(){this._sash.layout()},t.prototype.onSashReset=function(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()},t.prototype.getVerticalSashTop=function(e){return 0},t.prototype.getVerticalSashLeft=function(e){return this._sashPosition},t.prototype.getVerticalSashHeight=function(e){return this._dataSource.getHeight()},t.prototype._getViewZones=function(e,t,n,i,o){var r=new Ui(e,t,n);return r.getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,i,o){for(var r=String(this._removeColor),s={decorations:[],overviewZones:[]},a=i.getModel(),u=0,l=e.length;ut?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n-t,domNode:null}:null},t.prototype._produceModifiedFromDiff=function(e,t,n){return t>n?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-n,domNode:null}:null},t}(Vi),Ki=function(e){function t(t,n){var i=e.call(this,t)||this;return i.decorationsLeft=t.getOriginalEditor().getLayoutInfo().decorationsLeft,i._register(t.getOriginalEditor().onDidLayoutChange(function(e){i.decorationsLeft!==e.decorationsLeft&&(i.decorationsLeft=e.decorationsLeft,t.relayoutEditors())})),i}return Mi(t,e),t.prototype.setEnableSplitViewResizing=function(e){},t.prototype._getViewZones=function(e,t,n,i,o,r){var s=new qi(e,t,n,i,o,r);return s.getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,i,o){for(var r=String(this._removeColor),s={decorations:[],overviewZones:[]},a=0,u=e.length;a'])}h+=this.modifiedEditorConfiguration.viewInfo.scrollBeyondLastColumn;var m=document.createElement("div");m.className="view-lines line-delete",m.innerHTML=a.build(),ri["a"].applyFontInfoSlow(m,this.modifiedEditorConfiguration.fontInfo);var v=document.createElement("div");return v.className="inline-deleted-margin-view-zone",v.innerHTML=u.join(""),ri["a"].applyFontInfoSlow(v,this.modifiedEditorConfiguration.fontInfo),{shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:h*d,domNode:m,marginDomNode:v,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalContent:p}}},t.prototype._renderOriginalLine=function(e,t,n,i,o,r,s){var a=t.getLineTokens(o),u=a.getLineContent(),l=Oi["a"].filter(r,o,1,u.length+1);s.appendASCIIString('
    ');var c=It["d"].isBasicASCII(u,t.mightContainNonBasicASCII()),d=It["d"].containsRTL(u,c,t.mightContainRTL()),h=Object(kt["d"])(new kt["c"](n.fontInfo.isMonospace&&!n.viewInfo.disableMonospaceOptimizations,n.fontInfo.canUseHalfwidthRightwardsArrow,u,!1,c,d,0,a,l,i,n.fontInfo.spaceWidth,n.viewInfo.stopRenderingLineAfter,n.viewInfo.renderWhitespace,n.viewInfo.renderControlCharacters,n.viewInfo.fontLigatures,null),s);s.appendASCIIString("
    ");var p=h.characterMapping.getAbsoluteOffsets();return p.length>0?p[p.length-1]:0},t}(Vi);function Gi(e){return e.modifiedEndLineNumber>0}function Zi(e){return e.originalEndLineNumber>0}function Yi(){var e=document.createElement("div");return e.className="diagonal-fill",e}Object(pi["f"])(function(e,t){var n=e.getColor(hi["j"]);n&&(t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-editor .inline-added-margin-view-zone { background-color: "+n+"; }"));var i=e.getColor(hi["l"]);i&&(t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { background-color: "+i+"; }"),t.addRule(".monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: "+i+"; }"),t.addRule(".monaco-editor .inline-deleted-margin-view-zone { background-color: "+i+"; }"));var o=e.getColor(hi["k"]);o&&t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+o+"; }");var r=e.getColor(hi["m"]);r&&t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+r+"; }");var s=e.getColor(hi["Lb"]);s&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px "+s+"; }");var a=e.getColor(hi["i"]);a&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid "+a+"; }")});var Xi=n("f58f"),$i=n("b1ca"),Qi=n("7e32"),Ji=n("6dec"),eo=n("4779"),to=n("f577"),no=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),io=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},oo=function(e,t){return function(n,i){t(n,i,e)}},ro=0,so=!1;function ao(){so||(so=!0,ti["b"](document.body))}var uo=function(e){function t(t,n,i,o,r,s,a,u,l,c){var d=this;return n=n||{},n.ariaLabel=n.ariaLabel||Mn["g"].editorViewAccessibleLabel,n.ariaLabel=n.ariaLabel+";"+(ei["j"]?Mn["g"].accessibilityHelpMessageIE:Mn["g"].accessibilityHelpMessage),d=e.call(this,t,n,{},i,o,r,s,u,l,c)||this,d._standaloneKeybindingService=a instanceof zn?a:null,ao(),d}return no(t,e),t.prototype.addCommand=function(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;var i="DYNAMIC_"+ ++ro,o=yn["a"].deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(i,e,t,o),i},t.prototype.createContextKey=function(e,t){return this._contextKeyService.createKey(e,t)},t.prototype.addAction=function(e){var t=this;if("string"!==typeof e.id||"string"!==typeof e.label||"function"!==typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),q["a"].None;var n=e.id,i=e.label,o=yn["a"].and(yn["a"].equals("editorId",this.getId()),yn["a"].deserialize(e.precondition)),r=e.keybindings,s=yn["a"].and(o,yn["a"].deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,u=e.contextMenuOrder||0,l=function(){return Promise.resolve(e.run(t))},c=new q["b"],d=this.getId()+":"+n;if(c.add(Q["a"].registerCommand(d,l)),a){var h={command:{id:d,title:i},when:o,group:a,order:u};c.add(Qi["c"].appendMenuItem(7,h))}if(Array.isArray(r))for(var p=0,f=r;p> to now point to mime <<"+n.mime+">>"),n.filename&&e.filename===n.filename&&console.warn("Overwriting filename <<"+n.filename+">> to now point to mime <<"+n.mime+">>"),n.filepattern&&e.filepattern===n.filepattern&&console.warn("Overwriting filepattern <<"+n.filepattern+">> to now point to mime <<"+n.mime+">>"),n.firstline&&e.firstline===n.firstline&&console.warn("Overwriting firstline <<"+n.firstline+">> to now point to mime <<"+n.mime+">>"))})}function So(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:e.userConfigured,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?e.filepattern.toLowerCase():void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(go["posix"].sep)>=0}}function Lo(e,t){var n;if(e)switch(e.scheme){case Y["b"].file:n=e.fsPath;break;case Y["b"].data:var i=X["a"].parseMetaData(e);n=i.get(X["a"].META_DATA_LABEL);break;default:n=e.path}if(!n)return[_o];n=n.toLowerCase();var o=Object(go["basename"])(n),r=Oo(n,o,wo);if(r)return[r,vo];var s=Oo(n,o,yo);if(s)return[s,vo];if(t){var a=xo(t);if(a)return[a,vo]}return[_o]}function Oo(e,t,n){for(var i=null,o=null,r=null,s=n.length-1;s>=0;s--){var a=n[s];if(t===a.filenameLowercase){i=a;break}if(a.filepattern&&(!o||a.filepattern.length>o.filepattern.length)){var u=a.filepatternOnPath?e:t;Object(mo["a"])(a.filepatternLowercase,u)&&(o=a)}a.extension&&(!r||a.extension.length>r.extension.length)&&Object($["m"])(t,a.extensionLowercase)&&(r=a)}return i?i.mime:o?o.mime:r?r.mime:null}function xo(e){if(Object($["L"])(e)&&(e=e.substr(1)),e.length>0)for(var t=bo.length-1;t>=0;t--){var n=bo[t];if(n.firstline){var i=e.match(n.firstline);if(i&&i.length>0)return n.mime}}return null}var No=n("32a4"),Do=n("89cd"),ko=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Io=Object.prototype.hasOwnProperty,Eo=function(e){function t(t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var i=e.call(this)||this;return i._onDidChange=i._register(new R["a"]),i.onDidChange=i._onDidChange.event,i._warnOnOverwrite=n,i._nextLanguageId2=1,i._languageIdToLanguage=[],i._languageToLanguageId=Object.create(null),i._languages={},i._mimeTypesMap={},i._nameMap={},i._lowercaseNameMap={},t&&(i._initializeFromRegistry(),i._register(No["a"].onDidChangeLanguages(function(e){return i._initializeFromRegistry()}))),i}return ko(t,e),t.prototype._initializeFromRegistry=function(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};var e=No["a"].getLanguages();this._registerLanguages(e)},t.prototype._registerLanguages=function(e){for(var t=this,n=0,i=e;n0&&((n=e.mimetypes).push.apply(n,t.mimetypes),o=t.mimetypes[0]),o||(o="text/x-"+i,e.mimetypes.push(o)),Array.isArray(t.extensions))for(var r=0,s=t.extensions;r0){var f=t.firstLine;"^"!==f.charAt(0)&&(f="^"+f);try{var g=new RegExp(f);$["E"](g)||Co({id:i,mime:o,firstline:g},this._warnOnOverwrite)}catch(C){Object(_e["e"])(C)}}e.aliases.push(i);var m=null;if("undefined"!==typeof t.aliases&&Array.isArray(t.aliases)&&(m=0===t.aliases.length?[null]:t.aliases),null!==m)for(var v=0,_=m;v<_.length;v++){var b=_[v];b&&0!==b.length&&e.aliases.push(b)}var y=null!==m&&m.length>0;if(y&&null===m[0]);else{var w=(y?m[0]:null)||i;!y&&e.name||(e.name=w)}t.configuration&&e.configurationFiles.push(t.configuration)},t.prototype.isRegisteredMode=function(e){return!!Io.call(this._mimeTypesMap,e)||Io.call(this._languages,e)},t.prototype.getModeIdForLanguageNameLowercase=function(e){return Io.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null},t.prototype.extractModeIds=function(e){var t=this;return e?e.split(",").map(function(e){return e.trim()}).map(function(e){return Io.call(t._mimeTypesMap,e)?t._mimeTypesMap[e].language:e}).filter(function(e){return Io.call(t._languages,e)}):[]},t.prototype.getLanguageIdentifier=function(e){if(e===fe["b"]||0===e)return fe["a"];var t;if("string"===typeof e)t=e;else if(t=this._languageIdToLanguage[e],!t)return null;return Io.call(this._languages,t)?this._languages[t].identifier:null},t.prototype.getModeIdsFromFilepathOrFirstLine=function(e,t){if(!e&&!t)return[];var n=Lo(e,t);return this.extractModeIds(n.join(","))},t}(q["a"]),Mo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),To=function(e){function t(t,n){var i=e.call(this)||this;return i._onDidChange=i._register(new R["a"]),i.onDidChange=i._onDidChange.event,i._selector=n,i.languageIdentifier=i._selector(),i._register(t(function(){return i._evaluate()})),i}return Mo(t,e),t.prototype._evaluate=function(){var e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))},t}(q["a"]),Po=function(){function e(e){var t=this;void 0===e&&(e=!1),this._onDidCreateMode=new R["a"],this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=new R["a"],this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=new Eo(!0,e),this._registry.onDidChange(function(){return t._onLanguagesMaybeChanged.fire()})}return e.prototype.isRegisteredMode=function(e){return this._registry.isRegisteredMode(e)},e.prototype.getModeIdForLanguageName=function(e){return this._registry.getModeIdForLanguageNameLowercase(e)},e.prototype.getModeIdByFilepathOrFirstLine=function(e,t){var n=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return n.length>0?n[0]:null},e.prototype.getModeId=function(e){var t=this._registry.extractModeIds(e);return t.length>0?t[0]:null},e.prototype.getLanguageIdentifier=function(e){return this._registry.getLanguageIdentifier(e)},e.prototype.create=function(e){var t=this;return new To(this.onLanguagesMaybeChanged,function(){var n=t.getModeId(e);return t._createModeAndGetLanguageIdentifier(n)})},e.prototype.createByFilepathOrFirstLine=function(e,t){var n=this;return new To(this.onLanguagesMaybeChanged,function(){var i=n.getModeIdByFilepathOrFirstLine(e,t);return n._createModeAndGetLanguageIdentifier(i)})},e.prototype._createModeAndGetLanguageIdentifier=function(e){var t=this.getLanguageIdentifier(e||"plaintext")||fe["a"];return this._getOrCreateMode(t.language),t},e.prototype.triggerMode=function(e){var t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")},e.prototype._getOrCreateMode=function(e){if(!this._instantiatedModes.hasOwnProperty(e)){var t=this.getLanguageIdentifier(e)||fe["a"];this._instantiatedModes[e]=new fo(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]},e}(),Ro=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ao=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Fo=function(e,t){return function(n,i){t(n,i,e)}};function jo(e){return e.toString()}var Wo=function(){function e(e,t,n){this._modelEventListeners=new q["b"],this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose(function(){return t(e)})),this._modelEventListeners.add(e.onDidChangeLanguage(function(t){return n(e,t)}))}return e.prototype._disposeLanguageSelection=function(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=null)},e.prototype.dispose=function(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()},e.prototype.setLanguage=function(e){var t=this;this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange(function(){return t.model.setMode(e.languageIdentifier)}),this.model.setMode(e.languageIdentifier)},e}(),Vo=be["c"]||be["d"]?1:2,Bo=function(e){function t(t,n){var i=e.call(this)||this;return i._onModelAdded=i._register(new R["a"]),i.onModelAdded=i._onModelAdded.event,i._onModelRemoved=i._register(new R["a"]),i.onModelRemoved=i._onModelRemoved.event,i._onModelModeChanged=i._register(new R["a"]),i.onModelModeChanged=i._onModelModeChanged.event,i._configurationService=t,i._resourcePropertiesService=n,i._models={},i._modelCreationOptionsByLanguageAndResource=Object.create(null),i._configurationServiceSubscription=i._configurationService.onDidChangeConfiguration(function(e){return i._updateModelOptions()}),i._updateModelOptions(),i}return Ro(t,e),t._readModelOptions=function(e,t){var n=T["c"].tabSize;if(e.editor&&"undefined"!==typeof e.editor.tabSize){var i=parseInt(e.editor.tabSize,10);isNaN(i)||(n=i),n<1&&(n=1)}var o=n;if(e.editor&&"undefined"!==typeof e.editor.indentSize&&"tabSize"!==e.editor.indentSize){var r=parseInt(e.editor.indentSize,10);isNaN(r)||(o=r),o<1&&(o=1)}var s=T["c"].insertSpaces;e.editor&&"undefined"!==typeof e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));var a=Vo,u=e.eol;"\r\n"===u?a=2:"\n"===u&&(a=1);var l=T["c"].trimAutoWhitespace;e.editor&&"undefined"!==typeof e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));var c=T["c"].detectIndentation;e.editor&&"undefined"!==typeof e.editor.detectIndentation&&(c="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));var d=T["c"].largeFileOptimizations;return e.editor&&"undefined"!==typeof e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:s,detectIndentation:c,defaultEOL:a,trimAutoWhitespace:l,largeFileOptimizations:d}},t.prototype.getCreationOptions=function(e,n,i){var o=this._modelCreationOptionsByLanguageAndResource[e+n];if(!o){var r=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:n}),s=this._resourcePropertiesService.getEOL(n,e);o=t._readModelOptions({editor:r,eol:s},i),this._modelCreationOptionsByLanguageAndResource[e+n]=o}return o},t.prototype._updateModelOptions=function(){var e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);for(var n=Object.keys(this._models),i=0,o=n.length;i=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},qo=function(e,t){return function(n,i){t(n,i,e)}},Go=function(e){function t(t,n){void 0===n&&(n=K["s"]());var i=e.call(this)||this;return i._decorationOptionProviders=new Map,i._styleSheet=n,i._themeService=t,i}return Uo(t,e),t.prototype.registerDecorationType=function(e,t,n){var i=this._decorationOptionProviders.get(e);if(!i){var o={styleSheet:this._styleSheet,key:e,parentTypeKey:n,options:t||Object.create(null)};i=n?new Zo(this._themeService,o):new Yo(this._themeService,o),this._decorationOptionProviders.set(e,i)}i.refCount++},t.prototype.removeDecorationType=function(e){var t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(function(t){return t.removeDecorations(e)})))},t.prototype.resolveDecorationOptions=function(e,t){var n=this._decorationOptionProviders.get(e);if(!n)throw new Error("Unknown decoration type key: "+e);return n.getOptions(this,t)},t=Ko([qo(0,pi["c"])],t),t}(zo),Zo=function(){function e(e,t){this._parentTypeKey=t.parentTypeKey,this.refCount=0,this._beforeContentRules=new $o(3,t,e),this._afterContentRules=new $o(4,t,e)}return e.prototype.getOptions=function(e,t){var n=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(n.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(n.afterContentClassName=this._afterContentRules.className),n},e.prototype.dispose=function(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null)},e}(),Yo=function(){function e(e,t){var n=this;this._disposables=new q["b"],this.refCount=0;var i=function(i){var o=new $o(i,t,e);if(n._disposables.add(o),o.hasContent)return o.className},o=function(i){var o=new $o(i,t,e);return n._disposables.add(o),o.hasContent?{className:o.className,hasLetterSpacing:o.hasLetterSpacing}:null};this.className=i(0);var r=o(1);r&&(this.inlineClassName=r.className,this.inlineClassNameAffectsLetterSpacing=r.hasLetterSpacing),this.beforeContentClassName=i(3),this.afterContentClassName=i(4),this.glyphMarginClassName=i(2);var s=t.options;this.isWholeLine=Boolean(s.isWholeLine),this.stickiness=s.rangeBehavior;var a=s.light&&s.light.overviewRulerColor||s.overviewRulerColor,u=s.dark&&s.dark.overviewRulerColor||s.overviewRulerColor;"undefined"===typeof a&&"undefined"===typeof u||(this.overviewRuler={color:a||u,darkColor:u||a,position:s.overviewRulerLane||he["d"].Center})}return e.prototype.getOptions=function(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this},e.prototype.dispose=function(){this._disposables.dispose()},e}(),Xo={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",width:"width:{0};",height:"height:{0};"},$o=function(){function e(e,t,n){var i=this;this._theme=n.getTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;var o=Qo.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(o=o+" "+Qo.getClassName(this._providerArgs.parentTypeKey,e)),this._className=o,this._unThemedSelector=Qo.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=n.onThemeChange(function(e){i._theme=n.getTheme(),i._removeCSS(),i._buildCSS()}):this._themeListener=null}return e.prototype.dispose=function(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)},Object.defineProperty(e.prototype,"hasContent",{get:function(){return this._hasContent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasLetterSpacing",{get:function(){return this._hasLetterSpacing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),e.prototype._buildCSS=function(){var e,t,n,i=this._providerArgs.options;switch(this._ruleType){case 0:e=this.getCSSTextForModelDecorationClassName(i),t=this.getCSSTextForModelDecorationClassName(i.light),n=this.getCSSTextForModelDecorationClassName(i.dark);break;case 1:e=this.getCSSTextForModelDecorationInlineClassName(i),t=this.getCSSTextForModelDecorationInlineClassName(i.light),n=this.getCSSTextForModelDecorationInlineClassName(i.dark);break;case 2:e=this.getCSSTextForModelDecorationGlyphMarginClassName(i),t=this.getCSSTextForModelDecorationGlyphMarginClassName(i.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(i.dark);break;case 3:e=this.getCSSTextForModelDecorationContentClassName(i.before),t=this.getCSSTextForModelDecorationContentClassName(i.light&&i.light.before),n=this.getCSSTextForModelDecorationContentClassName(i.dark&&i.dark.before);break;case 4:e=this.getCSSTextForModelDecorationContentClassName(i.after),t=this.getCSSTextForModelDecorationContentClassName(i.light&&i.light.after),n=this.getCSSTextForModelDecorationContentClassName(i.dark&&i.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}var o=this._providerArgs.styleSheet.sheet,r=!1;e.length>0&&(o.insertRule(this._unThemedSelector+" {"+e+"}",0),r=!0),t.length>0&&(o.insertRule(".vs"+this._unThemedSelector+" {"+t+"}",0),r=!0),n.length>0&&(o.insertRule(".vs-dark"+this._unThemedSelector+", .hc-black"+this._unThemedSelector+" {"+n+"}",0),r=!0),this._hasContent=r},e.prototype._removeCSS=function(){K["H"](this._unThemedSelector,this._providerArgs.styleSheet)},e.prototype.getCSSTextForModelDecorationClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")},e.prototype.getCSSTextForModelDecorationInlineClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")},e.prototype.getCSSTextForModelDecorationContentClassName=function(e){if(!e)return"";var t=[];if("undefined"!==typeof e){if(this.collectBorderSettingsCSSText(e,t),"undefined"!==typeof e.contentIconPath&&t.push($["r"](Xo.contentIconPath,K["n"](F["a"].revive(e.contentIconPath)))),"string"===typeof e.contentText){var n=e.contentText.match(/^.*$/m)[0],i=n.replace(/['\\]/g,"\\$&");t.push($["r"](Xo.contentText,i))}this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","color","opacity","backgroundColor","margin"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")},e.prototype.getCSSTextForModelDecorationGlyphMarginClassName=function(e){if(!e)return"";var t=[];return"undefined"!==typeof e.gutterIconPath&&(t.push($["r"](Xo.gutterIconPath,K["n"](F["a"].revive(e.gutterIconPath)))),"undefined"!==typeof e.gutterIconSize&&t.push($["r"](Xo.gutterIconSize,e.gutterIconSize))),t.join("")},e.prototype.collectBorderSettingsCSSText=function(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push($["r"]("box-sizing: border-box;")),!0)},e.prototype.collectCSSText=function(e,t,n){for(var i=n.length,o=0,r=t;o=1&&""===e[0].token){var r=e.shift();-1!==r.fontStyle&&(n=r.fontStyle),null!==r.foreground&&(i=r.foreground),null!==r.background&&(o=r.background)}for(var s=new sr,a=0,u=t;a>>0,this._cache.set(t,n)}return(n|e<<0)>>>0},e}(),ur=/\b(comment|string|regex|regexp)\b/;function lr(e){var t=e.match(ur);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function cr(e,t){return et?1:0}var dr,hr,pr,fr=function(){function e(e,t,n){this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}return e.prototype.clone=function(){return new e(this._fontStyle,this._foreground,this._background)},e.prototype.acceptOverwrite=function(e,t,n){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==n&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0},e}(),gr=function(){function e(e){this._mainRule=e,this._children=new Map}return e.prototype.match=function(e){if(""===e)return this._mainRule;var t,n,i=e.indexOf(".");-1===i?(t=e,n=""):(t=e.substring(0,i),n=e.substring(i+1));var o=this._children.get(t);return"undefined"!==typeof o?o.match(n):this._mainRule},e.prototype.insert=function(t,n,i,o){if(""!==t){var r,s,a=t.indexOf(".");-1===a?(r=t,s=""):(r=t.substring(0,a),s=t.substring(a+1));var u=this._children.get(r);"undefined"===typeof u&&(u=new e(this._mainRule.clone()),this._children.set(r,u)),u.insert(s,n,i,o)}else this._mainRule.acceptOverwrite(n,i,o)},e}();function mr(e){for(var t=[],n=1,i=e.length;n0?(this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}return Object.defineProperty(e.prototype,"base",{get:function(){return this.themeData.base},enumerable:!0,configurable:!0}),e.prototype.notifyBaseUpdated=function(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)},e.prototype.getColors=function(){if(!this.colors){var e=new Map;for(var t in this.themeData.colors)e.set(t,tr["a"].fromHex(this.themeData.colors[t]));if(this.themeData.inherit){var n=Nr(this.themeData.base);for(var t in n.colors)e.has(t)||e.set(t,tr["a"].fromHex(n.colors[t]))}this.colors=e}return this.colors},e.prototype.getColor=function(e,t){var n=this.getColors().get(e);return n||(!1!==t?this.getDefault(e):void 0)},e.prototype.getDefault=function(e){var t=this.defaultColors[e];return t||(t=Sr.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)},e.prototype.defines=function(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)},Object.defineProperty(e.prototype,"type",{get:function(){switch(this.base){case yr:return"light";case Cr:return"hc";default:return"dark"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenTheme",{get:function(){if(!this._tokenTheme){var e=[],t=[];if(this.themeData.inherit){var n=Nr(this.themeData.base);e=n.rules,n.encodedTokensColors&&(t=n.encodedTokensColors)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=ar.createFromRawTokenTheme(e,t)}return this._tokenTheme},enumerable:!0,configurable:!0}),e}();function xr(e){return e===yr||e===wr||e===Cr}function Nr(e){switch(e){case yr:return vr;case wr:return _r;case Cr:return br}}function Dr(e){var t=Nr(e);return new Or(e,t)}var kr=function(){function e(){this.environment=Object.create(null),this._onThemeChange=new R["a"],this._onIconThemeChange=new R["a"],this._knownThemes=new Map,this._knownThemes.set(yr,Dr(yr)),this._knownThemes.set(wr,Dr(wr)),this._knownThemes.set(Cr,Dr(Cr)),this._styleElement=K["s"](),this._styleElement.className="monaco-colors",this.setTheme(yr)}return Object.defineProperty(e.prototype,"onThemeChange",{get:function(){return this._onThemeChange.event},enumerable:!0,configurable:!0}),e.prototype.defineTheme=function(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!xr(t.base)&&!xr(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new Or(e,t)),xr(e)&&this._knownThemes.forEach(function(t){t.base===e&&t.notifyBaseUpdated()}),this._theme&&this._theme.themeName===e&&this.setTheme(e)},e.prototype.getTheme=function(){return this._theme},e.prototype.setTheme=function(e){var t,n=this;if(t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(yr),this._theme===t)return t.id;this._theme=t;var i=[],o={},r={addRule:function(e){o[e]||(i.push(e),o[e]=!0)}};Lr.getThemingParticipants().forEach(function(e){return e(t,r,n.environment)});var s=t.tokenTheme,a=s.getColorMap();return r.addRule(mr(a)),this._styleElement.innerHTML=i.join("\n"),pe["y"].setColorMap(a),this._onThemeChange.fire(t),t.id},e.prototype.getIconTheme=function(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}},e}(),Ir=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Er=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Mr=function(e,t){return function(n,i){t(n,i,e)}},Tr="data-keybinding-context",Pr=function(){function e(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value["_contextId"]=e}return e.prototype.setValue=function(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)},e.prototype.removeValue=function(e){return e in this._value&&(delete this._value[e],!0)},e.prototype.getValue=function(e){var t=this._value[e];return"undefined"===typeof t&&this._parent?this._parent.getValue(e):t},e}(),Rr=function(e){function t(){return e.call(this,-1,null)||this}return Ir(t,e),t.prototype.setValue=function(e,t){return!1},t.prototype.removeValue=function(e){return!1},t.prototype.getValue=function(e){},t.INSTANCE=new t,t}(Pr),Ar=function(e){function t(t,n,i){var o=e.call(this,t,null)||this;return o._configurationService=n,o._values=new Map,o._listener=o._configurationService.onDidChangeConfiguration(function(e){if(6===e.source){var t=Object(dn["d"])(o._values);o._values.clear(),i.fire(new Wr(t))}else{for(var n=[],r=0,s=e.affectedKeys;r1){var i=n.shift();i&&(o.focusItemByElement(i.container),n.push(i)),o.mnemonics.set(t,n)}}})),be["c"]&&o._register(Object(K["h"])(r,K["d"].KEY_DOWN,function(e){var t=new rn["a"](e);t.equals(14)||t.equals(11)?(o.focusedItem=o.viewItems.length-1,o.focusNext(),K["c"].stop(e,!0)):(t.equals(13)||t.equals(12))&&(o.focusedItem=0,o.focusPrevious(),K["c"].stop(e,!0))})),o._register(Object(K["h"])(o.domNode,K["d"].MOUSE_OUT,function(e){var t=e.relatedTarget;Object(K["E"])(t,o.domNode)||(o.focusedItem=void 0,o.scrollTopHold=o.menuElement.scrollTop,o.updateFocus(),e.stopPropagation())})),o._register(Object(K["h"])(o.domNode,K["d"].MOUSE_UP,function(e){K["c"].stop(e,!0)})),o._register(Object(K["h"])(o.actionsList,K["d"].MOUSE_OVER,function(e){var t=e.target;if(t&&Object(K["E"])(t,o.actionsList)&&t!==o.actionsList){while(t.parentElement!==o.actionsList&&null!==t.parentElement)t=t.parentElement;if(Object(K["C"])(t,"action-item")){var n=o.focusedItem;o.scrollTopHold=o.menuElement.scrollTop,o.setFocusedItem(t),n!==o.focusedItem&&o.updateFocus()}}}));var s={parent:o};o.mnemonics=new Map,o.push(n,{icon:!0,label:!0,isMenu:!0}),o.scrollableElement=o._register(new ui["a"](r,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));var a=o.scrollableElement.getDomNode();return a.style.position=null,r.style.maxHeight=Math.max(10,window.innerHeight-t.getBoundingClientRect().top-30)+"px",o.menuDisposables.add(o.scrollableElement.onScroll(function(){o._onScroll.fire()},o)),o._register(Object(K["h"])(o.menuElement,K["d"].SCROLL,function(e){void 0!==o.scrollTopHold&&(o.menuElement.scrollTop=o.scrollTopHold,o.scrollTopHold=void 0),o.scrollableElement.scanDomNode()})),t.appendChild(o.scrollableElement.getDomNode()),o.scrollableElement.scanDomNode(),o.viewItems.filter(function(e){return!(e instanceof Qr)}).forEach(function(e,t,n){e.updatePositionInSet(t+1,n.length)}),o}return Kr(t,e),t.prototype.style=function(e){var t=this.getContainer(),n=e.foregroundColor?""+e.foregroundColor:null,i=e.backgroundColor?""+e.backgroundColor:null,o=e.borderColor?"2px solid "+e.borderColor:null,r=e.shadowColor?"0 2px 4px "+e.shadowColor:null;t.style.border=o,this.domNode.style.color=n,this.domNode.style.backgroundColor=i,t.style.boxShadow=r,this.viewItems&&this.viewItems.forEach(function(t){(t instanceof Xr||t instanceof Qr)&&t.style(e)})},t.prototype.getContainer=function(){return this.scrollableElement.getDomNode()},Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollOffset",{get:function(){return this.menuElement.scrollTop},enumerable:!0,configurable:!0}),t.prototype.focusItemByElement=function(e){var t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()},t.prototype.setFocusedItem=function(e){for(var t=0;t