/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */!function(e){function t(t){for(var r,s,i=t[0],a=t[1],o=0,u=[];oconsole.error("SEMVER",...e):()=>{};e.exports=r}).call(this,r(17))},function(e,t){const r=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),s=r.n(n),i=r(0),a=r(5);const o=new class ApiService{constructor(){s()(this,"client",void 0),s()(this,"clusterUpgradeStateListeners",[])}handleClusterUpgradeError(e){if(Boolean(e&&426===e.statusCode)){const t=e.attributes.allNodesUpgraded?"isUpgradeComplete":"isUpgrading";this.clusterUpgradeStateListeners.forEach((e=>e(t)))}}useRequest(e){if(!this.client)throw new Error("API service has not been initialized.");const t=Object(a.l)(this.client,e);return this.handleClusterUpgradeError(t.error),t}async sendRequest(e){if(!this.client)throw new Error("API service has not been initialized.");const t=await Object(a.k)(this.client,e);return this.handleClusterUpgradeError(t.error),t}setup(e){this.client=e}onClusterUpgradeStateChange(e){this.clusterUpgradeStateListeners.push(e)}useLoadClusterUpgradeStatus(){return this.useRequest({path:`${i.a}/cluster_upgrade_status`,method:"get",pollIntervalMs:i.e})}useLoadCloudBackupStatus(){return this.useRequest({path:`${i.a}/cloud_backup_status`,method:"get",pollIntervalMs:i.c})}useLoadSystemIndicesMigrationStatus(){return this.useRequest({path:`${i.a}/system_indices_migration`,method:"get"})}async migrateSystemIndices(){return await this.sendRequest({path:`${i.a}/system_indices_migration`,method:"post"})}useLoadEsDeprecations(){return this.useRequest({path:`${i.a}/es_deprecations`,method:"get"})}useLoadDeprecationLogging(){return this.useRequest({path:`${i.a}/deprecation_logging`,method:"get"})}async updateDeprecationLogging(e){return await this.sendRequest({path:`${i.a}/deprecation_logging`,method:"put",body:JSON.stringify(e)})}getDeprecationLogsCount(e){return this.useRequest({path:`${i.a}/deprecation_logging/count`,method:"get",query:{from:e},pollIntervalMs:i.f})}deleteDeprecationLogsCache(){return this.sendRequest({path:`${i.a}/deprecation_logging/cache`,method:"delete"})}async updateIndexSettings(e,t){return await this.sendRequest({path:`${i.a}/${e}/index_settings`,method:"post",body:{settings:JSON.stringify(t)}})}async upgradeMlSnapshot(e){return await this.sendRequest({path:`${i.a}/ml_snapshots`,method:"post",body:e})}async deleteMlSnapshot({jobId:e,snapshotId:t}){return await this.sendRequest({path:`${i.a}/ml_snapshots/${e}/${t}`,method:"delete"})}async getMlSnapshotUpgradeStatus({jobId:e,snapshotId:t}){return await this.sendRequest({path:`${i.a}/ml_snapshots/${e}/${t}`,method:"get"})}useLoadMlUpgradeMode(){return this.useRequest({path:`${i.a}/ml_upgrade_mode`,method:"get"})}async getReindexStatus(e){return await this.sendRequest({path:`${i.a}/reindex/${e}`,method:"get"})}async startReindexTask(e){return await this.sendRequest({path:`${i.a}/reindex/${e}`,method:"post"})}async cancelReindexTask(e){return await this.sendRequest({path:`${i.a}/reindex/${e}/cancel`,method:"post"})}useLoadUpgradeStatus(){return this.useRequest({path:`${i.a}/status`,method:"get"})}async updateClusterSettings(e){return await this.sendRequest({path:`${i.a}/cluster_settings`,method:"post",body:{settings:JSON.stringify(e)}})}useLoadRemoteClusters(){return this.useRequest({path:`${i.a}/remote_clusters`,method:"get"})}useLoadNodeDiskSpace(){return this.useRequest({path:`${i.a}/node_disk_space`,method:"get"})}}},function(e,t,r){r.r(t);var n=__kbnBundles__.get("plugin/kibanaUtils/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){r.r(t);var n=__kbnBundles__.get("entry/core/public");Object.defineProperties(t,Object.getOwnPropertyDescriptors(n))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),s=r.n(n),i=r(3);const a={breadcrumbs:{overview:i.i18n.translate("xpack.upgradeAssistant.breadcrumb.overviewLabel",{defaultMessage:"Upgrade Assistant"}),esDeprecations:i.i18n.translate("xpack.upgradeAssistant.breadcrumb.esDeprecationsLabel",{defaultMessage:"Elasticsearch deprecation issues"}),esDeprecationLogs:i.i18n.translate("xpack.upgradeAssistant.breadcrumb.esDeprecationLogsLabel",{defaultMessage:"Elasticsearch deprecation logs"}),kibanaDeprecations:i.i18n.translate("xpack.upgradeAssistant.breadcrumb.kibanaDeprecationsLabel",{defaultMessage:"Kibana deprecation issues"})}},o=new class BreadcrumbService{constructor(){s()(this,"breadcrumbs",{overview:[{text:a.breadcrumbs.overview}],esDeprecations:[{text:a.breadcrumbs.overview,href:"/"},{text:a.breadcrumbs.esDeprecations}],esDeprecationLogs:[{text:a.breadcrumbs.overview,href:"/"},{text:a.breadcrumbs.esDeprecationLogs}],kibanaDeprecations:[{text:a.breadcrumbs.overview,href:"/"},{text:a.breadcrumbs.kibanaDeprecations}]}),s()(this,"setBreadcrumbsHandler",void 0)}setup(e){this.setBreadcrumbsHandler=e}setBreadcrumbs(e){if(!this.setBreadcrumbsHandler)throw new Error("Breadcrumb service has not been initialized");const t=this.breadcrumbs[e]?[...this.breadcrumbs[e]]:[...this.breadcrumbs.home];this.setBreadcrumbsHandler(t)}}},function(e,t,r){const n=r(8),{MAX_LENGTH:s,MAX_SAFE_INTEGER:i}=r(9),{safeRe:a,t:o}=r(18),c=r(19),{compareIdentifiers:u}=r(20);class SemVer{constructor(e,t){if(t=c(t),e instanceof SemVer){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[o.LOOSE]:a[o.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=SemVer},function(e,t,r){r(16),__kbnBundles__.define("plugin/upgradeAssistant/public",r,21)},function(e,t,r){r.p=window.__kbnPublicPath__.upgradeAssistant},function(e,t,r){e.exports=r(7)(448)},function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=r(9),a=r(8),o=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],p=t.t={};let d=0;const l="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[l,s]],E=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=d++;a(e,s,t),p[e]=s,u[s]=t,o[s]=new RegExp(t,r?"g":void 0),c[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),E("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${u[p.NUMERICIDENTIFIER]}|${u[p.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NUMERICIDENTIFIERLOOSE]}|${u[p.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${l}+`),E("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),E("FULL",`^${u[p.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),E("LOOSE",`^${u[p.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),E("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),E("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),E("COERCERTL",u[p.COERCE],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},function(e,t){const r=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?r:e:n},function(e,t){const r=/^[0-9]+$/,n=(e,t)=>{const n=r.test(e),s=r.test(t);return n&&s&&(e=+e,t=+t),e===t?0:n&&!s?-1:s&&!n?1:en(t,e)}},function(e,t,r){"use strict";r.r(t),r.d(t,"plugin",(function(){return u}));var n=r(14),s=r.n(n),i=r(3),a=r(10),o=r(13),c=r(6);class plugin_UpgradeAssistantUIPlugin{constructor(e){this.ctx=e}setup(e,{management:t,cloud:n,share:u,usageCollection:p}){const{featureSet:d,ui:{enabled:l}}=this.ctx.config.get();if(l){const l=t.sections.section.stack,h=new s.a(this.ctx.env.packageInfo.version),E={currentMajor:h.major,prevMajor:h.major-1,nextMajor:h.major+1},f=i.i18n.translate("xpack.upgradeAssistant.appTitle",{defaultMessage:"Upgrade Assistant"});p&&c.s.setup(p),l.registerApp({id:"upgrade_assistant",title:f,order:1,async mount(t){const[s,{data:i,...c}]=await e.getStartServices(),{chrome:{docTitle:p}}=s;p.change(f);const l={featureSet:d,kibanaVersionInfo:E,plugins:{cloud:n,share:u,infra:c.hasOwnProperty("infra")?{}:void 0},services:{core:s,data:i,history:t.history,api:a.a,breadcrumbs:o.a},theme$:t.theme$},{mountManagementSection:h}=await r.e(1).then(r.bind(null,69)),_=h(t,l);return()=>{p.reset(),_()}}})}}start(){}stop(){}}const u=e=>new plugin_UpgradeAssistantUIPlugin(e)},function(e,t){e.exports=__kbnSharedDeps__.React},function(e,t){e.exports=__kbnSharedDeps__.EmotionReact},function(e,t){e.exports=__kbnSharedDeps__.ElasticEui},function(e,t){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,t){e.exports=__kbnSharedDeps__.KbnAnalytics},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDom},function(e,t){e.exports=__kbnSharedDeps__.Lodash},function(e,t){e.exports=__kbnSharedDeps__.MomentTimezone},function(e,t){e.exports=__kbnSharedDeps__.TsLib},function(e,t){e.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(e,t){e.exports=__kbnSharedDeps__.ReactDom},function(e,t){e.exports=__kbnSharedDeps__.Uuid},function(e,t){e.exports=__kbnSharedDeps__.Classnames},function(e,t){e.exports=__kbnSharedDeps__.KbnRison},function(e,t){e.exports=__kbnSharedDeps__.KbnEsQuery}]);