@spinnaker/titus 2026.0.2 → 2026.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"angular";import{module as t}from"angular";import{InstanceInformation as n,getAllTargetGroups as r,InstanceStatus as a,VpcReader as s,ServerGroupSecurityGroupsRemoved as i,SecurityGroupSelector as o,AWSProviderSettings as l,SubnetSelectField as c,ServerGroupCapacity as u,ServerGroupLoadBalancers as d,ServerGroupSecurityGroups as m,MetricAlarmChart as p,TargetMetricFields as g,TargetTrackingAdditionalSettings as h,AlarmConfigurer as f,StepPolicyAction as v,ScalingPolicyAdditionalSettings as y,PolicyTypeSelectionModal as b,AmazonLoadBalancersTag as C}from"@spinnaker/amazon";import{HelpContentsRegistry as E,CollapsibleSection as w,LabeledValueList as S,LabeledValue as k,CopyToClipboard as N,LinkWithClipboard as A,ReactInject as G,AccountService as T,ReactInjector as I,FirewallLabels as D,ConfirmationModalService as x,InstanceWriter as P,overridableComponent as O,InstanceDetailsHeader as L,InstanceActions as M,InstanceInsights as F,ConsoleOutputLink as z,InstanceLinks as j,useData as B,SETTINGS as R,InstanceDetailsPane as V,Spinner as W,RecentHistoryService as H,InstanceReader as Z,ClusterState as U,UrlBuilder as q,Registry as J,StageConstants as K,NameUtils as X,ExecutionDetailsSection as Y,AccountTag as Q,Markdown as $,RenderOutputFile as _,StageFailureMessage as ee,DeployingIntoManagedClusterWarning as te,AccountSelectInput as ne,RegionSelectField as re,HelpField as ae,ServerGroupDetailsField as se,DeploymentStrategySelector as ie,ServerGroupNamePreview as oe,SpelNumberInput as le,ValidationMessage as ce,FormValidator as ue,FormikFormField as de,TextInput as me,SelectInput as pe,LayoutProvider as ge,MapEditorInput as he,PlatformHealthOverrideInput as fe,useFormInputValueMapper as ve,robotToHuman as ye,ChecklistInput as be,CheckboxInput as Ce,CACHE_INITIALIZER_SERVICE as Ee,LOAD_BALANCER_READ_SERVICE as we,SECURITY_GROUP_READER as Se,setMatchingResourceSummary as ke,SubnetReader as Ne,NumberInput as Ae,SpinFormik as Ge,ReactSelectInput as Te,ResponsiveFieldLayout as Ie,TetheredSelect as De,StageConfigField as xe,MapEditor as Pe,ExecutionDetailsTasks as Oe,TaskMonitor as Le,ReactModal as Me,DeployInitializer as Fe,WizardModal as ze,WizardPage as je,noop as Be,useTaskMonitor as Re,TaskMonitorWrapper as Ve,ModalClose as We,PlatformHealthOverride as He,UserVerification as Ze,MinMaxDesiredChanges as Ue,ModalHeader as qe,ModalBody as Je,ModalFooter as Ke,ServerGroupReader as Xe,DesiredCapacity as Ye,CurrentCapacity as Qe,showModal as $e,Overridable as _e,confirmNotManaged as et,TaskMonitorModal as tt,withErrorBoundary as nt,TaskExecutor as rt,SubmitButton as at,SERVER_GROUP_WRITER as st,TextAreaInput as it,ServerGroupWarningMessageService as ot,ClusterTargetBuilder as lt,ApplicationNameValidator as ct,CloudProviderRegistry as ut,DeploymentStrategyRegistry as dt}from"@spinnaker/core";import*as mt from"react";import pt from"react";import{UISref as gt}from"@uirouter/react";import{UIRouterContextComponent as ht}from"@uirouter/react-hybrid";import ft,{sortBy as vt,get as yt,chain as bt,xor as Ct,isUndefined as Et,intersection as wt,set as St,union as kt,cloneDeep as Nt,flatten as At,isEqual as Gt,defaultsDeep as Tt}from"lodash";import It from"@uirouter/angularjs";import{DockerImageUtils as Dt,DockerImageAndTagSelector as xt}from"@spinnaker/docker";import{$q as Pt}from"ngimport";import{Field as Ot,Form as Lt}from"formik";import Mt from"react-select";import{Subject as Ft}from"rxjs";import{Modal as zt}from"react-bootstrap";import{react2angular as jt}from"react2angular";import Bt from"pretty-ms";const Rt={"titus.deploy.runtimeLimitSecs":"<p>Maximum amount of time (in seconds) a batch job is allowed to run</p>","titus.deploy.retries":"<p>Number of times to retry this job</p>","titus.deploy.propertyFile":"<p>(Optional) Configures the name to the file used to pass in properties to later stages in the Spinnaker pipeline. The file must be saved into the /logs directory during execution</p>","titus.deploy.iamProfile":"AWS IAM instance profile to assign to this service","titus.deploy.capacityGroup":"Used by Titus to ensure capacity guarantees, defaults to the application name if not provided","titus.deploy.command":"<p>(Optional) Defines one or more custom commands. If multiple commands are defined, they must be comma delimited with no spaces: <b>cmd1,cmd2</b></p>","titus.deploy.entrypoint":"<p>(Optional) Defines one or more entrypoints. If multiple entrypoints are defined, they must be comma delimited with no spaces: <b>entry1,entry2</b></p>","titus.deploy.migrationPolicy":"Defines how the tasks for this job will be migrated during an infrastructure change","titus.deploy.network":"Amount of networking bandwidth to allocate in Mbps","titus.deploy.gpu":"Number of GPUs to use. WARNING: only use if directed by Titus team, otherwise leave at 0","titus.deploy.softConstraints":"Soft constraints are enforced on a best efforts basis. For example, if tasks can’t be perfectly balanced across zones, the best available balance is achieved without keeping the tasks pending for execution.","titus.deploy.hardConstraints":"Constraints must be met and tasks will not be launched if constraint can’t be perfectly met","titus.deploy.efs":"if completed, allows you to specify an EFS volume to attach to each Task that gets created for the Job","titus.deploy.mountPoint":"(Required) A valid directory to mount the volume, e.g, <samp>/efs</samp>. Invalid locations are <samp>/</samp>, <samp>/data</samp>, and <samp>/logs</samp> as these are reserved directories.","titus.deploy.efsId":"(Required) The EFS file system ID, e.g. <samp> fs-0208c74b</samp>.","titus.deploy.efsRelativeMountPoint":"(Optional) Relative dir within FS ID, e.g. <samp>/dirInVol</samp>","titus.job.waitForCompletion":"if unchecked, marks the stage as successful right away without waiting for the job to complete","titus.bake.fromGitTrigger":"If checked, gets git details from the specified git trigger.","titus.bake.repositoryUrl":"Url to the git repository containing the code to create the Docker image from, <samp>ssh://git@stash.corp.netflix.com:7999/SPKR/orca.git</samp> or <samp>ssh://git@github.com/spinnaker/orca.git</samp>","titus.bake.repositoryHash":"(Optional) The hashcode to the git commit for the image","titus.bake.repositoryBranch":"(Optional) The branch in git to build the image from","titus.bake.repositoryDirectory":"(Optional) If specified, will build the image from the Dockerfile contained in this directory. Default to project root.","titus.bake.imageOrganization":"(Optional) The organization to which this image belongs to, e.g. <samp>spinnaker</samp> for <samp>spinnaker/igor</samp>Defaults to none.","titus.bake.imageName":"(Optional) The name for the image, e.g. <samp>igor</samp> for <samp>spinnaker/igor</samp>Defaults to [git project name].[git repo name].","titus.bake.tags":"(Optional) Comma separated. By default, the <samp>latest</samp> tag is updated. Adds additional tags to label this image <samp>1.0.0-unstable,1.0.0-rc1</samp>","titus.bake.buildParameters":"(Optional) Build time variables to be passed to the Docker image. These are the set of values passed to --build-args in the command line.","titus.serverGroup.subnet":"The subnet selection determines the VPC in which your container will run. Options vary by account and region. The most common are: \n <ul>\n <li><b>titus</b>: instances will be restricted to internal clients with their own NAT gateways</li>\n <li><b>internal</b> instances will be restricted to internal clients (i.e. require VPN access)</li>\n <li><b>external</b> instances will be publicly accessible and running in VPC</li>\n </ul>\n ","titus.serverGroup.traffic":'\n <p>Enables the "inService" scaling process, which is used by Spinnaker and discovery services to determine if the server group is enabled.</p>\n <p>Will be automatically enabled when any non "custom" deployment strategy is selected.</p>',"titus.deploy.imageId":"This value has been manually overridden. To edit this value, please update the <b><i>imageId</i></b> attribute in the stage JSON. Spinnaker expects this to follow the <b><i>name:tag</i></b> format, or the <b><i>imageName</i></b> directly from Jenkins","titus.deploy.securityGroups":"AWS Security Groups to assign to this service. Security groups are set only if <samp>Allocate IP?</samp> has been selected and are assigned to the Titus AWS Elastic Network Interface.","titus.job.capacityGroup":"Capacity Group will default to application name if not specified.","titus.job.securityGroups":"AWS Security Groups to assign to this job","titus.autoscaling.cooldown":"\n <p>The amount of time, in seconds, after a scaling activity completes where previous trigger-related scaling\n activities can influence future scaling events.</p>\n <p>For scale out policies, while the cooldown period is in effect, the capacity that has been added by the\n previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next\n scale out. The intention is to continuously (but not excessively) scale out. For example, an alarm triggers a\n step scaling policy to scale out an Amazon ECS service by 2 tasks, the scaling activity completes successfully,\n and a cooldown period of 5 minutes starts. During the Cooldown period, if the alarm triggers the same policy\n again but at a more aggressive step adjustment to scale out the service by 3 tasks, the 2 tasks that were added\n in the previous scale out event are considered part of that capacity and only 1 additional task is added to the desired count.</p>\n <p>For scale in policies, the cooldown period is used to block subsequent scale in requests until it has expired.\n The intention is to scale in conservatively to protect your application's availability. However, if another\n alarm triggers a scale out policy during the cooldown period after a scale in, Application Auto Scaling scales\n out your scalable target immediately.</p>\n ","titus.autoscaling.scaleIn.cooldown":"\n <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.</p>\n <p>The cooldown period is used to block subsequent scale in requests until it has expired. The intention is to scale\n in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy\n during the cooldown period after a scale in, Application Auto Scaling scales out your scalable target immediately.</p>\n ","titus.autoscaling.scaleOut.cooldown":"\n <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.</p>\n <p>While the cooldown period is in effect, the capacity that has been added by the previous scale out event that\n initiated the cooldown is calculated as part of the desired capacity for the next scale out. The intention is to\n continuously (but not excessively) scale out.</p>\n ","titus.disruptionbudget.description":'\n <p>\n The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the\n job can be relocated.\n <a href="http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/" target="_blank">\n Read the full documentation\n </a>\n </p>\n '};Object.keys(Rt).forEach((e=>E.register(e,Rt[e])));const Vt=({containerIp:e,host:t,instancePort:n,ipv6Address:r})=>mt.createElement(w,{heading:"DNS",defaultExpanded:!0},mt.createElement(S,{className:"dl-horizontal dl-narrow"},e&&mt.createElement(k,{label:"Container IP",value:mt.createElement(mt.Fragment,null,e,mt.createElement(N,{text:e,toolTip:"Copy container IP to clipboard"}))}),r&&mt.createElement(k,{label:"Container IPv6",value:mt.createElement(A,{text:r,url:`http://${r}:${n}`})}),mt.createElement(k,{label:"Host IP",value:t}))),Wt=({instance:e,titusUiEndpoint:t})=>{const{id:r,jobId:a}=e;return pt.createElement(w,{heading:"Instance Information",defaultExpanded:!0},pt.createElement("dl",{className:"dl-horizontal dl-narrow"},pt.createElement(n,{account:e.account,availabilityZone:e.availabilityZone,instanceType:e.instanceType,launchTime:e.launchTime,provider:e.provider,region:e.region,serverGroup:e.serverGroup}),pt.createElement(k,{label:"Job Id",value:pt.createElement("a",{href:`${t}jobs/${a}`,target:"_blank"},a)}),pt.createElement(k,{label:"Instance Id",value:pt.createElement(A,{text:r,url:`${t}jobs/${a}/tasks/${r}`})})))};class Ht extends G{get titusServerGroupTransformer(){return this.$injector.get("titusServerGroupTransformer")}get titusServerGroupCommandBuilder(){return this.$injector.get("titusServerGroupCommandBuilder")}get titusServerGroupConfigurationService(){return this.$injector.get("titusServerGroupConfigurationService")}get titusSecurityGroupReader(){return this.$injector.get("titusSecurityGroupReader")}initialize(e){this.$injector=e}}const Zt=new Ht;class Ut extends pt.Component{constructor(e){super(e),this.state={}}componentDidMount(){this.configureSecurityGroups(this.props)}configureSecurityGroups(e){const{app:t,serverGroup:n}=e,{region:r}=n;if(t.securityGroupsIndex&&n.accountDetails){const e=n.securityGroups.map((e=>Zt.titusSecurityGroupReader.resolveIndexedSecurityGroup(t.securityGroupsIndex,{account:n.accountDetails.awsAccount,region:r},e)));this.setState({securityGroups:e})}else T.listAllAccounts("titus").then((e=>{const t=e.find((e=>e.name===n.account));t&&t.awsAccount&&I.securityGroupReader.getAllSecurityGroups().then((e=>{const a=e[t.awsAccount].aws[r],s=n.securityGroups.map((e=>a.find((t=>t.id===e)))).filter((e=>e)).map((e=>({account:t.awsAccount,name:e.name,id:e.id,vpcId:e.vpcId})));this.setState({securityGroups:s})}))}))}componentWillReceiveProps(e){this.configureSecurityGroups(e)}render(){const{serverGroup:e}=this.props,{securityGroups:t}=this.state,n=!t&&(e.securityGroups||[]).length;return pt.createElement(w,{heading:D.get("Firewalls"),outerDivClassName:""},pt.createElement("ul",null,n&&e.securityGroups.map((e=>pt.createElement("li",{key:e},"..."))),pt.createElement(ht,null,pt.createElement(pt.Fragment,null,vt(t,"name").map((t=>pt.createElement("li",{key:t.name},pt.createElement(gt,{to:"^.firewallDetails",params:{name:t.name,accountId:t.account,region:e.region,vpcId:t.vpcId,provider:"aws"}},pt.createElement("a",null,t.name," (",t.id,")")))))))))}}const qt=(e,t,n)=>e.map((e=>{var r;const a=t.find((t=>(t.name===e.name||t.name===e.targetGroupName)&&t.account===n)),s="traffic-port"===(null==a?void 0:a.healthCheckPort)||!(null==a?void 0:a.healthCheckPort);return{...e,name:null==a?void 0:a.name,healthCheckPath:a?`:${s?null==a?void 0:a.port:a.healthCheckPort}${(null==a?void 0:a.healthCheckPath)||""}`:void 0,healthCheckProtocol:null==(r=null==a?void 0:a.healthCheckProtocol)?void 0:r.toLowerCase()}})),Jt=(e,t,n)=>{const a=(e||[]).filter((e=>"Unknown"!==e.state)),s=r(t);return a.map((e=>{if("TargetGroup"===e.type){const t=qt(e.targetGroups,s,n);return{...e,targetGroups:t}}return e}))},Kt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id}`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{id:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id}?`,buttonText:`Terminate ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>{const n={cloudProvider:"titus"};return e.serverGroup&&(n.serverGroupName=e.serverGroup),P.terminateInstance(e,t,n)}})},Xt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id} and shrinking server group`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{instanceId:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id} and shrink ${e.serverGroup}?`,buttonText:`Terminate ${e.id} and shrink ${e.serverGroup}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.terminateInstancesAndShrinkServerGroups([{cloudProvider:e.cloudProvider,instanceIds:[e.id],account:e.account,region:e.region,serverGroup:e.serverGroup,instances:[e]}],t)})},Yt=(e,t)=>()=>{const n={application:t,title:`Enabling ${e.id} in discovery`};x.confirm({header:`Really enable ${e.id} in discovery?`,buttonText:`Enable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.enableInstanceInDiscovery(e,t)})},Qt=(e,t)=>()=>{const n={application:t,title:`Disabling ${e.id} in discovery`};x.confirm({header:`Really disable ${e.id} in discovery?`,buttonText:`Disable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.disableInstanceInDiscovery(e,t)})},$t=(e,t)=>{const n=[{label:"Terminate",triggerAction:Kt(e,t)},{label:"Terminate and Shrink Server Group",triggerAction:Xt(e,t)}],r=(e.health||[]).filter((e=>"Discovery"===e.type));r.length&&"OutOfService"===r[0].state&&n.push({label:"Enable in Discovery",triggerAction:Yt(e,t)});return(r||[]).some((e=>"Up"===e.state||"Down"===e.state))&&n.push({label:"Disable in Discovery",triggerAction:Qt(e,t)}),n},_t=O((({account:e,actions:t,app:n,baseIpAddress:r,environment:s,healthMetrics:i,instance:o,instanceId:l,instancePort:c,loading:u,moniker:d,serverGroup:m,region:p})=>{var g,h,f;const v=`ssh -t ${null==e?void 0:e.bastionHost} 'titus-ssh -region ${p} ${l}'`;return mt.createElement("div",{className:"details-panel"},mt.createElement("div",{className:"header"},mt.createElement(L,{healthState:o.healthState,instanceId:l,loading:u,sshLink:v,standalone:n.isStandalone}),mt.createElement("div",{className:"actions"},mt.createElement(M,{actions:t}),Boolean(null==(g=null==o?void 0:o.insightActions)?void 0:g.length)&&mt.createElement(F,{analytics:!0,insights:o.insightActions,instance:o}))),mt.createElement("div",{className:"content"},mt.createElement(Wt,{instance:o,titusUiEndpoint:o.titusUiEndpoint}),mt.createElement(a,{healthMetrics:i,healthState:o.healthState,metricTypes:["TargetGroup"],privateIpAddress:o.privateIpAddress}),mt.createElement(Vt,{containerIp:null==(h=o.placement)?void 0:h.containerIp,host:null==(f=o.placement)?void 0:f.host,instancePort:c,ipv6Address:o.ipv6Address}),mt.createElement("div",{className:"collapsible-section"},mt.createElement(Ut,{app:n,serverGroup:m})),mt.createElement(w,{heading:"Console Output"},mt.createElement(z,{instance:o})),mt.createElement(j,{address:r,application:n,instance:o,environment:s,moniker:d})))}),"titus.instance.details.content"),en=({app:e,environment:t,instance:n,moniker:r})=>{var a,s,i;const{instanceId:o}=n,l=e.serverGroups.data.find((e=>e.instances.some((e=>e.id===o)))),{account:c,region:u}=l,d=()=>(H.addExtraDataToLatest("instances",{account:c,region:u,serverGroup:l.name}),Promise.all([Z.getInstanceDetails(c,u,o).then((e=>({...e,account:c,region:u}))),T.getAccountDetails(c)])),m=e=>{const[t,n]=e,r=((null==n?void 0:n.regions)||[]).find((e=>e.name===u));return[{titusUiEndpoint:null==r?void 0:r.endpoint,...t},n]},{result:[p,g],status:h}=B((()=>e.isStandalone?d().then((e=>m(e))):e.serverGroups.ready().then(d).then((e=>m(e)))),[{},{}],[o,l]),f=$t(p,e),v=Jt(p.health,e.loadBalancers.data,g.awsAccount),y="PENDING"===h,b=(null==(a=e.attributes)?void 0:a.instancePort)||R.defaultInstancePort||"80",C=(null==(s=p.placement)?void 0:s.containerIp)||(null==(i=null==p?void 0:p.placement)?void 0:i.host);return y?mt.createElement(V,null,mt.createElement("div",{className:"horizontal center middle"},mt.createElement(W,{size:"small"}))):(null==p?void 0:p.id)?mt.createElement(_t,{account:g,actions:f,app:e,baseIpAddress:C,environment:t,healthMetrics:v,instance:p,instanceId:n.instanceId,instancePort:b,moniker:r,loading:y,serverGroup:l,region:u}):mt.createElement("div",{className:"details-panel"},mt.createElement("div",{className:"header"},mt.createElement(V,null,mt.createElement("div",{className:"header-text horizontal middle"},mt.createElement("h3",{className:"horizontal middle space-between flex-1"},n.instanceId)))),mt.createElement("div",{className:"content"},mt.createElement("div",{className:"content-section"},mt.createElement("div",{className:"content-body text-center"},mt.createElement("h3",null,"Instance not found.")))))};const tn="spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller";t(tn,[It]).controller("titusCloneServerGroupExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService",function(e,t,n){e.configSections=["cloneServerGroupConfig","taskStatus"];const r=()=>{const n=r["kato.tasks"][0].resultObjects;e.detailsSection=t.details;const r=e.stage.context||{},a=[];r&&r["kato.tasks"]&&r["kato.tasks"].length&&n&&n.length&&function(e){const s=ft.find(n,e);s&&ft.forEach(s[e],(e=>{if(e.includes(":")){const[n,s]=e.split(":"),i={type:"serverGroups",application:r.application,serverGroup:s,account:r.credentials,region:n,provider:"titus",project:t.project};i.href=q.buildFromMetadata(i),a.push(i)}}))}("serverGroupNames"),e.deployed=a};this.overrideFiltersForUrl=e=>U.filterService.overrideFiltersForUrl(e);const a=()=>n.synchronizeSection(e.configSections,r);a(),e.$on("$stateChangeSuccess",a)}]);const nn="spinnaker.titus.pipeline.stage.cloneServerGroupStage";t(nn,[tn]).config((function(){J.pipeline.registerStage({provides:"cloneServerGroup",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",executionDetailsUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",executionStepLabelUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",validators:[{type:"requiredField",fieldName:"targetCluster",fieldLabel:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"region"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusCloneServerGroupStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1},T.listAccounts("titus").then((t=>{e.accounts=t,e.viewState.accountsLoaded=!0})),this.cloneTargets=K.TARGET_LIST,t.target=t.target||this.cloneTargets[0].val,t.application=e.application.name,t.cloudProvider="titus",t.cloudProviderType="titus",t.viewState={mode:"editPipeline"},t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),this.targetClusterUpdated=()=>{if(t.targetCluster){const e=X.parseServerGroupName(t.targetCluster);t.stack=e.stack,t.freeFormDetails=e.freeFormDetails}else t.stack="",t.freeFormDetails=""},e.$watch("stage.targetCluster",this.targetClusterUpdated),this.removeCapacity=()=>{delete t.capacity},ft.has(t,"useSourceCapacity")||(t.useSourceCapacity=!0),this.toggleSuspendedProcess=e=>{t.suspendedProcesses=t.suspendedProcesses||[];const n=t.suspendedProcesses.indexOf(e);-1===n?t.suspendedProcesses.push(e):t.suspendedProcesses.splice(n,1)},this.processIsSuspended=e=>t.suspendedProcesses&&t.suspendedProcesses.includes(e),this.onRedBlackFieldChange=(e,n)=>{ft.set(t,e,n)}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",'<div ng-controller="titusCloneServerGroupStageCtrl as cloneServerGroupStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="viewState.loading">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="!viewState.loading">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n single-region="true"\n cluster-field="targetCluster"\n >\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="cloneServerGroupStageCtrl.cloneTargets"></target-select>\n </stage-config-field>\n <div>\n <div class="form-group">\n <div class="col-md-3 sm-label-right">Capacity</div>\n <div class="col-md-9 radio">\n <label>\n <input\n type="radio"\n ng-model="stage.useSourceCapacity"\n ng-value="true"\n ng-click="cloneServerGroupStageCtrl.removeCapacity()"\n id="useSourceCapacityTrue"\n />\n Copy the capacity from the current server group\n <help-field key="serverGroupCapacity.useSourceCapacityTrue"></help-field>\n </label>\n </div>\n <div class="col-md-9 col-md-offset-3 radio">\n <label>\n <input type="radio" ng-model="stage.useSourceCapacity" ng-value="false" id="useSourceCapacityFalse" />\n Let me specify the capacity\n <help-field key="serverGroupCapacity.useSourceCapacityFalse"></help-field>\n </label>\n </div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">Min</div>\n <div class="col-md-2">Max</div>\n <div class="col-md-2">Desired</div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.min"\n min="0"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.max"\n min="{{stage.capacity.min}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.desired"\n min="{{stage.capacity.min}}"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n </div>\n </div>\n <stage-config-field label="Traffic" help-key="titus.serverGroup.traffic">\n <div class="checkbox">\n <label>\n <input\n type="checkbox"\n ng-click="cloneServerGroupStageCtrl.toggleSuspendedProcess(\'AddToLoadBalancer\')"\n ng-checked="!cloneServerGroupStageCtrl.processIsSuspended(\'AddToLoadBalancer\')"\n />\n Send client requests to new instances\n </label>\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n <deployment-strategy-selector\n label-columns="3"\n field-columns="6"\n command="stage"\n on-field-change="cloneServerGroupStageCtrl.onRedBlackFieldChange"\n ></deployment-strategy-selector>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",'<div ng-controller="titusCloneServerGroupExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'cloneServerGroupConfig\'">\n <div class="row">\n <div class="col-md-9">\n <dl class="dl-narrow dl-horizontal">\n <dt>Account</dt>\n <dd><account-tag account="stage.context.credentials"></account-tag></dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Cluster</dt>\n <dd>{{stage.context.targetCluster}}</dd>\n <dt>Server Group</dt>\n <dd>{{stage.context.source.serverGroupName}}</dd>\n <dt ng-if="!stage.context.useSourceCapacity && stage.context.capacity">Capacity</dt>\n <dd ng-if="!stage.context.useSourceCapacity && stage.context.capacity">\n Min: {{stage.context.capacity.min}} / Desired: {{stage.context.capacity.desired}} / Max:\n {{stage.context.capacity.max}}\n </dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="deployed.length">\n <div class="col-md-12">\n <div class="well alert alert-info">\n <strong>Deployed:</strong>\n <a\n ng-repeat="serverGroup in deployed"\n ng-click="$event.stopPropagation(); deployDetailsCtrl.overrideFiltersForUrl(serverGroup);"\n ng-href="{{serverGroup.href}}"\n >\n {{serverGroup.serverGroup}}\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",'<span class="task-label"> Clone Server Group: {{step.context.source.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const rn="spinnaker.titus.pipeline.stage.destroyAsgStage";t(rn,[]).config((function(){J.pipeline.registerStage({provides:"destroyServerGroup",alias:"destroyAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to destroy a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDestroyAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.regions=["us-east-1","us-west-1","eu-west-1","us-west-2"],e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",'<div ng-controller="titusDestroyAsgStageCtrl as destroyAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",'<span class="task-label"> Destroy Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const an="spinnaker.titus.pipeline.stage.disableAsgStage";t(an,[]).config((function(){J.pipeline.registerStage({provides:"disableServerGroup",alias:"disableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",validators:[{type:"targetImpedance",message:"This pipeline will attempt to disable a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDisableAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStage.html",'<div ng-controller="titusDisableAsgStageCtrl as disableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",'<span class="task-label"> Disable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const sn="spinnaker.titus.pipeline.stage.disableClusterStage";t(sn,[]).config((function(){J.pipeline.registerStage({provides:"disableCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableCluster/disableClusterStage.html",executionConfigSections:["disableClusterConfig","taskStatus"],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingEnabledServerGroups",fieldLabel:"Keep [X] enabled Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusDisableClusterStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),void 0===n.remainingEnabledServerGroups&&(n.remainingEnabledServerGroups=1),t.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===n.preferLargerOverNewer&&(n.preferLargerOverNewer="false"),n.preferLargerOverNewer=n.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableCluster/disableClusterStage.html",'<div ng-controller="titusDisableClusterStageCtrl as disableClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Disable Options">\n <div class="form-inline">\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingEnabledServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{disableClusterStageCtrl.pluralize(\'server group\', stage.remainingEnabledServerGroups)}} enabled.\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);const on="spinnaker.titus.pipeline.stage.enableAsgStage";t(on,[]).config((function(){J.pipeline.registerStage({provides:"enableServerGroup",alias:"enableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusEnableAsgStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},e.targets=K.TARGET_LIST,n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),n.target||(n.target=e.targets[0].val),e.$watch("stage.credentials",e.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStage.html",'<div ng-controller="titusEnableAsgStageCtrl as enableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",'<span class="task-label"> Enable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const ln="spinnaker.titus.pipeline.stage.findAmiStage";e.module(ln,[]).config((function(){J.pipeline.registerStage({provides:"findImage",alias:"findAmi",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/findAmi/findAmiStage.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"selectionStrategy",fieldLabel:"Server Group Selection"},{type:"requiredField",fieldName:"credentials"}]})})).controller("titusFindAmiStageCtrl",["$scope",function(t){const n=t.stage;t.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(e){t.accounts=e,t.state.accounts=!0})),t.selectionStrategies=[{label:"Largest",val:"LARGEST",description:"When multiple server groups exist, prefer the server group with the most instances"},{label:"Newest",val:"NEWEST",description:"When multiple server groups exist, prefer the newest"},{label:"Oldest",val:"OLDEST",description:"When multiple server groups exist, prefer the oldest"},{label:"Fail",val:"FAIL",description:"When multiple server groups exist, fail"}],n.regions=n.regions||[],n.cloudProvider="titus",n.selectionStrategy=n.selectionStrategy||t.selectionStrategies[0].val,e.isUndefined(n.onlyEnabled)&&(n.onlyEnabled=!0),!n.credentials&&t.application.defaultCredentials.titus&&(n.credentials=t.application.defaultCredentials.titus),!n.regions.length&&t.application.defaultRegions.titus&&n.regions.push(t.application.defaultRegions.titus),t.$watch("stage.credentials",t.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/findAmi/findAmiStage.html",'<div ng-controller="titusFindAmiStageCtrl as findAmiCtrl" class="form-horizontal">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n show-all-regions="true"\n >\n </account-region-cluster-selector>\n <stage-config-field label="Server Group Selection">\n <ui-select ng-model="stage.selectionStrategy" class="form-control input-sm">\n <ui-select-match placeholder="None">{{$select.selected.label}}</ui-select-match>\n <ui-select-choices repeat="strategy.val as strategy in selectionStrategies | filter: $select.search">\n <strong ng-bind-html="strategy.label | highlight: $select.search"></strong>\n <div ng-bind-html="strategy.description"></div>\n </ui-select-choices>\n </ui-select>\n </stage-config-field>\n <stage-config-field label="Server Group Filters">\n <label class="checkbox-inline">\n <input type="checkbox" ng-model="stage.onlyEnabled" />\n Only consider enabled Server Groups\n </label>\n </stage-config-field>\n</div>\n')}]);const cn="spinnaker.titus.pipeline.stage.resizeAsgStage";t(cn,[]).config((function(){J.pipeline.registerStage({provides:"resizeServerGroup",alias:"resizeAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",executionConfigSections:["resizeServerGroupConfig","taskStatus"],executionStepLabelUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to resize a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"action"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusResizeAsgStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.viewState.accountsLoaded=!0})),e.resizeTargets=K.TARGET_LIST,e.scaleActions=[{label:"Scale Up",val:"scale_up"},{label:"Scale Down",val:"scale_down"},{label:"Scale to Cluster Size",val:"scale_to_cluster"},{label:"Scale to Exact Size",val:"scale_exact"}],e.resizeTypes=[{label:"Percentage",val:"pct"},{label:"Incremental",val:"incr"}],t.capacity=t.capacity||{},t.regions=t.regions||[],t.target=t.target||e.resizeTargets[0].val,t.action=t.action||e.scaleActions[0].val,t.resizeType=t.resizeType||e.resizeTypes[0].val,t.action||"exact"!==t.resizeType||(t.action="scale_exact"),t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),this.updateResizeType=function(){"scale_exact"===t.action?(t.resizeType="exact",delete t.scalePct,delete t.scaleNum):(t.capacity={},"pct"===t.resizeType?delete t.scaleNum:(t.resizeType="incr",delete t.scalePct,t.scaleNum=t.scaleNum||0))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",'<div ng-controller="titusResizeAsgStageCtrl as resizeAsgStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="!viewState.accountsLoaded">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="viewState.accountsLoaded">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="resizeTargets"></target-select>\n </stage-config-field>\n <stage-config-field label="Action" help-key="pipeline.config.resizeAsg.action">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.action"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="a.val as a.label for a in scaleActions"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div ng-if="stage.action !== \'scale_exact\'">\n <stage-config-field label="{{stage.action === \'scale_to_cluster\' ? \'Additional Capacity\' : \'Type\'}}">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.resizeType"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="t.val as t.label for t in resizeTypes"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div class="form-group" ng-if="stage.resizeType === \'pct\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize Percentage</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scalePct" class="form-control input-sm" />\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the percentage by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n <div class="form-group" ng-if="stage.resizeType === \'incr\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize-by Amount</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scaleNum" class="form-control input-sm" />\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the exact amount by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n </div>\n <div class="form-group" ng-if="stage.action === \'scale_exact\'">\n <div class="col-md-9 col-md-offset-3 small">\n <div class="col-md-9">\n <div class="col-md-3 col-md-offset-3">Min</div>\n <div class="col-md-3">Max</div>\n <div class="col-md-3">Desired</div>\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right small" style="margin-left: 0; padding-left: 0">Match Capacity</label>\n\n <div class="col-md-9">\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.min" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.max" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.desired" class="form-control input-sm" />\n </div>\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note">This is the exact amount to which the target server group will be scaled</em>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",'<span class="task-label"> Resize Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);class un extends pt.Component{constructor(e){super(e),this.mounted=!1,this.state={}}componentDidMount(){this.mounted=!0,this.setEndpoint()}setEndpoint(){const{context:e}=this.props.stage;T.getAccountDetails(e.credentials).then((t=>{const n=t.regions.find((t=>t.name===e.cluster.region)).endpoint;this.mounted&&this.setState({titusUiEndpoint:n})}))}formatEntryPoint(e,t){return e&&Array.isArray(e)&&e.length>0?1===e.length?e[0]:JSON.stringify(e):t}componentWillUnmount(){this.mounted=!1}componentWillReceiveProps(){this.setEndpoint()}render(){const{stage:e,current:t,name:n}=this.props,{titusUiEndpoint:r}=this.state,{context:a}=e,{cluster:s}=a,{resources:i,env:o,entryPoint:l,entryPointList:c}=s,u=s?yt(a["deploy.jobs"],s.region,[])[0]:null,d=yt(a,"jobStatus.completionDetails.taskId"),m=this.formatEntryPoint(c,l);return pt.createElement(Y,{name:n,current:t},pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-9"},pt.createElement(S,{className:"dl-narrow dl-horizontal"},pt.createElement(k,{label:"Account",value:pt.createElement(Q,{account:a.credentials})}),s&&pt.createElement(pt.Fragment,null,pt.createElement(k,{label:"Image",value:s.imageId}),m&&pt.createElement(k,{label:"Entrypoint",value:m})),u&&pt.createElement(k,{label:"Titus Job Id",value:pt.createElement($,{message:`[${u}](${r}jobs/${u})`})}),d&&pt.createElement(k,{label:"Titus Task Id",value:pt.createElement($,{message:`[${d}](${r}jobs/${u}/tasks/${d})`})}),i&&Object.keys(i)&&pt.createElement(k,{label:"Resources",value:pt.createElement("ul",{className:"nostyle"},Object.keys(i).map((e=>pt.createElement("li",{key:e},e,": ",i[e]))))})))),o&&Object.keys(o)&&pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-12"},pt.createElement("h5",{style:{marginBottom:0,paddingBottom:"5px"}},"Environment Variables"),pt.createElement(S,null,Object.keys(o).map((e=>pt.createElement(k,{key:e,label:e,value:o[e]})))))),a.propertyFileContents&&pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-12"},pt.createElement("h5",{style:{marginBottom:"0px",paddingBottom:"5px"}},"Property File"),pt.createElement(_,{outputFileObject:a.propertyFileContents}))),pt.createElement(ee,{stage:e,message:e.failureMessage||yt(a,"completionDetails.message")}),d&&pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-12"},pt.createElement("div",{className:"well alert alert-info"},pt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs`},"View Execution Logs"),pt.createElement("br",null),pt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stdout&view=Finished&open=true`},"Stdout"),pt.createElement("br",null),pt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stderr&view=Finished&open=true`},"Stderr")))))}}un.title="runJobConfig";class dn extends pt.Component{constructor(e){super(e),this.state={availableGroups:[],removedGroups:[],loaded:!1},this.credentials={},this.vpcs=[],this.securityGroups={},this.clearRemoved=()=>{this.setState({removedGroups:[]})}}getCredentials(){return this.credentials[this.props.command.credentials]}getAwsAccount(){return this.getCredentials().awsAccount}getRegion(){return this.props.command.region||(this.props.command.cluster?this.props.command.cluster.region:null)}getVpcId(){const e=this.getCredentials(),t=this.vpcs.find((t=>t.name===e.awsVpc&&t.account===e.awsAccount&&t.region===this.getRegion()&&"aws"===t.cloudProvider));return t?t.id:null}getRegionalSecurityGroups(){const e=this.securityGroups[this.getAwsAccount()]||{aws:{}};return bt(e.aws[this.getRegion()]).filter({vpcId:this.getVpcId()}).sortBy("name").value()}refreshSecurityGroups(e){return I.cacheInitializer.refreshCache("securityGroups").then((()=>I.securityGroupReader.getAllSecurityGroups().then((t=>{this.securityGroups=t,e||this.configureSecurityGroupOptions()}))))}configureSecurityGroupOptions(){let e=this.getRegionalSecurityGroups();const t=this.state.availableGroups.length?this.state.availableGroups:e;let n,r=this.props.groupsToEdit;if(e&&this.props.groupsToEdit){const a=r.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),s=a.map((t=>{const n=e.find((e=>e.id===t||e.name===t));return n?n.name:null})).map((t=>e.find((e=>e.name===t)))).filter((e=>e)),i=s.map((e=>e.name));n=Ct(a,i),r=s.map((e=>e.id)),this.props.onChange(r)}e=e.sort(((e,t)=>e.name.localeCompare(t.name))),this.setState({availableGroups:e,loaded:!0,removedGroups:n})}componentDidMount(){const e=T.getCredentialsKeyedByAccount("titus").then((e=>{this.credentials=e})),t=I.securityGroupReader.getAllSecurityGroups().then((e=>{this.securityGroups=e})),n=s.listVpcs().then((e=>this.vpcs=e));Pt.all([e,t,n]).then((()=>this.configureSecurityGroupOptions()))}componentWillReceiveProps(e){this.props.account===e.account&&this.props.region===e.region||this.configureSecurityGroupOptions()}render(){const{command:e,hideLabel:t,groupsToEdit:n,amazonAccount:r}=this.props,{availableGroups:a,loaded:s,removedGroups:l}=this.state,c=D.get("firewalls");return s?pt.createElement("div",{className:"clearfix"},pt.createElement(i,{removed:l,onClear:this.clearRemoved}),pt.createElement(o,{command:e,hideLabel:t,availableGroups:a,groupsToEdit:n,refresh:()=>this.refreshSecurityGroups(),onChange:this.props.onChange,helpKey:"titus.deploy.securityGroups"}),r&&void 0!==e.credentials&&pt.createElement("div",{className:"small "+(t?"":"col-md-offset-3 col-md-9")},"Uses ",c," from the Amazon account ",pt.createElement(Q,{account:r}))):null}}const mn=R.providers.titus||{defaults:{}};mn&&(mn.resetToOriginal=R.resetToOriginal);const pn=e=>e&&!e.includes("${");class gn extends pt.Component{constructor(e){super(e),this.accountUpdated=e=>{const{setFieldValue:t,values:n}=this.props.formik;n.credentials=e,n.credentialsChanged(n),t("account",e),t("credentials",e);const r=n.backingData.credentialsKeyedByAccount[e];t("containerAttributes",{...n.containerAttributes,"titusParameter.agent.assignIPv6Address":"test"===r.environment?"true":"false"})},this.regionUpdated=e=>{const{values:t,setFieldValue:n}=this.props.formik;t.region=e,t.regionChanged(t),n("region",e)},this.navigateToLatestServerGroup=()=>{const{values:e}=this.props.formik,{latestServerGroup:t}=this.state,n={provider:e.selectedProvider,accountId:t.account,region:t.region,serverGroup:t.name},{$state:r}=I;r.is("home.applications.application.insight.clusters")?r.go(".serverGroup",n):r.go("^.serverGroup",n)},this.stackChanged=e=>{const{formik:t}=this.props;t.setFieldValue("stack",e),t.values.clusterChanged(t.values)},this.strategyChanged=(e,t)=>{e.onStrategyChange(e,t),this.props.formik.setFieldValue("strategy",t.key)},this.dockerValuesChanged=e=>{Object.keys(e).forEach((t=>{this.props.formik.setFieldValue(t,e[t])}))},this.onStrategyFieldChange=(e,t)=>{this.props.formik.setFieldValue(e,t)},this.onSubnetChange=()=>{const{setFieldValue:e,values:t}=this.props.formik;t.subnetChanged(t),e("subnetType",t.subnetType)};const{values:t,setFieldValue:n}=this.props.formik;if(t.imageId&&!t.imageId.includes("${")){const{digest:e,organization:r,repository:a,tag:s}=Dt.splitImageId(t.imageId);n("digest",e),n("organization",r),n("repository",a),n("tag",s)}this.state={...this.getStateFromProps(e)}}getStateFromProps(e){const{app:t}=e,{values:n}=e.formik,r=X.getClusterName(t.name,n.stack,n.freeFormDetails),a=!t.clusters.find((e=>e.name===r)),s=t.serverGroups.data.filter((e=>e.cluster===r&&e.account===n.credentials&&e.region===n.region)).sort(((e,t)=>e.createdTime-t.createdTime)),i=s.length?s.pop():null;return{namePreview:r,createsNewCluster:a,latestServerGroup:i}}validate(e){const t={};var n,r;return n=e.stack,pn(n)&&!/^([\w.]+|\${[^}]+})*$/.test(n)&&(t.stack="Only dot(.) and underscore(_) special characters are allowed in the Stack field."),r=e.freeFormDetails,pn(r)&&!/^([\w.^~-]+|\${[^}]+})*$/.test(r)&&(t.freeFormDetails="Only dot(.), underscore(_), caret (^), tilde (~), and dash(-) special characters are allowed in the Detail field."),e.viewState.disableImageSelection||e.imageId||(t.imageId="Image is required."),e.resourceSummary&&(t.resourceSummary={id:"Cluster is managed"}),t}componentWillReceiveProps(e){this.setState(this.getStateFromProps(e))}render(){var e,t,n;const{app:r,formik:a}=this.props,{errors:s,setFieldValue:i,values:o}=a,{createsNewCluster:u,latestServerGroup:d,namePreview:m}=this.state,p=o.backingData.accounts,g=o.viewState.readOnlyFields||{},h=o.imageId&&"${trigger.properties.imageName}"!==o.imageId,f=[].concat(null==(e=mn.defaults)?void 0:e.subnetType).concat(null==(t=l.defaults)?void 0:t.subnetType).filter((e=>!!e));return pt.createElement("div",{className:"container-fluid form-horizontal"},pt.createElement(te,{app:r,formik:a}),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Account"),pt.createElement("div",{className:"col-md-7"},pt.createElement(ne,{value:o.credentials,onChange:e=>this.accountUpdated(e.target.value),readOnly:g.credentials,accounts:p,provider:"titus"}),void 0!==o.credentials&&pt.createElement("div",{className:"small"},"Uses resources from the Amazon account"," ",pt.createElement(Q,{account:o.backingData.credentialsKeyedByAccount[o.credentials]&&o.backingData.credentialsKeyedByAccount[o.credentials].awsAccount})))),pt.createElement(re,{readOnly:g.region,labelColumns:3,component:o,field:"region",account:o.credentials,regions:o.backingData.filtered.regions,onChange:this.regionUpdated}),pt.createElement(c,{application:r,component:o,field:"subnetType",helpKey:"titus.serverGroup.subnet",labelColumns:3,onChange:this.onSubnetChange,region:o.region,subnets:o.backingData.filtered.subnetPurposes,defaultSubnetTypes:f,recommendedSubnetTypes:null==(n=mn.serverGroups)?void 0:n.recommendedSubnets,showSubnetWarning:!0}),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Stack ",pt.createElement(ae,{id:"aws.serverGroup.stack"})),pt.createElement("div",{className:"col-md-7"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:o.stack||"",onChange:e=>this.stackChanged(e.target.value)}))),s.stack&&pt.createElement("div",{className:"form-group row slide-in"},pt.createElement("div",{className:"col-sm-9 col-sm-offset-2 error-message"},pt.createElement("span",null,s.stack))),pt.createElement(se,{app:r,formik:a}),!o.viewState.disableImageSelection&&pt.createElement(xt,{specifyTagByRegex:!1,account:o.credentials,digest:o.digest,imageId:o.imageId,organization:o.organization,registry:o.registry,repository:o.repository,tag:o.tag,showRegistry:!1,deferInitialization:o.deferredInitialization,onChange:this.dockerValuesChanged}),o.viewState.disableImageSelection&&h&&pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Image")," ",pt.createElement(ae,{id:"titus.deploy.imageId"})),pt.createElement("div",{className:"col-md-7 sp-padding-xs-yaxis"},o.imageId)),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Entrypoint")),pt.createElement("div",{className:"col-md-7"},pt.createElement(Ot,{type:"text",className:"form-control input-sm no-spel",name:"entryPoint"}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Traffic ",pt.createElement(ae,{id:"titus.serverGroup.traffic"})),pt.createElement("div",{className:"col-md-7"},pt.createElement("div",{className:"checkbox"},pt.createElement("label",null,pt.createElement("input",{type:"checkbox",checked:o.inService,onChange:e=>i("inService",e.target.checked),disabled:""!==o.strategy&&"custom"!==o.strategy})," ","Send client requests to new instances")))),!o.viewState.disableStrategySelection&&o.selectedProvider&&pt.createElement(ie,{command:o,onFieldChange:this.onStrategyFieldChange,onStrategyChange:this.strategyChanged}),!o.viewState.hideClusterNamePreview&&pt.createElement(oe,{createsNewCluster:u,latestServerGroupName:null==d?void 0:d.name,mode:o.viewState.mode,namePreview:m,navigateToLatestServerGroup:this.navigateToLatestServerGroup}))}}const hn=[{label:"Read and Write",value:"RW"},{label:"Read Only",value:"RO"},{label:"Write Only",value:"WO"}];class fn extends pt.Component{validate(e){const t={};return e.resources||(t.resources="CPU is required."),e.resources||(t.resources="Memory is required."),e.resources||(t.resources="Disk is required."),e.resources||(t.resources="Network is required."),t}render(){const{setFieldValue:e,values:t}=this.props.formik;return pt.createElement("div",{className:"clearfix"},pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"CPU(s)")),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.cpu,onChange:n=>e("resources",{...t.resources,cpu:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Memory (MB)")),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.memory,onChange:n=>e("resources",{...t.resources,memory:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Disk (MB)")),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.disk,onChange:n=>e("resources",{...t.resources,disk:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Network (Mbps)"),pt.createElement(ae,{id:"titus.deploy.network"})),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.networkMbps,onChange:n=>e("resources",{...t.resources,networkMbps:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Gpu"),pt.createElement(ae,{id:"titus.deploy.gpu"})),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.gpu,onChange:n=>e("resources",{...t.resources,gpu:n})}))),pt.createElement("hr",null),pt.createElement("h4",null,pt.createElement("b",null,"Elastic File System Options ",pt.createElement(ae,{id:"titus.deploy.efs"}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Mount Permission "),pt.createElement(ae,{id:"titus.deploy.mountPermissions"})),pt.createElement("div",{className:"col-md-8"},pt.createElement(Mt,{value:t.efs.mountPerm,clearable:!1,options:hn,onChange:n=>e("efs",{...t.efs,mountPerm:n.value})}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Mount Point "),pt.createElement(ae,{id:"titus.deploy.mountPoint"})),pt.createElement("div",{className:"col-md-8"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.mountPoint,onChange:n=>e("efs",{...t.efs,mountPoint:n.target.value})}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"EFS ID "),pt.createElement(ae,{id:"titus.deploy.efsId"})),pt.createElement("div",{className:"col-md-8"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsId,onChange:n=>e("efs",{...t.efs,efsId:n.target.value})})),pt.createElement("div",{className:"col-md-offset-3 col-md-8"})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"EFS Relative Mount Point "),pt.createElement(ae,{id:"titus.deploy.efsRelativeMountPoint"})),pt.createElement("div",{className:"col-md-8"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsRelativeMountPoint,onChange:n=>e("efs",{...t.efs,efsRelativeMountPoint:n.target.value})}))))}}function vn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}function yn(e){const{label:t,help:n,input:r,actions:a,validation:s={}}=e,{hidden:i,messageNode:o,category:l}=s,c=!Et(t)||!Et(n);return pt.createElement("div",{className:"TitusMapLayout flex-container-v"},c&&pt.createElement("h4",null,t," ",n),pt.createElement("div",{className:"flex-container-h baseline margin-between-lg TitusMapLayout_Contents"},r," ",a),!i&&pt.createElement(ce,{message:o,type:l}))}vn(".TitusMapLayout_Contents * {\n flex: auto;\n}\n");const bn=["disableIncreaseDesired","disableDecreaseDesired"];vn(".ServerGroupParameters .StandardFieldLayout_Label {\n min-width: 160px;\n}\n");const Cn=[{label:"System Default",value:"systemDefault"},{label:"Self Managed",value:"selfManaged"}];function En(e){const t=kt(bn,Object.keys(e.value)),n=ve(e,(e=>Object.entries(e).filter((([e,t])=>!0===t)).map((([e,t])=>e))),(e=>t.reduce(((t,n)=>(t[n]=e.includes(n),t)),{}))),r=t.map((e=>({label:ye(e),value:e})));return pt.createElement(be,{...n,options:r})}function wn(e){const t=ve(e,(e=>"true"===e),((e,t)=>t.target.checked?"true":"false"));return pt.createElement(Ce,{...t})}const Sn=e=>{const{awsAccount:t,setDefaultIamProfile:n,...r}=e;return pt.createElement("div",{className:"flex-container-h baseline margin-between-md"},pt.createElement(me,{...r}),e.value?pt.createElement(pt.Fragment,null,pt.createElement("span",null,"in"),pt.createElement(Q,{account:t})):pt.createElement("button",{className:"link",style:{whiteSpace:"nowrap"},onClick:n},"Apply default value"))};class kn extends pt.Component{constructor(e){super(e)}validate(e){const t=new ue(e);t.field("iamProfile","IAM Instance Profile").required();const n=t.validateForm();return wt(Object.keys(e.constraints.soft),Object.keys(e.constraints.hard)).forEach((e=>{St(n,`constraints.soft.${e}`,`Constraint '${e}' must be either soft or hard, not both.`),St(n,`constraints.hard.${e}`,`Constraint '${e}' must be either soft or hard, not both.`)})),Object.keys(e.env||{}).filter((e=>!e.startsWith("__MapEditorDuplicateKey"))).forEach((e=>{e.match(/^[A-Za-z_].*/)?e.match(/[A-Za-z_][a-zA-Z0-9_]*$/)||St(n,`env.${e}`,"Environment variable names must contain only letter, numbers, or underscores"):St(n,`env.${e}`,"Environment variable names must start with a letter or underscore")})),n}render(){const{app:e}=this.props,{setFieldValue:t,values:n}=this.props.formik,r=()=>t("iamProfile",n.viewState.defaultIamProfile);return pt.createElement("div",{className:"ServerGroupParameters"},pt.createElement(de,{name:"iamProfile",label:"IAM Instance Profile",help:pt.createElement(ae,{id:"titus.deploy.iamProfile"}),input:e=>{var t;return pt.createElement(Sn,{...e,awsAccount:null==(t=n.backingData.credentialsKeyedByAccount[n.credentials])?void 0:t.awsAccount,setDefaultIamProfile:r})}}),pt.createElement(de,{name:"capacityGroup",label:"Capacity Group",help:pt.createElement(ae,{id:"titus.deploy.capacityGroup"}),input:e=>pt.createElement(me,{...e})}),pt.createElement(de,{name:"migrationPolicy.type",label:"Migration Policy",help:pt.createElement(ae,{id:"titus.deploy.migrationPolicy"}),input:e=>pt.createElement(pe,{options:Cn,...e})}),pt.createElement(de,{name:"serviceJobProcesses",label:"Service Job Processes",input:e=>pt.createElement(En,{...e})}),pt.createElement(de,{name:"containerAttributes['titusParameter.agent.assignIPv6Address']",label:"Associate IPv6 Address (Recommended)",help:pt.createElement(ae,{id:"serverGroup.ipv6"}),input:e=>pt.createElement(wn,{...e})}),pt.createElement("hr",null),pt.createElement(ge,{value:yn},pt.createElement(de,{name:"constraints.soft",label:"Soft Constraints ",help:pt.createElement(ae,{id:"titus.deploy.softConstraints"}),input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement(de,{name:"constraints.hard",label:"Hard Constraints",help:pt.createElement(ae,{id:"titus.deploy.hardConstraints"}),input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement("hr",null),pt.createElement(de,{name:"labels",label:"Job Attributes",input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement(de,{name:"containerAttributes",label:"Container Attributes",input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement(de,{name:"env",label:"Environment Variables",input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})})),e.attributes.platformHealthOnlyShowOverride&&pt.createElement(de,{name:"interestingHealthProviderNames",label:"Task Completion",input:e=>pt.createElement(fe,{...e,platformHealthType:"Titus"})}))}}const Nn={availabilityPercentageLimit:{percentageOfHealthyContainers:95},ratePercentagePerInterval:{intervalMs:6e5,percentageLimitPerInterval:5},containerHealthProviders:[{name:"eureka"}],timeWindows:[{days:["Monday","Tuesday","Wednesday","Thursday","Friday"],hourlyTimeWindows:[{startHour:10,endHour:16}],timeZone:"PST"}]},An=e=>{const t=Nt(Nn);return e.attributes&&e.attributes.platformHealthOnly&&(t.containerHealthProviders=[]),t};class Gn{constructor(e,t,n){this.cacheInitializer=e,this.loadBalancerReader=t,this.securityGroupReader=n}configureZones(e){e.backingData.filtered.regions=e.backingData.credentialsKeyedByAccount[e.credentials].regions}configureSubnets(e){const t={dirty:{}},n=e.backingData.filtered;if(null===e.region)return t;const r=this.getCredentials(e);n.subnetPurposes=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region}).reject({target:"elb"}).reject({purpose:null}).uniqBy("purpose").value();const a=e.subnetType||"titus (vpc0)",s=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region,purpose:a}).map((e=>e.id)).value();return e.containerAttributes["titusParameter.agent.subnets"]=s.join(","),t}attachEventHandlers(e){e.credentialsChanged=e=>{const t={dirty:{}},n=e.backingData;if(this.configureZones(e),e.credentials){e.registry=n.credentialsKeyedByAccount[e.credentials].registry,n.filtered.regions=n.credentialsKeyedByAccount[e.credentials].regions;const t=n.credentialsKeyedByAccount[e.credentials].accountId;e.containerAttributes["titusParameter.agent.accountId"]=t,n.filtered.regions.some((t=>t.name===e.region))||(e.region=null,e.regionChanged(e))}else e.region=null;return e.viewState.dirty={...e.viewState.dirty||{},...t.dirty},this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),t},e.regionChanged=e=>(this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),{}),e.clusterChanged=e=>{e.moniker=X.getMoniker(e.application,e.stack,e.freeFormDetails),ke(e)},e.subnetChanged=e=>this.configureSubnets(e)}configureCommand(e){return e.viewState.accountChangedStream=new Ft,e.viewState.regionChangedStream=new Ft,e.viewState.groupsRemovedStream=new Ft,e.viewState.dirty={},e.onStrategyChange=(e,t)=>{""!==t.key&&"custom"!==t.key&&(e.inService=!0)},e.image=e.viewState.imageId,Pt.all([T.getCredentialsKeyedByAccount("titus"),this.securityGroupReader.getAllSecurityGroups(),s.listVpcs(),Ne.listSubnets(),T.getCredentialsKeyedByAccount("aws")]).then((([t,n,r,a,s])=>{var i,o;const l={credentialsKeyedByAccount:t,securityGroups:n,vpcs:r};Object.keys(t).forEach((e=>{const n=t[e].awsAccount,r=s[n].accountId;t[e].accountId=r})),l.credentialsKeyedByAccount=t,e.credentials&&(e.containerAttributes["titusParameter.agent.accountId"]=l.credentialsKeyedByAccount[e.credentials].accountId),l.images=[],l.accounts=Object.keys(t),l.subnets=a,l.filtered={},e.credentials.includes("${")?l.filtered.regions=[{name:e.region}]:l.filtered.regions=null!=(o=null==(i=t[e.credentials])?void 0:i.regions)?o:[],e.backingData=l,l.filtered.securityGroups=this.getRegionalSecurityGroups(e);let c=Pt.when();if(e.securityGroups&&e.securityGroups.length){const t=l.filtered.securityGroups.map((e=>e.id));wt(e.securityGroups,t).length<e.securityGroups.length&&(c=this.refreshSecurityGroups(e,!1))}return Pt.all([this.refreshLoadBalancers(e),c]).then((()=>{this.attachEventHandlers(e)}))}))}getVpcId(e){const t=this.getCredentials(e),n=e.backingData.vpcs.find((n=>n.name===t.awsVpc&&n.account===t.awsAccount&&n.region===this.getRegion(e)&&"aws"===n.cloudProvider));return n?n.id:null}getRegionalSecurityGroups(e){const t=e.backingData.securityGroups[this.getAwsAccount(e)]||{aws:{}};return bt(t.aws[this.getRegion(e)]).filter({vpcId:this.getVpcId(e)}).sortBy("name").value()}configureSecurityGroupOptions(e){const t=e.backingData.filtered.securityGroups;if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.backingData.filtered.securityGroups=e.securityGroups.map((e=>({name:e,id:e})));else{const n=this.getRegionalSecurityGroups(e),r="string"==typeof e.securityGroups&&e.securityGroups.includes("${");if(t&&e.securityGroups&&!r){const r=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),a=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e||t.name===e));return n?n.name:null})).map((e=>n.find((t=>t.name===e)))).filter((e=>e)),s=a.map((e=>e.name)),i=Ct(r,s);e.securityGroups=a.map((e=>e.id)),i.length&&(e.viewState.dirty.securityGroups=i)}e.backingData.filtered.securityGroups=n.sort(((t,n)=>e.securityGroups.includes(t.id)?-1:e.securityGroups.includes(n.id)?1:t.name.localeCompare(n.name)))}}refreshSecurityGroups(e,t){return this.cacheInitializer.refreshCache("securityGroups").then((()=>this.securityGroupReader.getAllSecurityGroups().then((n=>{e.backingData.securityGroups=n,t||this.configureSecurityGroupOptions(e)}))))}getCredentials(e){return e.backingData.credentialsKeyedByAccount[e.credentials]}getAwsAccount(e){return this.getCredentials(e).awsAccount}getRegion(e){return e.region||(e.cluster?e.cluster.region:null)}getTargetGroupNames(e){const t=this.getLoadBalancerMap(e).filter((e=>"classic"!==e.loadBalancerType));return At(t.map((e=>e.targetGroups.filter((e=>"ip"===e.targetType))))).map((e=>e.name)).sort()}getLoadBalancerMap(e){return bt(e.backingData.loadBalancers).map("accounts").flattenDeep().filter({name:this.getAwsAccount(e)}).map("regions").flattenDeep().filter({name:this.getRegion(e)}).map("loadBalancers").flattenDeep().value()}configureLoadBalancerOptions(e){const t=e.targetGroups||[];if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.targetGroups=t,e.backingData.filtered.targetGroups=t;else{const n=this.getTargetGroupNames(e);if(t&&e.targetGroups){const r=wt(n,t),a=Ct(r,t);e.targetGroups=wt(n,r),a&&a.length>0?e.viewState.dirty.targetGroups=a:delete e.viewState.dirty.targetGroups}e.backingData.filtered.targetGroups=n}}refreshLoadBalancers(e){return this.loadBalancerReader.listLoadBalancers("aws").then((t=>{e.backingData.loadBalancers=t,this.configureLoadBalancerOptions(e)}))}}Gn.$inject=["cacheInitializer","loadBalancerReader","securityGroupReader"];const Tn="spinnaker.titus.serverGroup.configure.service";t(Tn,[Ee,we,Se]).service("titusServerGroupConfigurationService",Gn);const In=[{field:"availabilityPercentageLimit",label:"Availability Percentage Limit",value:0,description:"\n Lets you specify the required percentage of tasks in a healthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:Nn.availabilityPercentageLimit,fieldComponent:e=>pt.createElement(de,{name:"disruptionBudget.availabilityPercentageLimit.percentageOfHealthyContainers",label:"Percentage of Healthy Containers",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,disabled:e.isDisabled}),pt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))})},{field:"relocationLimit",label:"Relocation Limit",value:1,description:"\n Lets you specify the maximum number of times a task can be relocated.\n Should only be used with batch tasks, which have a maximum execution time.\n ",defaultValues:{limit:1},fieldComponent:()=>pt.createElement(de,{name:"disruptionBudget.relocationLimit.limit",label:"Limit",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(tasks)"}))})},{field:"unhealthyTasksLimit",label:"Unhealthy Tasks Limit",value:2,description:"\n Lets you specify the maximum allowed amount of tasks in an unhealthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:{limitOfUnhealthyContainers:1},fieldComponent:()=>pt.createElement(de,{name:"disruptionBudget.unhealthyTasksLimit.limitOfUnhealthyContainers",label:"Limit of Unhealthy Containers",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(integer)"}))})},{field:"selfManaged",label:"Self Managed",value:3,description:"\n Requires that you orchestrate custom termination logic.\n If the containers are not terminated within the configured amount of time,\n the system default migration policy is used instead.\n ",defaultValues:{relocationTimeMs:864e5},fieldComponent:()=>pt.createElement(de,{name:"disruptionBudget.selfManaged.relocationTimeMs",label:"Relocation Time",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(milliseconds)"}))})}],Dn=[{field:"rateUnlimited",label:"Unlimited",value:0,description:"\n No limits on how many containers in a job may be relocated, provided the other disruption budget constraints\n are not violated.\n ",defaultValues:!0},{field:"ratePercentagePerInterval",label:"Rate Percentage Per Interval",value:1,description:"\n Percentage of containers that can be relocated within a time interval.\n ",defaultValues:Nn.ratePercentagePerInterval,fieldComponent:e=>pt.createElement(pt.Fragment,null,pt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.intervalMs",label:"Interval",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,disabled:e.isDisabled}),pt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),pt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.percentageLimitPerInterval",label:"Percentage Per Interval",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,disabled:e.isDisabled}),pt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))}))},{field:"ratePerInterval",label:"Rate Per Interval",value:2,description:"\n Limit number of relocations within a given time interval.\n ",defaultValues:{intervalMs:6e4,limitPerInterval:2},fieldComponent:()=>pt.createElement(pt.Fragment,null,pt.createElement(de,{name:"disruptionBudget.ratePerInterval.intervalMs",label:"Interval",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),pt.createElement(de,{name:"disruptionBudget.ratePerInterval.limitPerInterval",label:"Limit Per Interval",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(tasks)"}))}))}],xn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];class Pn extends pt.Component{constructor(e){super(e),this.configureNewWindow=()=>{this.setState({addingNewWindow:!0})},this.addNewWindow=e=>{const{values:t,setFieldValue:n}=this.props.formik,{days:r,startHour:a,endHour:s,timeZone:i}=e,o={days:r,hourlyTimeWindows:[{startHour:a,endHour:s}],timeZone:i};n("disruptionBudget.timeWindows",t.disruptionBudget.timeWindows.concat(o)),this.setState({addingNewWindow:!1})},this.CurrentWindows=()=>{const{disruptionBudget:e}=this.props.formik.values,{isDisabled:t}=this.props;if(!e)return null;const{timeWindows:n}=e;return pt.createElement("div",{className:"sp-formItem"},pt.createElement("div",{className:"sp-formItem__left"}),pt.createElement("div",{className:"sp-formItem__right"},n.map(((e,n)=>e.hourlyTimeWindows.map(((r,a)=>pt.createElement("div",{className:"sp-margin-l-yaxis sp-margin-m-right",style:{display:"inline-block"},key:`${n}.${a}`},pt.createElement("div",{key:`${n}.${a}`,className:"horizontal center top sp-padding-m-yaxis sp-padding-s-xaxis",style:{backgroundColor:"var(--color-dovegray)",borderRadius:"4px"}},pt.createElement("div",{className:"sp-padding-m-right",style:{color:"var(--color-text-on-dark)",fontSize:"12px"}},pt.createElement("div",null,pt.createElement("b",null,e.days.map((e=>e.substr(0,3))).join(", "))),pt.createElement("div",null,pt.createElement("em",null,r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))),!t&&pt.createElement("a",{className:"clickable",style:{color:"var(--color-text-on-dark)"},onClick:()=>this.removeWindow(n,a)},pt.createElement("span",{className:"glyphicon glyphicon-remove"}))))))))))},this.NewWindowComponent=()=>this.state.addingNewWindow?pt.createElement(Ge,{initialValues:{days:[],startHour:10,endHour:16,timeZone:yt(this.props.formik.values.disruptionBudget,"timeWindows[0].timeZone","PST")},onSubmit:this.addNewWindow,render:e=>pt.createElement(pt.Fragment,null,pt.createElement(de,{name:"days",label:"Define a New Window",input:e=>pt.createElement(be,{...e,stringOptions:xn})}),pt.createElement(de,{name:"startHour",label:"Start",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,min:0,max:e.values.endHour}),pt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),pt.createElement(de,{name:"endHour",label:"End",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,min:e.values.startHour,max:23}),pt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),pt.createElement(de,{name:"timeZone",label:"Timezone",input:e=>pt.createElement(Te,{...e,clearable:!1,stringOptions:["PST","UTC"]})}),pt.createElement("div",{className:"sp-formItem"},pt.createElement("div",{className:"sp-formItem__left"}),pt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},pt.createElement("button",{className:"primary",type:"submit",onClick:()=>this.addNewWindow(e.values)}," ","Add Window"))))}):pt.createElement("div",{className:"sp-formItem"},pt.createElement("div",{className:"sp-formItem__left"}),pt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},pt.createElement("a",{className:"button primary",onClick:this.configureNewWindow},pt.createElement("i",{className:"fas fa-plus-circle"})," Define New Window"))),this.state={addingNewWindow:!1}}removeWindow(e,t){const{values:n,setFieldValue:r}=this.props.formik,{timeWindows:a}=n.disruptionBudget,s=a[e];if(1===s.hourlyTimeWindows.length)r("disruptionBudget.timeWindows",a.filter((e=>e!==s)));else{const n=s.hourlyTimeWindows[t];r(`disruptionBudget.timeWindows[${e}].hourlyTimeWindows`,s.hourlyTimeWindows.filter((e=>e!==n)))}}render(){const{CurrentWindows:e,NewWindowComponent:t}=this,{isDisabled:n}=this.props;return pt.createElement(pt.Fragment,null,pt.createElement(e,null),!n&&pt.createElement(t,null))}}const On=()=>pt.createElement("p",null,"The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the job can be relocated."," ",pt.createElement("a",{href:"http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/",target:"_blank"},"Read the full documentation"));class Ln extends pt.Component{constructor(e){super(e),this.timeWindowOptions=[{field:"timeWindows",label:"Anytime",value:0,defaultValues:void 0},{field:"timeWindows",label:"Specific Time Windows",value:1,defaultValues:Nn.timeWindows}],this.toggleUseDefault=()=>{this.state.usingDefault||this.setToDefaultBudget(),this.setState({usingDefault:!this.state.usingDefault})},this.componentDidUpdate=e=>{this.props.onStageChange&&!Gt(e.formik.values.disruptionBudget,this.props.formik.values.disruptionBudget)&&this.props.onStageChange(this.props.formik.values.disruptionBudget)},this.optionTypeChanged=(e,t)=>{t.filter((t=>t!==e)).forEach((e=>this.props.formik.setFieldValue("disruptionBudget."+e.field,void 0))),this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)},this.policyTypeChanged=e=>this.optionTypeChanged(e,In),this.rateTypeChanged=e=>this.optionTypeChanged(e,Dn),this.timeWindowsChanged=e=>{this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)};const{disruptionBudget:t}=e.formik.values;this.state={usingDefault:!t||Gt(t,An(e.app))},this.state.usingDefault&&this.setToDefaultBudget()}setToDefaultBudget(){this.props.formik.setFieldValue("disruptionBudget",An(this.props.app))}getSelectionFromFields(e){const{disruptionBudget:t}=this.props.formik.values;return t?e.find((e=>!!t[e.field])):e[0]}getTimeWindowSelection(){return yt(this.props.formik.values,"disruptionBudget.timeWindows")?this.timeWindowOptions.find((e=>e.defaultValues)):this.timeWindowOptions.find((e=>!e.defaultValues))}toggleHealthProvider(e){const{values:t,setFieldValue:n}=this.props.formik,r=t.disruptionBudget.containerHealthProviders,a=r.find((t=>t.name===e));n("disruptionBudget.containerHealthProviders",a?r.filter((e=>e!==a)):r.concat({name:e}))}render(){var e;const{runJobView:t}=this.props,{usingDefault:n}=this.state,r=this.props.formik.values.disruptionBudget||An(this.props.app),a=this.getSelectionFromFields(In),s=a.fieldComponent,i=this.getSelectionFromFields(Dn),o=null==i?void 0:i.fieldComponent,l=this.getTimeWindowSelection(),c=(null!=(e=r.containerHealthProviders)?e:[]).map((e=>e.name)),u=!!r.selfManaged,d=!t||t&&!n;return pt.createElement(ge,{value:Ie},pt.createElement("div",{className:"form-horizontal sp-margin-l-xaxis"},!t&&pt.createElement(On,null),pt.createElement(de,{name:"usingDefault",input:()=>pt.createElement(Ce,{checked:n,onChange:this.toggleUseDefault,text:pt.createElement("b",null,"Use Netflix Defaults")}),layout:t?({input:e})=>pt.createElement(pt.Fragment,null,e):void 0}),d&&pt.createElement("div",{style:{opacity:n?.5:1}},pt.createElement("div",{className:"sp-formGroup"},pt.createElement("div",{className:"groupHeader"},pt.createElement(de,{name:"policyType",label:"Policy",input:e=>pt.createElement("div",null,pt.createElement(De,{...e,menuContainerStyle:{height:"300px"},className:"Select-menu-long",style:{width:"300px"},disabled:n,clearable:!1,onChange:this.policyTypeChanged,value:a,options:In}),pt.createElement(ae,{expand:!0,content:"A job policy defines container relocation rules and constraints"}))})),pt.createElement("div",{className:"sp-formItem"},pt.createElement("p",null,a.description)),s&&pt.createElement(s,{isDisabled:n})),!u&&pt.createElement("div",null,pt.createElement("div",{className:""+(r.rateUnlimited?"":"sp-formGroup")},pt.createElement("div",{className:""+(r.rateUnlimited?"":"groupHeader")},pt.createElement(de,{name:"rates",label:"Rates",input:e=>pt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.rateTypeChanged,value:i,options:Dn})})),pt.createElement("div",{className:"sp-formItem"},pt.createElement("p",null,i.description)),o&&pt.createElement(o,{isDisabled:n})),pt.createElement("div",{className:""+(r.timeWindows?"sp-formGroup":"")},pt.createElement("div",{className:""+(r.timeWindows?"groupHeader":"")},pt.createElement(de,{name:"timeWindows",label:"When Can Disruption Occur?",input:e=>pt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.timeWindowsChanged,value:l,options:this.timeWindowOptions})})),r.timeWindows&&pt.createElement(Pn,{isDisabled:n,formik:this.props.formik})),pt.createElement(de,{name:"healthProviders",label:"Container Health Provider",input:()=>pt.createElement("div",null,pt.createElement(Ce,{checked:c.includes("eureka"),onChange:()=>this.toggleHealthProvider("eureka"),text:"Discovery",disabled:n}))})))))}}class Mn extends pt.Component{constructor(e){super(e),this.credentialsKeyedByAccount={},this.defaultIamProfile="",this.state={credentials:[],regions:[],loaded:!1},this.accountChanged=e=>{St(this.props.stage,"account",e),this.stageFieldChanged("credentials",e),this.setRegistry(e),this.updateRegions(e);const t="test"===this.credentialsKeyedByAccount[e].environment?"true":"false";this.associateIPv6AddressChanged(t)},this.dockerChanged=e=>{const{imageId:t,...n}=e;Object.assign(this.props.stage,n),t?this.props.stage.cluster.imageId=t:delete this.props.stage.cluster.imageId,this.props.stageFieldUpdated(),this.forceUpdate()},this.stageFieldChanged=(e,t)=>{St(this.props.stage,e,t),this.props.stageFieldUpdated(),this.forceUpdate()},this.mapChanged=(e,t)=>{this.stageFieldChanged(e,t)},this.groupsChanged=e=>{this.stageFieldChanged("cluster.securityGroups",e),this.forceUpdate()},this.associateIPv6AddressChanged=e=>{const t={...this.props.stage.cluster.containerAttributes||{},"titusParameter.agent.assignIPv6Address":e};this.mapChanged("cluster.containerAttributes",t)},this.disruptionBudgetChanged=e=>{const{stage:t,stageFieldUpdated:n}=this.props;t.cluster.disruptionBudget=e,n()};const{application:t,stage:n}=e;n.cluster=n.cluster||{},n.waitForCompletion=void 0===n.waitForCompletion||n.waitForCompletion,n.cluster.imageId&&!n.cluster.imageId.includes("${")&&Object.assign(n,Dt.splitImageId(n.cluster.imageId)),!n.credentials&&t.defaultCredentials.titus&&(n.credentials=t.defaultCredentials.titus),n.cluster.capacity||(n.cluster.capacity={min:1,max:1,desired:1});const r=mn.defaults.iamProfile||"{{application}}InstanceProfile";this.defaultIamProfile=r.replace("{{application}}",t.name);const a={application:t.name,containerAttributes:{},env:{},labels:{},resources:{cpu:1,disk:1e4,gpu:0,memory:512,networkMbps:128},retries:0,runtimeLimitSecs:3600,securityGroups:[]};n.isNew&&(a.iamProfile=this.defaultIamProfile),Tt(n.cluster,a),n.cloudProvider=n.cloudProvider||"titus",n.deferredInitialization=!0}setRegistry(e){e&&(this.props.stage.registry=this.credentialsKeyedByAccount[e].registry)}updateRegions(e){let t;e?(t=this.credentialsKeyedByAccount[e].regions,t.map((e=>e.name)).every((e=>e!==this.props.stage.cluster.region))&&(delete this.props.stage.cluster.region,this.props.stageFieldUpdated())):t=[],this.setState({regions:t})}componentDidMount(){const{stage:e}=this.props;T.getCredentialsKeyedByAccount("titus").then((t=>{this.credentialsKeyedByAccount=t;const n=Object.keys(t);e.credentials=e.credentials||n[0],this.setRegistry(e.credentials),this.updateRegions(e.credentials),this.setState({credentials:n,loaded:!0});const r="test"===this.credentialsKeyedByAccount[e.credentials].environment&&void 0===e.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"]?"true":"false";this.associateIPv6AddressChanged(r)}))}render(){var e,t;const{application:n,stage:r}=this.props,{credentials:a,loaded:s,regions:i}=this.state,o=(this.credentialsKeyedByAccount[r.credentials]||{awsAccount:""}).awsAccount,l=(null==(e=r.cluster.entryPointList)?void 0:e.length)?r.cluster.entryPointList.join(","):r.cluster.entryPoint,c=(null==(t=r.cluster.cmdList)?void 0:t.length)?r.cluster.cmdList.join(","):r.cluster.cmd;return pt.createElement("div",{className:"form-horizontal"},pt.createElement("div",{className:"form-group"},pt.createElement("label",{className:"col-md-3 sm-label-right"},pt.createElement("span",{className:"label-text"},"Account")),pt.createElement("div",{className:"col-md-5"},pt.createElement(ne,{value:r.credentials,onChange:e=>this.accountChanged(e.target.value),accounts:a,provider:"titus"}),void 0!==r.credentials&&pt.createElement("div",{className:"small"},"Uses resources from the Amazon account ",pt.createElement(Q,{account:o})))),pt.createElement(re,{labelColumns:3,fieldColumns:5,component:r.cluster,field:"region",account:r.credentials,regions:i,onChange:e=>this.stageFieldChanged("region",e)}),pt.createElement(xt,{specifyTagByRegex:!1,account:r.credentials,digest:r.digest,imageId:r.cluster.imageId,organization:r.organization,registry:r.registry,repository:r.repository,tag:r.tag,showRegistry:!1,onChange:this.dockerChanged,deferInitialization:r.deferredInitialization}),pt.createElement(xe,{label:"CPU(s)"},pt.createElement(le,{value:r.cluster.resources.cpu,onChange:e=>this.stageFieldChanged("cluster.resources.cpu",e),required:!0})),pt.createElement(xe,{label:"Memory (MB)"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.memory",e),value:r.cluster.resources.memory,required:!0})),pt.createElement(xe,{label:"Disk (MB)"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.disk",e),value:r.cluster.resources.disk,required:!0})),pt.createElement(xe,{label:"Network (Mbps)",helpKey:"titus.deploy.network"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.networkMbps",e),value:r.cluster.resources.networkMbps,required:!0})),pt.createElement(xe,{label:"GPU(s)",helpKey:"titus.deploy.gpu"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.gpu",e),value:r.cluster.resources.gpu,required:!0})),pt.createElement(xe,{label:"Entrypoint(s)",helpKey:"titus.deploy.entrypoint"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:l,onChange:e=>this.stageFieldChanged("cluster.entryPointList",e.target.value.split(","))})),pt.createElement(xe,{label:"Command(s)",helpKey:"titus.deploy.command"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:c,onChange:e=>this.stageFieldChanged("cluster.cmdList",e.target.value.split(","))})),pt.createElement(xe,{label:"Runtime Limit (Seconds)",helpKey:"titus.deploy.runtimeLimitSecs"},pt.createElement(le,{value:r.cluster.runtimeLimitSecs,onChange:e=>this.stageFieldChanged("cluster.runtimeLimitSecs",e),min:1,required:!0})),pt.createElement(xe,{label:"Retries",helpKey:"titus.deploy.retries"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.retries",e),value:r.cluster.retries,min:0,required:!0})),pt.createElement(xe,{label:"Property File",helpKey:"titus.deploy.propertyFile"},pt.createElement("input",{type:"text",className:"form-control input-sm",onChange:e=>this.stageFieldChanged("propertyFile",e.target.value),value:r.propertyFile})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-9 col-md-offset-1"},pt.createElement("div",{className:"checkbox"},pt.createElement("label",null,pt.createElement("input",{type:"checkbox",checked:r.showAdvancedOptions,onChange:e=>this.stageFieldChanged("showAdvancedOptions",e.target.checked)}),pt.createElement("strong",null,"Show Advanced Options"))))),pt.createElement("div",{className:""+(!0===r.showAdvancedOptions?"collapse.in":"collapse")},pt.createElement("div",{className:"form-group"},pt.createElement("label",{className:"col-md-3 sm-label-right"},pt.createElement("span",{className:"label-text"},"IAM Instance Profile")," ",pt.createElement(ae,{id:"titus.deploy.iamProfile"})),pt.createElement("div",{className:"col-md-4"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.iamProfile,placeholder:this.defaultIamProfile,required:!0,onChange:e=>this.stageFieldChanged("cluster.iamProfile",e.target.value)}),!r.isNew&&!r.cluster.iamProfile&&pt.createElement("a",{className:"small clickable",onClick:()=>this.stageFieldChanged("cluster.iamProfile",this.defaultIamProfile)},"Use suggested default")),pt.createElement("div",{className:"col-md-1 small",style:{whiteSpace:"nowrap",paddingLeft:"0px",paddingTop:"7px"}},"in ",pt.createElement(Q,{account:o}))),pt.createElement(xe,{label:"Capacity Group",fieldColumns:4,helpKey:"titus.job.capacityGroup"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.capacityGroup||"",onChange:e=>this.stageFieldChanged("cluster.capacityGroup",e.target.value)})),pt.createElement(xe,{label:D.get("Firewalls"),helpKey:"titus.job.securityGroups"},(!r.credentials||!r.cluster.region)&&pt.createElement("div",null,"Account and region must be selected before ",D.get("firewalls")," can be added"),s&&r.credentials&&r.cluster.region&&pt.createElement(dn,{account:r.credentials,region:r.cluster.region,command:r,amazonAccount:o,hideLabel:!0,groupsToEdit:r.cluster.securityGroups,onChange:this.groupsChanged})),pt.createElement(xe,{label:"Associate IPv6 Address (Recommended)",helpKey:"serverGroup.ipv6"},pt.createElement(wn,{value:r.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"],onChange:e=>this.associateIPv6AddressChanged(e.target.value)})),pt.createElement(xe,{label:"Disruption Budget",helpKey:"titus.disruptionbudget.description"},pt.createElement(Ge,{initialValues:r.cluster,onSubmit:()=>{},render:e=>pt.createElement(Ln,{formik:e,app:n,runJobView:!0,onStageChange:this.disruptionBudgetChanged})})),pt.createElement(xe,{label:"Job Attributes (optional)"},pt.createElement(Pe,{model:r.cluster.labels,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.labels",e)})),pt.createElement(xe,{label:"Container Attributes (optional)"},pt.createElement(Pe,{model:r.cluster.containerAttributes,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.containerAttributes",e)})),pt.createElement(xe,{label:"Environment Variables (optional)"},pt.createElement(Pe,{model:r.cluster.env,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.env",e)}))),pt.createElement(xe,{label:"Wait for results",helpKey:"titus.job.waitForCompletion"},pt.createElement("input",{type:"checkbox",className:"input-sm",name:"waitForCompletion",checked:r.waitForCompletion,onChange:e=>this.stageFieldChanged("waitForCompletion",e.target.checked)})))}}J.pipeline.registerStage({provides:"runJob",useBaseProvider:!0,restartable:!0,key:"runJob",cloudProvider:"titus",providesFor:["aws","titus"],component:Mn,executionDetailsSections:[un,Oe],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],supportsCustomTimeout:!0,validators:[{type:"requiredField",fieldName:"cluster.iamProfile"},{type:"requiredField",fieldName:"cluster.imageId"},{type:"requiredField",fieldName:"credentials"},{type:"requiredField",fieldName:"cluster.region"},{type:"requiredField",fieldName:"cluster.resources.cpu"},{type:"requiredField",fieldName:"cluster.resources.gpu"},{type:"requiredField",fieldName:"cluster.resources.memory"},{type:"requiredField",fieldName:"cluster.resources.disk"},{type:"requiredField",fieldName:"cluster.runtimeLimitSecs"}]});const Fn="spinnaker.titus.pipeline.stage.scaleDownClusterStage";t(Fn,[]).config((function(){J.pipeline.registerStage({provides:"scaleDownCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",executionConfigSections:["scaleDownClusterConfig","taskStatus"],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingFullSizeServerGroups",fieldLabel:"Keep [X] full size Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],strategy:!0})})).controller("titusScaleDownClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.remainingFullSizeServerGroups&&(t.remainingFullSizeServerGroups=1),void 0===t.allowScaleDownActive&&(t.allowScaleDownActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.preferLargerOverNewer&&(t.preferLargerOverNewer="false"),t.preferLargerOverNewer=t.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",'<div ng-controller="titusScaleDownClusterStageCtrl as scaleDownClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Scale Down Options">\n <div class="form-inline">\n <p>\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingFullSizeServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{scaleDownClusterStageCtrl.pluralize(\'server group\', stage.remainingFullSizeServerGroups)}} at current size.\n </p>\n <p>The remaining server groups will be scaled down to zero instances.</p>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowScaleDownActive" />\n Allow scale down of active server groups\n </label>\n </div>\n </div>\n</div>\n')}]);const zn="spinnaker.titus.pipeline.stage.shrinkClusterStage";t(zn,[]).config((function(){J.pipeline.registerStage({provides:"shrinkCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"shrinkToSize",fieldLabel:"shrink to [X] Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})})).controller("titusShrinkClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.shrinkToSize&&(t.shrinkToSize=1),void 0===t.allowDeleteActive&&(t.allowDeleteActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.retainLargerOverNewer&&(t.retainLargerOverNewer="false"),t.retainLargerOverNewer=t.retainLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",'<div ng-controller="titusShrinkClusterStageCtrl as shrinkClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Shrink Options">\n <div class="form-inline">\n Shrink to\n <input\n type="number"\n min="0"\n required\n ng-model="stage.shrinkToSize"\n class="form-control input-sm"\n style="width: 50px"\n />\n {{shrinkClusterStageCtrl.pluralize(\'server group\', stage.shrinkToSize)}}, keeping the\n <select class="form-control input-sm" ng-model="stage.retainLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowDeleteActive" />\n Allow deletion of active server groups\n </label>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);const jn="spinnaker.titus.react";t(jn,[]).run(["$injector",function(e){Zt.initialize(e)}]);const Bn="spinnaker.titus.securityGroup.reader";t(Bn,[]).factory("titusSecurityGroupReader",(function(){return{resolveIndexedSecurityGroup:function(e,t,n){return e[t.awsAccount][t.region][n]}}}));const Rn="spinnaker.titus.serverGroupCommandBuilder.service";e.module(Rn,[]).factory("titusServerGroupCommandBuilder",["$q",function(t){function n(e){return(mn.defaults.iamProfile||"{{application}}InstanceProfile").replace("{{application}}",e.name)}function r(e,r){const a=(r=r||{}).account||mn.defaults.account,s=r.region||mn.defaults.region,i=r.zone||mn.defaults.zone,o=n(e),l={application:e.name,credentials:a,region:s,zone:i,network:"default",inService:!0,resources:{cpu:1,networkMbps:128,disk:1e4,memory:512,gpu:0},efs:{mountPerm:"RW"},strategy:"",capacity:{min:1,max:1,desired:1},targetHealthyDeployPercentage:100,env:{},labels:{},containerAttributes:{"titusParameter.agent.assignIPv6Address":"true"},cloudProvider:"titus",selectedProvider:"titus",iamProfile:o,constraints:{hard:{},soft:{}},serviceJobProcesses:{},viewState:{defaultIamProfile:o,useSimpleCapacity:!0,usePreferredZones:!0,mode:r.mode||"create"},securityGroups:[],imageId:r.imageId,migrationPolicy:{type:"systemDefault"},digest:"",organization:"",tag:"",registry:"",repository:""};return t.when(l)}return{buildNewServerGroupCommand:r,buildNewServerGroupCommandForPipeline:function(){return t.when({viewState:{requiresTemplateSelection:!0}})},buildServerGroupCommandFromExisting:function(e,r,a){a=a||"clone";const s=X.parseServerGroupName(r.name),i="test"===r.awsAccount,o=r.containerAttributes&&void 0!==r.containerAttributes["titusParameter.agent.assignIPv6Address"]?r.containerAttributes["titusParameter.agent.assignIPv6Address"]:i?"true":"false",l={...r.containerAttributes,"titusParameter.agent.assignIPv6Address":o},c={application:e.name,disruptionBudget:r.disruptionBudget,strategy:"",stack:s.stack,freeFormDetails:s.freeFormDetails,account:r.account,credentials:r.account,region:r.region,env:r.env,labels:r.labels,containerAttributes:l,entryPoint:r.entryPoint,iamProfile:r.iamProfile,capacityGroup:r.capacityGroup,migrationPolicy:r.migrationPolicy?r.migrationPolicy:{type:"systemDefault"},securityGroups:r.securityGroups||[],constraints:{hard:r.constraints&&r.constraints.hard||{},soft:r.constraints&&r.constraints.soft||{}},serviceJobProcesses:Object.assign({},r.serviceJobProcesses),inService:!r.disabled,source:{account:r.account,region:r.region,asgName:r.name},resources:{cpu:r.resources.cpu,gpu:r.resources.gpu,memory:r.resources.memory,disk:r.resources.disk,networkMbps:r.resources.networkMbps},targetGroups:r.targetGroups,capacity:{min:r.capacity.min,max:r.capacity.max,desired:r.capacity.desired},targetHealthyDeployPercentage:100,cloudProvider:"titus",selectedProvider:"titus",viewState:{defaultIamProfile:n(e),useSimpleCapacity:r.capacity.min===r.capacity.max,mode:a},organization:"",tag:"",digest:"",registry:"",repository:""};return r.efs?c.efs={mountPoint:r.efs.mountPoint,mountPerm:r.efs.mountPerm,efsId:r.efs.efsId}:c.efs={mountPerm:"RW"},"editPipeline"!==a&&(c.imageId=r.image.dockerImageName+":"+(r.image.dockerImageVersion?r.image.dockerImageVersion:r.image.dockerImageDigest)),t.when(c)},buildServerGroupCommandFromPipeline:function(t,a){const s=Nt(a),i={account:s.account,imageId:s.imageId,region:s.region};return r(t,i).then((function(r){r.constraints={hard:a.constraints&&a.constraints.hard||a.hardConstraints&&a.hardConstraints.reduce(((e,t)=>St(e,t,"true")),{})||{},soft:a.constraints&&a.constraints.soft||a.softConstraints&&a.softConstraints.reduce(((e,t)=>St(e,t,"true")),{})||{}},delete s.hardConstraints,delete s.softConstraints;const i={disableImageSelection:!0,useSimpleCapacity:a.capacity.min===a.capacity.max,mode:"editPipeline",submitButtonLabel:"Done",defaultIamProfile:n(t)},o={region:s.region,credentials:s.account,iamProfile:s.iamProfile,viewState:i};s.strategy=s.strategy||"";return e.extend({},r,s,o)}))}}}]);const Vn="spinnaker.serverGroup.configure.titus";t(Vn,[Tn]);const Wn=class extends pt.Component{constructor(e){super(e),this._isUnmounted=!1,this.templateSelected=()=>{this.setState({requiresTemplateSelection:!1}),this.configureCommand()},this.onTaskComplete=()=>{this.props.application.serverGroups.refresh(),this.props.application.serverGroups.onNextRefresh(null,this.onApplicationRefresh)},this.onApplicationRefresh=()=>{if(this._isUnmounted)return;const{command:e}=this.props,{taskMonitor:t}=this.state,n=t.task.execution.stages.find((e=>"cloneServerGroup"===e.type));if(n&&n.context["deploy.server.groups"]){const t=n.context["deploy.server.groups"][e.region];if(t){const n={serverGroup:t,accountId:e.credentials,region:e.region,provider:"titus"};let r="^.^.^.clusters.serverGroup";I.$state.includes("**.clusters.serverGroup")&&(r="^.serverGroup"),I.$state.includes("**.clusters.cluster.serverGroup")&&(r="^.^.serverGroup"),I.$state.includes("**.clusters")&&(r=".serverGroup"),I.$state.go(r,n)}}},this.configureCommand=()=>{const{command:e}=this.props;Zt.titusServerGroupConfigurationService.configureCommand(e).then((()=>{Zt.titusServerGroupConfigurationService.configureSubnets(e),e.credentials.includes("${")||(e.registry=(e.backingData.credentialsKeyedByAccount[e.credentials]||{}).registry),this.setState({loaded:!0,requiresTemplateSelection:!1})}))},this.submit=e=>{const t="editPipeline"===e.viewState.mode||"createPipeline"===e.viewState.mode;let n=e;e.disruptionBudget.timeWindows&&!e.disruptionBudget.timeWindows.length&&delete e.disruptionBudget.timeWindows,Gt(An(this.props.application),e.disruptionBudget)&&(n={...e,disruptionBudget:void 0}),t?this.props.closeModal&&this.props.closeModal(n):this.state.taskMonitor.submit((()=>I.serverGroupWriter.cloneServerGroup(n,this.props.application)))},this.getLoadBalancerNote=e=>pt.createElement("div",{className:"form-group small",style:{marginTop:"20px"}},pt.createElement("div",{className:"col-md-8 col-md-offset-3"},pt.createElement("p",null,"Only target groups with target type ",pt.createElement("em",null,"ip")," are supported in Titus. It is not possible to re-use target groups of target type ",pt.createElement("em",null,"instance")," used by Amazon instances."," "),void 0!==e.backingData&&void 0!==e.backingData.credentialsKeyedByAccount&&void 0!==e.credentials&&pt.createElement("p",null,"Uses target groups from the Amazon account"," ",pt.createElement(Q,{account:e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount})))),this.getSecurityGroupNote=e=>{const t=e.backingData&&e.backingData.credentialsKeyedByAccount&&e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount;return t&&void 0!==e.credentials?pt.createElement("div",{className:"form-group small"},pt.createElement("div",{className:"col-md-9 col-md-offset-3"},"Uses ",D.get("firewalls")," from the Amazon account ",pt.createElement(Q,{account:t}))):null};const t=yt(e,"command.viewState.requiresTemplateSelection",!1);t||this.configureCommand(),this.state={firewallsLabel:D.get("Firewalls"),loaded:!1,requiresTemplateSelection:t,taskMonitor:new Le({application:e.application,title:"Creating your server group",modalInstance:Le.modalInstanceEmulation((()=>this.props.dismissModal())),onTaskComplete:this.onTaskComplete})}}static show(e){return Me.show(Wn,e,{dialogClassName:"wizard-modal modal-lg"})}componentWillUnmount(){this._isUnmounted=!0,this.refreshUnsubscribe&&this.refreshUnsubscribe()}render(){const{application:e,command:t,dismissModal:n,title:r}=this.props,{loaded:a,taskMonitor:s,requiresTemplateSelection:i}=this.state;return i?pt.createElement(Fe,{application:e,cloudProvider:"titus",command:t,onDismiss:n,onTemplateSelected:this.templateSelected}):pt.createElement(ze,{heading:r,initialValues:t,loading:!a,taskMonitor:s,dismissModal:n,closeModal:this.submit,submitButtonLabel:t.viewState.submitButtonLabel,render:({formik:t,nextIdx:n,wizard:r})=>pt.createElement(pt.Fragment,null,pt.createElement(je,{label:"Basic Settings",wizard:r,order:n(),render:({innerRef:n})=>pt.createElement(gn,{ref:n,formik:t,app:e})}),pt.createElement(je,{label:"Resources",wizard:r,order:n(),render:({innerRef:e})=>pt.createElement(fn,{ref:e,formik:t})}),pt.createElement(je,{label:"Capacity",wizard:r,order:n(),render:({innerRef:e})=>pt.createElement(u,{ref:e,formik:t})}),pt.createElement(je,{label:"Load Balancers",wizard:r,order:n(),note:this.getLoadBalancerNote(t.values),render:({innerRef:e})=>pt.createElement(d,{ref:e,formik:t,hideLoadBalancers:!0,targetGroupTypeHelpText:"ip"})}),pt.createElement(je,{label:D.get("Firewalls"),wizard:r,order:n(),note:this.getSecurityGroupNote(t.values),render:({innerRef:e})=>pt.createElement(m,{ref:e,formik:t})}),pt.createElement(je,{label:"Job Disruption Budget",wizard:r,order:n(),render:({innerRef:n})=>pt.createElement(Ln,{ref:n,formik:t,app:e})}),pt.createElement(je,{label:"Advanced Settings",wizard:r,order:n(),render:({innerRef:n})=>pt.createElement(kn,{ref:n,formik:t,app:e})}))})}};let Hn=Wn;Hn.defaultProps={closeModal:Be,dismissModal:Be};const{useState:Zn,useEffect:Un,useMemo:qn}=pt;function Jn(e){const t=e.errors.capacity||{},{min:n,max:r,desired:a}=t;return[n,r,a].find((e=>!!e))}function Kn({formik:e,serverGroup:t,toggleMode:n}){Un((()=>{e.setFieldValue("capacity.min",e.values.capacity.desired),e.setFieldValue("capacity.max",e.values.capacity.desired)}),[e.values.capacity.desired]);const r=Jn(e);return pt.createElement("div",null,pt.createElement("p",null,"Sets min, max, and desired instance counts to the same value."),pt.createElement("p",null,"To allow autoscaling, use the"," ",pt.createElement("a",{className:"clickable",onClick:n},"Advanced Mode"),"."),pt.createElement("div",{className:"form-group row"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Current size"),pt.createElement("div",{className:"col-md-4"},pt.createElement("div",{className:"horizontal middle"},pt.createElement("input",{type:"number",className:"NumberInput form-control",value:t.capacity.desired,disabled:!0}),pt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),pt.createElement("div",{className:"col-md-4"},pt.createElement("div",{className:"horizontal middle"},pt.createElement(de,{name:"capacity.desired",input:e=>pt.createElement(Ae,{...e,min:0}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0,onChange:()=>{}}),pt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),!!r&&pt.createElement("div",{className:"col-md-offset-3 col-md-9"},pt.createElement(ce,{message:r,type:"error"})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),pt.createElement("div",{className:"col-md-9 sm-control-field"},pt.createElement(Ue,{current:t.capacity,next:e.values.capacity}))))}function Xn({formik:e,serverGroup:t,toggleMode:n}){const{min:r,max:a}=e.values.capacity||{},s=({value:e})=>pt.createElement("div",{className:"col-md-2"},pt.createElement("input",{className:"NumberInput form-control",type:"number",disabled:!0,value:e})),i=Jn(e);return pt.createElement("div",null,pt.createElement("p",null,"Sets up auto-scaling for this server group."),pt.createElement("p",null,"To disable auto-scaling, use the"," ",pt.createElement("a",{className:"clickable",onClick:n},"Simple Mode"),"."),pt.createElement("div",{className:"form-group bold"},pt.createElement("div",{className:"col-md-2 col-md-offset-3"},"Min"),pt.createElement("div",{className:"col-md-2"},"Max"),pt.createElement("div",{className:"col-md-2"},"Desired")),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Current"),pt.createElement(s,{value:t.capacity.min}),pt.createElement(s,{value:t.capacity.max}),pt.createElement(s,{value:t.capacity.desired})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),pt.createElement("div",{className:"col-md-2"},pt.createElement(de,{name:"capacity.min",input:e=>pt.createElement(Ae,{...e,min:0,max:a}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0})),pt.createElement("div",{className:"col-md-2"},pt.createElement(de,{name:"capacity.max",input:e=>pt.createElement(Ae,{...e,min:r}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0})),pt.createElement("div",{className:"col-md-2"},pt.createElement(de,{name:"capacity.desired",input:e=>pt.createElement(Ae,{...e,min:r,max:a}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0}))),!!i&&pt.createElement("div",{className:"col-md-offset-3 col-md-9"},pt.createElement(ce,{message:i,type:"error"})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),pt.createElement("div",{className:"col-md-9 sm-control-field"},pt.createElement(Ue,{current:t.capacity,next:e.values.capacity}))))}function Yn(e){const{min:t,max:n,desired:r}=e.capacity,a={};return t>n?a.min=a.max="Min cannot be larger than Max":r<t?a.desired=a.min="Desired cannot be smaller than Min":r>n&&(a.desired=a.max="Desired cannot be larger than Max"),Object.keys(a).length?{capacity:a}:{}}function Qn(e){const{serverGroup:t,application:n,dismissModal:r}=e,a=qn((()=>{const{min:e,max:n,desired:r}=t.capacity;return r!==n||r!==e}),[]),[s,i]=Zn(a),o=n.attributes&&n.attributes.platformHealthOnlyShowOverride,[l,c]=Zn(),u=Re({application:n,title:`Resizing ${t.name}`,onTaskComplete:()=>n.getDataSource("serverGroups").refresh(!0)},r),d=e=>u.submit((()=>I.serverGroupWriter.resizeServerGroup(t,n,e))),m={capacity:t.capacity};return pt.createElement(pt.Fragment,null,pt.createElement(Ve,{monitor:u}),pt.createElement(Ge,{initialValues:m,validate:Yn,onSubmit:d,render:e=>pt.createElement(pt.Fragment,null,pt.createElement(We,{dismiss:r}),pt.createElement(zt.Header,null,pt.createElement(zt.Title,null,"Resize ",t.name)),pt.createElement(zt.Body,null,pt.createElement(Lt,{className:"form-horizontal"},s?pt.createElement(Xn,{formik:e,serverGroup:t,toggleMode:()=>i(!1)}):pt.createElement(Kn,{formik:e,serverGroup:t,toggleMode:()=>i(!0)}),o&&pt.createElement(He,{interestingHealthProviderNames:e.values.interestingHealthProviderNames,platformHealthType:"Titus",showHelpDetails:!0,onChange:t=>e.setFieldValue("interestingHealthProviderNames",t||void 0)}))),pt.createElement(zt.Footer,null,pt.createElement(Ze,{account:t.account,onValidChange:c}),pt.createElement("button",{className:"btn btn-default",onClick:r},"Cancel"),pt.createElement("button",{type:"submit",disabled:!l||!e.isValid,className:"btn btn-primary",onClick:()=>d(e.values)},"Submit")))}))}class $n extends Error{}class _n extends $n{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class er extends $n{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class tr extends $n{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class nr extends $n{}class rr extends $n{constructor(e){super(`Invalid unit ${e}`)}}class ar extends $n{}class sr extends $n{constructor(){super("Zone is an abstract class")}}const ir="numeric",or="short",lr="long",cr={year:ir,month:ir,day:ir},ur={year:ir,month:or,day:ir},dr={year:ir,month:lr,day:ir},mr={year:ir,month:lr,day:ir,weekday:lr},pr={hour:ir,minute:ir},gr={hour:ir,minute:ir,second:ir},hr={hour:ir,minute:ir,second:ir,timeZoneName:or},fr={hour:ir,minute:ir,second:ir,timeZoneName:lr},vr={hour:ir,minute:ir,hour12:!1},yr={hour:ir,minute:ir,second:ir,hour12:!1},br={hour:ir,minute:ir,second:ir,hour12:!1,timeZoneName:or},Cr={hour:ir,minute:ir,second:ir,hour12:!1,timeZoneName:lr},Er={year:ir,month:ir,day:ir,hour:ir,minute:ir},wr={year:ir,month:ir,day:ir,hour:ir,minute:ir,second:ir},Sr={year:ir,month:or,day:ir,hour:ir,minute:ir},kr={year:ir,month:or,day:ir,hour:ir,minute:ir,second:ir},Nr={year:ir,month:or,day:ir,weekday:or,hour:ir,minute:ir},Ar={year:ir,month:lr,day:ir,hour:ir,minute:ir,timeZoneName:or},Gr={year:ir,month:lr,day:ir,hour:ir,minute:ir,second:ir,timeZoneName:or},Tr={year:ir,month:lr,day:ir,weekday:lr,hour:ir,minute:ir,timeZoneName:lr},Ir={year:ir,month:lr,day:ir,weekday:lr,hour:ir,minute:ir,second:ir,timeZoneName:lr};function Dr(e){return void 0===e}function xr(e){return"number"==typeof e}function Pr(e){return"number"==typeof e&&e%1==0}function Or(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function Lr(){return!Dr(Intl.DateTimeFormat.prototype.formatToParts)}function Mr(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Fr(e,t,n){if(0!==e.length)return e.reduce(((e,r)=>{const a=[t(r),r];return e&&n(e[0],a[0])===e[0]?e:a}),null)[1]}function zr(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function jr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Br(e,t,n){return Pr(e)&&e>=t&&e<=n}function Rr(e,t=2){return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function Vr(e){return Dr(e)||null===e||""===e?void 0:parseInt(e,10)}function Wr(e){if(!Dr(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Hr(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Zr(e){return e%4==0&&(e%100!=0||e%400==0)}function Ur(e){return Zr(e)?366:365}function qr(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Zr(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Jr(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Kr(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Xr(e){return e>99?e:e>60?1900+e:2e3+e}function Yr(e,t,n,r=null){const a=new Date(e),s={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const i=Object.assign({timeZoneName:t},s),o=Or();if(o&&Lr()){const e=new Intl.DateTimeFormat(n,i).formatToParts(a).find((e=>"timezonename"===e.type.toLowerCase()));return e?e.value:null}if(o){const e=new Intl.DateTimeFormat(n,s).format(a);return new Intl.DateTimeFormat(n,i).format(a).substring(e.length).replace(/^[, \u200e]+/,"")}return null}function Qr(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function $r(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new ar(`Invalid unit value ${e}`);return t}function _r(e,t,n){const r={};for(const a in e)if(jr(e,a)){if(n.indexOf(a)>=0)continue;const s=e[a];if(null==s)continue;r[t(a)]=$r(s)}return r}function ea(e,t){const n=Math.trunc(e/60),r=Math.abs(e%60),a=n>=0&&!Object.is(n,-0)?"+":"-",s=`${a}${Math.abs(n)}`;switch(t){case"short":return`${a}${Rr(Math.abs(n),2)}:${Rr(r,2)}`;case"narrow":return r>0?`${s}:${r}`:s;case"techie":return`${a}${Rr(Math.abs(n),2)}${Rr(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ta(e){return zr(e,["hour","minute","second","millisecond"])}const na=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function ra(e){return JSON.stringify(e,Object.keys(e).sort())}const aa=["January","February","March","April","May","June","July","August","September","October","November","December"],sa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ia=["J","F","M","A","M","J","J","A","S","O","N","D"];function oa(e){switch(e){case"narrow":return ia;case"short":return sa;case"long":return aa;case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const la=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ca=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ua=["M","T","W","T","F","S","S"];function da(e){switch(e){case"narrow":return ua;case"short":return ca;case"long":return la;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ma=["AM","PM"],pa=["Before Christ","Anno Domini"],ga=["BC","AD"],ha=["B","A"];function fa(e){switch(e){case"narrow":return ha;case"short":return ga;case"long":return pa;default:return null}}function va(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ya={D:cr,DD:ur,DDD:dr,DDDD:mr,t:pr,tt:gr,ttt:hr,tttt:fr,T:vr,TT:yr,TTT:br,TTTT:Cr,f:Er,ff:Sr,fff:Ar,ffff:Tr,F:wr,FF:kr,FFF:Gr,FFFF:Ir};class ba{static create(e,t={}){return new ba(e,t)}static parseFormat(e){let t=null,n="",r=!1;const a=[];for(let s=0;s<e.length;s++){const i=e.charAt(s);"'"===i?(n.length>0&&a.push({literal:r,val:n}),t=null,n="",r=!r):r||i===t?n+=i:(n.length>0&&a.push({literal:!1,val:n}),n=i,t=i)}return n.length>0&&a.push({literal:r,val:n}),a}static macroTokenToFormatOpts(e){return ya[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Rr(e,t);const n=Object.assign({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&Lr(),a=(t,n)=>this.loc.extract(e,t,n),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>n?function(e){return ma[e.hour<12?0:1]}(e):a({hour:"numeric",hour12:!0},"dayperiod"),o=(t,r)=>n?function(e,t){return oa(t)[e.month-1]}(e,t):a(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>n?function(e,t){return da(t)[e.weekday-1]}(e,t):a(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=ba.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return fa(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return va(ba.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?a({day:"numeric"},"day"):this.num(e.day);case"dd":return r?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?a({month:"numeric"},"month"):this.num(e.month);case"MM":return r?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?a({year:"numeric"},"year"):this.num(e.year);case"yy":return r?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}}))}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},r=ba.parseFormat(t),a=r.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]);return va(r,(e=>t=>{const r=n(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...a.map(n).filter((e=>e)))))}}class Ca{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ea{get type(){throw new sr}get name(){throw new sr}get universal(){throw new sr}offsetName(e,t){throw new sr}formatOffset(e,t){throw new sr}offset(e){throw new sr}equals(e){throw new sr}get isValid(){throw new sr}}let wa=null;class Sa extends Ea{static get instance(){return null===wa&&(wa=new Sa),wa}get type(){return"local"}get name(){return Or()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Yr(e,t,n)}formatOffset(e,t){return ea(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"local"===e.type}get isValid(){return!0}}const ka=RegExp(`^${na.source}$`);let Na={};const Aa={year:0,month:1,day:2,hour:3,minute:4,second:5};let Ga={};class Ta extends Ea{static create(e){return Ga[e]||(Ga[e]=new Ta(e)),Ga[e]}static resetCache(){Ga={},Na={}}static isValidSpecifier(e){return!(!e||!e.match(ka))}static isValidZone(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}static parseGMTOffset(e){if(e){const t=e.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null}constructor(e){super(),this.zoneName=e,this.valid=Ta.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Yr(e,t,n,this.name)}formatOffset(e,t){return ea(this.offset(e),t)}offset(e){const t=new Date(e),n=(c=this.name,Na[c]||(Na[c]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:c,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Na[c]),[r,a,s,i,o,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:a}=n[e],s=Aa[t];Dr(s)||(r[s]=parseInt(a,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,a,s,i,o,l,c]=r;return[i,a,s,o,l,c]}(n,t);var c;let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(Jr({year:r,month:a,day:s,hour:24===i?0:i,minute:o,second:l,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ia=null;class Da extends Ea{static get utcInstance(){return null===Ia&&(Ia=new Da(0)),Ia}static instance(e){return 0===e?Da.utcInstance:new Da(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Da(Qr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${ea(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ea(this.fixed,t)}get universal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class xa extends Ea{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get universal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Pa(e,t){let n;if(Dr(e)||null===e)return t;if(e instanceof Ea)return e;if("string"==typeof e){const r=e.toLowerCase();return"local"===r?t:"utc"===r||"gmt"===r?Da.utcInstance:null!=(n=Ta.parseGMTOffset(e))?Da.instance(n):Ta.isValidSpecifier(r)?Ta.create(e):Da.parseSpecifier(r)||new xa(e)}return xr(e)?Da.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new xa(e)}let Oa=()=>Date.now(),La=null,Ma=null,Fa=null,za=null,ja=!1;class Ba{static get now(){return Oa}static set now(e){Oa=e}static get defaultZoneName(){return Ba.defaultZone.name}static set defaultZoneName(e){La=e?Pa(e):null}static get defaultZone(){return La||Sa.instance}static get defaultLocale(){return Ma}static set defaultLocale(e){Ma=e}static get defaultNumberingSystem(){return Fa}static set defaultNumberingSystem(e){Fa=e}static get defaultOutputCalendar(){return za}static set defaultOutputCalendar(e){za=e}static get throwOnInvalid(){return ja}static set throwOnInvalid(e){ja=e}static resetCaches(){Xa.resetCache(),Ta.resetCache()}}let Ra={};function Va(e,t={}){const n=JSON.stringify([e,t]);let r=Ra[n];return r||(r=new Intl.DateTimeFormat(e,t),Ra[n]=r),r}let Wa={};let Ha={};let Za=null;function Ua(e,t,n,r,a){const s=e.listingMode(n);return"error"===s?null:"en"===s?r(t):a(t)}class qa{constructor(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&Or()){const t={useGrouping:!1};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Wa[n];return r||(r=new Intl.NumberFormat(e,t),Wa[n]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Rr(this.floor?Math.floor(e):Hr(e,3),this.padTo)}}class Ja{constructor(e,t,n){let r;if(this.opts=n,this.hasIntl=Or(),e.zone.universal&&this.hasIntl?(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:qi.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name),this.hasIntl){const e=Object.assign({},this.opts);r&&(e.timeZone=r),this.dtf=Va(t,e)}}format(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());{const e=function(e){const t="EEEE, LLLL d, yyyy, h:mm a";switch(ra(zr(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case ra(cr):return"M/d/yyyy";case ra(ur):return"LLL d, yyyy";case ra(dr):return"LLLL d, yyyy";case ra(mr):return"EEEE, LLLL d, yyyy";case ra(pr):return"h:mm a";case ra(gr):return"h:mm:ss a";case ra(hr):case ra(fr):return"h:mm a";case ra(vr):return"HH:mm";case ra(yr):return"HH:mm:ss";case ra(br):case ra(Cr):return"HH:mm";case ra(Er):return"M/d/yyyy, h:mm a";case ra(Sr):return"LLL d, yyyy, h:mm a";case ra(Ar):return"LLLL d, yyyy, h:mm a";case ra(Tr):return t;case ra(wr):return"M/d/yyyy, h:mm:ss a";case ra(kr):return"LLL d, yyyy, h:mm:ss a";case ra(Nr):return"EEE, d LLL yyyy, h:mm a";case ra(Gr):return"LLLL d, yyyy, h:mm:ss a";case ra(Ir):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}(this.opts),t=Xa.create("en-US");return ba.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){return this.hasIntl&&Lr()?this.dtf.formatToParts(this.dt.toJSDate()):[]}resolvedOptions(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}class Ka{constructor(e,t,n){this.opts=Object.assign({style:"long"},n),!t&&Mr()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let s=Ha[a];return s||(s=new Intl.RelativeTimeFormat(e,t),Ha[a]=s),s}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&s){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${a[e][0]}`;case-1:return n?"yesterday":`last ${a[e][0]}`;case 0:return n?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=a[e],u=r?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return i?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Xa{static fromOpts(e){return Xa.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=!1){const a=e||Ba.defaultLocale,s=a||(r?"en-US":function(){if(Za)return Za;if(Or()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;return Za=e&&"und"!==e?e:"en-US",Za}return Za="en-US",Za}()),i=t||Ba.defaultNumberingSystem,o=n||Ba.defaultOutputCalendar;return new Xa(s,i,o,a)}static resetCache(){Za=null,Ra={},Wa={},Ha={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Xa.create(e,t,n)}constructor(e,t,n,r){const[a,s,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const r=e.substring(0,t);try{n=Va(e).resolvedOptions()}catch(e){n=Va(r).resolvedOptions()}const{numberingSystem:a,calendar:s}=n;return[r,a,s]}}(e);this.locale=a,this.numberingSystem=t||s||null,this.outputCalendar=n||i||null,this.intl=function(e,t,n){return Or()?n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||Or()&&"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(e=!0){const t=Or()&&Lr(),n=this.isEnglish(),r=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t||n&&r||e?!t||n&&r?"en":"intl":"error"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Xa.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone(Object.assign({},e,{defaultToEN:!0}))}redefaultToSystem(e={}){return this.clone(Object.assign({},e,{defaultToEN:!1}))}months(e,t=!1,n=!0){return Ua(this,e,n,oa,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=qi.utc(2016,n,1);t.push(e(r))}return t}((e=>this.extract(e,n,"month")))),this.monthsCache[r][e]}))}weekdays(e,t=!1,n=!0){return Ua(this,e,n,da,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=qi.utc(2016,11,13+n);t.push(e(r))}return t}((e=>this.extract(e,n,"weekday")))),this.weekdaysCache[r][e]}))}meridiems(e=!0){return Ua(this,void 0,e,(()=>ma),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:!0};this.meridiemCache=[qi.utc(2016,11,13,9),qi.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Ua(this,e,t,fa,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[qi.utc(-40,1,1),qi.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===n));return r?r.value:null}numberFormatter(e={}){return new qa(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ja(e,this.intl,t)}relFormatter(e={}){return new Ka(this.intl,this.isEnglish(),e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||Or()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ya(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Qa(...e){return t=>e.reduce((([e,n,r],a)=>{const[s,i,o]=a(t,r);return[Object.assign(e,s),n||i,o]}),[{},null,1]).slice(0,2)}function $a(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function _a(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=Vr(t[n+a]);return[r,null,n+a]}}const es=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ts=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,ns=RegExp(`${ts.source}${es.source}?`),rs=RegExp(`(?:T${ns.source})?`),as=_a("weekYear","weekNumber","weekDay"),ss=_a("year","ordinal"),is=RegExp(`${ts.source} ?(?:${es.source}|(${na.source}))?`),os=RegExp(`(?: ${is.source})?`);function ls(e,t,n){const r=e[t];return Dr(r)?n:Vr(r)}function cs(e,t){return[{year:ls(e,t),month:ls(e,t+1,1),day:ls(e,t+2,1)},null,t+3]}function us(e,t){return[{hour:ls(e,t,0),minute:ls(e,t+1,0),second:ls(e,t+2,0),millisecond:Wr(e[t+3])},null,t+4]}function ds(e,t){const n=!e[t]&&!e[t+1],r=Qr(e[t+1],e[t+2]);return[{},n?null:Da.instance(r),t+3]}function ms(e,t){return[{},e[t]?Ta.create(e[t]):null,t+1]}const ps=/^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;function gs(e){const[t,n,r,a,s,i,o,l,c]=e,u="-"===t[0],d=e=>e&&u?-e:e;return[{years:d(Vr(n)),months:d(Vr(r)),weeks:d(Vr(a)),days:d(Vr(s)),hours:d(Vr(i)),minutes:d(Vr(o)),seconds:d(Vr(l)),milliseconds:d(Wr(c))}]}const hs={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fs(e,t,n,r,a,s,i){const o={year:2===t.length?Xr(Vr(t)):Vr(t),month:sa.indexOf(n)+1,day:Vr(r),hour:Vr(a),minute:Vr(s)};return i&&(o.second=Vr(i)),e&&(o.weekday=e.length>3?la.indexOf(e)+1:ca.indexOf(e)+1),o}const vs=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ys(e){const[,t,n,r,a,s,i,o,l,c,u,d]=e,m=fs(t,a,r,n,s,i,o);let p;return p=l?hs[l]:c?0:Qr(u,d),[m,new Da(p)]}const bs=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Cs=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Es=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ws(e){const[,t,n,r,a,s,i,o]=e;return[fs(t,a,r,n,s,i,o),Da.utcInstance]}function Ss(e){const[,t,n,r,a,s,i,o]=e;return[fs(t,o,n,r,a,s,i),Da.utcInstance]}const ks=Ya(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,rs),Ns=Ya(/(\d{4})-?W(\d\d)(?:-?(\d))?/,rs),As=Ya(/(\d{4})-?(\d{3})/,rs),Gs=Ya(ns),Ts=Qa(cs,us,ds),Is=Qa(as,us,ds),Ds=Qa(ss,us),xs=Qa(us,ds);const Ps=Ya(/(\d{4})-(\d\d)-(\d\d)/,os),Os=Ya(is),Ls=Qa(cs,us,ds,ms),Ms=Qa(us,ds,ms);const Fs={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},zs=Object.assign({years:{months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Fs),js=365.2425,Bs=30.436875,Rs=Object.assign({years:{months:12,weeks:52.1775,days:js,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:Bs,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Fs),Vs=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ws=Vs.slice(0).reverse();function Hs(e,t,n=!1){const r={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new qs(r)}function Zs(e,t,n,r,a){const s=e[a][n],i=t[n]/s,o=!(Math.sign(i)===Math.sign(r[a]))&&0!==r[a]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);r[a]+=o,t[n]-=o*s}function Us(e,t){Ws.reduce(((n,r)=>Dr(t[r])?n:(n&&Zs(e,t,n,t,r),r)),null)}class qs{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||Xa.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Rs:zs,this.isLuxonDuration=!0}static fromMillis(e,t){return qs.fromObject(Object.assign({milliseconds:e},t))}static fromObject(e){if(null==e||"object"!=typeof e)throw new ar("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new qs({values:_r(e,qs.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:Xa.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromISO(e,t){const[n]=function(e){return $a(e,[ps,gs])}(e);if(n){const e=Object.assign(n,t);return qs.fromObject(e)}return qs.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new ar("need to specify a reason the Duration is invalid");const n=e instanceof Ca?e:new Ca(e,t);if(Ba.throwOnInvalid)throw new tr(n);return new qs({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new rr(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n=Object.assign({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?ba.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.values);return e.includeConfig&&(t.conversionAccuracy=this.conversionAccuracy,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Hr(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toJSON(){return this.toISO()}toString(){return this.toISO()}valueOf(){return this.as("milliseconds")}plus(e){if(!this.isValid)return this;const t=Js(e),n={};for(const e of Vs)(jr(t.values,e)||jr(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Hs(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Js(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=$r(e(this.values[n],n));return Hs(this,{values:t},!0)}get(e){return this[qs.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Hs(this,{values:Object.assign(this.values,_r(e,qs.normalizeUnit,[]))})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const r={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(r.conversionAccuracy=n),Hs(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Us(this.matrix,e),Hs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>qs.normalizeUnit(e)));const t={},n={},r=this.toObject();let a;Us(this.matrix,r);for(const s of Vs)if(e.indexOf(s)>=0){a=s;let e=0;for(const t in n)e+=this.matrix[t][s]*n[t],n[t]=0;xr(r[s])&&(e+=r[s]);const i=Math.trunc(e);t[s]=i,n[s]=e-i;for(const e in r)Vs.indexOf(e)>Vs.indexOf(s)&&Zs(this.matrix,r,e,t,s)}else xr(r[s])&&(n[s]=r[s]);for(const e in n)0!==n[e]&&(t[a]+=e===a?n[e]:n[e]/this.matrix[a][e]);return Hs(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=-this.values[t];return Hs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const t of Vs)if(this.values[t]!==e.values[t])return!1;return!0}}function Js(e){if(xr(e))return qs.fromMillis(e);if(qs.isDuration(e))return e;if("object"==typeof e)return qs.fromObject(e);throw new ar(`Unknown duration argument ${e} of type ${typeof e}`)}const Ks="Invalid Interval";class Xs{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new ar("need to specify a reason the Interval is invalid");const n=e instanceof Ca?e:new Ca(e,t);if(Ba.throwOnInvalid)throw new er(n);return new Xs({invalid:n})}static fromDateTimes(e,t){const n=Ji(e),r=Ji(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Xs.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Xs.invalid("missing or invalid end"):Xs.invalid("missing or invalid start")}(n,r);return null==a?new Xs({start:n,end:r}):a}static after(e,t){const n=Js(t),r=Ji(e);return Xs.fromDateTimes(r,r.plus(n))}static before(e,t){const n=Js(t),r=Ji(e);return Xs.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){const e=qi.fromISO(n,t),a=qi.fromISO(r,t);if(e.isValid&&a.isValid)return Xs.fromDateTimes(e,a);if(e.isValid){const n=qs.fromISO(r,t);if(n.isValid)return Xs.after(e,n)}else if(a.isValid){const e=qs.fromISO(n,t);if(e.isValid)return Xs.before(a,e)}}return Xs.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),n=this.end.startOf(e);return Math.floor(n.diff(t,e).get(e))+1}hasSame(e){return!!this.isValid&&this.e.minus(1).hasSame(this.s,e)}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Xs.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ji).filter((e=>this.contains(e))).sort(),n=[];let{s:r}=this,a=0;for(;r<this.e;){const e=t[a]||this.e,s=+e>+this.e?this.e:e;n.push(Xs.fromDateTimes(r,s)),r=s,a+=1}return n}splitBy(e){const t=Js(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,r,{s:a}=this;const s=[];for(;a<this.e;)n=a.plus(t),r=+n>+this.e?this.e:n,s.push(Xs.fromDateTimes(a,r)),a=r;return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>n?null:Xs.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return Xs.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n]),[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],a=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),s=Array.prototype.concat(...a).sort(((e,t)=>e.time-t.time));for(const e of s)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!=+e.time&&r.push(Xs.fromDateTimes(t,e.time)),t=null);return Xs.merge(r)}difference(...e){return Xs.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ks}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ks}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ks}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ks}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ks}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):qs.invalid(this.invalidReason)}mapEndpoints(e){return Xs.fromDateTimes(e(this.s),e(this.e))}}class Ys{static hasDST(e=Ba.defaultZone){const t=qi.local().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ta.isValidSpecifier(e)&&Ta.isValidZone(e)}static normalizeZone(e){return Pa(e,Ba.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return Xa.create(t,n,r).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return Xa.create(t,n,r).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null}={}){return Xa.create(t,n,null).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null}={}){return Xa.create(t,n,null).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Xa.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Xa.create(t,null,"gregory").eras(e)}static features(){let e=!1,t=!1,n=!1,r=!1;if(Or()){e=!0,t=Lr(),r=Mr();try{n="America/New_York"===new Intl.DateTimeFormat("en",{timeZone:"America/New_York"}).resolvedOptions().timeZone}catch(e){n=!1}}return{intl:e,intlTokens:t,zones:n,relative:r}}}function Qs(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(qs.fromMillis(r).as("days"))}function $s(e,t,n,r){let[a,s,i,o]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Qs(e,t);return(n-n%7)/7}],["days",Qs]],a={};let s,i;for(const[o,l]of r)if(n.indexOf(o)>=0){s=o;let n=l(e,t);i=e.plus({[o]:n}),i>t?(e=e.plus({[o]:n-1}),n-=1):e=i,a[o]=n}return[e,a,i,s]}(e,t,n);const l=t-a,c=n.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(i<t&&(i=a.plus({[o]:1})),i!==a&&(s[o]=(s[o]||0)+l/(i-a)));const u=qs.fromObject(Object.assign(s,r));return c.length>0?qs.fromMillis(l,r).shiftTo(...c).plus(u):u}const _s={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ei={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ti=_s.hanidec.replace(/[\[|\]]/g,"").split("");function ni({numberingSystem:e},t=""){return new RegExp(`${_s[e||"latn"]}${t}`)}function ri(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(_s.hanidec))t+=ti.indexOf(e[n]);else for(const e in ei){const[n,a]=ei[e];r>=n&&r<=a&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}function ai(e){return e.replace(/\./,"\\.?")}function si(e){return e.replace(/\./,"").toLowerCase()}function ii(e,t){return null===e?null:{regex:RegExp(e.map(ai).join("|")),deser:([n])=>e.findIndex((e=>si(n)===si(e)))+t}}function oi(e,t){return{regex:e,deser:([,e,t])=>Qr(e,t),groups:t}}function li(e){return{regex:e,deser:([e])=>e}}const ci={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let ui=null;function di(e,t){if(e.literal)return e;const n=ba.macroTokenToFormatOpts(e.val);if(!n)return e;const r=ba.create(t,n).formatDateTimeParts((ui||(ui=qi.fromMillis(1555555555555)),ui)).map((e=>function(e,t,n){const{type:r,value:a}=e;if("literal"===r)return{literal:!0,val:a};const s=n[r];let i=ci[r];return"object"==typeof i&&(i=i[s]),i?{literal:!1,val:i}:void 0}(e,0,n)));return r.includes(void 0)?e:r}function mi(e,t,n){const r=function(e,t){return Array.prototype.concat(...e.map((e=>di(e,t))))}(ba.parseFormat(n),e),a=r.map((t=>function(e,t){const n=ni(t),r=ni(t,"{2}"),a=ni(t,"{3}"),s=ni(t,"{4}"),i=ni(t,"{6}"),o=ni(t,"{1,2}"),l=ni(t,"{1,3}"),c=ni(t,"{1,6}"),u=ni(t,"{1,9}"),d=ni(t,"{2,4}"),m=ni(t,"{4,6}"),p=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},g=(g=>{if(e.literal)return p(g);switch(g.val){case"G":return ii(t.eras("short",!1),0);case"GG":return ii(t.eras("long",!1),0);case"y":return ri(c);case"yy":case"kk":return ri(d,Xr);case"yyyy":case"kkkk":return ri(s);case"yyyyy":return ri(m);case"yyyyyy":return ri(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ri(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ri(r);case"MMM":return ii(t.months("short",!0,!1),1);case"MMMM":return ii(t.months("long",!0,!1),1);case"LLL":return ii(t.months("short",!1,!1),1);case"LLLL":return ii(t.months("long",!1,!1),1);case"o":case"S":return ri(l);case"ooo":case"SSS":return ri(a);case"u":return li(u);case"a":return ii(t.meridiems(),0);case"E":case"c":return ri(n);case"EEE":return ii(t.weekdays("short",!1,!1),1);case"EEEE":return ii(t.weekdays("long",!1,!1),1);case"ccc":return ii(t.weekdays("short",!0,!1),1);case"cccc":return ii(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return oi(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return oi(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return li(/[a-z_+-/]{1,256}?/i);default:return p(g)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e))),s=a.find((e=>e.invalidReason));if(s)return{input:t,tokens:r,invalidReason:s.invalidReason};{const[e,n]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(a),s=RegExp(e,"i"),[i,o]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const a in n)if(jr(n,a)){const s=n[a],i=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(t,s,n),[l,c]=o?function(e){let t;return t=Dr(e.Z)?Dr(e.z)?null:Ta.create(e.z):new Da(e.Z),Dr(e.q)||(e.M=3*(e.q-1)+1),Dr(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Dr(e.u)||(e.S=Wr(e.u)),[Object.keys(e).reduce(((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t}),{}),t]}(o):[null,null];if(jr(o,"a")&&jr(o,"H"))throw new nr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:s,rawMatches:i,matches:o,result:l,zone:c}}}const pi=[0,31,59,90,120,151,181,212,243,273,304,334],gi=[0,31,60,91,121,152,182,213,244,274,305,335];function hi(e,t){return new Ca("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function fi(e,t,n){const r=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===r?7:r}function vi(e,t,n){return n+(Zr(e)?gi:pi)[t-1]}function yi(e,t){const n=Zr(e)?gi:pi,r=n.findIndex((e=>e<t));return{month:r+1,day:t-n[r]}}function bi(e){const{year:t,month:n,day:r}=e,a=vi(t,n,r),s=fi(t,n,r);let i,o=Math.floor((a-s+10)/7);return o<1?(i=t-1,o=Kr(i)):o>Kr(t)?(i=t+1,o=1):i=t,Object.assign({weekYear:i,weekNumber:o,weekday:s},ta(e))}function Ci(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=fi(t,1,4),s=Ur(t);let i,o=7*n+r-a-3;o<1?(i=t-1,o+=Ur(i)):o>s?(i=t+1,o-=Ur(t)):i=t;const{month:l,day:c}=yi(i,o);return Object.assign({year:i,month:l,day:c},ta(e))}function Ei(e){const{year:t,month:n,day:r}=e,a=vi(t,n,r);return Object.assign({year:t,ordinal:a},ta(e))}function wi(e){const{year:t,ordinal:n}=e,{month:r,day:a}=yi(t,n);return Object.assign({year:t,month:r,day:a},ta(e))}function Si(e){const t=Pr(e.year),n=Br(e.month,1,12),r=Br(e.day,1,qr(e.year,e.month));return t?n?!r&&hi("day",e.day):hi("month",e.month):hi("year",e.year)}function ki(e){const{hour:t,minute:n,second:r,millisecond:a}=e,s=Br(t,0,23)||24===t&&0===n&&0===r&&0===a,i=Br(n,0,59),o=Br(r,0,59),l=Br(a,0,999);return s?i?o?!l&&hi("millisecond",a):hi("second",r):hi("minute",n):hi("hour",t)}const Ni="Invalid DateTime",Ai=864e13;function Gi(e){return new Ca("unsupported zone",`the zone "${e.name}" is not supported`)}function Ti(e){return null===e.weekData&&(e.weekData=bi(e.c)),e.weekData}function Ii(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new qi(Object.assign({},n,t,{old:n}))}function Di(e,t,n){let r=e-60*t*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=60*(a-t)*1e3;const s=n.offset(r);return a===s?[r,a]:[e-60*Math.min(a,s)*1e3,Math.max(a,s)]}function xi(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Pi(e,t,n){return Di(Jr(e),t,n)}function Oi(e,t){const n=Object.keys(t.values);-1===n.indexOf("milliseconds")&&n.push("milliseconds"),t=t.shiftTo(...n);const r=e.o,a=e.c.year+t.years,s=e.c.month+t.months+3*t.quarters,i=Object.assign({},e.c,{year:a,month:s,day:Math.min(e.c.day,qr(a,s))+t.days+7*t.weeks}),o=qs.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Jr(i);let[c,u]=Di(l,r,e.zone);return 0!==o&&(c+=o,u=e.zone.offset(c)),{ts:c,o:u}}function Li(e,t,n,r,a){const{setZone:s,zone:i}=n;if(e&&0!==Object.keys(e).length){const r=t||i,a=qi.fromObject(Object.assign(e,n,{zone:r,setZone:void 0}));return s?a:a.setZone(i)}return qi.invalid(new Ca("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Mi(e,t,n=!0){return e.isValid?ba.create(Xa.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Fi(e,{suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r,includeZone:a=!1,spaceZone:s=!1,format:i="extended"}){let o="basic"===i?"HHmm":"HH:mm";return t&&0===e.second&&0===e.millisecond||(o+="basic"===i?"ss":":ss",n&&0===e.millisecond||(o+=".SSS")),(a||r)&&s&&(o+=" "),a?o+="z":r&&(o+="basic"===i?"ZZZ":"ZZ"),Mi(e,o)}const zi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ji={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Bi={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ri=["year","month","day","hour","minute","second","millisecond"],Vi=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Wi=["year","ordinal","hour","minute","second","millisecond"];function Hi(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new rr(e);return t}function Zi(e,t){for(const t of Ri)Dr(e[t])&&(e[t]=zi[t]);const n=Si(e)||ki(e);if(n)return qi.invalid(n);const r=Ba.now(),a=t.offset(r),[s,i]=Pi(e,a,t);return new qi({ts:s,zone:t,o:i})}function Ui(e,t,n){const r=!!Dr(n.round)||n.round,a=(e,a)=>{e=Hr(e,r||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,a)},s=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(s(n.unit),n.unit);for(const e of n.units){const t=s(e);if(Math.abs(t)>=1)return a(t,e)}return a(0,n.units[n.units.length-1])}class qi{constructor(e){const t=e.zone||Ba.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ca("invalid input"):null)||(t.isValid?null:Gi(t));this.ts=Dr(e.ts)?Ba.now():e.ts;let r=null,a=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,a]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=xi(this.ts,e),n=Number.isNaN(r.year)?new Ca("invalid input"):null,r=n?null:r,a=n?null:e}}this._zone=t,this.loc=e.loc||Xa.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=a,this.isLuxonDateTime=!0}static local(e,t,n,r,a,s,i){return Dr(e)?new qi({ts:Ba.now()}):Zi({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},Ba.defaultZone)}static utc(e,t,n,r,a,s,i){return Dr(e)?new qi({ts:Ba.now(),zone:Da.utcInstance}):Zi({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},Da.utcInstance)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return qi.invalid("invalid input");const a=Pa(t.zone,Ba.defaultZone);return a.isValid?new qi({ts:n,zone:a,loc:Xa.fromObject(t)}):qi.invalid(Gi(a))}static fromMillis(e,t={}){if(xr(e))return e<-Ai||e>Ai?qi.invalid("Timestamp out of range"):new qi({ts:e,zone:Pa(t.zone,Ba.defaultZone),loc:Xa.fromObject(t)});throw new ar(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(xr(e))return new qi({ts:1e3*e,zone:Pa(t.zone,Ba.defaultZone),loc:Xa.fromObject(t)});throw new ar("fromSeconds requires a numerical input")}static fromObject(e){const t=Pa(e.zone,Ba.defaultZone);if(!t.isValid)return qi.invalid(Gi(t));const n=Ba.now(),r=t.offset(n),a=_r(e,Hi,["zone","locale","outputCalendar","numberingSystem"]),s=!Dr(a.ordinal),i=!Dr(a.year),o=!Dr(a.month)||!Dr(a.day),l=i||o,c=a.weekYear||a.weekNumber,u=Xa.fromObject(e);if((l||s)&&c)throw new nr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new nr("Can't mix ordinal dates with month/day");const d=c||a.weekday&&!l;let m,p,g=xi(n,r);d?(m=Vi,p=ji,g=bi(g)):s?(m=Wi,p=Bi,g=Ei(g)):(m=Ri,p=zi);let h=!1;for(const e of m){Dr(a[e])?a[e]=h?p[e]:g[e]:h=!0}const f=d?function(e){const t=Pr(e.weekYear),n=Br(e.weekNumber,1,Kr(e.weekYear)),r=Br(e.weekday,1,7);return t?n?!r&&hi("weekday",e.weekday):hi("week",e.week):hi("weekYear",e.weekYear)}(a):s?function(e){const t=Pr(e.year),n=Br(e.ordinal,1,Ur(e.year));return t?!n&&hi("ordinal",e.ordinal):hi("year",e.year)}(a):Si(a),v=f||ki(a);if(v)return qi.invalid(v);const y=d?Ci(a):s?wi(a):a,[b,C]=Pi(y,r,t),E=new qi({ts:b,zone:t,o:C,loc:u});return a.weekday&&l&&e.weekday!==E.weekday?qi.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[n,r]=function(e){return $a(e,[ks,Ts],[Ns,Is],[As,Ds],[Gs,xs])}(e);return Li(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return $a(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[vs,ys])}(e);return Li(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return $a(e,[bs,ws],[Cs,ws],[Es,Ss])}(e);return Li(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(Dr(e)||Dr(t))throw new ar("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:a=null}=n,s=Xa.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),[i,o,l]=function(e,t,n){const{result:r,zone:a,invalidReason:s}=mi(e,t,n);return[r,a,s]}(s,e,t);return l?qi.invalid(l):Li(i,o,n,`format ${t}`,e)}static fromString(e,t,n={}){return qi.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return $a(e,[Ps,Ls],[Os,Ms])}(e);return Li(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new ar("need to specify a reason the DateTime is invalid");const n=e instanceof Ca?e:new Ca(e,t);if(Ba.throwOnInvalid)throw new _n(n);return new qi({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ti(this).weekYear:NaN}get weekNumber(){return this.isValid?Ti(this).weekNumber:NaN}get weekday(){return this.isValid?Ti(this).weekday:NaN}get ordinal(){return this.isValid?Ei(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ys.months("short",{locale:this.locale})[this.month-1]:null}get monthLong(){return this.isValid?Ys.months("long",{locale:this.locale})[this.month-1]:null}get weekdayShort(){return this.isValid?Ys.weekdays("short",{locale:this.locale})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ys.weekdays("long",{locale:this.locale})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.universal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Zr(this.year)}get daysInMonth(){return qr(this.year,this.month)}get daysInYear(){return this.isValid?Ur(this.year):NaN}get weeksInWeekYear(){return this.isValid?Kr(this.weekYear):NaN}resolvedLocaleOpts(e={}){const{locale:t,numberingSystem:n,calendar:r}=ba.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Da.instance(e),t)}toLocal(){return this.setZone(Ba.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=Pa(e,Ba.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=Pi(n,t,e)}return Ii(this,{ts:r,zone:e})}return qi.invalid(Gi(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return Ii(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_r(e,Hi,[]);let n;!Dr(t.weekYear)||!Dr(t.weekNumber)||!Dr(t.weekday)?n=Ci(Object.assign(bi(this.c),t)):Dr(t.ordinal)?(n=Object.assign(this.toObject(),t),Dr(t.day)&&(n.day=Math.min(qr(n.year,n.month),n.day))):n=wi(Object.assign(Ei(this.c),t));const[r,a]=Pi(n,this.o,this.zone);return Ii(this,{ts:r,o:a})}plus(e){if(!this.isValid)return this;return Ii(this,Oi(this,Js(e)))}minus(e){if(!this.isValid)return this;return Ii(this,Oi(this,Js(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=qs.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?ba.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Ni}toLocaleString(e=cr){return this.isValid?ba.create(this.loc.clone(e),e).formatDateTime(this):Ni}toLocaleParts(e={}){return this.isValid?ba.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO(e={}){return this.isValid?`${this.toISODate(e)}T${this.toISOTime(e)}`:null}toISODate({format:e="extended"}={}){let t="basic"===e?"yyyyMMdd":"yyyy-MM-dd";return this.year>9999&&(t="+"+t),Mi(this,t)}toISOWeekDate(){return Mi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,format:r="extended"}={}){return Fi(this,{suppressSeconds:t,suppressMilliseconds:e,includeOffset:n,format:r})}toRFC2822(){return Mi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return Mi(this,"yyyy-MM-dd")}toSQLTime({includeOffset:e=!0,includeZone:t=!1}={}){return Fi(this,{includeOffset:e,includeZone:t,spaceZone:!0})}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Ni}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return qs.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");const r=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),a=(o=t,Array.isArray(o)?o:[o]).map(qs.normalizeUnit),s=e.valueOf()>this.valueOf(),i=$s(s?this:e,s?e:this,a,r);var o;return s?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(qi.local(),e,t)}until(e){return this.isValid?Xs.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;if("millisecond"===t)return this.valueOf()===e.valueOf();{const n=e.valueOf();return this.startOf(t)<=n&&n<=this.endOf(t)}}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||qi.fromObject({zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;return Ui(t,this.plus(n),Object.assign(e,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}toRelativeCalendar(e={}){return this.isValid?Ui(e.base||qi.fromObject({zone:this.zone}),this,Object.assign(e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(qi.isDateTime))throw new ar("min requires all arguments be DateTimes");return Fr(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(qi.isDateTime))throw new ar("max requires all arguments be DateTimes");return Fr(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:a=null}=n;return mi(Xa.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return qi.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return cr}static get DATE_MED(){return ur}static get DATE_FULL(){return dr}static get DATE_HUGE(){return mr}static get TIME_SIMPLE(){return pr}static get TIME_WITH_SECONDS(){return gr}static get TIME_WITH_SHORT_OFFSET(){return hr}static get TIME_WITH_LONG_OFFSET(){return fr}static get TIME_24_SIMPLE(){return vr}static get TIME_24_WITH_SECONDS(){return yr}static get TIME_24_WITH_SHORT_OFFSET(){return br}static get TIME_24_WITH_LONG_OFFSET(){return Cr}static get DATETIME_SHORT(){return Er}static get DATETIME_SHORT_WITH_SECONDS(){return wr}static get DATETIME_MED(){return Sr}static get DATETIME_MED_WITH_SECONDS(){return kr}static get DATETIME_MED_WITH_WEEKDAY(){return Nr}static get DATETIME_FULL(){return Ar}static get DATETIME_FULL_WITH_SECONDS(){return Gr}static get DATETIME_HUGE(){return Tr}static get DATETIME_HUGE_WITH_SECONDS(){return Ir}}function Ji(e){if(qi.isDateTime(e))return e;if(e&&e.valueOf&&xr(e.valueOf()))return qi.fromJSDate(e);if(e&&"object"==typeof e)return qi.fromObject(e);throw new ar(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Ki=({dismissModal:e,serverGroup:t})=>{const{result:n,status:r,error:a}=B((()=>Xe.getScalingActivities(t)),[],[t.id]),s="PENDING"===r;return mt.createElement(mt.Fragment,null,mt.createElement(qe,null,`Scaling activities for ${t.name}`),mt.createElement(Je,null,mt.createElement("div",{className:"flex-1 heading-3"},s&&mt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},mt.createElement(W,null)),!s&&Boolean(a)&&mt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},mt.createElement("h4",null,`There was an error loading scaling activities for ${t.name}. Please try again later.`)),!s&&!a&&!Boolean(n.length)&&mt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},mt.createElement("h4",null,`No scaling activities found for ${t.name}.`)),!s&&!a&&Boolean(n.length)&&mt.createElement("div",{className:"middle sp-margin-xl-yaxis"},n.map(((e,t)=>{var n;return mt.createElement("div",{key:`${t}-${e.jobId}`,className:"sp-margin-xl-yaxis"},mt.createElement("p",{className:"clearfix"},mt.createElement("span",{className:`label label-${"KillInitiated"!==e.jobState?"success":"danger"} pull-left`},e.jobState),mt.createElement("span",{className:"label label-default pull-right"},(e=>{const t=new Date(e);return qi.fromJSDate(t).toFormat("yyyy-MM-dd HH:mm:ss ZZZZ")})(e.date))),mt.createElement("p",null,`${e.reasonMessage} Desired capacity is ${(null==(n=e.capacity)?void 0:n.desired)||"unknown"}.`))}))))),mt.createElement(Ke,{primaryActions:mt.createElement("button",{className:"btn btn-primary",onClick:e},"Close")}))};var Xi=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor;let Qi=class extends pt.Component{render(){const{serverGroup:e,app:t}=this.props,{capacity:n}=e,r=e.instances.length,a=n.min===n.max;return pt.createElement(pt.Fragment,null,pt.createElement("dl",{className:"dl-horizontal dl-narrow"},pt.createElement(Ye,{capacity:n,simpleMode:a}),pt.createElement(Qe,{currentCapacity:r}),e.capacityGroup&&pt.createElement(pt.Fragment,null,pt.createElement("dt",null,"Cap. Group"),pt.createElement("dd",null,e.capacityGroup))),pt.createElement("div",null,pt.createElement("a",{className:"clickable",onClick:()=>et(e,t).then((n=>{n&&Me.show(Qn,{serverGroup:e,application:t})}))},"Resize Server Group")),pt.createElement("div",null,pt.createElement("a",{className:"clickable",onClick:()=>$e(Ki,{serverGroup:e},{maxWidth:"1000px"})},"View Scaling Activities")))}};Qi=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?Yi(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&Xi(t,n,s),s})([_e("titus.serverGroup.CapacityDetailsSection")],Qi);const $i=({config:e,serverGroup:t,unit:n,updateUnit:r})=>{const[a,s]=mt.useState({alarmName:null,alarmArn:null,metricName:null,namespace:null,statistic:"Average",dimensions:[],period:60,threshold:e.targetValue,comparisonOperator:"GreaterThanThreshold",okactions:[],insufficientDataActions:[],alarmActions:[],evaluationPeriods:null,alarmDescription:null,unit:null});mt.useEffect((()=>{(()=>{const t=null==e?void 0:e.customizedMetricSpecification,n={...a,dimensions:null==t?void 0:t.dimensions,metricName:null==t?void 0:t.metricName,namespace:null==t?void 0:t.namespace,statistic:null==t?void 0:t.statistic,threshold:null==e?void 0:e.targetValue};s(n)})()}),[e]);return mt.createElement(p,{alarm:a,onChartLoaded:e=>{n&&r(e.unit)},serverGroup:t})},_i={buildAlarm:(e,t)=>{const n=null==e?void 0:e.alarms[0];return{comparisonOperator:n.comparisonOperator,region:t,dimensions:n.dimensions,disableEditingDimensions:n.disableEditingDimensions,evaluationPeriods:n.evaluationPeriods,metricName:n.metricName,namespace:n.namespace,period:n.period,statistic:n.statistic,threshold:n.threshold,unit:n.unit}},buildStepPolicy:(e,t,n)=>({cooldown:n||600,estimatedInstanceWarmup:null,metricAggregationType:"Average",stepAdjustments:e.stepAdjustments.map((e=>{const n={scalingAdjustment:Math.abs(e.scalingAdjustment)};return void 0!==e.metricIntervalUpperBound&&(n.metricIntervalUpperBound=e.metricIntervalUpperBound+t),void 0!==e.metricIntervalLowerBound&&(n.metricIntervalLowerBound=e.metricIntervalLowerBound+t),n}))}),buildNewCommand:(e,t,n)=>{const r={adjustmentType:"Step"===e?n.adjustmentType:null,cloudProvider:t.cloudProvider,credentials:t.account,jobId:t.id,name:n.id,region:t.region,scalingPolicyID:n.id,serverGroupName:t.name};return"Step"===e&&(r.alarm=_i.buildAlarm(n,t.region),r.minAdjustmentMagnitude=n.minAdjustmentMagnitude||1,r.step=_i.buildStepPolicy(n,r.alarm.threshold,n.cooldown)),"TargetTracking"===e&&(r.targetTrackingConfiguration={...n.targetTrackingConfiguration}),r},prepareCommandForUpsert:(e,t)=>{const n=Nt(e);return"PercentChangeInCapacity"!==n.adjustmentType&&delete n.minAdjustmentMagnitude,n.step?n.step.stepAdjustments.forEach((e=>{t&&(e.scalingAdjustment=0-e.scalingAdjustment,delete n.step.estimatedInstanceWarmup),void 0!==e.metricIntervalLowerBound&&(e.metricIntervalLowerBound-=n.alarm.threshold),void 0!==e.metricIntervalUpperBound&&(e.metricIntervalUpperBound-=n.alarm.threshold)})):t&&(e.simple.scalingAdjustment=0-e.simple.scalingAdjustment),n}},eo=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s;const[i,o]=mt.useState(Boolean(null==(s=r.targetTrackingConfiguration)?void 0:s.customizedMetricSpecification)),[l,c]=mt.useState({});mt.useEffect((()=>{const e=_i.buildNewCommand("TargetTracking",a,r);c(e)}),[]);const u=r.id?"Update":"Create";return mt.createElement(tt,{closeModal:t,dismissModal:n,title:`${u} scaling policy`,application:e,description:`${u} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>({application:e,job:[{type:"upsertScalingPolicy",...l}]}),render:()=>mt.createElement("div",{className:"modal-body"},mt.createElement("h4",{className:"section-heading"},"Target Metric"),mt.createElement(g,{allowDualMode:!1,cloudwatch:!0,command:l,isCustomMetric:i,app:e,serverGroup:a,toggleMetricType:e=>o("custom"===e),updateCommand:c}),mt.createElement("h4",{className:"section-heading"},"Additional Settings"),mt.createElement(h,{command:l,cooldowns:!0,policyName:r.policyName,updateCommand:c}))})},to=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s,i,o;const[l,c]=mt.useState({});mt.useEffect((()=>{const e=_i.buildNewCommand("Step",a,r);c(e)}),[]);const u=(null==(s=r.stepAdjustments)?void 0:s.length)?r.stepAdjustments[0].scalingAdjustment:r.scalingAdjustment,[d,m]=mt.useState("ExactCapacity"===l.adjustmentType?"Set to":u>0?"Add":"Remove"),p="ExactCapacity"===l.adjustmentType||"ChangeInCapacity"===l.adjustmentType?"instances":"percent of group",g=r.id?"Edit":"Create",h=0===(null==(o=null==(i=null==l?void 0:l.alarm)?void 0:i.comparisonOperator)?void 0:o.indexOf("Greater"))?"max":"min",b=e=>{const t=Nt(l);t.step.stepAdjustments=e,(e=>{const t="min"===h?"metricIntervalLowerBound":"metricIntervalUpperBound",n="metricIntervalLowerBound"===t?"metricIntervalUpperBound":"metricIntervalLowerBound",r=e.stepAdjustments;(r||[]).forEach(((e,a)=>{r.length>a+1&&(r[a+1][n]=e[t])})),delete r[r.length-1][t]})(t.step),c(t)},C=(e,t)=>{m(e);const n="instances"!==t?"PercentChangeInCapacity":"Set to"===e?"ExactCapacity":"ChangeInCapacity";c({...l,adjustmentType:n})};return mt.createElement(tt,{closeModal:t,dismissModal:n,title:`${g} scaling policy`,application:e,description:`${g} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>{const t=_i.prepareCommandForUpsert(l,"Remove"===d);return{application:e,job:[{type:t.type||"upsertScalingPolicy",...t}]}},render:()=>{var e,t,n;return mt.createElement("div",null,mt.createElement("h4",{className:"section-heading"},"Conditions"),mt.createElement("div",{className:"section-body"},mt.createElement("p",null,mt.createElement("b",null,"Note:"),' metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not see a metric below, click "Configure available metrics" in the server group details to set up forwarding from Atlas to CloudWatch.'),mt.createElement(f,{alarm:l.alarm,multipleAlarms:Boolean((null==(e=null==r?void 0:r.alarms)?void 0:e.length)>1),serverGroup:a,stepAdjustments:l.step.stepAdjustments,stepsChanged:b,updateAlarm:e=>c({...l,alarm:e})})),mt.createElement("h4",{className:"section-heading"},"Actions"),mt.createElement("div",{className:"section-body"},!(null==(t=l.alarm)?void 0:t.metricName)&&mt.createElement("h4",{className:"text-center"},"Select a metric"),(null==(n=l.alarm)?void 0:n.metricName)&&mt.createElement(v,{adjustmentType:p,adjustmentTypeChanged:C,alarm:l.alarm,isMin:"min"===h,operator:d,step:l.step,stepsChanged:b})),mt.createElement(y,{command:l,isInstanceType:"instances"===p,isNew:Boolean(!r.policyARN),operator:d,updateCommand:c}))}})},no="titus.servergroup.details.capacitydetailssection";t(no,[]).component("titusCapacityDetailsSection",jt(nt(Qi,"titusCapacityDetailsSection"),["serverGroup","app"]));var ro=Object.defineProperty,ao=Object.getOwnPropertyDescriptor;let so=class extends pt.Component{render(){if(!this.props.serverGroup||!this.props.serverGroup.image)return null;const{serverGroup:{image:e,entryPoint:t,iamProfile:n,resources:r}}=this.props;return pt.createElement(S,{className:"horizontal-when-filters-collapsed"},e.dockerImageName&&pt.createElement(k,{label:"Image Name",value:e.dockerImageName}),e.dockerImageVersion&&pt.createElement(k,{label:"Image Version",value:e.dockerImageVersion}),t&&pt.createElement(k,{label:"Entrypoint",value:t}),n&&pt.createElement(k,{label:"IAM Profile",value:n}),pt.createElement(k,{label:"CPU(s)",value:r.cpu}),pt.createElement(k,{label:"Memory",value:`${r.memory} MB`}),pt.createElement(k,{label:"Disk",value:`${r.disk} MB`}),pt.createElement(k,{label:"Network",value:`${r.networkMbps} Mbps`}),pt.createElement(k,{label:"GPU(s)",value:r.gpu}))}};so=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?ao(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&ro(t,n,s),s})([_e("titus.serverGroup.launchConfigSection")],so);const io="titus.servergroup.details.launchConfigSection";t(io,[]).component("titusLaunchConfigSection",jt(nt(so,"titusLaunchConfigSection"),["serverGroup"]));class oo extends pt.Component{static show(e){return Me.show(oo,e)}submit(e,t){const{application:n,serverGroup:r}=this.props,a={type:"upsertDisruptionBudget",cloudProvider:"titus",credentials:r.account,region:r.region,jobId:r.id,disruptionBudget:e.disruptionBudget};t.submit((()=>rt.executeTask({job:[a],application:n,description:`Update Disruption Budget for ${r.name}`})))}render(){const{application:e,command:t,dismissModal:n}=this.props,r=new Le({application:e,title:"Updating Job Disruption Budget",modalInstance:Le.modalInstanceEmulation((()=>n())),onTaskComplete:()=>e.serverGroups.refresh()});return pt.createElement(pt.Fragment,null,pt.createElement(Ve,{monitor:r}),pt.createElement(Ge,{initialValues:t,onSubmit:e=>this.submit(e,r),render:t=>pt.createElement(pt.Fragment,null,pt.createElement(We,{dismiss:n}),pt.createElement(zt.Header,null,pt.createElement(zt.Title,null,"Update Disruption Budget")),pt.createElement(zt.Body,null,pt.createElement(Ln,{formik:t,app:e})),pt.createElement(zt.Footer,null,pt.createElement("button",{className:"btn btn-default",onClick:n,type:"button"},"Cancel"),pt.createElement(at,{onClick:()=>this.submit(t.values,r),isDisabled:!t.isValid,isFormSubmit:!0,submitting:!1,label:"Update Budget"})))}))}}class lo extends pt.Component{constructor(){super(...arguments),this.SectionHeading=({budget:e,options:t,label:n})=>{const r=t.find((t=>!!e[t.field]));return r?pt.createElement("div",null,pt.createElement("div",{className:"bold"},n),r.label," ",pt.createElement(ae,{content:r.description})):null},this.Policy=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.availabilityPercentageLimit?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Percentage of Healthy Containers"),e.availabilityPercentageLimit.percentageOfHealthyContainers," percent"):e.relocationLimit?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Limit"),e.relocationLimit.limit," task",1!==e.relocationLimit.limit&&"s"):e.unhealthyTasksLimit?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Limit of Unhealthy Containers"),e.unhealthyTasksLimit.limitOfUnhealthyContainers," container",1!==e.unhealthyTasksLimit.limitOfUnhealthyContainers&&"s"):e.selfManaged?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Relocation Time"),e.selfManaged.relocationTimeMs>0&&pt.createElement(t,{durationMs:e.selfManaged.relocationTimeMs}),0===e.selfManaged.relocationTimeMs&&"0 ms (immediate)"):null},this.ParentheticalDuration=({durationMs:e})=>pt.createElement("span",null,e," ms",e>1e3&&` (${Bt(e)})`),this.Rate=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.ratePerInterval?pt.createElement(pt.Fragment,null,pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Interval"),pt.createElement(t,{durationMs:e.ratePerInterval.intervalMs})),pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Limit"),e.ratePerInterval.limitPerInterval," task",1!==e.ratePerInterval.limitPerInterval&&"s")):e.ratePercentagePerInterval?pt.createElement(pt.Fragment,null,pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Interval"),pt.createElement(t,{durationMs:e.ratePercentagePerInterval.intervalMs})),pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Percentage per Interval"),e.ratePercentagePerInterval.percentageLimitPerInterval," percent")):null},this.groupedDays=e=>{const t=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=e.sort(((e,n)=>t.indexOf(e)-t.indexOf(n))),r=[],a=[];return t.slice(t.indexOf(n[0])).forEach((e=>{n.includes(e)?a.push(e):a.length&&(r.push(this.toDayRangeString(a)),a.length=0)})),a.length&&r.push(this.toDayRangeString(a)),r.join(", ")},this.TimeWindows=({budget:e})=>{const{groupedDays:t}=this,n=e.timeWindows&&e.timeWindows.length>0;return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:"bold"},"When can disruption occur?"),pt.createElement("div",null,n&&e.timeWindows.map(((e,n)=>e.hourlyTimeWindows.map(((r,a)=>pt.createElement("div",{key:`${n}.${a}`},t(e.days),", ",r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))))),!n&&"Any time"))},this.editBudget=()=>{const{app:e,serverGroup:t}=this.props;Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(e,t).then((n=>{oo.show({command:n,application:e,serverGroup:t})}))}}toDayRangeString(e){return e.length?1===e.length?e[0].substr(0,3):`${e[0].substr(0,3)}-${e[e.length-1].substr(0,3)}`:null}render(){const{Policy:e,SectionHeading:t,Rate:n,TimeWindows:r}=this,a=this.props.serverGroup,s=!a.migrationPolicy||"SystemDefault"===a.migrationPolicy.type,i=An(this.props.app),o=a.disruptionBudget||i,l=!s&&Gt(o,i);return pt.createElement(pt.Fragment,null,pt.createElement(On,null),l&&pt.createElement("div",null,"(default policy)"),pt.createElement("div",{className:"bottom-border"},pt.createElement(t,{budget:o,options:In,label:"Policy"}),pt.createElement(e,{budget:o})),pt.createElement("div",{className:"bottom-border"},pt.createElement(t,{budget:o,options:Dn,label:"Rate"}),pt.createElement(n,{budget:o})),pt.createElement(r,{budget:o}),pt.createElement("div",{className:"sp-margin-l-top"},pt.createElement("a",{className:"clickable",onClick:this.editBudget},"Edit Disruption Budget")))}}const co="spinnaker.titus.disruptionbudget.section";t(co,[]).component("titusDisruptionBudgetSection",jt(nt(lo,"titusDisruptionBudgetSection"),["serverGroup","app"]));const uo="spinnaker.titus.serverGroup.details.rollback.controller";t(uo,[st]).controller("titusRollbackServerGroupCtrl",["$scope","$uibModalInstance","serverGroupWriter","application","serverGroup","previousServerGroup","disabledServerGroups","allServerGroups",function(e,t,n,r,a,s,i,o){e.serverGroup=a,e.disabledServerGroups=i.sort(((e,t)=>t.name.localeCompare(e.name))),e.allServerGroups=o.sort(((e,t)=>t.name.localeCompare(e.name))),e.verification={};const l=a.capacity.desired;let c,u="EXPLICIT";if(0===o.length&&a.entityTags){const t=yt(a,"entityTags.creationMetadata.value.previousServerGroup");t&&(u="PREVIOUS_IMAGE",e.previousServerGroup={name:t.name,imageName:t.imageName},t.imageId&&t.imageId!==t.imageName&&(e.previousServerGroup.imageId=t.imageId))}c=l<10?100:l<20?90:95,e.command={rollbackType:u,rollbackContext:{imageId:s?s.imageId:void 0,rollbackServerGroupName:a.name,restoreServerGroupName:s?s.name:void 0,targetHealthyRollbackPercentage:c,delayBeforeDisableSeconds:0},targetGroups:a.targetGroups,securityGroups:a.securityGroups},e.minHealthy=function(e){return Math.ceil(l*e/100)},r&&r.attributes&&(r.attributes.platformHealthOnlyShowOverride&&r.attributes.platformHealthOnly&&(e.command.interestingHealthProviderNames=["Titus"]),e.command.platformHealthOnlyShowOverride=r.attributes.platformHealthOnlyShowOverride),this.isValid=function(){const t=e.command;return!!e.verification.verified&&("PREVIOUS_IMAGE"===u||void 0!==t.rollbackContext.restoreServerGroupName)},e.taskMonitor=new Le({application:r,title:"Rollback "+a.name,modalInstance:t}),this.rollback=function(){if(!this.isValid())return;e.taskMonitor.submit((function(){return n.rollbackServerGroup(a,r,e.command)}))},this.cancel=function(){t.dismiss()},this.label=function(e){if(!e)return"";if(!e.buildInfo||!e.buildInfo.images)return e.name;let t=e.buildInfo.images[0];return t.indexOf("/")>0&&(t=t.substring(t.indexOf("/")+1)),e.name+" ("+t+")"},this.group=function(e){return e.isDisabled?"Disabled Server Groups":"Enabled Server Groups"}}]);class mo extends pt.Component{constructor(e){super(e),this.handleClick=()=>{this.setState({showSelection:!0})},this.typeSelected=e=>{this.setState({typeSelection:e,showSelection:!1,showModal:!0}),"step"===e&&this.createStepPolicy(),"targetTracking"===e&&this.createTargetTrackingPolicy()},this.showModalCallback=()=>{this.setState({showSelection:!1,showModal:!1,typeSelection:null})},this.state={showSelection:!1,showModal:!1,typeSelection:null,awsAccount:null},T.getAccountDetails(e.serverGroup.account).then((e=>{this.setState({awsAccount:e.awsAccount})}))}createStepPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewStepScalingPolicyTemplate(e),serverGroup:e};Me.show(to,n,{dialogClassName:"wizard-modal modal-lg"})}createTargetTrackingPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewTargetTrackingPolicyTemplate(e),serverGroup:e};Me.show(eo,n,{dialogClassName:"wizard-modal modal-lg"})}render(){const{min:e,max:t}=this.props.serverGroup.capacity;return pt.createElement("div",null,this.state.awsAccount?pt.createElement("a",{className:"clickable",onClick:this.handleClick},"Create new scaling policy"):null,this.state.showSelection&&pt.createElement(b,{warnOnMinMaxCapacity:e===t,typeSelectedCallback:this.typeSelected,showCallback:this.showModalCallback}))}}const po="spinnaker.titus.serverGroup.details.scaling.policy.button";t(po,[]).component("titusCreateScalingPolicyButton",jt(nt(mo,"titusCreateScalingPolicyButton"),["application","serverGroup"]));const go=O((()=>null),"titus.serverGroup.details.customScaling"),ho="spinnaker.application.titus.serverGroup.customScaling.component";t(ho,[]).component("titusCustomScalingPolicy",jt(nt(go,"titusCustomScalingPolicy"),["application","serverGroup"]));const fo="spinnaker.titus.scalingPolicy.module";t(fo,[po,ho]);const vo=e=>{const{application:t,serverGroup:n}=e,{region:r,id:a,account:s,cloudProvider:i}=n,o=(l=n.serviceJobProcesses,Object.keys(l).reduce(((e,t)=>(l[t]&&e.push(t),e)),[]));var l;return pt.createElement(tt,{...e,title:`Modify Service Job Processes for ${n.name}`,description:`Update Service Job Processes for ${n.name}`,initialValues:{serviceJobProcesses:o},render:()=>pt.createElement(pt.Fragment,null,pt.createElement(de,{label:"Service Job Processes",name:"serviceJobProcesses",input:e=>pt.createElement(be,{...e,options:Object.keys(n.serviceJobProcesses).map((e=>({value:e,label:ye(e)})))})}),pt.createElement(de,{label:"Reason",name:"reason",input:e=>pt.createElement(it,{...e,rows:3,placeholder:"(Optional) anything that might be helpful to explain the reason for this change; HTML is okay"})})),mapValuesToTask:({serviceJobProcesses:e,reason:o})=>({job:[{type:"updateJobProcesses",serviceJobProcesses:Object.keys(n.serviceJobProcesses).reduce(((t,n)=>(t[n]=!!e.includes(n),t)),{}),reason:o,region:r,jobId:a,credentials:s,cloudProvider:i}],application:t.name})})};class yo extends pt.Component{constructor(){super(...arguments),this.toggleServiceJobProcesses=()=>{const{app:e,serverGroup:t}=this.props;Me.show(vo,{application:e,serverGroup:t})}}render(){const{serviceJobProcesses:e}=this.props.serverGroup;return pt.createElement(pt.Fragment,null,pt.createElement("ul",{className:"scaling-processes"},Object.keys(e).map((t=>pt.createElement("li",{key:t},pt.createElement("span",{style:{visibility:e[t]?"visible":"hidden"},className:"fa fa-check small"}),pt.createElement("span",{className:e[t]?"":"text-disabled"},ye(t)," "))))),pt.createElement("a",{className:"clickable",onClick:this.toggleServiceJobProcesses},"Edit Service Job Processes"))}}const bo="spinnaker.titus.servicejobprocesses.section";t(bo,[]).component("titusServiceJobProcessesSection",jt(nt(yo,"titusServiceJobProcessesSection"),["serverGroup","app"]));const Co="spinnaker.titus.serverGroup.details.packageDetails.component";t(Co,[]).component("titusPackageDetailsSection",jt(nt((({buildInfo:e})=>{var t,n;const r=e.jenkins||{},a=Boolean(Object.keys(r).length),{commitId:s,host:i,name:o,number:l,version:c}=r,u=`${i}job/${o}/${l}`;return mt.createElement(w,{heading:"Package"},!a&&mt.createElement("div",null,"No package information available."),a&&mt.createElement(S,{className:"horizontal-when-filters-collapsed"},o&&mt.createElement(k,{label:"Job",value:o}),(null==(t=e.docker)?void 0:t.image)&&mt.createElement(k,{label:"Image Name",value:null==(n=e.docker)?void 0:n.image}),l&&mt.createElement(k,{label:"Build",value:l}),s&&mt.createElement(k,{label:"Commit",value:s.substring(0,8)}),c&&mt.createElement(k,{label:"Version",value:c}),i&&mt.createElement(k,{label:"Build Link",value:mt.createElement("a",{target:"_blank",href:u},u)})))}),"titusPackageDetailsSection"),["buildInfo"]));const Eo="spinnaker.titus.serverGroup.details.securityGroups.component";t(Eo,[]).component("titusSecurityGroups",jt(nt(Ut,"titusSecurityGroups"),["app","serverGroup"]));const wo="spinnaker.serverGroup.details.titus.controller";e.module(wo,[It,Rn,co,st,uo,bo,fo,Eo,Co]).controller("titusServerGroupDetailsCtrl",["$scope","$state","$templateCache","$interpolate","app","serverGroup","titusServerGroupCommandBuilder","$uibModal","serverGroupWriter","awsServerGroupTransformer",function(t,n,r,a,s,i,o,l,c,u){const d=s;function m(){const n=ft.find(d.serverGroups.data,(function(e){return e.name===i.name&&e.account===i.accountId&&e.region===i.region}));return Xe.getServerGroup(d.name,i.accountId,i.region,i.name).then((function(r){t.state.loading=!1,r.account=i.accountId,T.getAccountDetails(r.account).then((e=>{r.apiEndpoint=ft.filter(e.regions,{name:r.region})[0].endpoint})),t.buildInfo=r.buildInfo,e.extend(r,n),t.serverGroup=r;const a=t.serverGroup.labels;var s;delete a.name,delete a.source,delete a.spinnakerAccount,delete a[""],Object.keys(a).forEach((e=>{e.startsWith("titus.")&&delete a[e]})),t.labels=a,(s=r).scalingPolicies=(s.scalingPolicies||[]).map((e=>{const{policy:t}=e,{stepPolicyDescriptor:n,targetPolicyDescriptor:r}=t,a=n?"StepScaling":"TargetTrackingScaling";if(n){const t=n.alarmConfig;t.period=t.periodSec,t.namespace=t.metricNamespace,t.disableEditingDimensions=!0,"NFLX/EPIC"!==t.metricNamespace||t.dimensions||(t.dimensions=[{name:"AutoScalingGroupName",value:s.name}]),t.dimensions||(t.dimensions=[]);const r=ft.cloneDeep(n.scalingPolicy);return r.cooldown=r.cooldownSec,r.policyType=a,r.alarms=[t],r.id=e.id,r.stepAdjustments&&r.stepAdjustments.forEach((e=>{e.metricIntervalUpperBound=ft.get(e,"metricIntervalUpperBound",e.MetricIntervalUpperBound),e.metricIntervalLowerBound=ft.get(e,"metricIntervalLowerBound",e.MetricIntervalLowerBound)})),r}{const{customizedMetricSpecification:n}=r;return void 0===n.dimensions&&(n.dimensions=[]),t.id=e.id,t.targetTrackingConfiguration=t.targetPolicyDescriptor,t.targetTrackingConfiguration.scaleOutCooldown=t.targetTrackingConfiguration.scaleOutCooldownSec,t.targetTrackingConfiguration.scaleInCooldown=t.targetTrackingConfiguration.scaleInCooldownSec,t}})).map((e=>u.transformScalingPolicy(e))),ft.isEmpty(t.serverGroup)?p():g()}),p)}function p(){t.$$destroyed||n.go("^",{allowModalToStayOpen:!0},{location:"replace"})}this.application=s,t.gateUrl=R.gateUrl,t.state={loading:!0},m().then((()=>{t.$$destroyed||s.serverGroups.onRefresh(t,m)})).catch((()=>{})),T.getAccountDetails(i.accountId).then((e=>{const n=e.awsAccount;t.titusUiEndpoint=ft.filter(e.regions,{name:i.region})[0].endpoint,T.getAccountDetails(n).then((e=>{this.awsAccountId=e.accountId,this.env=e.environment}))}));const g=()=>{this.entityTagTargets=lt.buildClusterTargets(t.serverGroup)};this.destroyServerGroup=function(){const e=t.serverGroup,r={application:d,title:"Destroying "+e.name,onTaskComplete:function(){n.includes("**.serverGroup",a)&&n.go("^")}},a={name:e.name,accountId:e.account,region:e.region},i={header:"Really destroy "+e.name+"?",buttonText:"Destroy "+e.name,account:e.account,taskMonitorConfig:r,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.destroyServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region})}};ot.addDestroyWarningMessage(s,e,i),et(e,s).then((e=>e&&x.confirm(i)))},this.disableServerGroup=function(){const e=t.serverGroup,n={application:d,title:"Disabling "+e.name},r={header:"Really disable "+e.name+"?",buttonText:"Disable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.disableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};ot.addDisableWarningMessage(s,e,r),et(e,s).then((e=>e&&x.confirm(r)))},this.enableServerGroup=()=>{et(i,s).then((e=>{if(!e)return;if(!this.isRollbackEnabled())return void this.showEnableServerGroupModal();const t={header:"Rolling back?",body:"Spinnaker provides an orchestrated rollback feature to carefully restore a different version of this\n server group. Do you want to use the orchestrated rollback?",buttonText:"Yes, take me to the rollback settings modal",cancelButtonText:"No, I just want to enable the server group"};x.confirm(t).then((()=>new Promise((e=>setTimeout(e,500))))).then((()=>this.rollbackServerGroup())).catch((({source:e})=>{"footer"===e&&this.showEnableServerGroupModal()}))}))},this.resizeServerGroup=()=>{et(i,s).then((e=>{e&&Me.show(Qn,{serverGroup:t.serverGroup,application:d})}))},this.showEnableServerGroupModal=()=>{const e=t.serverGroup,n={application:d,title:"Enabling "+e.name},r={header:"Really enable "+e.name+"?",buttonText:"Enable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.enableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};x.confirm(r)},this.cloneServerGroup=function(){Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(d,t.serverGroup).then((e=>{const t=`Clone ${i.name}`;Hn.show({title:t,application:d,command:e})}))},this.isRollbackEnabled=function(){const e=t.serverGroup;return!e.isDisabled||d.getDataSource("serverGroups").data.some((t=>t.cluster===e.cluster&&t.region===e.region&&t.account===e.account&&!1===t.isDisabled))},this.rollbackServerGroup=function(){let e,n=t.serverGroup,r=s.getDataSource("serverGroups").data.filter((e=>e.cluster===n.cluster&&e.region===n.region&&e.account===n.account));n.isDisabled&&(e=n,n=ft.orderBy(r.filter((t=>t.name!==e.name&&!t.isDisabled)),["instanceCounts.total","createdTime"],["desc","desc"])[0]),r=r.filter((e=>e.name!==n.name)),1!==r.length||e||(e=r[0]),et(n,s).then((t=>{t&&l.open({templateUrl:"titus/src/serverGroup/details/rollback/rollbackServerGroup.html",controller:"titusRollbackServerGroupCtrl as ctrl",resolve:{serverGroup:()=>n,previousServerGroup:()=>e,disabledServerGroups:()=>{const e=ft.find(d.clusters,{name:n.cluster,account:n.account});return ft.filter(e.serverGroups,{isDisabled:!0,region:n.region})},allServerGroups:()=>r,application:()=>d}})}))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/rollback/rollbackServerGroup.html",'<div modal-page class="confirmation-modal">\n <task-monitor monitor="taskMonitor"></task-monitor>\n <form role="form">\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">Rollback {{serverGroup.name}}</h4>\n </div>\n <div class="modal-body confirmation-modal">\n <div class="row">\n <div class="col-sm-3 sm-label-right">Restore to</div>\n <div class="col-sm-7">\n <ui-select\n ng-model="command.rollbackContext.restoreServerGroupName"\n class="form-control input-sm"\n ng-if="command.rollbackType === \'EXPLICIT\'"\n >\n <ui-select-match placeholder="Select...">{{ctrl.label($select.selected)}}</ui-select-match>\n <ui-select-choices group-by="ctrl.group" repeat="serverGroup.name as serverGroup in allServerGroups">\n <span ng-bind-html="ctrl.label(serverGroup)"></span>\n </ui-select-choices>\n </ui-select>\n <div ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'" style="margin-top: 5px">\n {{ previousServerGroup.name }} <span class="small">(no longer deployed)</span><br />\n <span class="small">\n <strong>Image</strong>: {{ previousServerGroup.imageName}}\n <span ng-if="previousServerGroup.imageId">({{ previousServerGroup.imageId }})</span><br />\n </span>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="command.platformHealthOnlyShowOverride">\n <div class="col-sm-10 col-sm-offset-1">\n <platform-health-override\n command="command"\n platform-health-type="\'Titus\'"\n show-help-details="true"\n field-columns="12"\n >\n </platform-health-override>\n </div>\n </div>\n\n <task-reason command="command"></task-reason>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Wait\n <input\n placeholder="0"\n min="0"\n type="number"\n ng-model="command.rollbackContext.delayBeforeDisableSeconds"\n class="form-control input-sm inline-number"\n />\n seconds before disabling <em>{{ ctrl.label(serverGroup) }}</em>.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Consider rollback successful when\n <input\n type="number"\n min="0"\n max="100"\n ng-model="command.rollbackContext.targetHealthyRollbackPercentage"\n class="form-control input-sm inline-number"\n />\n percent of instances are healthy.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-4 sm-label-right">Rollback Operations</div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'EXPLICIT\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>Enable <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em></li>\n <li>\n Resize <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> to [\n <strong>min</strong>: {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max\n }}, <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during rollback)\n </li>\n\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable {{ serverGroup.name }}</li>\n <li>\n Restore minimum capacity of\n <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> [\n <strong>min</strong>: {{ serverGroup.capacity.min }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>\n Deploy <em>{{ previousServerGroup.imageId }}</em> [ <strong>min</strong>:\n {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max }},\n <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during deploy)\n </li>\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable <em>{{ serverGroup.name }}</em></li>\n <li>\n Restore minimum capacity of <em>new server group</em> [ <strong>min</strong>: {{ serverGroup.capacity.min\n }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n </div>\n <aws-footer\n action="ctrl.rollback()"\n cancel="ctrl.cancel()"\n is-valid="ctrl.isValid()"\n account="serverGroup.account"\n verification="verification"\n ></aws-footer>\n </form>\n</div>\n')}]);const So="spinnaker.titus.serverGroup.transformer";t(So,[]).factory("titusServerGroupTransformer",["$q",function(e){return{convertServerGroupCommandToDeployConfiguration:function(e){const t=ft.defaults({backingData:[],viewState:[]},e);return"clone"!==e.viewState.mode&&delete t.source,t.account=t.credentials,t.efs.mountPoint&&t.efs.efsId&&t.efs.mountPerm||delete t.efs,delete t.viewState,delete t.backingData,delete t.selectedProvider,t},normalizeServerGroup:function(e){return T.getCredentialsKeyedByAccount("titus").then((t=>(e.account&&t[e.account]&&(e.awsAccount=t[e.account].awsAccount),e)))},constructNewStepScalingPolicyTemplate:function(e){return{alarms:[{namespace:"NFLX/EPIC",metricName:"",threshold:50,statistic:"Average",comparisonOperator:"GreaterThanThreshold",evaluationPeriods:1,disableEditingDimensions:!0,dimensions:[{name:"AutoScalingGroupName",value:e.name}],period:60}],adjustmentType:"ChangeInCapacity",stepAdjustments:[{scalingAdjustment:1,metricIntervalLowerBound:0}],cooldown:300}},constructNewTargetTrackingPolicyTemplate:function(e){return{alarms:[],targetTrackingConfiguration:{targetValue:null,disableScaleIn:!1,customizedMetricSpecification:{namespace:"NFLX/EPIC",metricName:"",dimensions:[{name:"AutoScalingGroupName",value:e.name}]},scaleInCooldown:300,scaleOutCooldown:300}}}}}]);ct.registerValidator("titus",new class{validateSpecialCharacters(e,t){/^[a-zA-Z_0-9.]*$/g.test(e)||t.push("Only dot(.) and underscore(_) special characters are allowed.")}validateLength(e,t,n){if(e.length>250)n.push("The maximum length for an application in Titus is 250 characters.");else if(e.length>240)if(e.length>=248)t.push(`You will not be able to include a stack or detail field for clusters or ${D.get("firewalls")}.`);else{const n=248-e.length;t.push(`If you plan to include a stack or detail field for clusters, you will only\n have ~${n} characters to do so.`)}}validate(e=""){const t=[],n=[];return e&&e.length&&(this.validateSpecialCharacters(e,n),this.validateLength(e,t,n)),{warnings:t,errors:n}}});vn('.cloud-provider-logo .icon-titus {\n -webkit-mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n}\n');const ko="spinnaker.titus";t(ko,[jn,Bn,wo,Rn,Vn,So,ln,on,an,rn,cn,nn,sn,zn,Fn,no,io]).config((()=>{ut.registerProvider("titus",{name:"Titus",logo:{path:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABGCAYAAAB7Xo6TAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAABCVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25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FPI0FokkwtzqtNEZC7Q69Cc7U9FnGIi+vTLH5GC3F5iUkSTbT3pt9hOjPNVVTSPdjP1zMpoNVM17bUI+uXdDha1KkMfGS19tO3hvexh039iAG69zjnn3++2GQrq8zPz08HxEMwU/VnnwG4EyCASMAfrg3bbASEEc9x9xZi6A9BsJx6jfs8ufbaGCVaNxGFfgeVS6/m4F7ntDJAE9MTFUVZ1fZyh7/kGezXr9+2Di8eYScFcpJk5T3AcIQ19YA254gDevunwy5dyDlt73nXeFnyqokjhcP5I+HkCXDYDAAtYhjC1h8u7ogCQEdCJGGMAmEaASCSMAgiTJ4+7o3nuHsL4TjCgEjc5BAIx0Ulcq9Xbad7cXrc5fvO2GkJh+aCB3L2sr0rVtnTug9NAw5RLRCyPLVtkha9/B4X7m9z9gj/QXtDQSVvoOLdc3kWeSW1yWmTzqavwcnNraHaqeoQQBhbOO7qCPYJbJkiDAhiMITiF/cH+E48kpikY4UVCPjaIBA3dU57jxhkWkRs6UX9SbRt9ywMKu0okW8Q+dZ2dO1gnqNOcXKJWpr7t3v+38Gs9AgpWxz9DDp+NQ//ryOkTXttBm0VcMXNPfDqGRR8lMQmcHdnE8A9rs9hEOQ6kGzN5pm5JNTLJa2gILm1k9lckrxPXU7uhxhcAJf22sTltZf4I2LQnsWJTuDGr3HPH+lLN9Gkpag2O64P4oS8gze1udD146D2wP8H5JyTFz+hnOcAAAAASUVORK5CYII="},serverGroup:{transformer:"titusServerGroupTransformer",detailsTemplateUrl:"titus/src/serverGroup/details/serverGroupDetails.html",detailsController:"titusServerGroupDetailsCtrl",CloneServerGroupModal:Hn,commandBuilder:"titusServerGroupCommandBuilder",configurationService:"titusServerGroupConfigurationService",skipUpstreamStageCheck:!0,checkForImageProviders:!0,TargetTrackingChart:$i,UpsertStepPolicyModal:to,UpsertTargetTrackingModal:eo},securityGroup:{reader:"titusSecurityGroupReader",useProvider:"aws"},loadBalancer:{LoadBalancersTag:C,incompatibleLoadBalancerTypes:[{type:"classic",reason:"Classic Load Balancers cannot be used with Titus as they do not have IP based target groups."}],useProvider:"aws"},instance:{details:en}})})),dt.registerProvider("titus",["custom","redblack","monitored"]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/serverGroupDetails.html",'<div class="details-panel" ng-class="{ disabled: serverGroup.isDisabled }">\n <div class="header" ng-if="state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n\n <div class="header" ng-if="!state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <div class="header-text horizontal middle">\n <cloud-provider-logo provider="serverGroup.type" height="\'36px\'" width="\'36px\'"></cloud-provider-logo>\n <h3 class="horizontal middle space-between flex-1" select-on-dbl-click>\n {{serverGroup.name}}\n <render-if-feature feature="entityTags">\n <entity-notifications\n entity="serverGroup"\n application="ctrl.application"\n placement="bottom"\n h-offset-percent="90%"\n entity-type="serverGroup"\n page-location="details"\n on-update="ctrl.application.serverGroups.refresh()"\n ></entity-notifications>\n </render-if-feature>\n </h3>\n </div>\n <div>\n <div class="actions" ng-class="{ insights: serverGroup.insightActions.length > 0 }">\n <div class="dropdown" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle>\n Server Group Actions <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li><a href ng-if="ctrl.isRollbackEnabled()" ng-click="ctrl.rollbackServerGroup()">Rollback</a></li>\n <li role="presentation" class="divider" ng-if="ctrl.isRollbackEnabled()"></li>\n <li><a href ng-click="ctrl.resizeServerGroup()">Resize</a></li>\n <li><a href ng-if="!serverGroup.isDisabled" ng-click="ctrl.disableServerGroup()">Disable</a></li>\n <li><a href ng-if="serverGroup.isDisabled" ng-click="ctrl.enableServerGroup()">Enable</a></li>\n <li><a href ng-click="ctrl.destroyServerGroup()">Destroy</a></li>\n <li><a href ng-click="ctrl.cloneServerGroup()">Clone</a></li>\n <add-entity-tag-links\n component="serverGroup"\n application="ctrl.application"\n entity-type="serverGroup"\n owner-options="ctrl.entityTagTargets"\n on-update="ctrl.application.serverGroups.refresh"\n ></add-entity-tag-links>\n </ul>\n </div>\n <div class="dropdown" ng-if="serverGroup.insightActions.length > 0" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-default dropdown-toggle" uib-dropdown-toggle>\n Insight <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li\n ng-repeat="action in serverGroup.insightActions"\n analytics-on="click"\n analytics-category="Insight Menu (Server Group)"\n analytics-event="{{action.label}} clicked"\n analytics-label="{{serverGroup.account}}/{{serverGroup.region}}/{{serverGroup.name}}"\n >\n <a target="_blank" href="{{action.url}}">{{action.label}}</a>\n </li>\n </ul>\n </div>\n <div class="clearfix"></div>\n </div>\n </div>\n </div>\n <div class="content" ng-if="!state.loading">\n <div class="band band-info" ng-if="serverGroup.isDisabled">Job is Disabled</div>\n <managed-resource-details-indicator\n ng-if="!state.loading && serverGroup.isManaged"\n resource-summary="serverGroup.managedResourceSummary"\n application="ctrl.application"\n ></managed-resource-details-indicator>\n <server-group-running-tasks-details\n server-group="serverGroup"\n application="ctrl.application"\n ></server-group-running-tasks-details>\n <collapsible-section heading="Server Group Information" expanded="true">\n <dl class="dl-horizontal dl-narrow">\n <dt>Created</dt>\n <dd>{{serverGroup.createdTime | timestamp}}</dd>\n <dt>In</dt>\n <dd>\n <account-tag account="serverGroup.account" pad="right"></account-tag>\n {{serverGroup.region}}\n </dd>\n <dt>Job Id</dt>\n <dd><a href="{{titusUiEndpoint}}jobs/{{serverGroup.id}}" target="_blank">{{serverGroup.id}}</a></dd>\n <entity-source metadata="serverGroup.entityTags.creationMetadata"></entity-source>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Capacity" expanded="true">\n <titus-capacity-details-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-capacity-details-section>\n </collapsible-section>\n <collapsible-section heading="Health" expanded="true" ng-if="serverGroup.instanceCounts.total > 0">\n <dl class="dl-horizontal dl-narrow" ng-if="serverGroup">\n <dt>Tasks</dt>\n <dd>\n <health-counts container="serverGroup.instanceCounts" class="pull-left"></health-counts>\n </dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Launch Configuration">\n <titus-launch-config-section server-group="serverGroup"></titus-launch-config-section>\n </collapsible-section>\n\n <titus-security-groups\n app="ctrl.application"\n server-group="serverGroup"\n class="collapsible-section"\n style="display: block"\n ></titus-security-groups>\n\n <collapsible-section heading="Service Job Processes">\n <titus-service-job-processes-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-service-job-processes-section>\n </collapsible-section>\n\n <collapsible-section heading="Scaling Policies">\n <scaling-policy-summary\n ng-repeat="policy in serverGroup.scalingPolicies"\n policy="policy"\n server-group="serverGroup"\n application="ctrl.application"\n ></scaling-policy-summary>\n <titus-create-scaling-policy-button\n server-group="serverGroup"\n application="ctrl.application"\n ></titus-create-scaling-policy-button>\n <div ng-if="ctrl.awsAccountId">\n <config-bin-link\n application="ctrl.application"\n aws-account-id="ctrl.awsAccountId"\n cluster-name="serverGroup.cluster"\n region="serverGroup.region"\n env="ctrl.env"\n cloud-provider="\'titus\'"\n ></config-bin-link>\n </div>\n <titus-custom-scaling-policy\n application="ctrl.application"\n server-group="serverGroup"\n ></titus-custom-scaling-policy>\n </collapsible-section>\n <titus-package-details-section build-info="buildInfo"></titus-package-details-section>\n <collapsible-section heading="Job Disruption Budget">\n <titus-disruption-budget-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-disruption-budget-section>\n </collapsible-section>\n <collapsible-section heading="Job Attributes">\n <div ng-if="!serverGroup.labels">No job attributes associated with this server group</div>\n <dl ng-if="labels">\n <dt ng-repeat-start="(key, val) in labels">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Container Attributes">\n <div ng-if="!serverGroup.containerAttributes">No container attributes associated with this server group</div>\n <dl ng-if="serverGroup.containerAttributes">\n <dt ng-repeat-start="(key, val) in serverGroup.containerAttributes">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Environment Variables">\n <div ng-if="!serverGroup.env">No environment variables associated with this server group</div>\n <dl ng-if="serverGroup.env">\n <dt ng-repeat-start="(key, val) in serverGroup.env">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n </div>\n</div>\n')}]);export{ko as TITUS_MODULE,Qi as TitusCapacityDetailsSection,en as TitusInstanceDetails,Vt as TitusInstanceDns,Wt as TitusInstanceInformation,mn as TitusProviderSettings,Ht as TitusReactInject,Zt as TitusReactInjector,Qn as TitusResizeServerGroupModal,Ki as TitusScalingActivitiesModal,Ut as TitusSecurityGroupsDetailsSection,$i as TitusTargetTrackingChart,to as TitusUpsertScalingPolicyModal,eo as TitusUpsertTargetTrackingModal,qt as applyTargetGroupInfoToHealthMetric,$t as buildTaskActions,Jt as extractHealthMetrics};
|
|
1
|
+
import*as e from"angular";import{module as t}from"angular";import{InstanceInformation as n,getAllTargetGroups as r,InstanceStatus as a,VpcReader as s,ServerGroupSecurityGroupsRemoved as i,SecurityGroupSelector as o,AWSProviderSettings as l,SubnetSelectField as c,ServerGroupCapacity as u,ServerGroupLoadBalancers as d,ServerGroupSecurityGroups as m,MetricAlarmChart as p,TargetMetricFields as g,TargetTrackingAdditionalSettings as h,AlarmConfigurer as f,StepPolicyAction as v,ScalingPolicyAdditionalSettings as y,PolicyTypeSelectionModal as b,AmazonLoadBalancersTag as C}from"@spinnaker/amazon";import{HelpContentsRegistry as E,CollapsibleSection as w,LabeledValueList as S,LabeledValue as k,CopyToClipboard as N,LinkWithClipboard as A,ReactInject as G,AccountService as T,ReactInjector as I,FirewallLabels as D,ConfirmationModalService as x,InstanceWriter as P,overridableComponent as O,InstanceDetailsHeader as L,InstanceActions as M,InstanceInsights as F,ConsoleOutputLink as z,InstanceLinks as j,useData as B,SETTINGS as R,InstanceDetailsPane as V,Spinner as W,RecentHistoryService as H,InstanceReader as Z,ClusterState as U,UrlBuilder as q,Registry as J,StageConstants as K,NameUtils as X,ExecutionDetailsSection as Y,AccountTag as Q,Markdown as $,RenderOutputFile as _,StageFailureMessage as ee,DeployingIntoManagedClusterWarning as te,AccountSelectInput as ne,RegionSelectField as re,HelpField as ae,ServerGroupDetailsField as se,DeploymentStrategySelector as ie,ServerGroupNamePreview as oe,SpelNumberInput as le,ValidationMessage as ce,FormValidator as ue,FormikFormField as de,TextInput as me,SelectInput as pe,LayoutProvider as ge,MapEditorInput as he,PlatformHealthOverrideInput as fe,useFormInputValueMapper as ve,robotToHuman as ye,ChecklistInput as be,CheckboxInput as Ce,CACHE_INITIALIZER_SERVICE as Ee,LOAD_BALANCER_READ_SERVICE as we,SECURITY_GROUP_READER as Se,setMatchingResourceSummary as ke,SubnetReader as Ne,NumberInput as Ae,SpinFormik as Ge,ReactSelectInput as Te,ResponsiveFieldLayout as Ie,TetheredSelect as De,StageConfigField as xe,MapEditor as Pe,ExecutionDetailsTasks as Oe,TaskMonitor as Le,ReactModal as Me,DeployInitializer as Fe,WizardModal as ze,WizardPage as je,noop as Be,useTaskMonitor as Re,TaskMonitorWrapper as Ve,ModalClose as We,PlatformHealthOverride as He,UserVerification as Ze,MinMaxDesiredChanges as Ue,ModalHeader as qe,ModalBody as Je,ModalFooter as Ke,ServerGroupReader as Xe,DesiredCapacity as Ye,CurrentCapacity as Qe,showModal as $e,Overridable as _e,confirmNotManaged as et,TaskMonitorModal as tt,withErrorBoundary as nt,TaskExecutor as rt,SubmitButton as at,SERVER_GROUP_WRITER as st,TextAreaInput as it,ServerGroupWarningMessageService as ot,ClusterTargetBuilder as lt,ApplicationNameValidator as ct,CloudProviderRegistry as ut,DeploymentStrategyRegistry as dt}from"@spinnaker/core";import*as mt from"react";import pt from"react";import{UISref as gt}from"@uirouter/react";import{UIRouterContextComponent as ht}from"@uirouter/react-hybrid";import ft,{sortBy as vt,get as yt,chain as bt,xor as Ct,isUndefined as Et,intersection as wt,set as St,union as kt,flatten as Nt,cloneDeep as At,isEqual as Gt,defaultsDeep as Tt}from"lodash";import It from"@uirouter/angularjs";import{DockerImageUtils as Dt,DockerImageAndTagSelector as xt}from"@spinnaker/docker";import{$q as Pt}from"ngimport";import{Field as Ot,Form as Lt}from"formik";import Mt from"react-select";import{Subject as Ft}from"rxjs";import{Modal as zt}from"react-bootstrap";import{react2angular as jt}from"react2angular";import Bt from"pretty-ms";const Rt={"titus.deploy.runtimeLimitSecs":"<p>Maximum amount of time (in seconds) a batch job is allowed to run</p>","titus.deploy.retries":"<p>Number of times to retry this job</p>","titus.deploy.propertyFile":"<p>(Optional) Configures the name to the file used to pass in properties to later stages in the Spinnaker pipeline. The file must be saved into the /logs directory during execution</p>","titus.deploy.iamProfile":"AWS IAM instance profile to assign to this service","titus.deploy.capacityGroup":"Used by Titus to ensure capacity guarantees, defaults to the application name if not provided","titus.deploy.command":"<p>(Optional) Defines one or more custom commands. If multiple commands are defined, they must be comma delimited with no spaces: <b>cmd1,cmd2</b></p>","titus.deploy.entrypoint":"<p>(Optional) Defines one or more entrypoints. If multiple entrypoints are defined, they must be comma delimited with no spaces: <b>entry1,entry2</b></p>","titus.deploy.migrationPolicy":"Defines how the tasks for this job will be migrated during an infrastructure change","titus.deploy.network":"Amount of networking bandwidth to allocate in Mbps","titus.deploy.gpu":"Number of GPUs to use. WARNING: only use if directed by Titus team, otherwise leave at 0","titus.deploy.softConstraints":"Soft constraints are enforced on a best efforts basis. For example, if tasks can’t be perfectly balanced across zones, the best available balance is achieved without keeping the tasks pending for execution.","titus.deploy.hardConstraints":"Constraints must be met and tasks will not be launched if constraint can’t be perfectly met","titus.deploy.efs":"if completed, allows you to specify an EFS volume to attach to each Task that gets created for the Job","titus.deploy.mountPoint":"(Required) A valid directory to mount the volume, e.g, <samp>/efs</samp>. Invalid locations are <samp>/</samp>, <samp>/data</samp>, and <samp>/logs</samp> as these are reserved directories.","titus.deploy.efsId":"(Required) The EFS file system ID, e.g. <samp> fs-0208c74b</samp>.","titus.deploy.efsRelativeMountPoint":"(Optional) Relative dir within FS ID, e.g. <samp>/dirInVol</samp>","titus.job.waitForCompletion":"if unchecked, marks the stage as successful right away without waiting for the job to complete","titus.bake.fromGitTrigger":"If checked, gets git details from the specified git trigger.","titus.bake.repositoryUrl":"Url to the git repository containing the code to create the Docker image from, <samp>ssh://git@stash.corp.netflix.com:7999/SPKR/orca.git</samp> or <samp>ssh://git@github.com/spinnaker/orca.git</samp>","titus.bake.repositoryHash":"(Optional) The hashcode to the git commit for the image","titus.bake.repositoryBranch":"(Optional) The branch in git to build the image from","titus.bake.repositoryDirectory":"(Optional) If specified, will build the image from the Dockerfile contained in this directory. Default to project root.","titus.bake.imageOrganization":"(Optional) The organization to which this image belongs to, e.g. <samp>spinnaker</samp> for <samp>spinnaker/igor</samp>Defaults to none.","titus.bake.imageName":"(Optional) The name for the image, e.g. <samp>igor</samp> for <samp>spinnaker/igor</samp>Defaults to [git project name].[git repo name].","titus.bake.tags":"(Optional) Comma separated. By default, the <samp>latest</samp> tag is updated. Adds additional tags to label this image <samp>1.0.0-unstable,1.0.0-rc1</samp>","titus.bake.buildParameters":"(Optional) Build time variables to be passed to the Docker image. These are the set of values passed to --build-args in the command line.","titus.serverGroup.subnet":"The subnet selection determines the VPC in which your container will run. Options vary by account and region. The most common are: \n <ul>\n <li><b>titus</b>: instances will be restricted to internal clients with their own NAT gateways</li>\n <li><b>internal</b> instances will be restricted to internal clients (i.e. require VPN access)</li>\n <li><b>external</b> instances will be publicly accessible and running in VPC</li>\n </ul>\n ","titus.serverGroup.traffic":'\n <p>Enables the "inService" scaling process, which is used by Spinnaker and discovery services to determine if the server group is enabled.</p>\n <p>Will be automatically enabled when any non "custom" deployment strategy is selected.</p>',"titus.deploy.imageId":"This value has been manually overridden. To edit this value, please update the <b><i>imageId</i></b> attribute in the stage JSON. Spinnaker expects this to follow the <b><i>name:tag</i></b> format, or the <b><i>imageName</i></b> directly from Jenkins","titus.deploy.securityGroups":"AWS Security Groups to assign to this service. Security groups are set only if <samp>Allocate IP?</samp> has been selected and are assigned to the Titus AWS Elastic Network Interface.","titus.job.capacityGroup":"Capacity Group will default to application name if not specified.","titus.job.securityGroups":"AWS Security Groups to assign to this job","titus.autoscaling.cooldown":"\n <p>The amount of time, in seconds, after a scaling activity completes where previous trigger-related scaling\n activities can influence future scaling events.</p>\n <p>For scale out policies, while the cooldown period is in effect, the capacity that has been added by the\n previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next\n scale out. The intention is to continuously (but not excessively) scale out. For example, an alarm triggers a\n step scaling policy to scale out an Amazon ECS service by 2 tasks, the scaling activity completes successfully,\n and a cooldown period of 5 minutes starts. During the Cooldown period, if the alarm triggers the same policy\n again but at a more aggressive step adjustment to scale out the service by 3 tasks, the 2 tasks that were added\n in the previous scale out event are considered part of that capacity and only 1 additional task is added to the desired count.</p>\n <p>For scale in policies, the cooldown period is used to block subsequent scale in requests until it has expired.\n The intention is to scale in conservatively to protect your application's availability. However, if another\n alarm triggers a scale out policy during the cooldown period after a scale in, Application Auto Scaling scales\n out your scalable target immediately.</p>\n ","titus.autoscaling.scaleIn.cooldown":"\n <p>The amount of time, in seconds, after a scale in activity completes before another scale in activity can start.</p>\n <p>The cooldown period is used to block subsequent scale in requests until it has expired. The intention is to scale\n in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy\n during the cooldown period after a scale in, Application Auto Scaling scales out your scalable target immediately.</p>\n ","titus.autoscaling.scaleOut.cooldown":"\n <p>The amount of time, in seconds, after a scale out activity completes before another scale out activity can start.</p>\n <p>While the cooldown period is in effect, the capacity that has been added by the previous scale out event that\n initiated the cooldown is calculated as part of the desired capacity for the next scale out. The intention is to\n continuously (but not excessively) scale out.</p>\n ","titus.disruptionbudget.description":'\n <p>\n The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the\n job can be relocated.\n <a href="http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/" target="_blank">\n Read the full documentation\n </a>\n </p>\n '};Object.keys(Rt).forEach(e=>E.register(e,Rt[e]));const Vt=({containerIp:e,host:t,instancePort:n,ipv6Address:r})=>mt.createElement(w,{heading:"DNS",defaultExpanded:!0},mt.createElement(S,{className:"dl-horizontal dl-narrow"},e&&mt.createElement(k,{label:"Container IP",value:mt.createElement(mt.Fragment,null,e,mt.createElement(N,{text:e,toolTip:"Copy container IP to clipboard"}))}),r&&mt.createElement(k,{label:"Container IPv6",value:mt.createElement(A,{text:r,url:`http://${r}:${n}`})}),mt.createElement(k,{label:"Host IP",value:t}))),Wt=({instance:e,titusUiEndpoint:t})=>{const{id:r,jobId:a}=e;return pt.createElement(w,{heading:"Instance Information",defaultExpanded:!0},pt.createElement("dl",{className:"dl-horizontal dl-narrow"},pt.createElement(n,{account:e.account,availabilityZone:e.availabilityZone,instanceType:e.instanceType,launchTime:e.launchTime,provider:e.provider,region:e.region,serverGroup:e.serverGroup}),pt.createElement(k,{label:"Job Id",value:pt.createElement("a",{href:`${t}jobs/${a}`,target:"_blank"},a)}),pt.createElement(k,{label:"Instance Id",value:pt.createElement(A,{text:r,url:`${t}jobs/${a}/tasks/${r}`})})))};class Ht extends G{get titusServerGroupTransformer(){return this.$injector.get("titusServerGroupTransformer")}get titusServerGroupCommandBuilder(){return this.$injector.get("titusServerGroupCommandBuilder")}get titusServerGroupConfigurationService(){return this.$injector.get("titusServerGroupConfigurationService")}get titusSecurityGroupReader(){return this.$injector.get("titusSecurityGroupReader")}initialize(e){this.$injector=e}}const Zt=new Ht;class Ut extends pt.Component{constructor(e){super(e),this.state={}}componentDidMount(){this.configureSecurityGroups(this.props)}configureSecurityGroups(e){const{app:t,serverGroup:n}=e,{region:r}=n;if(t.securityGroupsIndex&&n.accountDetails){const e=n.securityGroups.map(e=>Zt.titusSecurityGroupReader.resolveIndexedSecurityGroup(t.securityGroupsIndex,{account:n.accountDetails.awsAccount,region:r},e));this.setState({securityGroups:e})}else T.listAllAccounts("titus").then(e=>{const t=e.find(e=>e.name===n.account);t&&t.awsAccount&&I.securityGroupReader.getAllSecurityGroups().then(e=>{const a=e[t.awsAccount].aws[r],s=n.securityGroups.map(e=>a.find(t=>t.id===e)).filter(e=>e).map(e=>({account:t.awsAccount,name:e.name,id:e.id,vpcId:e.vpcId}));this.setState({securityGroups:s})})})}componentWillReceiveProps(e){this.configureSecurityGroups(e)}render(){const{serverGroup:e}=this.props,{securityGroups:t}=this.state,n=!t&&(e.securityGroups||[]).length;return pt.createElement(w,{heading:D.get("Firewalls"),outerDivClassName:""},pt.createElement("ul",null,n&&e.securityGroups.map(e=>pt.createElement("li",{key:e},"...")),pt.createElement(ht,null,pt.createElement(pt.Fragment,null,vt(t,"name").map(t=>pt.createElement("li",{key:t.name},pt.createElement(gt,{to:"^.firewallDetails",params:{name:t.name,accountId:t.account,region:e.region,vpcId:t.vpcId,provider:"aws"}},pt.createElement("a",null,t.name," (",t.id,")"))))))))}}const qt=(e,t,n)=>e.map(e=>{var r;const a=t.find(t=>(t.name===e.name||t.name===e.targetGroupName)&&t.account===n),s="traffic-port"===(null==a?void 0:a.healthCheckPort)||!(null==a?void 0:a.healthCheckPort);return{...e,name:null==a?void 0:a.name,healthCheckPath:a?`:${s?null==a?void 0:a.port:a.healthCheckPort}${(null==a?void 0:a.healthCheckPath)||""}`:void 0,healthCheckProtocol:null==(r=null==a?void 0:a.healthCheckProtocol)?void 0:r.toLowerCase()}}),Jt=(e,t,n)=>{const a=(e||[]).filter(e=>"Unknown"!==e.state),s=r(t);return a.map(e=>{if("TargetGroup"===e.type){const t=qt(e.targetGroups,s,n);return{...e,targetGroups:t}}return e})},Kt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id}`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{id:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id}?`,buttonText:`Terminate ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>{const n={cloudProvider:"titus"};return e.serverGroup&&(n.serverGroupName=e.serverGroup),P.terminateInstance(e,t,n)}})},Xt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id} and shrinking server group`,onTaskComplete:()=>{I.$state.includes("**.instanceDetails",{instanceId:e.id})&&I.$state.go("^")}};x.confirm({header:`Really terminate ${e.id} and shrink ${e.serverGroup}?`,buttonText:`Terminate ${e.id} and shrink ${e.serverGroup}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.terminateInstancesAndShrinkServerGroups([{cloudProvider:e.cloudProvider,instanceIds:[e.id],account:e.account,region:e.region,serverGroup:e.serverGroup,instances:[e]}],t)})},Yt=(e,t)=>()=>{const n={application:t,title:`Enabling ${e.id} in discovery`};x.confirm({header:`Really enable ${e.id} in discovery?`,buttonText:`Enable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.enableInstanceInDiscovery(e,t)})},Qt=(e,t)=>()=>{const n={application:t,title:`Disabling ${e.id} in discovery`};x.confirm({header:`Really disable ${e.id} in discovery?`,buttonText:`Disable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>P.disableInstanceInDiscovery(e,t)})},$t=(e,t)=>{const n=[{label:"Terminate",triggerAction:Kt(e,t)},{label:"Terminate and Shrink Server Group",triggerAction:Xt(e,t)}],r=(e.health||[]).filter(e=>"Discovery"===e.type);r.length&&"OutOfService"===r[0].state&&n.push({label:"Enable in Discovery",triggerAction:Yt(e,t)});return(r||[]).some(e=>"Up"===e.state||"Down"===e.state)&&n.push({label:"Disable in Discovery",triggerAction:Qt(e,t)}),n},_t=O(({account:e,actions:t,app:n,baseIpAddress:r,environment:s,healthMetrics:i,instance:o,instanceId:l,instancePort:c,loading:u,moniker:d,serverGroup:m,region:p})=>{var g,h,f;const v=`ssh -t ${null==e?void 0:e.bastionHost} 'titus-ssh -region ${p} ${l}'`;return mt.createElement("div",{className:"details-panel"},mt.createElement("div",{className:"header"},mt.createElement(L,{healthState:o.healthState,instanceId:l,loading:u,sshLink:v,standalone:n.isStandalone}),mt.createElement("div",{className:"actions"},mt.createElement(M,{actions:t}),Boolean(null==(g=null==o?void 0:o.insightActions)?void 0:g.length)&&mt.createElement(F,{analytics:!0,insights:o.insightActions,instance:o}))),mt.createElement("div",{className:"content"},mt.createElement(Wt,{instance:o,titusUiEndpoint:o.titusUiEndpoint}),mt.createElement(a,{healthMetrics:i,healthState:o.healthState,metricTypes:["TargetGroup"],privateIpAddress:o.privateIpAddress}),mt.createElement(Vt,{containerIp:null==(h=o.placement)?void 0:h.containerIp,host:null==(f=o.placement)?void 0:f.host,instancePort:c,ipv6Address:o.ipv6Address}),mt.createElement("div",{className:"collapsible-section"},mt.createElement(Ut,{app:n,serverGroup:m})),mt.createElement(w,{heading:"Console Output"},mt.createElement(z,{instance:o})),mt.createElement(j,{address:r,application:n,instance:o,environment:s,moniker:d})))},"titus.instance.details.content"),en=({app:e,environment:t,instance:n,moniker:r})=>{var a,s,i;const{instanceId:o}=n,l=e.serverGroups.data.find(e=>e.instances.some(e=>e.id===o)),{account:c,region:u}=l,d=()=>(H.addExtraDataToLatest("instances",{account:c,region:u,serverGroup:l.name}),Promise.all([Z.getInstanceDetails(c,u,o).then(e=>({...e,account:c,region:u})),T.getAccountDetails(c)])),m=e=>{const[t,n]=e,r=((null==n?void 0:n.regions)||[]).find(e=>e.name===u);return[{titusUiEndpoint:null==r?void 0:r.endpoint,...t},n]},{result:[p,g],status:h}=B(()=>e.isStandalone?d().then(e=>m(e)):e.serverGroups.ready().then(d).then(e=>m(e)),[{},{}],[o,l]),f=$t(p,e),v=Jt(p.health,e.loadBalancers.data,g.awsAccount),y="PENDING"===h,b=(null==(a=e.attributes)?void 0:a.instancePort)||R.defaultInstancePort||"80",C=(null==(s=p.placement)?void 0:s.containerIp)||(null==(i=null==p?void 0:p.placement)?void 0:i.host);return y?mt.createElement(V,null,mt.createElement("div",{className:"horizontal center middle"},mt.createElement(W,{size:"small"}))):(null==p?void 0:p.id)?mt.createElement(_t,{account:g,actions:f,app:e,baseIpAddress:C,environment:t,healthMetrics:v,instance:p,instanceId:n.instanceId,instancePort:b,moniker:r,loading:y,serverGroup:l,region:u}):mt.createElement("div",{className:"details-panel"},mt.createElement("div",{className:"header"},mt.createElement(V,null,mt.createElement("div",{className:"header-text horizontal middle"},mt.createElement("h3",{className:"horizontal middle space-between flex-1"},n.instanceId)))),mt.createElement("div",{className:"content"},mt.createElement("div",{className:"content-section"},mt.createElement("div",{className:"content-body text-center"},mt.createElement("h3",null,"Instance not found.")))))};const tn="spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller";t(tn,[It]).controller("titusCloneServerGroupExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService",function(e,t,n){e.configSections=["cloneServerGroupConfig","taskStatus"];const r=()=>{const n=r["kato.tasks"][0].resultObjects;e.detailsSection=t.details;const r=e.stage.context||{},a=[];r&&r["kato.tasks"]&&r["kato.tasks"].length&&n&&n.length&&function(e){const s=ft.find(n,e);s&&ft.forEach(s[e],e=>{if(e.includes(":")){const[n,s]=e.split(":"),i={type:"serverGroups",application:r.application,serverGroup:s,account:r.credentials,region:n,provider:"titus",project:t.project};i.href=q.buildFromMetadata(i),a.push(i)}})}("serverGroupNames"),e.deployed=a};this.overrideFiltersForUrl=e=>U.filterService.overrideFiltersForUrl(e);const a=()=>n.synchronizeSection(e.configSections,r);a(),e.$on("$stateChangeSuccess",a)}]);const nn="spinnaker.titus.pipeline.stage.cloneServerGroupStage";t(nn,[tn]).config(function(){J.pipeline.registerStage({provides:"cloneServerGroup",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",executionDetailsUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",executionStepLabelUrl:"titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",validators:[{type:"requiredField",fieldName:"targetCluster",fieldLabel:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"region"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusCloneServerGroupStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1},T.listAccounts("titus").then(t=>{e.accounts=t,e.viewState.accountsLoaded=!0}),this.cloneTargets=K.TARGET_LIST,t.target=t.target||this.cloneTargets[0].val,t.application=e.application.name,t.cloudProvider="titus",t.cloudProviderType="titus",t.viewState={mode:"editPipeline"},t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),this.targetClusterUpdated=()=>{if(t.targetCluster){const e=X.parseServerGroupName(t.targetCluster);t.stack=e.stack,t.freeFormDetails=e.freeFormDetails}else t.stack="",t.freeFormDetails=""},e.$watch("stage.targetCluster",this.targetClusterUpdated),this.removeCapacity=()=>{delete t.capacity},ft.has(t,"useSourceCapacity")||(t.useSourceCapacity=!0),this.toggleSuspendedProcess=e=>{t.suspendedProcesses=t.suspendedProcesses||[];const n=t.suspendedProcesses.indexOf(e);-1===n?t.suspendedProcesses.push(e):t.suspendedProcesses.splice(n,1)},this.processIsSuspended=e=>t.suspendedProcesses&&t.suspendedProcesses.includes(e),this.onRedBlackFieldChange=(e,n)=>{ft.set(t,e,n)}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html",'<div ng-controller="titusCloneServerGroupStageCtrl as cloneServerGroupStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="viewState.loading">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="!viewState.loading">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n single-region="true"\n cluster-field="targetCluster"\n >\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="cloneServerGroupStageCtrl.cloneTargets"></target-select>\n </stage-config-field>\n <div>\n <div class="form-group">\n <div class="col-md-3 sm-label-right">Capacity</div>\n <div class="col-md-9 radio">\n <label>\n <input\n type="radio"\n ng-model="stage.useSourceCapacity"\n ng-value="true"\n ng-click="cloneServerGroupStageCtrl.removeCapacity()"\n id="useSourceCapacityTrue"\n />\n Copy the capacity from the current server group\n <help-field key="serverGroupCapacity.useSourceCapacityTrue"></help-field>\n </label>\n </div>\n <div class="col-md-9 col-md-offset-3 radio">\n <label>\n <input type="radio" ng-model="stage.useSourceCapacity" ng-value="false" id="useSourceCapacityFalse" />\n Let me specify the capacity\n <help-field key="serverGroupCapacity.useSourceCapacityFalse"></help-field>\n </label>\n </div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">Min</div>\n <div class="col-md-2">Max</div>\n <div class="col-md-2">Desired</div>\n </div>\n <div class="form-group">\n <div class="col-md-2 col-md-offset-3">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.min"\n min="0"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.max"\n min="{{stage.capacity.min}}"\n required\n />\n </div>\n <div class="col-md-2">\n <input\n type="number"\n ng-disabled="stage.useSourceCapacity"\n class="form-control input-sm"\n ng-model="stage.capacity.desired"\n min="{{stage.capacity.min}}"\n max="{{stage.capacity.max}}"\n required\n />\n </div>\n </div>\n </div>\n <stage-config-field label="Traffic" help-key="titus.serverGroup.traffic">\n <div class="checkbox">\n <label>\n <input\n type="checkbox"\n ng-click="cloneServerGroupStageCtrl.toggleSuspendedProcess(\'AddToLoadBalancer\')"\n ng-checked="!cloneServerGroupStageCtrl.processIsSuspended(\'AddToLoadBalancer\')"\n />\n Send client requests to new instances\n </label>\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n <deployment-strategy-selector\n label-columns="3"\n field-columns="6"\n command="stage"\n on-field-change="cloneServerGroupStageCtrl.onRedBlackFieldChange"\n ></deployment-strategy-selector>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html",'<div ng-controller="titusCloneServerGroupExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'cloneServerGroupConfig\'">\n <div class="row">\n <div class="col-md-9">\n <dl class="dl-narrow dl-horizontal">\n <dt>Account</dt>\n <dd><account-tag account="stage.context.credentials"></account-tag></dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Cluster</dt>\n <dd>{{stage.context.targetCluster}}</dd>\n <dt>Server Group</dt>\n <dd>{{stage.context.source.serverGroupName}}</dd>\n <dt ng-if="!stage.context.useSourceCapacity && stage.context.capacity">Capacity</dt>\n <dd ng-if="!stage.context.useSourceCapacity && stage.context.capacity">\n Min: {{stage.context.capacity.min}} / Desired: {{stage.context.capacity.desired}} / Max:\n {{stage.context.capacity.max}}\n </dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="deployed.length">\n <div class="col-md-12">\n <div class="well alert alert-info">\n <strong>Deployed:</strong>\n <a\n ng-repeat="serverGroup in deployed"\n ng-click="$event.stopPropagation(); deployDetailsCtrl.overrideFiltersForUrl(serverGroup);"\n ng-href="{{serverGroup.href}}"\n >\n {{serverGroup.serverGroup}}\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html",'<span class="task-label"> Clone Server Group: {{step.context.source.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const rn="spinnaker.titus.pipeline.stage.destroyAsgStage";t(rn,[]).config(function(){J.pipeline.registerStage({provides:"destroyServerGroup",alias:"destroyAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to destroy a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusDestroyAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.state.accounts=!0}),e.regions=["us-east-1","us-west-1","eu-west-1","us-west-2"],e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStage.html",'<div ng-controller="titusDestroyAsgStageCtrl as destroyAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html",'<span class="task-label"> Destroy Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const an="spinnaker.titus.pipeline.stage.disableAsgStage";t(an,[]).config(function(){J.pipeline.registerStage({provides:"disableServerGroup",alias:"disableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",validators:[{type:"targetImpedance",message:"This pipeline will attempt to disable a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusDisableAsgStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.state.accounts=!0}),e.targets=K.TARGET_LIST,t.regions=t.regions||[],t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),t.target||(t.target=e.targets[0].val)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStage.html",'<div ng-controller="titusDisableAsgStageCtrl as disableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableAsg/disableAsgStepLabel.html",'<span class="task-label"> Disable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const sn="spinnaker.titus.pipeline.stage.disableClusterStage";t(sn,[]).config(function(){J.pipeline.registerStage({provides:"disableCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/disableCluster/disableClusterStage.html",executionConfigSections:["disableClusterConfig","taskStatus"],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingEnabledServerGroups",fieldLabel:"Keep [X] enabled Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusDisableClusterStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.state.accounts=!0}),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),void 0===n.remainingEnabledServerGroups&&(n.remainingEnabledServerGroups=1),t.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===n.preferLargerOverNewer&&(n.preferLargerOverNewer="false"),n.preferLargerOverNewer=n.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/disableCluster/disableClusterStage.html",'<div ng-controller="titusDisableClusterStageCtrl as disableClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Disable Options">\n <div class="form-inline">\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingEnabledServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{disableClusterStageCtrl.pluralize(\'server group\', stage.remainingEnabledServerGroups)}} enabled.\n </div>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);const on="spinnaker.titus.pipeline.stage.enableAsgStage";t(on,[]).config(function(){J.pipeline.registerStage({provides:"enableServerGroup",alias:"enableAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStage.html",executionStepLabelUrl:"titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusEnableAsgStageCtrl",["$scope",function(e){const t=this,n=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.state.accounts=!0}),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},e.targets=K.TARGET_LIST,n.regions=n.regions||[],n.cloudProvider="titus",n.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(n.interestingHealthProviderNames=["Titus"]),!n.credentials&&e.application.defaultCredentials.titus&&(n.credentials=e.application.defaultCredentials.titus),!n.regions.length&&e.application.defaultRegions.titus&&n.regions.push(e.application.defaultRegions.titus),n.target||(n.target=e.targets[0].val),e.$watch("stage.credentials",e.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStage.html",'<div ng-controller="titusEnableAsgStageCtrl as enableAsgStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="targets"></target-select>\n </stage-config-field>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/enableAsg/enableAsgStepLabel.html",'<span class="task-label"> Enable Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);const ln="spinnaker.titus.pipeline.stage.findAmiStage";e.module(ln,[]).config(function(){J.pipeline.registerStage({provides:"findImage",alias:"findAmi",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/findAmi/findAmiStage.html",validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"selectionStrategy",fieldLabel:"Server Group Selection"},{type:"requiredField",fieldName:"credentials"}]})}).controller("titusFindAmiStageCtrl",["$scope",function(t){const n=t.stage;t.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(e){t.accounts=e,t.state.accounts=!0}),t.selectionStrategies=[{label:"Largest",val:"LARGEST",description:"When multiple server groups exist, prefer the server group with the most instances"},{label:"Newest",val:"NEWEST",description:"When multiple server groups exist, prefer the newest"},{label:"Oldest",val:"OLDEST",description:"When multiple server groups exist, prefer the oldest"},{label:"Fail",val:"FAIL",description:"When multiple server groups exist, fail"}],n.regions=n.regions||[],n.cloudProvider="titus",n.selectionStrategy=n.selectionStrategy||t.selectionStrategies[0].val,e.isUndefined(n.onlyEnabled)&&(n.onlyEnabled=!0),!n.credentials&&t.application.defaultCredentials.titus&&(n.credentials=t.application.defaultCredentials.titus),!n.regions.length&&t.application.defaultRegions.titus&&n.regions.push(t.application.defaultRegions.titus),t.$watch("stage.credentials",t.accountUpdated)}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/findAmi/findAmiStage.html",'<div ng-controller="titusFindAmiStageCtrl as findAmiCtrl" class="form-horizontal">\n <account-region-cluster-selector\n application="application"\n component="stage"\n accounts="accounts"\n show-all-regions="true"\n >\n </account-region-cluster-selector>\n <stage-config-field label="Server Group Selection">\n <ui-select ng-model="stage.selectionStrategy" class="form-control input-sm">\n <ui-select-match placeholder="None">{{$select.selected.label}}</ui-select-match>\n <ui-select-choices repeat="strategy.val as strategy in selectionStrategies | filter: $select.search">\n <strong ng-bind-html="strategy.label | highlight: $select.search"></strong>\n <div ng-bind-html="strategy.description"></div>\n </ui-select-choices>\n </ui-select>\n </stage-config-field>\n <stage-config-field label="Server Group Filters">\n <label class="checkbox-inline">\n <input type="checkbox" ng-model="stage.onlyEnabled" />\n Only consider enabled Server Groups\n </label>\n </stage-config-field>\n</div>\n')}]);const cn="spinnaker.titus.pipeline.stage.resizeAsgStage";t(cn,[]).config(function(){J.pipeline.registerStage({provides:"resizeServerGroup",alias:"resizeAsg",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",executionConfigSections:["resizeServerGroupConfig","taskStatus"],executionStepLabelUrl:"titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"targetImpedance",message:"This pipeline will attempt to resize a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"action"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusResizeAsgStageCtrl",["$scope",function(e){const t=e.stage;e.viewState={accountsLoaded:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.viewState.accountsLoaded=!0}),e.resizeTargets=K.TARGET_LIST,e.scaleActions=[{label:"Scale Up",val:"scale_up"},{label:"Scale Down",val:"scale_down"},{label:"Scale to Cluster Size",val:"scale_to_cluster"},{label:"Scale to Exact Size",val:"scale_exact"}],e.resizeTypes=[{label:"Percentage",val:"pct"},{label:"Incremental",val:"incr"}],t.capacity=t.capacity||{},t.regions=t.regions||[],t.target=t.target||e.resizeTargets[0].val,t.action=t.action||e.scaleActions[0].val,t.resizeType=t.resizeType||e.resizeTypes[0].val,t.action||"exact"!==t.resizeType||(t.action="scale_exact"),t.cloudProvider="titus",t.isNew&&e.application.attributes.platformHealthOnlyShowOverride&&e.application.attributes.platformHealthOnly&&(t.interestingHealthProviderNames=["Titus"]),!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),this.updateResizeType=function(){"scale_exact"===t.action?(t.resizeType="exact",delete t.scalePct,delete t.scaleNum):(t.capacity={},"pct"===t.resizeType?delete t.scaleNum:(t.resizeType="incr",delete t.scalePct,t.scaleNum=t.scaleNum||0))}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStage.html",'<div ng-controller="titusResizeAsgStageCtrl as resizeAsgStageCtrl">\n <div ng-if="!pipeline.strategy">\n <div ng-if="!viewState.accountsLoaded">\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n <div ng-if="viewState.accountsLoaded">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n </div>\n <stage-config-field label="Target">\n <target-select model="stage" options="resizeTargets"></target-select>\n </stage-config-field>\n <stage-config-field label="Action" help-key="pipeline.config.resizeAsg.action">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.action"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="a.val as a.label for a in scaleActions"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div ng-if="stage.action !== \'scale_exact\'">\n <stage-config-field label="{{stage.action === \'scale_to_cluster\' ? \'Additional Capacity\' : \'Type\'}}">\n <select\n class="form-control input-sm"\n required\n ng-model="stage.resizeType"\n ng-change="resizeAsgStageCtrl.updateResizeType()"\n ng-options="t.val as t.label for t in resizeTypes"\n >\n <option>Select an action...</option>\n </select>\n </stage-config-field>\n <div class="form-group" ng-if="stage.resizeType === \'pct\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize Percentage</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scalePct" class="form-control input-sm" />\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the percentage by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n <div class="form-group" ng-if="stage.resizeType === \'incr\'">\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize-by Amount</label>\n\n <div class="col-md-2">\n <input type="number" min="0" ng-model="stage.scaleNum" class="form-control input-sm" />\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note"\n >This is the exact amount by which the target server group\'s capacity will be increased</em\n >\n </div>\n </div>\n </div>\n <div class="form-group" ng-if="stage.action === \'scale_exact\'">\n <div class="col-md-9 col-md-offset-3 small">\n <div class="col-md-9">\n <div class="col-md-3 col-md-offset-3">Min</div>\n <div class="col-md-3">Max</div>\n <div class="col-md-3">Desired</div>\n </div>\n </div>\n <div class="col-md-9 col-md-offset-3">\n <label class="col-md-2 sm-label-right small" style="margin-left: 0; padding-left: 0">Match Capacity</label>\n\n <div class="col-md-9">\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.min" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.max" class="form-control input-sm" />\n </div>\n <div class="col-md-3">\n <input type="number" ng-model="stage.capacity.desired" class="form-control input-sm" />\n </div>\n </div>\n </div>\n\n <div class="col-md-9 col-md-offset-3">\n <em class="subinput-note">This is the exact amount to which the target server group will be scaled</em>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html",'<span class="task-label"> Resize Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>\n')}]);class un extends pt.Component{constructor(e){super(e),this.mounted=!1,this.state={}}componentDidMount(){this.mounted=!0,this.setEndpoint()}setEndpoint(){const{context:e}=this.props.stage;T.getAccountDetails(e.credentials).then(t=>{const n=t.regions.find(t=>t.name===e.cluster.region).endpoint;this.mounted&&this.setState({titusUiEndpoint:n})})}formatEntryPoint(e,t){return e&&Array.isArray(e)&&e.length>0?1===e.length?e[0]:JSON.stringify(e):t}componentWillUnmount(){this.mounted=!1}componentWillReceiveProps(){this.setEndpoint()}render(){const{stage:e,current:t,name:n}=this.props,{titusUiEndpoint:r}=this.state,{context:a}=e,{cluster:s}=a,{resources:i,env:o,entryPoint:l,entryPointList:c}=s,u=s?yt(a["deploy.jobs"],s.region,[])[0]:null,d=yt(a,"jobStatus.completionDetails.taskId"),m=this.formatEntryPoint(c,l);return pt.createElement(Y,{name:n,current:t},pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-9"},pt.createElement(S,{className:"dl-narrow dl-horizontal"},pt.createElement(k,{label:"Account",value:pt.createElement(Q,{account:a.credentials})}),s&&pt.createElement(pt.Fragment,null,pt.createElement(k,{label:"Image",value:s.imageId}),m&&pt.createElement(k,{label:"Entrypoint",value:m})),u&&pt.createElement(k,{label:"Titus Job Id",value:pt.createElement($,{message:`[${u}](${r}jobs/${u})`})}),d&&pt.createElement(k,{label:"Titus Task Id",value:pt.createElement($,{message:`[${d}](${r}jobs/${u}/tasks/${d})`})}),i&&Object.keys(i)&&pt.createElement(k,{label:"Resources",value:pt.createElement("ul",{className:"nostyle"},Object.keys(i).map(e=>pt.createElement("li",{key:e},e,": ",i[e])))})))),o&&Object.keys(o)&&pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-12"},pt.createElement("h5",{style:{marginBottom:0,paddingBottom:"5px"}},"Environment Variables"),pt.createElement(S,null,Object.keys(o).map(e=>pt.createElement(k,{key:e,label:e,value:o[e]}))))),a.propertyFileContents&&pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-12"},pt.createElement("h5",{style:{marginBottom:"0px",paddingBottom:"5px"}},"Property File"),pt.createElement(_,{outputFileObject:a.propertyFileContents}))),pt.createElement(ee,{stage:e,message:e.failureMessage||yt(a,"completionDetails.message")}),d&&pt.createElement("div",{className:"row"},pt.createElement("div",{className:"col-md-12"},pt.createElement("div",{className:"well alert alert-info"},pt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs`},"View Execution Logs"),pt.createElement("br",null),pt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stdout&view=Finished&open=true`},"Stdout"),pt.createElement("br",null),pt.createElement("a",{target:"_blank",href:`${r}jobs/${u}/tasks/${d}/logs/archived?file=stderr&view=Finished&open=true`},"Stderr")))))}}un.title="runJobConfig";class dn extends pt.Component{constructor(e){super(e),this.state={availableGroups:[],removedGroups:[],loaded:!1},this.credentials={},this.vpcs=[],this.securityGroups={},this.clearRemoved=()=>{this.setState({removedGroups:[]})}}getCredentials(){return this.credentials[this.props.command.credentials]}getAwsAccount(){return this.getCredentials().awsAccount}getRegion(){return this.props.command.region||(this.props.command.cluster?this.props.command.cluster.region:null)}getVpcId(){const e=this.getCredentials(),t=this.vpcs.find(t=>t.name===e.awsVpc&&t.account===e.awsAccount&&t.region===this.getRegion()&&"aws"===t.cloudProvider);return t?t.id:null}getRegionalSecurityGroups(){const e=this.securityGroups[this.getAwsAccount()]||{aws:{}};return bt(e.aws[this.getRegion()]).filter({vpcId:this.getVpcId()}).sortBy("name").value()}refreshSecurityGroups(e){return I.cacheInitializer.refreshCache("securityGroups").then(()=>I.securityGroupReader.getAllSecurityGroups().then(t=>{this.securityGroups=t,e||this.configureSecurityGroupOptions()}))}configureSecurityGroupOptions(){let e=this.getRegionalSecurityGroups();const t=this.state.availableGroups.length?this.state.availableGroups:e;let n,r=this.props.groupsToEdit;if(e&&this.props.groupsToEdit){const a=r.map(e=>{const n=t.find(t=>t.id===e);return n?n.name:e}),s=a.map(t=>{const n=e.find(e=>e.id===t||e.name===t);return n?n.name:null}).map(t=>e.find(e=>e.name===t)).filter(e=>e),i=s.map(e=>e.name);n=Ct(a,i),r=s.map(e=>e.id),this.props.onChange(r)}e=e.sort((e,t)=>e.name.localeCompare(t.name)),this.setState({availableGroups:e,loaded:!0,removedGroups:n})}componentDidMount(){const e=T.getCredentialsKeyedByAccount("titus").then(e=>{this.credentials=e}),t=I.securityGroupReader.getAllSecurityGroups().then(e=>{this.securityGroups=e}),n=s.listVpcs().then(e=>this.vpcs=e);Pt.all([e,t,n]).then(()=>this.configureSecurityGroupOptions())}componentWillReceiveProps(e){this.props.account===e.account&&this.props.region===e.region||this.configureSecurityGroupOptions()}render(){const{command:e,hideLabel:t,groupsToEdit:n,amazonAccount:r}=this.props,{availableGroups:a,loaded:s,removedGroups:l}=this.state,c=D.get("firewalls");return s?pt.createElement("div",{className:"clearfix"},pt.createElement(i,{removed:l,onClear:this.clearRemoved}),pt.createElement(o,{command:e,hideLabel:t,availableGroups:a,groupsToEdit:n,refresh:()=>this.refreshSecurityGroups(),onChange:this.props.onChange,helpKey:"titus.deploy.securityGroups"}),r&&void 0!==e.credentials&&pt.createElement("div",{className:"small "+(t?"":"col-md-offset-3 col-md-9")},"Uses ",c," from the Amazon account ",pt.createElement(Q,{account:r}))):null}}const mn=R.providers.titus||{defaults:{}};mn&&(mn.resetToOriginal=R.resetToOriginal);const pn=e=>e&&!e.includes("${");class gn extends pt.Component{constructor(e){super(e),this.accountUpdated=e=>{const{setFieldValue:t,values:n}=this.props.formik;n.credentials=e,n.credentialsChanged(n),t("account",e),t("credentials",e);const r=n.backingData.credentialsKeyedByAccount[e];t("containerAttributes",{...n.containerAttributes,"titusParameter.agent.assignIPv6Address":"test"===r.environment?"true":"false"})},this.regionUpdated=e=>{const{values:t,setFieldValue:n}=this.props.formik;t.region=e,t.regionChanged(t),n("region",e)},this.navigateToLatestServerGroup=()=>{const{values:e}=this.props.formik,{latestServerGroup:t}=this.state,n={provider:e.selectedProvider,accountId:t.account,region:t.region,serverGroup:t.name},{$state:r}=I;r.is("home.applications.application.insight.clusters")?r.go(".serverGroup",n):r.go("^.serverGroup",n)},this.stackChanged=e=>{const{formik:t}=this.props;t.setFieldValue("stack",e),t.values.clusterChanged(t.values)},this.strategyChanged=(e,t)=>{e.onStrategyChange(e,t),this.props.formik.setFieldValue("strategy",t.key)},this.dockerValuesChanged=e=>{Object.keys(e).forEach(t=>{this.props.formik.setFieldValue(t,e[t])})},this.onStrategyFieldChange=(e,t)=>{this.props.formik.setFieldValue(e,t)},this.onSubnetChange=()=>{const{setFieldValue:e,values:t}=this.props.formik;t.subnetChanged(t),e("subnetType",t.subnetType)};const{values:t,setFieldValue:n}=this.props.formik;if(t.imageId&&!t.imageId.includes("${")){const{digest:e,organization:r,repository:a,tag:s}=Dt.splitImageId(t.imageId);n("digest",e),n("organization",r),n("repository",a),n("tag",s)}this.state={...this.getStateFromProps(e)}}getStateFromProps(e){const{app:t}=e,{values:n}=e.formik,r=X.getClusterName(t.name,n.stack,n.freeFormDetails),a=!t.clusters.find(e=>e.name===r),s=t.serverGroups.data.filter(e=>e.cluster===r&&e.account===n.credentials&&e.region===n.region).sort((e,t)=>e.createdTime-t.createdTime),i=s.length?s.pop():null;return{namePreview:r,createsNewCluster:a,latestServerGroup:i}}validate(e){const t={};var n,r;return n=e.stack,pn(n)&&!/^([\w.]+|\${[^}]+})*$/.test(n)&&(t.stack="Only dot(.) and underscore(_) special characters are allowed in the Stack field."),r=e.freeFormDetails,pn(r)&&!/^([\w.^~-]+|\${[^}]+})*$/.test(r)&&(t.freeFormDetails="Only dot(.), underscore(_), caret (^), tilde (~), and dash(-) special characters are allowed in the Detail field."),e.viewState.disableImageSelection||e.imageId||(t.imageId="Image is required."),e.resourceSummary&&(t.resourceSummary={id:"Cluster is managed"}),t}componentWillReceiveProps(e){this.setState(this.getStateFromProps(e))}render(){var e,t,n;const{app:r,formik:a}=this.props,{errors:s,setFieldValue:i,values:o}=a,{createsNewCluster:u,latestServerGroup:d,namePreview:m}=this.state,p=o.backingData.accounts,g=o.viewState.readOnlyFields||{},h=o.imageId&&"${trigger.properties.imageName}"!==o.imageId,f=[].concat(null==(e=mn.defaults)?void 0:e.subnetType).concat(null==(t=l.defaults)?void 0:t.subnetType).filter(e=>!!e);return pt.createElement("div",{className:"container-fluid form-horizontal"},pt.createElement(te,{app:r,formik:a}),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Account"),pt.createElement("div",{className:"col-md-7"},pt.createElement(ne,{value:o.credentials,onChange:e=>this.accountUpdated(e.target.value),readOnly:g.credentials,accounts:p,provider:"titus"}),void 0!==o.credentials&&pt.createElement("div",{className:"small"},"Uses resources from the Amazon account"," ",pt.createElement(Q,{account:o.backingData.credentialsKeyedByAccount[o.credentials]&&o.backingData.credentialsKeyedByAccount[o.credentials].awsAccount})))),pt.createElement(re,{readOnly:g.region,labelColumns:3,component:o,field:"region",account:o.credentials,regions:o.backingData.filtered.regions,onChange:this.regionUpdated}),pt.createElement(c,{application:r,component:o,field:"subnetType",helpKey:"titus.serverGroup.subnet",labelColumns:3,onChange:this.onSubnetChange,region:o.region,subnets:o.backingData.filtered.subnetPurposes,defaultSubnetTypes:f,recommendedSubnetTypes:null==(n=mn.serverGroups)?void 0:n.recommendedSubnets,showSubnetWarning:!0}),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Stack ",pt.createElement(ae,{id:"aws.serverGroup.stack"})),pt.createElement("div",{className:"col-md-7"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:o.stack||"",onChange:e=>this.stackChanged(e.target.value)}))),s.stack&&pt.createElement("div",{className:"form-group row slide-in"},pt.createElement("div",{className:"col-sm-9 col-sm-offset-2 error-message"},pt.createElement("span",null,s.stack))),pt.createElement(se,{app:r,formik:a}),!o.viewState.disableImageSelection&&pt.createElement(xt,{specifyTagByRegex:!1,account:o.credentials,digest:o.digest,imageId:o.imageId,organization:o.organization,registry:o.registry,repository:o.repository,tag:o.tag,showRegistry:!1,deferInitialization:o.deferredInitialization,onChange:this.dockerValuesChanged}),o.viewState.disableImageSelection&&h&&pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Image")," ",pt.createElement(ae,{id:"titus.deploy.imageId"})),pt.createElement("div",{className:"col-md-7 sp-padding-xs-yaxis"},o.imageId)),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Entrypoint")),pt.createElement("div",{className:"col-md-7"},pt.createElement(Ot,{type:"text",className:"form-control input-sm no-spel",name:"entryPoint"}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Traffic ",pt.createElement(ae,{id:"titus.serverGroup.traffic"})),pt.createElement("div",{className:"col-md-7"},pt.createElement("div",{className:"checkbox"},pt.createElement("label",null,pt.createElement("input",{type:"checkbox",checked:o.inService,onChange:e=>i("inService",e.target.checked),disabled:""!==o.strategy&&"custom"!==o.strategy})," ","Send client requests to new instances")))),!o.viewState.disableStrategySelection&&o.selectedProvider&&pt.createElement(ie,{command:o,onFieldChange:this.onStrategyFieldChange,onStrategyChange:this.strategyChanged}),!o.viewState.hideClusterNamePreview&&pt.createElement(oe,{createsNewCluster:u,latestServerGroupName:null==d?void 0:d.name,mode:o.viewState.mode,namePreview:m,navigateToLatestServerGroup:this.navigateToLatestServerGroup}))}}const hn=[{label:"Read and Write",value:"RW"},{label:"Read Only",value:"RO"},{label:"Write Only",value:"WO"}];class fn extends pt.Component{validate(e){const t={};return e.resources||(t.resources="CPU is required."),e.resources||(t.resources="Memory is required."),e.resources||(t.resources="Disk is required."),e.resources||(t.resources="Network is required."),t}render(){const{setFieldValue:e,values:t}=this.props.formik;return pt.createElement("div",{className:"clearfix"},pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"CPU(s)")),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.cpu,onChange:n=>e("resources",{...t.resources,cpu:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Memory (MB)")),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.memory,onChange:n=>e("resources",{...t.resources,memory:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Disk (MB)")),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.disk,onChange:n=>e("resources",{...t.resources,disk:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Network (Mbps)"),pt.createElement(ae,{id:"titus.deploy.network"})),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.networkMbps,onChange:n=>e("resources",{...t.resources,networkMbps:n}),required:!0}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Gpu"),pt.createElement(ae,{id:"titus.deploy.gpu"})),pt.createElement("div",{className:"col-md-8"},pt.createElement(le,{value:t.resources.gpu,onChange:n=>e("resources",{...t.resources,gpu:n})}))),pt.createElement("hr",null),pt.createElement("h4",null,pt.createElement("b",null,"Elastic File System Options ",pt.createElement(ae,{id:"titus.deploy.efs"}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Mount Permission "),pt.createElement(ae,{id:"titus.deploy.mountPermissions"})),pt.createElement("div",{className:"col-md-8"},pt.createElement(Mt,{value:t.efs.mountPerm,clearable:!1,options:hn,onChange:n=>e("efs",{...t.efs,mountPerm:n.value})}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"Mount Point "),pt.createElement(ae,{id:"titus.deploy.mountPoint"})),pt.createElement("div",{className:"col-md-8"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.mountPoint,onChange:n=>e("efs",{...t.efs,mountPoint:n.target.value})}))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"EFS ID "),pt.createElement(ae,{id:"titus.deploy.efsId"})),pt.createElement("div",{className:"col-md-8"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsId,onChange:n=>e("efs",{...t.efs,efsId:n.target.value})})),pt.createElement("div",{className:"col-md-offset-3 col-md-8"})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},pt.createElement("b",null,"EFS Relative Mount Point "),pt.createElement(ae,{id:"titus.deploy.efsRelativeMountPoint"})),pt.createElement("div",{className:"col-md-8"},pt.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:t.efs.efsRelativeMountPoint,onChange:n=>e("efs",{...t.efs,efsRelativeMountPoint:n.target.value})}))))}}function vn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}function yn(e){const{label:t,help:n,input:r,actions:a,validation:s={}}=e,{hidden:i,messageNode:o,category:l}=s,c=!Et(t)||!Et(n);return pt.createElement("div",{className:"TitusMapLayout flex-container-v"},c&&pt.createElement("h4",null,t," ",n),pt.createElement("div",{className:"flex-container-h baseline margin-between-lg TitusMapLayout_Contents"},r," ",a),!i&&pt.createElement(ce,{message:o,type:l}))}vn(".TitusMapLayout_Contents * {\n flex: auto;\n}\n");const bn=["disableIncreaseDesired","disableDecreaseDesired"];vn(".ServerGroupParameters .StandardFieldLayout_Label {\n min-width: 160px;\n}\n");const Cn=[{label:"System Default",value:"systemDefault"},{label:"Self Managed",value:"selfManaged"}];function En(e){const t=kt(bn,Object.keys(e.value)),n=ve(e,e=>Object.entries(e).filter(([e,t])=>!0===t).map(([e,t])=>e),e=>t.reduce((t,n)=>(t[n]=e.includes(n),t),{})),r=t.map(e=>({label:ye(e),value:e}));return pt.createElement(be,{...n,options:r})}function wn(e){const t=ve(e,e=>"true"===e,(e,t)=>t.target.checked?"true":"false");return pt.createElement(Ce,{...t})}const Sn=e=>{const{awsAccount:t,setDefaultIamProfile:n,...r}=e;return pt.createElement("div",{className:"flex-container-h baseline margin-between-md"},pt.createElement(me,{...r}),e.value?pt.createElement(pt.Fragment,null,pt.createElement("span",null,"in"),pt.createElement(Q,{account:t})):pt.createElement("button",{className:"link",style:{whiteSpace:"nowrap"},onClick:n},"Apply default value"))};class kn extends pt.Component{constructor(e){super(e)}validate(e){const t=new ue(e);t.field("iamProfile","IAM Instance Profile").required();const n=t.validateForm();return wt(Object.keys(e.constraints.soft),Object.keys(e.constraints.hard)).forEach(e=>{St(n,`constraints.soft.${e}`,`Constraint '${e}' must be either soft or hard, not both.`),St(n,`constraints.hard.${e}`,`Constraint '${e}' must be either soft or hard, not both.`)}),Object.keys(e.env||{}).filter(e=>!e.startsWith("__MapEditorDuplicateKey")).forEach(e=>{e.match(/^[A-Za-z_].*/)?e.match(/[A-Za-z_][a-zA-Z0-9_]*$/)||St(n,`env.${e}`,"Environment variable names must contain only letter, numbers, or underscores"):St(n,`env.${e}`,"Environment variable names must start with a letter or underscore")}),n}render(){const{app:e}=this.props,{setFieldValue:t,values:n}=this.props.formik,r=()=>t("iamProfile",n.viewState.defaultIamProfile);return pt.createElement("div",{className:"ServerGroupParameters"},pt.createElement(de,{name:"iamProfile",label:"IAM Instance Profile",help:pt.createElement(ae,{id:"titus.deploy.iamProfile"}),input:e=>{var t;return pt.createElement(Sn,{...e,awsAccount:null==(t=n.backingData.credentialsKeyedByAccount[n.credentials])?void 0:t.awsAccount,setDefaultIamProfile:r})}}),pt.createElement(de,{name:"capacityGroup",label:"Capacity Group",help:pt.createElement(ae,{id:"titus.deploy.capacityGroup"}),input:e=>pt.createElement(me,{...e})}),pt.createElement(de,{name:"migrationPolicy.type",label:"Migration Policy",help:pt.createElement(ae,{id:"titus.deploy.migrationPolicy"}),input:e=>pt.createElement(pe,{options:Cn,...e})}),pt.createElement(de,{name:"serviceJobProcesses",label:"Service Job Processes",input:e=>pt.createElement(En,{...e})}),pt.createElement(de,{name:"containerAttributes['titusParameter.agent.assignIPv6Address']",label:"Associate IPv6 Address (Recommended)",help:pt.createElement(ae,{id:"serverGroup.ipv6"}),input:e=>pt.createElement(wn,{...e})}),pt.createElement("hr",null),pt.createElement(ge,{value:yn},pt.createElement(de,{name:"constraints.soft",label:"Soft Constraints ",help:pt.createElement(ae,{id:"titus.deploy.softConstraints"}),input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement(de,{name:"constraints.hard",label:"Hard Constraints",help:pt.createElement(ae,{id:"titus.deploy.hardConstraints"}),input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement("hr",null),pt.createElement(de,{name:"labels",label:"Job Attributes",input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement(de,{name:"containerAttributes",label:"Container Attributes",input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})}),pt.createElement(de,{name:"env",label:"Environment Variables",input:e=>pt.createElement(he,{allowEmptyValues:!0,...e})})),e.attributes.platformHealthOnlyShowOverride&&pt.createElement(de,{name:"interestingHealthProviderNames",label:"Task Completion",input:e=>pt.createElement(fe,{...e,platformHealthType:"Titus"})}))}}const Nn={availabilityPercentageLimit:{percentageOfHealthyContainers:95},ratePercentagePerInterval:{intervalMs:6e5,percentageLimitPerInterval:5},containerHealthProviders:[{name:"eureka"}],timeWindows:[{days:["Monday","Tuesday","Wednesday","Thursday","Friday"],hourlyTimeWindows:[{startHour:10,endHour:16}],timeZone:"PST"}]},An=e=>{const t=At(Nn);return e.attributes&&e.attributes.platformHealthOnly&&(t.containerHealthProviders=[]),t};class Gn{constructor(e,t,n){this.cacheInitializer=e,this.loadBalancerReader=t,this.securityGroupReader=n}configureZones(e){e.backingData.filtered.regions=e.backingData.credentialsKeyedByAccount[e.credentials].regions}configureSubnets(e){const t={dirty:{}},n=e.backingData.filtered;if(null===e.region)return t;const r=this.getCredentials(e);n.subnetPurposes=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region}).reject({target:"elb"}).reject({purpose:null}).uniqBy("purpose").value();const a=e.subnetType||"titus (vpc0)",s=bt(e.backingData.subnets).filter({account:r.awsAccount,region:e.region,purpose:a}).map(e=>e.id).value();return e.containerAttributes["titusParameter.agent.subnets"]=s.join(","),t}attachEventHandlers(e){e.credentialsChanged=e=>{const t={dirty:{}},n=e.backingData;if(this.configureZones(e),e.credentials){e.registry=n.credentialsKeyedByAccount[e.credentials].registry,n.filtered.regions=n.credentialsKeyedByAccount[e.credentials].regions;const t=n.credentialsKeyedByAccount[e.credentials].accountId;e.containerAttributes["titusParameter.agent.accountId"]=t,n.filtered.regions.some(t=>t.name===e.region)||(e.region=null,e.regionChanged(e))}else e.region=null;return e.viewState.dirty={...e.viewState.dirty||{},...t.dirty},this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),t},e.regionChanged=e=>(this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),ke(e),{}),e.clusterChanged=e=>{e.moniker=X.getMoniker(e.application,e.stack,e.freeFormDetails),ke(e)},e.subnetChanged=e=>this.configureSubnets(e)}configureCommand(e){return e.viewState.accountChangedStream=new Ft,e.viewState.regionChangedStream=new Ft,e.viewState.groupsRemovedStream=new Ft,e.viewState.dirty={},e.onStrategyChange=(e,t)=>{""!==t.key&&"custom"!==t.key&&(e.inService=!0)},e.image=e.viewState.imageId,Pt.all([T.getCredentialsKeyedByAccount("titus"),this.securityGroupReader.getAllSecurityGroups(),s.listVpcs(),Ne.listSubnets(),T.getCredentialsKeyedByAccount("aws")]).then(([t,n,r,a,s])=>{var i,o;const l={credentialsKeyedByAccount:t,securityGroups:n,vpcs:r};Object.keys(t).forEach(e=>{const n=t[e].awsAccount,r=s[n].accountId;t[e].accountId=r}),l.credentialsKeyedByAccount=t,e.credentials&&(e.containerAttributes["titusParameter.agent.accountId"]=l.credentialsKeyedByAccount[e.credentials].accountId),l.images=[],l.accounts=Object.keys(t),l.subnets=a,l.filtered={},e.credentials.includes("${")?l.filtered.regions=[{name:e.region}]:l.filtered.regions=null!=(o=null==(i=t[e.credentials])?void 0:i.regions)?o:[],e.backingData=l,l.filtered.securityGroups=this.getRegionalSecurityGroups(e);let c=Pt.when();if(e.securityGroups&&e.securityGroups.length){const t=l.filtered.securityGroups.map(e=>e.id);wt(e.securityGroups,t).length<e.securityGroups.length&&(c=this.refreshSecurityGroups(e,!1))}return Pt.all([this.refreshLoadBalancers(e),c]).then(()=>{this.attachEventHandlers(e)})})}getVpcId(e){const t=this.getCredentials(e),n=e.backingData.vpcs.find(n=>n.name===t.awsVpc&&n.account===t.awsAccount&&n.region===this.getRegion(e)&&"aws"===n.cloudProvider);return n?n.id:null}getRegionalSecurityGroups(e){const t=e.backingData.securityGroups[this.getAwsAccount(e)]||{aws:{}};return bt(t.aws[this.getRegion(e)]).filter({vpcId:this.getVpcId(e)}).sortBy("name").value()}configureSecurityGroupOptions(e){const t=e.backingData.filtered.securityGroups;if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.backingData.filtered.securityGroups=e.securityGroups.map(e=>({name:e,id:e}));else{const n=this.getRegionalSecurityGroups(e),r="string"==typeof e.securityGroups&&e.securityGroups.includes("${");if(t&&e.securityGroups&&!r){const r=e.securityGroups.map(e=>{const n=t.find(t=>t.id===e);return n?n.name:e}),a=e.securityGroups.map(e=>{const n=t.find(t=>t.id===e||t.name===e);return n?n.name:null}).map(e=>n.find(t=>t.name===e)).filter(e=>e),s=a.map(e=>e.name),i=Ct(r,s);e.securityGroups=a.map(e=>e.id),i.length&&(e.viewState.dirty.securityGroups=i)}e.backingData.filtered.securityGroups=n.sort((t,n)=>e.securityGroups.includes(t.id)?-1:e.securityGroups.includes(n.id)?1:t.name.localeCompare(n.name))}}refreshSecurityGroups(e,t){return this.cacheInitializer.refreshCache("securityGroups").then(()=>this.securityGroupReader.getAllSecurityGroups().then(n=>{e.backingData.securityGroups=n,t||this.configureSecurityGroupOptions(e)}))}getCredentials(e){return e.backingData.credentialsKeyedByAccount[e.credentials]}getAwsAccount(e){return this.getCredentials(e).awsAccount}getRegion(e){return e.region||(e.cluster?e.cluster.region:null)}getTargetGroupNames(e){const t=this.getLoadBalancerMap(e).filter(e=>"classic"!==e.loadBalancerType);return Nt(t.map(e=>e.targetGroups.filter(e=>"ip"===e.targetType))).map(e=>e.name).sort()}getLoadBalancerMap(e){return bt(e.backingData.loadBalancers).map("accounts").flattenDeep().filter({name:this.getAwsAccount(e)}).map("regions").flattenDeep().filter({name:this.getRegion(e)}).map("loadBalancers").flattenDeep().value()}configureLoadBalancerOptions(e){const t=e.targetGroups||[];if(e.credentials.includes("${")||e.region&&e.region.includes("${"))e.targetGroups=t,e.backingData.filtered.targetGroups=t;else{const n=this.getTargetGroupNames(e);if(t&&e.targetGroups){const r=wt(n,t),a=Ct(r,t);e.targetGroups=wt(n,r),a&&a.length>0?e.viewState.dirty.targetGroups=a:delete e.viewState.dirty.targetGroups}e.backingData.filtered.targetGroups=n}}refreshLoadBalancers(e){return this.loadBalancerReader.listLoadBalancers("aws").then(t=>{e.backingData.loadBalancers=t,this.configureLoadBalancerOptions(e)})}}Gn.$inject=["cacheInitializer","loadBalancerReader","securityGroupReader"];const Tn="spinnaker.titus.serverGroup.configure.service";t(Tn,[Ee,we,Se]).service("titusServerGroupConfigurationService",Gn);const In=[{field:"availabilityPercentageLimit",label:"Availability Percentage Limit",value:0,description:"\n Lets you specify the required percentage of tasks in a healthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:Nn.availabilityPercentageLimit,fieldComponent:e=>pt.createElement(de,{name:"disruptionBudget.availabilityPercentageLimit.percentageOfHealthyContainers",label:"Percentage of Healthy Containers",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,disabled:e.isDisabled}),pt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))})},{field:"relocationLimit",label:"Relocation Limit",value:1,description:"\n Lets you specify the maximum number of times a task can be relocated.\n Should only be used with batch tasks, which have a maximum execution time.\n ",defaultValues:{limit:1},fieldComponent:()=>pt.createElement(de,{name:"disruptionBudget.relocationLimit.limit",label:"Limit",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(tasks)"}))})},{field:"unhealthyTasksLimit",label:"Unhealthy Tasks Limit",value:2,description:"\n Lets you specify the maximum allowed amount of tasks in an unhealthy state.\n Tasks will not be terminated by the eviction service if this limit would be violated.\n ",defaultValues:{limitOfUnhealthyContainers:1},fieldComponent:()=>pt.createElement(de,{name:"disruptionBudget.unhealthyTasksLimit.limitOfUnhealthyContainers",label:"Limit of Unhealthy Containers",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(integer)"}))})},{field:"selfManaged",label:"Self Managed",value:3,description:"\n Requires that you orchestrate custom termination logic.\n If the containers are not terminated within the configured amount of time,\n the system default migration policy is used instead.\n ",defaultValues:{relocationTimeMs:864e5},fieldComponent:()=>pt.createElement(de,{name:"disruptionBudget.selfManaged.relocationTimeMs",label:"Relocation Time",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(milliseconds)"}))})}],Dn=[{field:"rateUnlimited",label:"Unlimited",value:0,description:"\n No limits on how many containers in a job may be relocated, provided the other disruption budget constraints\n are not violated.\n ",defaultValues:!0},{field:"ratePercentagePerInterval",label:"Rate Percentage Per Interval",value:1,description:"\n Percentage of containers that can be relocated within a time interval.\n ",defaultValues:Nn.ratePercentagePerInterval,fieldComponent:e=>pt.createElement(pt.Fragment,null,pt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.intervalMs",label:"Interval",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,disabled:e.isDisabled}),pt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),pt.createElement(de,{name:"disruptionBudget.ratePercentagePerInterval.percentageLimitPerInterval",label:"Percentage Per Interval",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,disabled:e.isDisabled}),pt.createElement(ae,{expand:!0,content:"0.0-100.0 (double)"}))}))},{field:"ratePerInterval",label:"Rate Per Interval",value:2,description:"\n Limit number of relocations within a given time interval.\n ",defaultValues:{intervalMs:6e4,limitPerInterval:2},fieldComponent:()=>pt.createElement(pt.Fragment,null,pt.createElement(de,{name:"disruptionBudget.ratePerInterval.intervalMs",label:"Interval",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(milliseconds)"}))}),pt.createElement(de,{name:"disruptionBudget.ratePerInterval.limitPerInterval",label:"Limit Per Interval",input:e=>pt.createElement("div",null,pt.createElement(Ae,{...e}),pt.createElement(ae,{expand:!0,content:"(tasks)"}))}))}],xn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];class Pn extends pt.Component{constructor(e){super(e),this.configureNewWindow=()=>{this.setState({addingNewWindow:!0})},this.addNewWindow=e=>{const{values:t,setFieldValue:n}=this.props.formik,{days:r,startHour:a,endHour:s,timeZone:i}=e,o={days:r,hourlyTimeWindows:[{startHour:a,endHour:s}],timeZone:i};n("disruptionBudget.timeWindows",t.disruptionBudget.timeWindows.concat(o)),this.setState({addingNewWindow:!1})},this.CurrentWindows=()=>{const{disruptionBudget:e}=this.props.formik.values,{isDisabled:t}=this.props;if(!e)return null;const{timeWindows:n}=e;return pt.createElement("div",{className:"sp-formItem"},pt.createElement("div",{className:"sp-formItem__left"}),pt.createElement("div",{className:"sp-formItem__right"},n.map((e,n)=>e.hourlyTimeWindows.map((r,a)=>pt.createElement("div",{className:"sp-margin-l-yaxis sp-margin-m-right",style:{display:"inline-block"},key:`${n}.${a}`},pt.createElement("div",{key:`${n}.${a}`,className:"horizontal center top sp-padding-m-yaxis sp-padding-s-xaxis",style:{backgroundColor:"var(--color-dovegray)",borderRadius:"4px"}},pt.createElement("div",{className:"sp-padding-m-right",style:{color:"var(--color-text-on-dark)",fontSize:"12px"}},pt.createElement("div",null,pt.createElement("b",null,e.days.map(e=>e.substr(0,3)).join(", "))),pt.createElement("div",null,pt.createElement("em",null,r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))),!t&&pt.createElement("a",{className:"clickable",style:{color:"var(--color-text-on-dark)"},onClick:()=>this.removeWindow(n,a)},pt.createElement("span",{className:"glyphicon glyphicon-remove"}))))))))},this.NewWindowComponent=()=>this.state.addingNewWindow?pt.createElement(Ge,{initialValues:{days:[],startHour:10,endHour:16,timeZone:yt(this.props.formik.values.disruptionBudget,"timeWindows[0].timeZone","PST")},onSubmit:this.addNewWindow,render:e=>pt.createElement(pt.Fragment,null,pt.createElement(de,{name:"days",label:"Define a New Window",input:e=>pt.createElement(be,{...e,stringOptions:xn})}),pt.createElement(de,{name:"startHour",label:"Start",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,min:0,max:e.values.endHour}),pt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),pt.createElement(de,{name:"endHour",label:"End",input:t=>pt.createElement("div",null,pt.createElement(Ae,{...t,min:e.values.startHour,max:23}),pt.createElement(ae,{expand:!0,content:"hour (0-24)"}))}),pt.createElement(de,{name:"timeZone",label:"Timezone",input:e=>pt.createElement(Te,{...e,clearable:!1,stringOptions:["PST","UTC"]})}),pt.createElement("div",{className:"sp-formItem"},pt.createElement("div",{className:"sp-formItem__left"}),pt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},pt.createElement("button",{className:"primary",type:"submit",onClick:()=>this.addNewWindow(e.values)}," ","Add Window"))))}):pt.createElement("div",{className:"sp-formItem"},pt.createElement("div",{className:"sp-formItem__left"}),pt.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},pt.createElement("a",{className:"button primary",onClick:this.configureNewWindow},pt.createElement("i",{className:"fas fa-plus-circle"})," Define New Window"))),this.state={addingNewWindow:!1}}removeWindow(e,t){const{values:n,setFieldValue:r}=this.props.formik,{timeWindows:a}=n.disruptionBudget,s=a[e];if(1===s.hourlyTimeWindows.length)r("disruptionBudget.timeWindows",a.filter(e=>e!==s));else{const n=s.hourlyTimeWindows[t];r(`disruptionBudget.timeWindows[${e}].hourlyTimeWindows`,s.hourlyTimeWindows.filter(e=>e!==n))}}render(){const{CurrentWindows:e,NewWindowComponent:t}=this,{isDisabled:n}=this.props;return pt.createElement(pt.Fragment,null,pt.createElement(e,null),!n&&pt.createElement(t,null))}}const On=()=>pt.createElement("p",null,"The Job Disruption Budget is part of the job descriptor, and defines the behavior of how containers of the job can be relocated."," ",pt.createElement("a",{href:"http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/",target:"_blank"},"Read the full documentation"));class Ln extends pt.Component{constructor(e){super(e),this.timeWindowOptions=[{field:"timeWindows",label:"Anytime",value:0,defaultValues:void 0},{field:"timeWindows",label:"Specific Time Windows",value:1,defaultValues:Nn.timeWindows}],this.toggleUseDefault=()=>{this.state.usingDefault||this.setToDefaultBudget(),this.setState({usingDefault:!this.state.usingDefault})},this.componentDidUpdate=e=>{this.props.onStageChange&&!Gt(e.formik.values.disruptionBudget,this.props.formik.values.disruptionBudget)&&this.props.onStageChange(this.props.formik.values.disruptionBudget)},this.optionTypeChanged=(e,t)=>{t.filter(t=>t!==e).forEach(e=>this.props.formik.setFieldValue("disruptionBudget."+e.field,void 0)),this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)},this.policyTypeChanged=e=>this.optionTypeChanged(e,In),this.rateTypeChanged=e=>this.optionTypeChanged(e,Dn),this.timeWindowsChanged=e=>{this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)};const{disruptionBudget:t}=e.formik.values;this.state={usingDefault:!t||Gt(t,An(e.app))},this.state.usingDefault&&this.setToDefaultBudget()}setToDefaultBudget(){this.props.formik.setFieldValue("disruptionBudget",An(this.props.app))}getSelectionFromFields(e){const{disruptionBudget:t}=this.props.formik.values;return t?e.find(e=>!!t[e.field]):e[0]}getTimeWindowSelection(){return yt(this.props.formik.values,"disruptionBudget.timeWindows")?this.timeWindowOptions.find(e=>e.defaultValues):this.timeWindowOptions.find(e=>!e.defaultValues)}toggleHealthProvider(e){const{values:t,setFieldValue:n}=this.props.formik,r=t.disruptionBudget.containerHealthProviders,a=r.find(t=>t.name===e);n("disruptionBudget.containerHealthProviders",a?r.filter(e=>e!==a):r.concat({name:e}))}render(){var e;const{runJobView:t}=this.props,{usingDefault:n}=this.state,r=this.props.formik.values.disruptionBudget||An(this.props.app),a=this.getSelectionFromFields(In),s=a.fieldComponent,i=this.getSelectionFromFields(Dn),o=null==i?void 0:i.fieldComponent,l=this.getTimeWindowSelection(),c=(null!=(e=r.containerHealthProviders)?e:[]).map(e=>e.name),u=!!r.selfManaged,d=!t||t&&!n;return pt.createElement(ge,{value:Ie},pt.createElement("div",{className:"form-horizontal sp-margin-l-xaxis"},!t&&pt.createElement(On,null),pt.createElement(de,{name:"usingDefault",input:()=>pt.createElement(Ce,{checked:n,onChange:this.toggleUseDefault,text:pt.createElement("b",null,"Use Netflix Defaults")}),layout:t?({input:e})=>pt.createElement(pt.Fragment,null,e):void 0}),d&&pt.createElement("div",{style:{opacity:n?.5:1}},pt.createElement("div",{className:"sp-formGroup"},pt.createElement("div",{className:"groupHeader"},pt.createElement(de,{name:"policyType",label:"Policy",input:e=>pt.createElement("div",null,pt.createElement(De,{...e,menuContainerStyle:{height:"300px"},className:"Select-menu-long",style:{width:"300px"},disabled:n,clearable:!1,onChange:this.policyTypeChanged,value:a,options:In}),pt.createElement(ae,{expand:!0,content:"A job policy defines container relocation rules and constraints"}))})),pt.createElement("div",{className:"sp-formItem"},pt.createElement("p",null,a.description)),s&&pt.createElement(s,{isDisabled:n})),!u&&pt.createElement("div",null,pt.createElement("div",{className:""+(r.rateUnlimited?"":"sp-formGroup")},pt.createElement("div",{className:""+(r.rateUnlimited?"":"groupHeader")},pt.createElement(de,{name:"rates",label:"Rates",input:e=>pt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.rateTypeChanged,value:i,options:Dn})})),pt.createElement("div",{className:"sp-formItem"},pt.createElement("p",null,i.description)),o&&pt.createElement(o,{isDisabled:n})),pt.createElement("div",{className:""+(r.timeWindows?"sp-formGroup":"")},pt.createElement("div",{className:""+(r.timeWindows?"groupHeader":"")},pt.createElement(de,{name:"timeWindows",label:"When Can Disruption Occur?",input:e=>pt.createElement(De,{...e,style:{width:"300px"},disabled:n,clearable:!1,onChange:this.timeWindowsChanged,value:l,options:this.timeWindowOptions})})),r.timeWindows&&pt.createElement(Pn,{isDisabled:n,formik:this.props.formik})),pt.createElement(de,{name:"healthProviders",label:"Container Health Provider",input:()=>pt.createElement("div",null,pt.createElement(Ce,{checked:c.includes("eureka"),onChange:()=>this.toggleHealthProvider("eureka"),text:"Discovery",disabled:n}))})))))}}class Mn extends pt.Component{constructor(e){super(e),this.credentialsKeyedByAccount={},this.defaultIamProfile="",this.state={credentials:[],regions:[],loaded:!1},this.accountChanged=e=>{St(this.props.stage,"account",e),this.stageFieldChanged("credentials",e),this.setRegistry(e),this.updateRegions(e);const t="test"===this.credentialsKeyedByAccount[e].environment?"true":"false";this.associateIPv6AddressChanged(t)},this.dockerChanged=e=>{const{imageId:t,...n}=e;Object.assign(this.props.stage,n),t?this.props.stage.cluster.imageId=t:delete this.props.stage.cluster.imageId,this.props.stageFieldUpdated(),this.forceUpdate()},this.stageFieldChanged=(e,t)=>{St(this.props.stage,e,t),this.props.stageFieldUpdated(),this.forceUpdate()},this.mapChanged=(e,t)=>{this.stageFieldChanged(e,t)},this.groupsChanged=e=>{this.stageFieldChanged("cluster.securityGroups",e),this.forceUpdate()},this.associateIPv6AddressChanged=e=>{const t={...this.props.stage.cluster.containerAttributes||{},"titusParameter.agent.assignIPv6Address":e};this.mapChanged("cluster.containerAttributes",t)},this.disruptionBudgetChanged=e=>{const{stage:t,stageFieldUpdated:n}=this.props;t.cluster.disruptionBudget=e,n()};const{application:t,stage:n}=e;n.cluster=n.cluster||{},n.waitForCompletion=void 0===n.waitForCompletion||n.waitForCompletion,n.cluster.imageId&&!n.cluster.imageId.includes("${")&&Object.assign(n,Dt.splitImageId(n.cluster.imageId)),!n.credentials&&t.defaultCredentials.titus&&(n.credentials=t.defaultCredentials.titus),n.cluster.capacity||(n.cluster.capacity={min:1,max:1,desired:1});const r=mn.defaults.iamProfile||"{{application}}InstanceProfile";this.defaultIamProfile=r.replace("{{application}}",t.name);const a={application:t.name,containerAttributes:{},env:{},labels:{},resources:{cpu:1,disk:1e4,gpu:0,memory:512,networkMbps:128},retries:0,runtimeLimitSecs:3600,securityGroups:[]};n.isNew&&(a.iamProfile=this.defaultIamProfile),Tt(n.cluster,a),n.cloudProvider=n.cloudProvider||"titus",n.deferredInitialization=!0}setRegistry(e){e&&(this.props.stage.registry=this.credentialsKeyedByAccount[e].registry)}updateRegions(e){let t;e?(t=this.credentialsKeyedByAccount[e].regions,t.map(e=>e.name).every(e=>e!==this.props.stage.cluster.region)&&(delete this.props.stage.cluster.region,this.props.stageFieldUpdated())):t=[],this.setState({regions:t})}componentDidMount(){const{stage:e}=this.props;T.getCredentialsKeyedByAccount("titus").then(t=>{this.credentialsKeyedByAccount=t;const n=Object.keys(t);e.credentials=e.credentials||n[0],this.setRegistry(e.credentials),this.updateRegions(e.credentials),this.setState({credentials:n,loaded:!0});const r="test"===this.credentialsKeyedByAccount[e.credentials].environment&&void 0===e.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"]?"true":"false";this.associateIPv6AddressChanged(r)})}render(){var e,t;const{application:n,stage:r}=this.props,{credentials:a,loaded:s,regions:i}=this.state,o=(this.credentialsKeyedByAccount[r.credentials]||{awsAccount:""}).awsAccount,l=(null==(e=r.cluster.entryPointList)?void 0:e.length)?r.cluster.entryPointList.join(","):r.cluster.entryPoint,c=(null==(t=r.cluster.cmdList)?void 0:t.length)?r.cluster.cmdList.join(","):r.cluster.cmd;return pt.createElement("div",{className:"form-horizontal"},pt.createElement("div",{className:"form-group"},pt.createElement("label",{className:"col-md-3 sm-label-right"},pt.createElement("span",{className:"label-text"},"Account")),pt.createElement("div",{className:"col-md-5"},pt.createElement(ne,{value:r.credentials,onChange:e=>this.accountChanged(e.target.value),accounts:a,provider:"titus"}),void 0!==r.credentials&&pt.createElement("div",{className:"small"},"Uses resources from the Amazon account ",pt.createElement(Q,{account:o})))),pt.createElement(re,{labelColumns:3,fieldColumns:5,component:r.cluster,field:"region",account:r.credentials,regions:i,onChange:e=>this.stageFieldChanged("region",e)}),pt.createElement(xt,{specifyTagByRegex:!1,account:r.credentials,digest:r.digest,imageId:r.cluster.imageId,organization:r.organization,registry:r.registry,repository:r.repository,tag:r.tag,showRegistry:!1,onChange:this.dockerChanged,deferInitialization:r.deferredInitialization}),pt.createElement(xe,{label:"CPU(s)"},pt.createElement(le,{value:r.cluster.resources.cpu,onChange:e=>this.stageFieldChanged("cluster.resources.cpu",e),required:!0})),pt.createElement(xe,{label:"Memory (MB)"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.memory",e),value:r.cluster.resources.memory,required:!0})),pt.createElement(xe,{label:"Disk (MB)"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.disk",e),value:r.cluster.resources.disk,required:!0})),pt.createElement(xe,{label:"Network (Mbps)",helpKey:"titus.deploy.network"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.networkMbps",e),value:r.cluster.resources.networkMbps,required:!0})),pt.createElement(xe,{label:"GPU(s)",helpKey:"titus.deploy.gpu"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.resources.gpu",e),value:r.cluster.resources.gpu,required:!0})),pt.createElement(xe,{label:"Entrypoint(s)",helpKey:"titus.deploy.entrypoint"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:l,onChange:e=>this.stageFieldChanged("cluster.entryPointList",e.target.value.split(","))})),pt.createElement(xe,{label:"Command(s)",helpKey:"titus.deploy.command"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:c,onChange:e=>this.stageFieldChanged("cluster.cmdList",e.target.value.split(","))})),pt.createElement(xe,{label:"Runtime Limit (Seconds)",helpKey:"titus.deploy.runtimeLimitSecs"},pt.createElement(le,{value:r.cluster.runtimeLimitSecs,onChange:e=>this.stageFieldChanged("cluster.runtimeLimitSecs",e),min:1,required:!0})),pt.createElement(xe,{label:"Retries",helpKey:"titus.deploy.retries"},pt.createElement(le,{onChange:e=>this.stageFieldChanged("cluster.retries",e),value:r.cluster.retries,min:0,required:!0})),pt.createElement(xe,{label:"Property File",helpKey:"titus.deploy.propertyFile"},pt.createElement("input",{type:"text",className:"form-control input-sm",onChange:e=>this.stageFieldChanged("propertyFile",e.target.value),value:r.propertyFile})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-9 col-md-offset-1"},pt.createElement("div",{className:"checkbox"},pt.createElement("label",null,pt.createElement("input",{type:"checkbox",checked:r.showAdvancedOptions,onChange:e=>this.stageFieldChanged("showAdvancedOptions",e.target.checked)}),pt.createElement("strong",null,"Show Advanced Options"))))),pt.createElement("div",{className:""+(!0===r.showAdvancedOptions?"collapse.in":"collapse")},pt.createElement("div",{className:"form-group"},pt.createElement("label",{className:"col-md-3 sm-label-right"},pt.createElement("span",{className:"label-text"},"IAM Instance Profile")," ",pt.createElement(ae,{id:"titus.deploy.iamProfile"})),pt.createElement("div",{className:"col-md-4"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.iamProfile,placeholder:this.defaultIamProfile,required:!0,onChange:e=>this.stageFieldChanged("cluster.iamProfile",e.target.value)}),!r.isNew&&!r.cluster.iamProfile&&pt.createElement("a",{className:"small clickable",onClick:()=>this.stageFieldChanged("cluster.iamProfile",this.defaultIamProfile)},"Use suggested default")),pt.createElement("div",{className:"col-md-1 small",style:{whiteSpace:"nowrap",paddingLeft:"0px",paddingTop:"7px"}},"in ",pt.createElement(Q,{account:o}))),pt.createElement(xe,{label:"Capacity Group",fieldColumns:4,helpKey:"titus.job.capacityGroup"},pt.createElement("input",{type:"text",className:"form-control input-sm",value:r.cluster.capacityGroup||"",onChange:e=>this.stageFieldChanged("cluster.capacityGroup",e.target.value)})),pt.createElement(xe,{label:D.get("Firewalls"),helpKey:"titus.job.securityGroups"},(!r.credentials||!r.cluster.region)&&pt.createElement("div",null,"Account and region must be selected before ",D.get("firewalls")," can be added"),s&&r.credentials&&r.cluster.region&&pt.createElement(dn,{account:r.credentials,region:r.cluster.region,command:r,amazonAccount:o,hideLabel:!0,groupsToEdit:r.cluster.securityGroups,onChange:this.groupsChanged})),pt.createElement(xe,{label:"Associate IPv6 Address (Recommended)",helpKey:"serverGroup.ipv6"},pt.createElement(wn,{value:r.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"],onChange:e=>this.associateIPv6AddressChanged(e.target.value)})),pt.createElement(xe,{label:"Disruption Budget",helpKey:"titus.disruptionbudget.description"},pt.createElement(Ge,{initialValues:r.cluster,onSubmit:()=>{},render:e=>pt.createElement(Ln,{formik:e,app:n,runJobView:!0,onStageChange:this.disruptionBudgetChanged})})),pt.createElement(xe,{label:"Job Attributes (optional)"},pt.createElement(Pe,{model:r.cluster.labels,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.labels",e)})),pt.createElement(xe,{label:"Container Attributes (optional)"},pt.createElement(Pe,{model:r.cluster.containerAttributes,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.containerAttributes",e)})),pt.createElement(xe,{label:"Environment Variables (optional)"},pt.createElement(Pe,{model:r.cluster.env,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.env",e)}))),pt.createElement(xe,{label:"Wait for results",helpKey:"titus.job.waitForCompletion"},pt.createElement("input",{type:"checkbox",className:"input-sm",name:"waitForCompletion",checked:r.waitForCompletion,onChange:e=>this.stageFieldChanged("waitForCompletion",e.target.checked)})))}}J.pipeline.registerStage({provides:"runJob",useBaseProvider:!0,restartable:!0,key:"runJob",cloudProvider:"titus",providesFor:["aws","titus"],component:Mn,executionDetailsSections:[un,Oe],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],supportsCustomTimeout:!0,validators:[{type:"requiredField",fieldName:"cluster.iamProfile"},{type:"requiredField",fieldName:"cluster.imageId"},{type:"requiredField",fieldName:"credentials"},{type:"requiredField",fieldName:"cluster.region"},{type:"requiredField",fieldName:"cluster.resources.cpu"},{type:"requiredField",fieldName:"cluster.resources.gpu"},{type:"requiredField",fieldName:"cluster.resources.memory"},{type:"requiredField",fieldName:"cluster.resources.disk"},{type:"requiredField",fieldName:"cluster.runtimeLimitSecs"}]});const Fn="spinnaker.titus.pipeline.stage.scaleDownClusterStage";t(Fn,[]).config(function(){J.pipeline.registerStage({provides:"scaleDownCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",executionConfigSections:["scaleDownClusterConfig","taskStatus"],accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"remainingFullSizeServerGroups",fieldLabel:"Keep [X] full size Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],strategy:!0})}).controller("titusScaleDownClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.state.accounts=!0}),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.remainingFullSizeServerGroups&&(t.remainingFullSizeServerGroups=1),void 0===t.allowScaleDownActive&&(t.allowScaleDownActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.preferLargerOverNewer&&(t.preferLargerOverNewer="false"),t.preferLargerOverNewer=t.preferLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html",'<div ng-controller="titusScaleDownClusterStageCtrl as scaleDownClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Scale Down Options">\n <div class="form-inline">\n <p>\n Keep the\n <input\n type="number"\n min="0"\n required\n ng-model="stage.remainingFullSizeServerGroups"\n class="form-control input-sm"\n style="width: 50px"\n />\n <select class="form-control input-sm" ng-model="stage.preferLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n {{scaleDownClusterStageCtrl.pluralize(\'server group\', stage.remainingFullSizeServerGroups)}} at current size.\n </p>\n <p>The remaining server groups will be scaled down to zero instances.</p>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowScaleDownActive" />\n Allow scale down of active server groups\n </label>\n </div>\n </div>\n</div>\n')}]);const zn="spinnaker.titus.pipeline.stage.shrinkClusterStage";t(zn,[]).config(function(){J.pipeline.registerStage({provides:"shrinkCluster",cloudProvider:"titus",templateUrl:"titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",accountExtractor:e=>[e.context.credentials],configAccountExtractor:e=>[e.credentials],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"shrinkToSize",fieldLabel:"shrink to [X] Server Groups"},{type:"requiredField",fieldName:"regions"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]})}).controller("titusShrinkClusterStageCtrl",["$scope",function(e){const t=e.stage;e.state={accounts:!1,regionsLoaded:!1},T.listAccounts("titus").then(function(t){e.accounts=t,e.state.accounts=!0}),t.regions=t.regions||[],t.cloudProvider="titus",!t.credentials&&e.application.defaultCredentials.titus&&(t.credentials=e.application.defaultCredentials.titus),!t.regions.length&&e.application.defaultRegions.titus&&t.regions.push(e.application.defaultRegions.titus),void 0===t.shrinkToSize&&(t.shrinkToSize=1),void 0===t.allowDeleteActive&&(t.allowDeleteActive=!1),this.pluralize=function(e,t){return 1===t?e:e+"s"},void 0===t.retainLargerOverNewer&&(t.retainLargerOverNewer="false"),t.retainLargerOverNewer=t.retainLargerOverNewer.toString()}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html",'<div ng-controller="titusShrinkClusterStageCtrl as shrinkClusterStageCtrl" class="form-horizontal">\n <div ng-if="!pipeline.strategy">\n <account-region-cluster-selector application="application" component="stage" accounts="accounts">\n </account-region-cluster-selector>\n </div>\n <stage-config-field label="Shrink Options">\n <div class="form-inline">\n Shrink to\n <input\n type="number"\n min="0"\n required\n ng-model="stage.shrinkToSize"\n class="form-control input-sm"\n style="width: 50px"\n />\n {{shrinkClusterStageCtrl.pluralize(\'server group\', stage.shrinkToSize)}}, keeping the\n <select class="form-control input-sm" ng-model="stage.retainLargerOverNewer" style="width: 100px">\n <option value="true">largest</option>\n <option value="false">newest</option>\n </select>\n </div>\n </stage-config-field>\n <div class="form-group">\n <div class="col-md-offset-3 col-md-6 checkbox">\n <label>\n <input type="checkbox" ng-model="stage.allowDeleteActive" />\n Allow deletion of active server groups\n </label>\n </div>\n </div>\n <stage-platform-health-override application="application" stage="stage" platform-health-type="\'Titus\'">\n </stage-platform-health-override>\n</div>\n')}]);const jn="spinnaker.titus.react";t(jn,[]).run(["$injector",function(e){Zt.initialize(e)}]);const Bn="spinnaker.titus.securityGroup.reader";t(Bn,[]).factory("titusSecurityGroupReader",function(){return{resolveIndexedSecurityGroup:function(e,t,n){return e[t.awsAccount][t.region][n]}}});const Rn="spinnaker.titus.serverGroupCommandBuilder.service";e.module(Rn,[]).factory("titusServerGroupCommandBuilder",["$q",function(t){function n(e){return(mn.defaults.iamProfile||"{{application}}InstanceProfile").replace("{{application}}",e.name)}function r(e,r){const a=(r=r||{}).account||mn.defaults.account,s=r.region||mn.defaults.region,i=r.zone||mn.defaults.zone,o=n(e),l={application:e.name,credentials:a,region:s,zone:i,network:"default",inService:!0,resources:{cpu:1,networkMbps:128,disk:1e4,memory:512,gpu:0},efs:{mountPerm:"RW"},strategy:"",capacity:{min:1,max:1,desired:1},targetHealthyDeployPercentage:100,env:{},labels:{},containerAttributes:{"titusParameter.agent.assignIPv6Address":"true"},cloudProvider:"titus",selectedProvider:"titus",iamProfile:o,constraints:{hard:{},soft:{}},serviceJobProcesses:{},viewState:{defaultIamProfile:o,useSimpleCapacity:!0,usePreferredZones:!0,mode:r.mode||"create"},securityGroups:[],imageId:r.imageId,migrationPolicy:{type:"systemDefault"},digest:"",organization:"",tag:"",registry:"",repository:""};return t.when(l)}return{buildNewServerGroupCommand:r,buildNewServerGroupCommandForPipeline:function(){return t.when({viewState:{requiresTemplateSelection:!0}})},buildServerGroupCommandFromExisting:function(e,r,a){a=a||"clone";const s=X.parseServerGroupName(r.name),i="test"===r.awsAccount,o=r.containerAttributes&&void 0!==r.containerAttributes["titusParameter.agent.assignIPv6Address"]?r.containerAttributes["titusParameter.agent.assignIPv6Address"]:i?"true":"false",l={...r.containerAttributes,"titusParameter.agent.assignIPv6Address":o},c={application:e.name,disruptionBudget:r.disruptionBudget,strategy:"",stack:s.stack,freeFormDetails:s.freeFormDetails,account:r.account,credentials:r.account,region:r.region,env:r.env,labels:r.labels,containerAttributes:l,entryPoint:r.entryPoint,iamProfile:r.iamProfile,capacityGroup:r.capacityGroup,migrationPolicy:r.migrationPolicy?r.migrationPolicy:{type:"systemDefault"},securityGroups:r.securityGroups||[],constraints:{hard:r.constraints&&r.constraints.hard||{},soft:r.constraints&&r.constraints.soft||{}},serviceJobProcesses:Object.assign({},r.serviceJobProcesses),inService:!r.disabled,source:{account:r.account,region:r.region,asgName:r.name},resources:{cpu:r.resources.cpu,gpu:r.resources.gpu,memory:r.resources.memory,disk:r.resources.disk,networkMbps:r.resources.networkMbps},targetGroups:r.targetGroups,capacity:{min:r.capacity.min,max:r.capacity.max,desired:r.capacity.desired},targetHealthyDeployPercentage:100,cloudProvider:"titus",selectedProvider:"titus",viewState:{defaultIamProfile:n(e),useSimpleCapacity:r.capacity.min===r.capacity.max,mode:a},organization:"",tag:"",digest:"",registry:"",repository:""};return r.efs?c.efs={mountPoint:r.efs.mountPoint,mountPerm:r.efs.mountPerm,efsId:r.efs.efsId}:c.efs={mountPerm:"RW"},"editPipeline"!==a&&(c.imageId=r.image.dockerImageName+":"+(r.image.dockerImageVersion?r.image.dockerImageVersion:r.image.dockerImageDigest)),t.when(c)},buildServerGroupCommandFromPipeline:function(t,a){const s=At(a),i={account:s.account,imageId:s.imageId,region:s.region};return r(t,i).then(function(r){r.constraints={hard:a.constraints&&a.constraints.hard||a.hardConstraints&&a.hardConstraints.reduce((e,t)=>St(e,t,"true"),{})||{},soft:a.constraints&&a.constraints.soft||a.softConstraints&&a.softConstraints.reduce((e,t)=>St(e,t,"true"),{})||{}},delete s.hardConstraints,delete s.softConstraints;const i={disableImageSelection:!0,useSimpleCapacity:a.capacity.min===a.capacity.max,mode:"editPipeline",submitButtonLabel:"Done",defaultIamProfile:n(t)},o={region:s.region,credentials:s.account,iamProfile:s.iamProfile,viewState:i};s.strategy=s.strategy||"";return e.extend({},r,s,o)})}}}]);const Vn="spinnaker.serverGroup.configure.titus";t(Vn,[Tn]);const Wn=class e extends pt.Component{constructor(e){super(e),this._isUnmounted=!1,this.templateSelected=()=>{this.setState({requiresTemplateSelection:!1}),this.configureCommand()},this.onTaskComplete=()=>{this.props.application.serverGroups.refresh(),this.props.application.serverGroups.onNextRefresh(null,this.onApplicationRefresh)},this.onApplicationRefresh=()=>{if(this._isUnmounted)return;const{command:e}=this.props,{taskMonitor:t}=this.state,n=t.task.execution.stages.find(e=>"cloneServerGroup"===e.type);if(n&&n.context["deploy.server.groups"]){const t=n.context["deploy.server.groups"][e.region];if(t){const n={serverGroup:t,accountId:e.credentials,region:e.region,provider:"titus"};let r="^.^.^.clusters.serverGroup";I.$state.includes("**.clusters.serverGroup")&&(r="^.serverGroup"),I.$state.includes("**.clusters.cluster.serverGroup")&&(r="^.^.serverGroup"),I.$state.includes("**.clusters")&&(r=".serverGroup"),I.$state.go(r,n)}}},this.configureCommand=()=>{const{command:e}=this.props;Zt.titusServerGroupConfigurationService.configureCommand(e).then(()=>{Zt.titusServerGroupConfigurationService.configureSubnets(e),e.credentials.includes("${")||(e.registry=(e.backingData.credentialsKeyedByAccount[e.credentials]||{}).registry),this.setState({loaded:!0,requiresTemplateSelection:!1})})},this.submit=e=>{const t="editPipeline"===e.viewState.mode||"createPipeline"===e.viewState.mode;let n=e;e.disruptionBudget.timeWindows&&!e.disruptionBudget.timeWindows.length&&delete e.disruptionBudget.timeWindows,Gt(An(this.props.application),e.disruptionBudget)&&(n={...e,disruptionBudget:void 0}),t?this.props.closeModal&&this.props.closeModal(n):this.state.taskMonitor.submit(()=>I.serverGroupWriter.cloneServerGroup(n,this.props.application))},this.getLoadBalancerNote=e=>pt.createElement("div",{className:"form-group small",style:{marginTop:"20px"}},pt.createElement("div",{className:"col-md-8 col-md-offset-3"},pt.createElement("p",null,"Only target groups with target type ",pt.createElement("em",null,"ip")," are supported in Titus. It is not possible to re-use target groups of target type ",pt.createElement("em",null,"instance")," used by Amazon instances."," "),void 0!==e.backingData&&void 0!==e.backingData.credentialsKeyedByAccount&&void 0!==e.credentials&&pt.createElement("p",null,"Uses target groups from the Amazon account"," ",pt.createElement(Q,{account:e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount})))),this.getSecurityGroupNote=e=>{const t=e.backingData&&e.backingData.credentialsKeyedByAccount&&e.backingData.credentialsKeyedByAccount[e.credentials]&&e.backingData.credentialsKeyedByAccount[e.credentials].awsAccount;return t&&void 0!==e.credentials?pt.createElement("div",{className:"form-group small"},pt.createElement("div",{className:"col-md-9 col-md-offset-3"},"Uses ",D.get("firewalls")," from the Amazon account ",pt.createElement(Q,{account:t}))):null};const t=yt(e,"command.viewState.requiresTemplateSelection",!1);t||this.configureCommand(),this.state={firewallsLabel:D.get("Firewalls"),loaded:!1,requiresTemplateSelection:t,taskMonitor:new Le({application:e.application,title:"Creating your server group",modalInstance:Le.modalInstanceEmulation(()=>this.props.dismissModal()),onTaskComplete:this.onTaskComplete})}}static show(t){return Me.show(e,t,{dialogClassName:"wizard-modal modal-lg"})}componentWillUnmount(){this._isUnmounted=!0,this.refreshUnsubscribe&&this.refreshUnsubscribe()}render(){const{application:e,command:t,dismissModal:n,title:r}=this.props,{loaded:a,taskMonitor:s,requiresTemplateSelection:i}=this.state;return i?pt.createElement(Fe,{application:e,cloudProvider:"titus",command:t,onDismiss:n,onTemplateSelected:this.templateSelected}):pt.createElement(ze,{heading:r,initialValues:t,loading:!a,taskMonitor:s,dismissModal:n,closeModal:this.submit,submitButtonLabel:t.viewState.submitButtonLabel,render:({formik:t,nextIdx:n,wizard:r})=>pt.createElement(pt.Fragment,null,pt.createElement(je,{label:"Basic Settings",wizard:r,order:n(),render:({innerRef:n})=>pt.createElement(gn,{ref:n,formik:t,app:e})}),pt.createElement(je,{label:"Resources",wizard:r,order:n(),render:({innerRef:e})=>pt.createElement(fn,{ref:e,formik:t})}),pt.createElement(je,{label:"Capacity",wizard:r,order:n(),render:({innerRef:e})=>pt.createElement(u,{ref:e,formik:t})}),pt.createElement(je,{label:"Load Balancers",wizard:r,order:n(),note:this.getLoadBalancerNote(t.values),render:({innerRef:e})=>pt.createElement(d,{ref:e,formik:t,hideLoadBalancers:!0,targetGroupTypeHelpText:"ip"})}),pt.createElement(je,{label:D.get("Firewalls"),wizard:r,order:n(),note:this.getSecurityGroupNote(t.values),render:({innerRef:e})=>pt.createElement(m,{ref:e,formik:t})}),pt.createElement(je,{label:"Job Disruption Budget",wizard:r,order:n(),render:({innerRef:n})=>pt.createElement(Ln,{ref:n,formik:t,app:e})}),pt.createElement(je,{label:"Advanced Settings",wizard:r,order:n(),render:({innerRef:n})=>pt.createElement(kn,{ref:n,formik:t,app:e})}))})}};Wn.defaultProps={closeModal:Be,dismissModal:Be};let Hn=Wn;const{useState:Zn,useEffect:Un,useMemo:qn}=pt;function Jn(e){const t=e.errors.capacity||{},{min:n,max:r,desired:a}=t;return[n,r,a].find(e=>!!e)}function Kn({formik:e,serverGroup:t,toggleMode:n}){Un(()=>{e.setFieldValue("capacity.min",e.values.capacity.desired),e.setFieldValue("capacity.max",e.values.capacity.desired)},[e.values.capacity.desired]);const r=Jn(e);return pt.createElement("div",null,pt.createElement("p",null,"Sets min, max, and desired instance counts to the same value."),pt.createElement("p",null,"To allow autoscaling, use the"," ",pt.createElement("a",{className:"clickable",onClick:n},"Advanced Mode"),"."),pt.createElement("div",{className:"form-group row"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Current size"),pt.createElement("div",{className:"col-md-4"},pt.createElement("div",{className:"horizontal middle"},pt.createElement("input",{type:"number",className:"NumberInput form-control",value:t.capacity.desired,disabled:!0}),pt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),pt.createElement("div",{className:"col-md-4"},pt.createElement("div",{className:"horizontal middle"},pt.createElement(de,{name:"capacity.desired",input:e=>pt.createElement(Ae,{...e,min:0}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0,onChange:()=>{}}),pt.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),!!r&&pt.createElement("div",{className:"col-md-offset-3 col-md-9"},pt.createElement(ce,{message:r,type:"error"})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),pt.createElement("div",{className:"col-md-9 sm-control-field"},pt.createElement(Ue,{current:t.capacity,next:e.values.capacity}))))}function Xn({formik:e,serverGroup:t,toggleMode:n}){const{min:r,max:a}=e.values.capacity||{},s=({value:e})=>pt.createElement("div",{className:"col-md-2"},pt.createElement("input",{className:"NumberInput form-control",type:"number",disabled:!0,value:e})),i=Jn(e);return pt.createElement("div",null,pt.createElement("p",null,"Sets up auto-scaling for this server group."),pt.createElement("p",null,"To disable auto-scaling, use the"," ",pt.createElement("a",{className:"clickable",onClick:n},"Simple Mode"),"."),pt.createElement("div",{className:"form-group bold"},pt.createElement("div",{className:"col-md-2 col-md-offset-3"},"Min"),pt.createElement("div",{className:"col-md-2"},"Max"),pt.createElement("div",{className:"col-md-2"},"Desired")),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Current"),pt.createElement(s,{value:t.capacity.min}),pt.createElement(s,{value:t.capacity.max}),pt.createElement(s,{value:t.capacity.desired})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),pt.createElement("div",{className:"col-md-2"},pt.createElement(de,{name:"capacity.min",input:e=>pt.createElement(Ae,{...e,min:0,max:a}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0})),pt.createElement("div",{className:"col-md-2"},pt.createElement(de,{name:"capacity.max",input:e=>pt.createElement(Ae,{...e,min:r}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0})),pt.createElement("div",{className:"col-md-2"},pt.createElement(de,{name:"capacity.desired",input:e=>pt.createElement(Ae,{...e,min:r,max:a}),layout:({input:e})=>pt.createElement(pt.Fragment,null,e),touched:!0}))),!!i&&pt.createElement("div",{className:"col-md-offset-3 col-md-9"},pt.createElement(ce,{message:i,type:"error"})),pt.createElement("div",{className:"form-group"},pt.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),pt.createElement("div",{className:"col-md-9 sm-control-field"},pt.createElement(Ue,{current:t.capacity,next:e.values.capacity}))))}function Yn(e){const{min:t,max:n,desired:r}=e.capacity,a={};return t>n?a.min=a.max="Min cannot be larger than Max":r<t?a.desired=a.min="Desired cannot be smaller than Min":r>n&&(a.desired=a.max="Desired cannot be larger than Max"),Object.keys(a).length?{capacity:a}:{}}function Qn(e){const{serverGroup:t,application:n,dismissModal:r}=e,a=qn(()=>{const{min:e,max:n,desired:r}=t.capacity;return r!==n||r!==e},[]),[s,i]=Zn(a),o=n.attributes&&n.attributes.platformHealthOnlyShowOverride,[l,c]=Zn(),u=Re({application:n,title:`Resizing ${t.name}`,onTaskComplete:()=>n.getDataSource("serverGroups").refresh(!0)},r),d=e=>u.submit(()=>I.serverGroupWriter.resizeServerGroup(t,n,e)),m={capacity:t.capacity};return pt.createElement(pt.Fragment,null,pt.createElement(Ve,{monitor:u}),pt.createElement(Ge,{initialValues:m,validate:Yn,onSubmit:d,render:e=>pt.createElement(pt.Fragment,null,pt.createElement(We,{dismiss:r}),pt.createElement(zt.Header,null,pt.createElement(zt.Title,null,"Resize ",t.name)),pt.createElement(zt.Body,null,pt.createElement(Lt,{className:"form-horizontal"},s?pt.createElement(Xn,{formik:e,serverGroup:t,toggleMode:()=>i(!1)}):pt.createElement(Kn,{formik:e,serverGroup:t,toggleMode:()=>i(!0)}),o&&pt.createElement(He,{interestingHealthProviderNames:e.values.interestingHealthProviderNames,platformHealthType:"Titus",showHelpDetails:!0,onChange:t=>e.setFieldValue("interestingHealthProviderNames",t||void 0)}))),pt.createElement(zt.Footer,null,pt.createElement(Ze,{account:t.account,onValidChange:c}),pt.createElement("button",{className:"btn btn-default",onClick:r},"Cancel"),pt.createElement("button",{type:"submit",disabled:!l||!e.isValid,className:"btn btn-primary",onClick:()=>d(e.values)},"Submit")))}))}class $n extends Error{}class _n extends $n{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class er extends $n{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class tr extends $n{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class nr extends $n{}class rr extends $n{constructor(e){super(`Invalid unit ${e}`)}}class ar extends $n{}class sr extends $n{constructor(){super("Zone is an abstract class")}}const ir="numeric",or="short",lr="long",cr={year:ir,month:ir,day:ir},ur={year:ir,month:or,day:ir},dr={year:ir,month:lr,day:ir},mr={year:ir,month:lr,day:ir,weekday:lr},pr={hour:ir,minute:ir},gr={hour:ir,minute:ir,second:ir},hr={hour:ir,minute:ir,second:ir,timeZoneName:or},fr={hour:ir,minute:ir,second:ir,timeZoneName:lr},vr={hour:ir,minute:ir,hour12:!1},yr={hour:ir,minute:ir,second:ir,hour12:!1},br={hour:ir,minute:ir,second:ir,hour12:!1,timeZoneName:or},Cr={hour:ir,minute:ir,second:ir,hour12:!1,timeZoneName:lr},Er={year:ir,month:ir,day:ir,hour:ir,minute:ir},wr={year:ir,month:ir,day:ir,hour:ir,minute:ir,second:ir},Sr={year:ir,month:or,day:ir,hour:ir,minute:ir},kr={year:ir,month:or,day:ir,hour:ir,minute:ir,second:ir},Nr={year:ir,month:or,day:ir,weekday:or,hour:ir,minute:ir},Ar={year:ir,month:lr,day:ir,hour:ir,minute:ir,timeZoneName:or},Gr={year:ir,month:lr,day:ir,hour:ir,minute:ir,second:ir,timeZoneName:or},Tr={year:ir,month:lr,day:ir,weekday:lr,hour:ir,minute:ir,timeZoneName:lr},Ir={year:ir,month:lr,day:ir,weekday:lr,hour:ir,minute:ir,second:ir,timeZoneName:lr};function Dr(e){return void 0===e}function xr(e){return"number"==typeof e}function Pr(e){return"number"==typeof e&&e%1==0}function Or(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function Lr(){return!Dr(Intl.DateTimeFormat.prototype.formatToParts)}function Mr(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Fr(e,t,n){if(0!==e.length)return e.reduce((e,r)=>{const a=[t(r),r];return e&&n(e[0],a[0])===e[0]?e:a},null)[1]}function zr(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function jr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Br(e,t,n){return Pr(e)&&e>=t&&e<=n}function Rr(e,t=2){return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function Vr(e){return Dr(e)||null===e||""===e?void 0:parseInt(e,10)}function Wr(e){if(!Dr(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Hr(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Zr(e){return e%4==0&&(e%100!=0||e%400==0)}function Ur(e){return Zr(e)?366:365}function qr(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Zr(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Jr(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Kr(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Xr(e){return e>99?e:e>60?1900+e:2e3+e}function Yr(e,t,n,r=null){const a=new Date(e),s={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const i=Object.assign({timeZoneName:t},s),o=Or();if(o&&Lr()){const e=new Intl.DateTimeFormat(n,i).formatToParts(a).find(e=>"timezonename"===e.type.toLowerCase());return e?e.value:null}if(o){const e=new Intl.DateTimeFormat(n,s).format(a);return new Intl.DateTimeFormat(n,i).format(a).substring(e.length).replace(/^[, \u200e]+/,"")}return null}function Qr(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function $r(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new ar(`Invalid unit value ${e}`);return t}function _r(e,t,n){const r={};for(const a in e)if(jr(e,a)){if(n.indexOf(a)>=0)continue;const s=e[a];if(null==s)continue;r[t(a)]=$r(s)}return r}function ea(e,t){const n=Math.trunc(e/60),r=Math.abs(e%60),a=n>=0&&!Object.is(n,-0)?"+":"-",s=`${a}${Math.abs(n)}`;switch(t){case"short":return`${a}${Rr(Math.abs(n),2)}:${Rr(r,2)}`;case"narrow":return r>0?`${s}:${r}`:s;case"techie":return`${a}${Rr(Math.abs(n),2)}${Rr(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ta(e){return zr(e,["hour","minute","second","millisecond"])}const na=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function ra(e){return JSON.stringify(e,Object.keys(e).sort())}const aa=["January","February","March","April","May","June","July","August","September","October","November","December"],sa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ia=["J","F","M","A","M","J","J","A","S","O","N","D"];function oa(e){switch(e){case"narrow":return ia;case"short":return sa;case"long":return aa;case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const la=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ca=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ua=["M","T","W","T","F","S","S"];function da(e){switch(e){case"narrow":return ua;case"short":return ca;case"long":return la;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ma=["AM","PM"],pa=["Before Christ","Anno Domini"],ga=["BC","AD"],ha=["B","A"];function fa(e){switch(e){case"narrow":return ha;case"short":return ga;case"long":return pa;default:return null}}function va(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const ya={D:cr,DD:ur,DDD:dr,DDDD:mr,t:pr,tt:gr,ttt:hr,tttt:fr,T:vr,TT:yr,TTT:br,TTTT:Cr,f:Er,ff:Sr,fff:Ar,ffff:Tr,F:wr,FF:kr,FFF:Gr,FFFF:Ir};class ba{static create(e,t={}){return new ba(e,t)}static parseFormat(e){let t=null,n="",r=!1;const a=[];for(let s=0;s<e.length;s++){const i=e.charAt(s);"'"===i?(n.length>0&&a.push({literal:r,val:n}),t=null,n="",r=!r):r||i===t?n+=i:(n.length>0&&a.push({literal:!1,val:n}),n=i,t=i)}return n.length>0&&a.push({literal:r,val:n}),a}static macroTokenToFormatOpts(e){return ya[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,Object.assign({},this.opts,t)).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Rr(e,t);const n=Object.assign({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&Lr(),a=(t,n)=>this.loc.extract(e,t,n),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>n?function(e){return ma[e.hour<12?0:1]}(e):a({hour:"numeric",hour12:!0},"dayperiod"),o=(t,r)=>n?function(e,t){return oa(t)[e.month-1]}(e,t):a(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>n?function(e,t){return da(t)[e.weekday-1]}(e,t):a(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=ba.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return fa(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return va(ba.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?a({day:"numeric"},"day"):this.num(e.day);case"dd":return r?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?a({month:"numeric"},"month"):this.num(e.month);case"MM":return r?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?a({year:"numeric"},"year"):this.num(e.year);case"yy":return r?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}})}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},r=ba.parseFormat(t),a=r.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]);return va(r,(e=>t=>{const r=n(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...a.map(n).filter(e=>e))))}}class Ca{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ea{get type(){throw new sr}get name(){throw new sr}get universal(){throw new sr}offsetName(e,t){throw new sr}formatOffset(e,t){throw new sr}offset(e){throw new sr}equals(e){throw new sr}get isValid(){throw new sr}}let wa=null;class Sa extends Ea{static get instance(){return null===wa&&(wa=new Sa),wa}get type(){return"local"}get name(){return Or()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Yr(e,t,n)}formatOffset(e,t){return ea(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"local"===e.type}get isValid(){return!0}}const ka=RegExp(`^${na.source}$`);let Na={};const Aa={year:0,month:1,day:2,hour:3,minute:4,second:5};let Ga={};class Ta extends Ea{static create(e){return Ga[e]||(Ga[e]=new Ta(e)),Ga[e]}static resetCache(){Ga={},Na={}}static isValidSpecifier(e){return!(!e||!e.match(ka))}static isValidZone(e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}static parseGMTOffset(e){if(e){const t=e.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null}constructor(e){super(),this.zoneName=e,this.valid=Ta.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Yr(e,t,n,this.name)}formatOffset(e,t){return ea(this.offset(e),t)}offset(e){const t=new Date(e),n=(c=this.name,Na[c]||(Na[c]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:c,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Na[c]),[r,a,s,i,o,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:a}=n[e],s=Aa[t];Dr(s)||(r[s]=parseInt(a,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,a,s,i,o,l,c]=r;return[i,a,s,o,l,c]}(n,t);var c;let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(Jr({year:r,month:a,day:s,hour:24===i?0:i,minute:o,second:l,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ia=null;class Da extends Ea{static get utcInstance(){return null===Ia&&(Ia=new Da(0)),Ia}static instance(e){return 0===e?Da.utcInstance:new Da(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Da(Qr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${ea(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ea(this.fixed,t)}get universal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class xa extends Ea{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get universal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Pa(e,t){let n;if(Dr(e)||null===e)return t;if(e instanceof Ea)return e;if("string"==typeof e){const r=e.toLowerCase();return"local"===r?t:"utc"===r||"gmt"===r?Da.utcInstance:null!=(n=Ta.parseGMTOffset(e))?Da.instance(n):Ta.isValidSpecifier(r)?Ta.create(e):Da.parseSpecifier(r)||new xa(e)}return xr(e)?Da.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new xa(e)}let Oa=()=>Date.now(),La=null,Ma=null,Fa=null,za=null,ja=!1;class Ba{static get now(){return Oa}static set now(e){Oa=e}static get defaultZoneName(){return Ba.defaultZone.name}static set defaultZoneName(e){La=e?Pa(e):null}static get defaultZone(){return La||Sa.instance}static get defaultLocale(){return Ma}static set defaultLocale(e){Ma=e}static get defaultNumberingSystem(){return Fa}static set defaultNumberingSystem(e){Fa=e}static get defaultOutputCalendar(){return za}static set defaultOutputCalendar(e){za=e}static get throwOnInvalid(){return ja}static set throwOnInvalid(e){ja=e}static resetCaches(){Xa.resetCache(),Ta.resetCache()}}let Ra={};function Va(e,t={}){const n=JSON.stringify([e,t]);let r=Ra[n];return r||(r=new Intl.DateTimeFormat(e,t),Ra[n]=r),r}let Wa={};let Ha={};let Za=null;function Ua(e,t,n,r,a){const s=e.listingMode(n);return"error"===s?null:"en"===s?r(t):a(t)}class qa{constructor(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&Or()){const t={useGrouping:!1};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Wa[n];return r||(r=new Intl.NumberFormat(e,t),Wa[n]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Rr(this.floor?Math.floor(e):Hr(e,3),this.padTo)}}class Ja{constructor(e,t,n){let r;if(this.opts=n,this.hasIntl=Or(),e.zone.universal&&this.hasIntl?(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:qi.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name),this.hasIntl){const e=Object.assign({},this.opts);r&&(e.timeZone=r),this.dtf=Va(t,e)}}format(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());{const e=function(e){const t="EEEE, LLLL d, yyyy, h:mm a";switch(ra(zr(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case ra(cr):return"M/d/yyyy";case ra(ur):return"LLL d, yyyy";case ra(dr):return"LLLL d, yyyy";case ra(mr):return"EEEE, LLLL d, yyyy";case ra(pr):return"h:mm a";case ra(gr):return"h:mm:ss a";case ra(hr):case ra(fr):return"h:mm a";case ra(vr):return"HH:mm";case ra(yr):return"HH:mm:ss";case ra(br):case ra(Cr):return"HH:mm";case ra(Er):return"M/d/yyyy, h:mm a";case ra(Sr):return"LLL d, yyyy, h:mm a";case ra(Ar):return"LLLL d, yyyy, h:mm a";case ra(Tr):return t;case ra(wr):return"M/d/yyyy, h:mm:ss a";case ra(kr):return"LLL d, yyyy, h:mm:ss a";case ra(Nr):return"EEE, d LLL yyyy, h:mm a";case ra(Gr):return"LLLL d, yyyy, h:mm:ss a";case ra(Ir):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}(this.opts),t=Xa.create("en-US");return ba.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){return this.hasIntl&&Lr()?this.dtf.formatToParts(this.dt.toJSDate()):[]}resolvedOptions(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}class Ka{constructor(e,t,n){this.opts=Object.assign({style:"long"},n),!t&&Mr()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let s=Ha[a];return s||(s=new Intl.RelativeTimeFormat(e,t),Ha[a]=s),s}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&s){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${a[e][0]}`;case-1:return n?"yesterday":`last ${a[e][0]}`;case 0:return n?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=a[e],u=r?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return i?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Xa{static fromOpts(e){return Xa.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=!1){const a=e||Ba.defaultLocale,s=a||(r?"en-US":function(){if(Za)return Za;if(Or()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;return Za=e&&"und"!==e?e:"en-US",Za}return Za="en-US",Za}()),i=t||Ba.defaultNumberingSystem,o=n||Ba.defaultOutputCalendar;return new Xa(s,i,o,a)}static resetCache(){Za=null,Ra={},Wa={},Ha={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Xa.create(e,t,n)}constructor(e,t,n,r){const[a,s,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const r=e.substring(0,t);try{n=Va(e).resolvedOptions()}catch(e){n=Va(r).resolvedOptions()}const{numberingSystem:a,calendar:s}=n;return[r,a,s]}}(e);this.locale=a,this.numberingSystem=t||s||null,this.outputCalendar=n||i||null,this.intl=function(e,t,n){return Or()?n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||Or()&&"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(e=!0){const t=Or()&&Lr(),n=this.isEnglish(),r=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t||n&&r||e?!t||n&&r?"en":"intl":"error"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Xa.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone(Object.assign({},e,{defaultToEN:!0}))}redefaultToSystem(e={}){return this.clone(Object.assign({},e,{defaultToEN:!1}))}months(e,t=!1,n=!0){return Ua(this,e,n,oa,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=qi.utc(2016,n,1);t.push(e(r))}return t}(e=>this.extract(e,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1,n=!0){return Ua(this,e,n,da,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=qi.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(e=!0){return Ua(this,void 0,e,()=>ma,()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:!0};this.meridiemCache=[qi.utc(2016,11,13,9),qi.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Ua(this,e,t,fa,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[qi.utc(-40,1,1),qi.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new qa(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ja(e,this.intl,t)}relFormatter(e={}){return new Ka(this.intl,this.isEnglish(),e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||Or()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ya(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Qa(...e){return t=>e.reduce(([e,n,r],a)=>{const[s,i,o]=a(t,r);return[Object.assign(e,s),n||i,o]},[{},null,1]).slice(0,2)}function $a(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function _a(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=Vr(t[n+a]);return[r,null,n+a]}}const es=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ts=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,ns=RegExp(`${ts.source}${es.source}?`),rs=RegExp(`(?:T${ns.source})?`),as=_a("weekYear","weekNumber","weekDay"),ss=_a("year","ordinal"),is=RegExp(`${ts.source} ?(?:${es.source}|(${na.source}))?`),os=RegExp(`(?: ${is.source})?`);function ls(e,t,n){const r=e[t];return Dr(r)?n:Vr(r)}function cs(e,t){return[{year:ls(e,t),month:ls(e,t+1,1),day:ls(e,t+2,1)},null,t+3]}function us(e,t){return[{hour:ls(e,t,0),minute:ls(e,t+1,0),second:ls(e,t+2,0),millisecond:Wr(e[t+3])},null,t+4]}function ds(e,t){const n=!e[t]&&!e[t+1],r=Qr(e[t+1],e[t+2]);return[{},n?null:Da.instance(r),t+3]}function ms(e,t){return[{},e[t]?Ta.create(e[t]):null,t+1]}const ps=/^-?P(?:(?:(-?\d{1,9})Y)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})W)?(?:(-?\d{1,9})D)?(?:T(?:(-?\d{1,9})H)?(?:(-?\d{1,9})M)?(?:(-?\d{1,9})(?:[.,](-?\d{1,9}))?S)?)?)$/;function gs(e){const[t,n,r,a,s,i,o,l,c]=e,u="-"===t[0],d=e=>e&&u?-e:e;return[{years:d(Vr(n)),months:d(Vr(r)),weeks:d(Vr(a)),days:d(Vr(s)),hours:d(Vr(i)),minutes:d(Vr(o)),seconds:d(Vr(l)),milliseconds:d(Wr(c))}]}const hs={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fs(e,t,n,r,a,s,i){const o={year:2===t.length?Xr(Vr(t)):Vr(t),month:sa.indexOf(n)+1,day:Vr(r),hour:Vr(a),minute:Vr(s)};return i&&(o.second=Vr(i)),e&&(o.weekday=e.length>3?la.indexOf(e)+1:ca.indexOf(e)+1),o}const vs=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ys(e){const[,t,n,r,a,s,i,o,l,c,u,d]=e,m=fs(t,a,r,n,s,i,o);let p;return p=l?hs[l]:c?0:Qr(u,d),[m,new Da(p)]}const bs=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Cs=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Es=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ws(e){const[,t,n,r,a,s,i,o]=e;return[fs(t,a,r,n,s,i,o),Da.utcInstance]}function Ss(e){const[,t,n,r,a,s,i,o]=e;return[fs(t,o,n,r,a,s,i),Da.utcInstance]}const ks=Ya(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,rs),Ns=Ya(/(\d{4})-?W(\d\d)(?:-?(\d))?/,rs),As=Ya(/(\d{4})-?(\d{3})/,rs),Gs=Ya(ns),Ts=Qa(cs,us,ds),Is=Qa(as,us,ds),Ds=Qa(ss,us),xs=Qa(us,ds);const Ps=Ya(/(\d{4})-(\d\d)-(\d\d)/,os),Os=Ya(is),Ls=Qa(cs,us,ds,ms),Ms=Qa(us,ds,ms);const Fs={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},zs=Object.assign({years:{months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Fs),js=365.2425,Bs=30.436875,Rs=Object.assign({years:{months:12,weeks:52.1775,days:js,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:Bs,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Fs),Vs=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ws=Vs.slice(0).reverse();function Hs(e,t,n=!1){const r={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new qs(r)}function Zs(e,t,n,r,a){const s=e[a][n],i=t[n]/s,o=!(Math.sign(i)===Math.sign(r[a]))&&0!==r[a]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);r[a]+=o,t[n]-=o*s}function Us(e,t){Ws.reduce((n,r)=>Dr(t[r])?n:(n&&Zs(e,t,n,t,r),r),null)}class qs{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||Xa.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Rs:zs,this.isLuxonDuration=!0}static fromMillis(e,t){return qs.fromObject(Object.assign({milliseconds:e},t))}static fromObject(e){if(null==e||"object"!=typeof e)throw new ar("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new qs({values:_r(e,qs.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:Xa.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromISO(e,t){const[n]=function(e){return $a(e,[ps,gs])}(e);if(n){const e=Object.assign(n,t);return qs.fromObject(e)}return qs.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new ar("need to specify a reason the Duration is invalid");const n=e instanceof Ca?e:new Ca(e,t);if(Ba.throwOnInvalid)throw new tr(n);return new qs({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new rr(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n=Object.assign({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?ba.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.values);return e.includeConfig&&(t.conversionAccuracy=this.conversionAccuracy,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Hr(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toJSON(){return this.toISO()}toString(){return this.toISO()}valueOf(){return this.as("milliseconds")}plus(e){if(!this.isValid)return this;const t=Js(e),n={};for(const e of Vs)(jr(t.values,e)||jr(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Hs(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Js(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=$r(e(this.values[n],n));return Hs(this,{values:t},!0)}get(e){return this[qs.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Hs(this,{values:Object.assign(this.values,_r(e,qs.normalizeUnit,[]))})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const r={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(r.conversionAccuracy=n),Hs(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Us(this.matrix,e),Hs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>qs.normalizeUnit(e));const t={},n={},r=this.toObject();let a;Us(this.matrix,r);for(const s of Vs)if(e.indexOf(s)>=0){a=s;let e=0;for(const t in n)e+=this.matrix[t][s]*n[t],n[t]=0;xr(r[s])&&(e+=r[s]);const i=Math.trunc(e);t[s]=i,n[s]=e-i;for(const e in r)Vs.indexOf(e)>Vs.indexOf(s)&&Zs(this.matrix,r,e,t,s)}else xr(r[s])&&(n[s]=r[s]);for(const e in n)0!==n[e]&&(t[a]+=e===a?n[e]:n[e]/this.matrix[a][e]);return Hs(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=-this.values[t];return Hs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const t of Vs)if(this.values[t]!==e.values[t])return!1;return!0}}function Js(e){if(xr(e))return qs.fromMillis(e);if(qs.isDuration(e))return e;if("object"==typeof e)return qs.fromObject(e);throw new ar(`Unknown duration argument ${e} of type ${typeof e}`)}const Ks="Invalid Interval";class Xs{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new ar("need to specify a reason the Interval is invalid");const n=e instanceof Ca?e:new Ca(e,t);if(Ba.throwOnInvalid)throw new er(n);return new Xs({invalid:n})}static fromDateTimes(e,t){const n=Ji(e),r=Ji(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Xs.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Xs.invalid("missing or invalid end"):Xs.invalid("missing or invalid start")}(n,r);return null==a?new Xs({start:n,end:r}):a}static after(e,t){const n=Js(t),r=Ji(e);return Xs.fromDateTimes(r,r.plus(n))}static before(e,t){const n=Js(t),r=Ji(e);return Xs.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){const e=qi.fromISO(n,t),a=qi.fromISO(r,t);if(e.isValid&&a.isValid)return Xs.fromDateTimes(e,a);if(e.isValid){const n=qs.fromISO(r,t);if(n.isValid)return Xs.after(e,n)}else if(a.isValid){const e=qs.fromISO(n,t);if(e.isValid)return Xs.before(a,e)}}return Xs.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),n=this.end.startOf(e);return Math.floor(n.diff(t,e).get(e))+1}hasSame(e){return!!this.isValid&&this.e.minus(1).hasSame(this.s,e)}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Xs.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ji).filter(e=>this.contains(e)).sort(),n=[];let{s:r}=this,a=0;for(;r<this.e;){const e=t[a]||this.e,s=+e>+this.e?this.e:e;n.push(Xs.fromDateTimes(r,s)),r=s,a+=1}return n}splitBy(e){const t=Js(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,r,{s:a}=this;const s=[];for(;a<this.e;)n=a.plus(t),r=+n>+this.e?this.e:n,s.push(Xs.fromDateTimes(a,r)),a=r;return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>n?null:Xs.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return Xs.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],a=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),s=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(const e of s)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(Xs.fromDateTimes(t,e.time)),t=null);return Xs.merge(r)}difference(...e){return Xs.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ks}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ks}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ks}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ks}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ks}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):qs.invalid(this.invalidReason)}mapEndpoints(e){return Xs.fromDateTimes(e(this.s),e(this.e))}}class Ys{static hasDST(e=Ba.defaultZone){const t=qi.local().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ta.isValidSpecifier(e)&&Ta.isValidZone(e)}static normalizeZone(e){return Pa(e,Ba.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return Xa.create(t,n,r).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:r="gregory"}={}){return Xa.create(t,n,r).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null}={}){return Xa.create(t,n,null).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null}={}){return Xa.create(t,n,null).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Xa.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Xa.create(t,null,"gregory").eras(e)}static features(){let e=!1,t=!1,n=!1,r=!1;if(Or()){e=!0,t=Lr(),r=Mr();try{n="America/New_York"===new Intl.DateTimeFormat("en",{timeZone:"America/New_York"}).resolvedOptions().timeZone}catch(e){n=!1}}return{intl:e,intlTokens:t,zones:n,relative:r}}}function Qs(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(qs.fromMillis(r).as("days"))}function $s(e,t,n,r){let[a,s,i,o]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Qs(e,t);return(n-n%7)/7}],["days",Qs]],a={};let s,i;for(const[o,l]of r)if(n.indexOf(o)>=0){s=o;let n=l(e,t);i=e.plus({[o]:n}),i>t?(e=e.plus({[o]:n-1}),n-=1):e=i,a[o]=n}return[e,a,i,s]}(e,t,n);const l=t-a,c=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(i<t&&(i=a.plus({[o]:1})),i!==a&&(s[o]=(s[o]||0)+l/(i-a)));const u=qs.fromObject(Object.assign(s,r));return c.length>0?qs.fromMillis(l,r).shiftTo(...c).plus(u):u}const _s={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ei={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ti=_s.hanidec.replace(/[\[|\]]/g,"").split("");function ni({numberingSystem:e},t=""){return new RegExp(`${_s[e||"latn"]}${t}`)}function ri(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(_s.hanidec))t+=ti.indexOf(e[n]);else for(const e in ei){const[n,a]=ei[e];r>=n&&r<=a&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}function ai(e){return e.replace(/\./,"\\.?")}function si(e){return e.replace(/\./,"").toLowerCase()}function ii(e,t){return null===e?null:{regex:RegExp(e.map(ai).join("|")),deser:([n])=>e.findIndex(e=>si(n)===si(e))+t}}function oi(e,t){return{regex:e,deser:([,e,t])=>Qr(e,t),groups:t}}function li(e){return{regex:e,deser:([e])=>e}}const ci={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let ui=null;function di(e,t){if(e.literal)return e;const n=ba.macroTokenToFormatOpts(e.val);if(!n)return e;const r=ba.create(t,n).formatDateTimeParts((ui||(ui=qi.fromMillis(1555555555555)),ui)).map(e=>function(e,t,n){const{type:r,value:a}=e;if("literal"===r)return{literal:!0,val:a};const s=n[r];let i=ci[r];return"object"==typeof i&&(i=i[s]),i?{literal:!1,val:i}:void 0}(e,0,n));return r.includes(void 0)?e:r}function mi(e,t,n){const r=function(e,t){return Array.prototype.concat(...e.map(e=>di(e,t)))}(ba.parseFormat(n),e),a=r.map(t=>function(e,t){const n=ni(t),r=ni(t,"{2}"),a=ni(t,"{3}"),s=ni(t,"{4}"),i=ni(t,"{6}"),o=ni(t,"{1,2}"),l=ni(t,"{1,3}"),c=ni(t,"{1,6}"),u=ni(t,"{1,9}"),d=ni(t,"{2,4}"),m=ni(t,"{4,6}"),p=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},g=(g=>{if(e.literal)return p(g);switch(g.val){case"G":return ii(t.eras("short",!1),0);case"GG":return ii(t.eras("long",!1),0);case"y":return ri(c);case"yy":case"kk":return ri(d,Xr);case"yyyy":case"kkkk":return ri(s);case"yyyyy":return ri(m);case"yyyyyy":return ri(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ri(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ri(r);case"MMM":return ii(t.months("short",!0,!1),1);case"MMMM":return ii(t.months("long",!0,!1),1);case"LLL":return ii(t.months("short",!1,!1),1);case"LLLL":return ii(t.months("long",!1,!1),1);case"o":case"S":return ri(l);case"ooo":case"SSS":return ri(a);case"u":return li(u);case"a":return ii(t.meridiems(),0);case"E":case"c":return ri(n);case"EEE":return ii(t.weekdays("short",!1,!1),1);case"EEEE":return ii(t.weekdays("long",!1,!1),1);case"ccc":return ii(t.weekdays("short",!0,!1),1);case"cccc":return ii(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return oi(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return oi(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return li(/[a-z_+-/]{1,256}?/i);default:return p(g)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e)),s=a.find(e=>e.invalidReason);if(s)return{input:t,tokens:r,invalidReason:s.invalidReason};{const[e,n]=function(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,e]}(a),s=RegExp(e,"i"),[i,o]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const a in n)if(jr(n,a)){const s=n[a],i=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(t,s,n),[l,c]=o?function(e){let t;return t=Dr(e.Z)?Dr(e.z)?null:Ta.create(e.z):new Da(e.Z),Dr(e.q)||(e.M=3*(e.q-1)+1),Dr(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Dr(e.u)||(e.S=Wr(e.u)),[Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{}),t]}(o):[null,null];if(jr(o,"a")&&jr(o,"H"))throw new nr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:s,rawMatches:i,matches:o,result:l,zone:c}}}const pi=[0,31,59,90,120,151,181,212,243,273,304,334],gi=[0,31,60,91,121,152,182,213,244,274,305,335];function hi(e,t){return new Ca("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function fi(e,t,n){const r=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===r?7:r}function vi(e,t,n){return n+(Zr(e)?gi:pi)[t-1]}function yi(e,t){const n=Zr(e)?gi:pi,r=n.findIndex(e=>e<t);return{month:r+1,day:t-n[r]}}function bi(e){const{year:t,month:n,day:r}=e,a=vi(t,n,r),s=fi(t,n,r);let i,o=Math.floor((a-s+10)/7);return o<1?(i=t-1,o=Kr(i)):o>Kr(t)?(i=t+1,o=1):i=t,Object.assign({weekYear:i,weekNumber:o,weekday:s},ta(e))}function Ci(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=fi(t,1,4),s=Ur(t);let i,o=7*n+r-a-3;o<1?(i=t-1,o+=Ur(i)):o>s?(i=t+1,o-=Ur(t)):i=t;const{month:l,day:c}=yi(i,o);return Object.assign({year:i,month:l,day:c},ta(e))}function Ei(e){const{year:t,month:n,day:r}=e,a=vi(t,n,r);return Object.assign({year:t,ordinal:a},ta(e))}function wi(e){const{year:t,ordinal:n}=e,{month:r,day:a}=yi(t,n);return Object.assign({year:t,month:r,day:a},ta(e))}function Si(e){const t=Pr(e.year),n=Br(e.month,1,12),r=Br(e.day,1,qr(e.year,e.month));return t?n?!r&&hi("day",e.day):hi("month",e.month):hi("year",e.year)}function ki(e){const{hour:t,minute:n,second:r,millisecond:a}=e,s=Br(t,0,23)||24===t&&0===n&&0===r&&0===a,i=Br(n,0,59),o=Br(r,0,59),l=Br(a,0,999);return s?i?o?!l&&hi("millisecond",a):hi("second",r):hi("minute",n):hi("hour",t)}const Ni="Invalid DateTime",Ai=864e13;function Gi(e){return new Ca("unsupported zone",`the zone "${e.name}" is not supported`)}function Ti(e){return null===e.weekData&&(e.weekData=bi(e.c)),e.weekData}function Ii(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new qi(Object.assign({},n,t,{old:n}))}function Di(e,t,n){let r=e-60*t*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=60*(a-t)*1e3;const s=n.offset(r);return a===s?[r,a]:[e-60*Math.min(a,s)*1e3,Math.max(a,s)]}function xi(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Pi(e,t,n){return Di(Jr(e),t,n)}function Oi(e,t){const n=Object.keys(t.values);-1===n.indexOf("milliseconds")&&n.push("milliseconds"),t=t.shiftTo(...n);const r=e.o,a=e.c.year+t.years,s=e.c.month+t.months+3*t.quarters,i=Object.assign({},e.c,{year:a,month:s,day:Math.min(e.c.day,qr(a,s))+t.days+7*t.weeks}),o=qs.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Jr(i);let[c,u]=Di(l,r,e.zone);return 0!==o&&(c+=o,u=e.zone.offset(c)),{ts:c,o:u}}function Li(e,t,n,r,a){const{setZone:s,zone:i}=n;if(e&&0!==Object.keys(e).length){const r=t||i,a=qi.fromObject(Object.assign(e,n,{zone:r,setZone:void 0}));return s?a:a.setZone(i)}return qi.invalid(new Ca("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Mi(e,t,n=!0){return e.isValid?ba.create(Xa.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Fi(e,{suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r,includeZone:a=!1,spaceZone:s=!1,format:i="extended"}){let o="basic"===i?"HHmm":"HH:mm";return t&&0===e.second&&0===e.millisecond||(o+="basic"===i?"ss":":ss",n&&0===e.millisecond||(o+=".SSS")),(a||r)&&s&&(o+=" "),a?o+="z":r&&(o+="basic"===i?"ZZZ":"ZZ"),Mi(e,o)}const zi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ji={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Bi={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ri=["year","month","day","hour","minute","second","millisecond"],Vi=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Wi=["year","ordinal","hour","minute","second","millisecond"];function Hi(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new rr(e);return t}function Zi(e,t){for(const t of Ri)Dr(e[t])&&(e[t]=zi[t]);const n=Si(e)||ki(e);if(n)return qi.invalid(n);const r=Ba.now(),a=t.offset(r),[s,i]=Pi(e,a,t);return new qi({ts:s,zone:t,o:i})}function Ui(e,t,n){const r=!!Dr(n.round)||n.round,a=(e,a)=>{e=Hr(e,r||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,a)},s=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(s(n.unit),n.unit);for(const e of n.units){const t=s(e);if(Math.abs(t)>=1)return a(t,e)}return a(0,n.units[n.units.length-1])}class qi{constructor(e){const t=e.zone||Ba.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ca("invalid input"):null)||(t.isValid?null:Gi(t));this.ts=Dr(e.ts)?Ba.now():e.ts;let r=null,a=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,a]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=xi(this.ts,e),n=Number.isNaN(r.year)?new Ca("invalid input"):null,r=n?null:r,a=n?null:e}}this._zone=t,this.loc=e.loc||Xa.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=a,this.isLuxonDateTime=!0}static local(e,t,n,r,a,s,i){return Dr(e)?new qi({ts:Ba.now()}):Zi({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},Ba.defaultZone)}static utc(e,t,n,r,a,s,i){return Dr(e)?new qi({ts:Ba.now(),zone:Da.utcInstance}):Zi({year:e,month:t,day:n,hour:r,minute:a,second:s,millisecond:i},Da.utcInstance)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return qi.invalid("invalid input");const a=Pa(t.zone,Ba.defaultZone);return a.isValid?new qi({ts:n,zone:a,loc:Xa.fromObject(t)}):qi.invalid(Gi(a))}static fromMillis(e,t={}){if(xr(e))return e<-Ai||e>Ai?qi.invalid("Timestamp out of range"):new qi({ts:e,zone:Pa(t.zone,Ba.defaultZone),loc:Xa.fromObject(t)});throw new ar(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(xr(e))return new qi({ts:1e3*e,zone:Pa(t.zone,Ba.defaultZone),loc:Xa.fromObject(t)});throw new ar("fromSeconds requires a numerical input")}static fromObject(e){const t=Pa(e.zone,Ba.defaultZone);if(!t.isValid)return qi.invalid(Gi(t));const n=Ba.now(),r=t.offset(n),a=_r(e,Hi,["zone","locale","outputCalendar","numberingSystem"]),s=!Dr(a.ordinal),i=!Dr(a.year),o=!Dr(a.month)||!Dr(a.day),l=i||o,c=a.weekYear||a.weekNumber,u=Xa.fromObject(e);if((l||s)&&c)throw new nr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new nr("Can't mix ordinal dates with month/day");const d=c||a.weekday&&!l;let m,p,g=xi(n,r);d?(m=Vi,p=ji,g=bi(g)):s?(m=Wi,p=Bi,g=Ei(g)):(m=Ri,p=zi);let h=!1;for(const e of m){Dr(a[e])?a[e]=h?p[e]:g[e]:h=!0}const f=d?function(e){const t=Pr(e.weekYear),n=Br(e.weekNumber,1,Kr(e.weekYear)),r=Br(e.weekday,1,7);return t?n?!r&&hi("weekday",e.weekday):hi("week",e.week):hi("weekYear",e.weekYear)}(a):s?function(e){const t=Pr(e.year),n=Br(e.ordinal,1,Ur(e.year));return t?!n&&hi("ordinal",e.ordinal):hi("year",e.year)}(a):Si(a),v=f||ki(a);if(v)return qi.invalid(v);const y=d?Ci(a):s?wi(a):a,[b,C]=Pi(y,r,t),E=new qi({ts:b,zone:t,o:C,loc:u});return a.weekday&&l&&e.weekday!==E.weekday?qi.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[n,r]=function(e){return $a(e,[ks,Ts],[Ns,Is],[As,Ds],[Gs,xs])}(e);return Li(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return $a(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[vs,ys])}(e);return Li(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return $a(e,[bs,ws],[Cs,ws],[Es,Ss])}(e);return Li(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(Dr(e)||Dr(t))throw new ar("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:a=null}=n,s=Xa.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),[i,o,l]=function(e,t,n){const{result:r,zone:a,invalidReason:s}=mi(e,t,n);return[r,a,s]}(s,e,t);return l?qi.invalid(l):Li(i,o,n,`format ${t}`,e)}static fromString(e,t,n={}){return qi.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return $a(e,[Ps,Ls],[Os,Ms])}(e);return Li(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new ar("need to specify a reason the DateTime is invalid");const n=e instanceof Ca?e:new Ca(e,t);if(Ba.throwOnInvalid)throw new _n(n);return new qi({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ti(this).weekYear:NaN}get weekNumber(){return this.isValid?Ti(this).weekNumber:NaN}get weekday(){return this.isValid?Ti(this).weekday:NaN}get ordinal(){return this.isValid?Ei(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ys.months("short",{locale:this.locale})[this.month-1]:null}get monthLong(){return this.isValid?Ys.months("long",{locale:this.locale})[this.month-1]:null}get weekdayShort(){return this.isValid?Ys.weekdays("short",{locale:this.locale})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ys.weekdays("long",{locale:this.locale})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.universal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Zr(this.year)}get daysInMonth(){return qr(this.year,this.month)}get daysInYear(){return this.isValid?Ur(this.year):NaN}get weeksInWeekYear(){return this.isValid?Kr(this.weekYear):NaN}resolvedLocaleOpts(e={}){const{locale:t,numberingSystem:n,calendar:r}=ba.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Da.instance(e),t)}toLocal(){return this.setZone(Ba.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=Pa(e,Ba.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=Pi(n,t,e)}return Ii(this,{ts:r,zone:e})}return qi.invalid(Gi(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return Ii(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_r(e,Hi,[]);let n;!Dr(t.weekYear)||!Dr(t.weekNumber)||!Dr(t.weekday)?n=Ci(Object.assign(bi(this.c),t)):Dr(t.ordinal)?(n=Object.assign(this.toObject(),t),Dr(t.day)&&(n.day=Math.min(qr(n.year,n.month),n.day))):n=wi(Object.assign(Ei(this.c),t));const[r,a]=Pi(n,this.o,this.zone);return Ii(this,{ts:r,o:a})}plus(e){if(!this.isValid)return this;return Ii(this,Oi(this,Js(e)))}minus(e){if(!this.isValid)return this;return Ii(this,Oi(this,Js(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=qs.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?ba.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Ni}toLocaleString(e=cr){return this.isValid?ba.create(this.loc.clone(e),e).formatDateTime(this):Ni}toLocaleParts(e={}){return this.isValid?ba.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO(e={}){return this.isValid?`${this.toISODate(e)}T${this.toISOTime(e)}`:null}toISODate({format:e="extended"}={}){let t="basic"===e?"yyyyMMdd":"yyyy-MM-dd";return this.year>9999&&(t="+"+t),Mi(this,t)}toISOWeekDate(){return Mi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,format:r="extended"}={}){return Fi(this,{suppressSeconds:t,suppressMilliseconds:e,includeOffset:n,format:r})}toRFC2822(){return Mi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return Mi(this,"yyyy-MM-dd")}toSQLTime({includeOffset:e=!0,includeZone:t=!1}={}){return Fi(this,{includeOffset:e,includeZone:t,spaceZone:!0})}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Ni}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t=Object.assign({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return qs.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");const r=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),a=(o=t,Array.isArray(o)?o:[o]).map(qs.normalizeUnit),s=e.valueOf()>this.valueOf(),i=$s(s?this:e,s?e:this,a,r);var o;return s?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(qi.local(),e,t)}until(e){return this.isValid?Xs.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;if("millisecond"===t)return this.valueOf()===e.valueOf();{const n=e.valueOf();return this.startOf(t)<=n&&n<=this.endOf(t)}}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||qi.fromObject({zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;return Ui(t,this.plus(n),Object.assign(e,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}toRelativeCalendar(e={}){return this.isValid?Ui(e.base||qi.fromObject({zone:this.zone}),this,Object.assign(e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(qi.isDateTime))throw new ar("min requires all arguments be DateTimes");return Fr(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(qi.isDateTime))throw new ar("max requires all arguments be DateTimes");return Fr(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:a=null}=n;return mi(Xa.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return qi.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return cr}static get DATE_MED(){return ur}static get DATE_FULL(){return dr}static get DATE_HUGE(){return mr}static get TIME_SIMPLE(){return pr}static get TIME_WITH_SECONDS(){return gr}static get TIME_WITH_SHORT_OFFSET(){return hr}static get TIME_WITH_LONG_OFFSET(){return fr}static get TIME_24_SIMPLE(){return vr}static get TIME_24_WITH_SECONDS(){return yr}static get TIME_24_WITH_SHORT_OFFSET(){return br}static get TIME_24_WITH_LONG_OFFSET(){return Cr}static get DATETIME_SHORT(){return Er}static get DATETIME_SHORT_WITH_SECONDS(){return wr}static get DATETIME_MED(){return Sr}static get DATETIME_MED_WITH_SECONDS(){return kr}static get DATETIME_MED_WITH_WEEKDAY(){return Nr}static get DATETIME_FULL(){return Ar}static get DATETIME_FULL_WITH_SECONDS(){return Gr}static get DATETIME_HUGE(){return Tr}static get DATETIME_HUGE_WITH_SECONDS(){return Ir}}function Ji(e){if(qi.isDateTime(e))return e;if(e&&e.valueOf&&xr(e.valueOf()))return qi.fromJSDate(e);if(e&&"object"==typeof e)return qi.fromObject(e);throw new ar(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Ki=({dismissModal:e,serverGroup:t})=>{const{result:n,status:r,error:a}=B(()=>Xe.getScalingActivities(t),[],[t.id]),s="PENDING"===r;return mt.createElement(mt.Fragment,null,mt.createElement(qe,null,`Scaling activities for ${t.name}`),mt.createElement(Je,null,mt.createElement("div",{className:"flex-1 heading-3"},s&&mt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},mt.createElement(W,null)),!s&&Boolean(a)&&mt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},mt.createElement("h4",null,`There was an error loading scaling activities for ${t.name}. Please try again later.`)),!s&&!a&&!Boolean(n.length)&&mt.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},mt.createElement("h4",null,`No scaling activities found for ${t.name}.`)),!s&&!a&&Boolean(n.length)&&mt.createElement("div",{className:"middle sp-margin-xl-yaxis"},n.map((e,t)=>{var n;return mt.createElement("div",{key:`${t}-${e.jobId}`,className:"sp-margin-xl-yaxis"},mt.createElement("p",{className:"clearfix"},mt.createElement("span",{className:`label label-${"KillInitiated"!==e.jobState?"success":"danger"} pull-left`},e.jobState),mt.createElement("span",{className:"label label-default pull-right"},(e=>{const t=new Date(e);return qi.fromJSDate(t).toFormat("yyyy-MM-dd HH:mm:ss ZZZZ")})(e.date))),mt.createElement("p",null,`${e.reasonMessage} Desired capacity is ${(null==(n=e.capacity)?void 0:n.desired)||"unknown"}.`))})))),mt.createElement(Ke,{primaryActions:mt.createElement("button",{className:"btn btn-primary",onClick:e},"Close")}))};var Xi=Object.getOwnPropertyDescriptor;let Yi=class extends pt.Component{render(){const{serverGroup:e,app:t}=this.props,{capacity:n}=e,r=e.instances.length,a=n.min===n.max;return pt.createElement(pt.Fragment,null,pt.createElement("dl",{className:"dl-horizontal dl-narrow"},pt.createElement(Ye,{capacity:n,simpleMode:a}),pt.createElement(Qe,{currentCapacity:r}),e.capacityGroup&&pt.createElement(pt.Fragment,null,pt.createElement("dt",null,"Cap. Group"),pt.createElement("dd",null,e.capacityGroup))),pt.createElement("div",null,pt.createElement("a",{className:"clickable",onClick:()=>et(e,t).then(n=>{n&&Me.show(Qn,{serverGroup:e,application:t})})},"Resize Server Group")),pt.createElement("div",null,pt.createElement("a",{className:"clickable",onClick:()=>$e(Ki,{serverGroup:e},{maxWidth:"1000px"})},"View Scaling Activities")))}};Yi=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?Xi(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([_e("titus.serverGroup.CapacityDetailsSection")],Yi);const Qi=({config:e,serverGroup:t,unit:n,updateUnit:r})=>{const[a,s]=mt.useState({alarmName:null,alarmArn:null,metricName:null,namespace:null,statistic:"Average",dimensions:[],period:60,threshold:e.targetValue,comparisonOperator:"GreaterThanThreshold",okactions:[],insufficientDataActions:[],alarmActions:[],evaluationPeriods:null,alarmDescription:null,unit:null});mt.useEffect(()=>{(()=>{const t=null==e?void 0:e.customizedMetricSpecification,n={...a,dimensions:null==t?void 0:t.dimensions,metricName:null==t?void 0:t.metricName,namespace:null==t?void 0:t.namespace,statistic:null==t?void 0:t.statistic,threshold:null==e?void 0:e.targetValue};s(n)})()},[e]);return mt.createElement(p,{alarm:a,onChartLoaded:e=>{n&&r(e.unit)},serverGroup:t})},$i={buildAlarm:(e,t)=>{const n=null==e?void 0:e.alarms[0];return{comparisonOperator:n.comparisonOperator,region:t,dimensions:n.dimensions,disableEditingDimensions:n.disableEditingDimensions,evaluationPeriods:n.evaluationPeriods,metricName:n.metricName,namespace:n.namespace,period:n.period,statistic:n.statistic,threshold:n.threshold,unit:n.unit}},buildStepPolicy:(e,t,n)=>({cooldown:n||600,estimatedInstanceWarmup:null,metricAggregationType:"Average",stepAdjustments:e.stepAdjustments.map(e=>{const n={scalingAdjustment:Math.abs(e.scalingAdjustment)};return void 0!==e.metricIntervalUpperBound&&(n.metricIntervalUpperBound=e.metricIntervalUpperBound+t),void 0!==e.metricIntervalLowerBound&&(n.metricIntervalLowerBound=e.metricIntervalLowerBound+t),n})}),buildNewCommand:(e,t,n)=>{const r={adjustmentType:"Step"===e?n.adjustmentType:null,cloudProvider:t.cloudProvider,credentials:t.account,jobId:t.id,name:n.id,region:t.region,scalingPolicyID:n.id,serverGroupName:t.name};return"Step"===e&&(r.alarm=$i.buildAlarm(n,t.region),r.minAdjustmentMagnitude=n.minAdjustmentMagnitude||1,r.step=$i.buildStepPolicy(n,r.alarm.threshold,n.cooldown)),"TargetTracking"===e&&(r.targetTrackingConfiguration={...n.targetTrackingConfiguration}),r},prepareCommandForUpsert:(e,t)=>{const n=At(e);return"PercentChangeInCapacity"!==n.adjustmentType&&delete n.minAdjustmentMagnitude,n.step?n.step.stepAdjustments.forEach(e=>{t&&(e.scalingAdjustment=0-e.scalingAdjustment,delete n.step.estimatedInstanceWarmup),void 0!==e.metricIntervalLowerBound&&(e.metricIntervalLowerBound-=n.alarm.threshold),void 0!==e.metricIntervalUpperBound&&(e.metricIntervalUpperBound-=n.alarm.threshold)}):t&&(e.simple.scalingAdjustment=0-e.simple.scalingAdjustment),n}},_i=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s;const[i,o]=mt.useState(Boolean(null==(s=r.targetTrackingConfiguration)?void 0:s.customizedMetricSpecification)),[l,c]=mt.useState({});mt.useEffect(()=>{const e=$i.buildNewCommand("TargetTracking",a,r);c(e)},[]);const u=r.id?"Update":"Create";return mt.createElement(tt,{closeModal:t,dismissModal:n,title:`${u} scaling policy`,application:e,description:`${u} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>({application:e,job:[{type:"upsertScalingPolicy",...l}]}),render:()=>mt.createElement("div",{className:"modal-body"},mt.createElement("h4",{className:"section-heading"},"Target Metric"),mt.createElement(g,{allowDualMode:!1,cloudwatch:!0,command:l,isCustomMetric:i,app:e,serverGroup:a,toggleMetricType:e=>o("custom"===e),updateCommand:c}),mt.createElement("h4",{className:"section-heading"},"Additional Settings"),mt.createElement(h,{command:l,cooldowns:!0,policyName:r.policyName,updateCommand:c}))})},eo=({app:e,closeModal:t,dismissModal:n,policy:r,serverGroup:a})=>{var s,i,o;const[l,c]=mt.useState({});mt.useEffect(()=>{const e=$i.buildNewCommand("Step",a,r);c(e)},[]);const u=(null==(s=r.stepAdjustments)?void 0:s.length)?r.stepAdjustments[0].scalingAdjustment:r.scalingAdjustment,[d,m]=mt.useState("ExactCapacity"===l.adjustmentType?"Set to":u>0?"Add":"Remove"),p="ExactCapacity"===l.adjustmentType||"ChangeInCapacity"===l.adjustmentType?"instances":"percent of group",g=r.id?"Edit":"Create",h=0===(null==(o=null==(i=null==l?void 0:l.alarm)?void 0:i.comparisonOperator)?void 0:o.indexOf("Greater"))?"max":"min",b=e=>{const t=At(l);t.step.stepAdjustments=e,(e=>{const t="min"===h?"metricIntervalLowerBound":"metricIntervalUpperBound",n="metricIntervalLowerBound"===t?"metricIntervalUpperBound":"metricIntervalLowerBound",r=e.stepAdjustments;(r||[]).forEach((e,a)=>{r.length>a+1&&(r[a+1][n]=e[t])}),delete r[r.length-1][t]})(t.step),c(t)},C=(e,t)=>{m(e);const n="instances"!==t?"PercentChangeInCapacity":"Set to"===e?"ExactCapacity":"ChangeInCapacity";c({...l,adjustmentType:n})};return mt.createElement(tt,{closeModal:t,dismissModal:n,title:`${g} scaling policy`,application:e,description:`${g} scaling policy for ${a.name}`,initialValues:l,mapValuesToTask:()=>{const t=$i.prepareCommandForUpsert(l,"Remove"===d);return{application:e,job:[{type:t.type||"upsertScalingPolicy",...t}]}},render:()=>{var e,t,n;return mt.createElement("div",null,mt.createElement("h4",{className:"section-heading"},"Conditions"),mt.createElement("div",{className:"section-body"},mt.createElement("p",null,mt.createElement("b",null,"Note:"),' metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not see a metric below, click "Configure available metrics" in the server group details to set up forwarding from Atlas to CloudWatch.'),mt.createElement(f,{alarm:l.alarm,multipleAlarms:Boolean((null==(e=null==r?void 0:r.alarms)?void 0:e.length)>1),serverGroup:a,stepAdjustments:l.step.stepAdjustments,stepsChanged:b,updateAlarm:e=>c({...l,alarm:e})})),mt.createElement("h4",{className:"section-heading"},"Actions"),mt.createElement("div",{className:"section-body"},!(null==(t=l.alarm)?void 0:t.metricName)&&mt.createElement("h4",{className:"text-center"},"Select a metric"),(null==(n=l.alarm)?void 0:n.metricName)&&mt.createElement(v,{adjustmentType:p,adjustmentTypeChanged:C,alarm:l.alarm,isMin:"min"===h,operator:d,step:l.step,stepsChanged:b})),mt.createElement(y,{command:l,isInstanceType:"instances"===p,isNew:Boolean(!r.policyARN),operator:d,updateCommand:c}))}})},to="titus.servergroup.details.capacitydetailssection";t(to,[]).component("titusCapacityDetailsSection",jt(nt(Yi,"titusCapacityDetailsSection"),["serverGroup","app"]));var no=Object.getOwnPropertyDescriptor;let ro=class extends pt.Component{render(){if(!this.props.serverGroup||!this.props.serverGroup.image)return null;const{serverGroup:{image:e,entryPoint:t,iamProfile:n,resources:r}}=this.props;return pt.createElement(S,{className:"horizontal-when-filters-collapsed"},e.dockerImageName&&pt.createElement(k,{label:"Image Name",value:e.dockerImageName}),e.dockerImageVersion&&pt.createElement(k,{label:"Image Version",value:e.dockerImageVersion}),t&&pt.createElement(k,{label:"Entrypoint",value:t}),n&&pt.createElement(k,{label:"IAM Profile",value:n}),pt.createElement(k,{label:"CPU(s)",value:r.cpu}),pt.createElement(k,{label:"Memory",value:`${r.memory} MB`}),pt.createElement(k,{label:"Disk",value:`${r.disk} MB`}),pt.createElement(k,{label:"Network",value:`${r.networkMbps} Mbps`}),pt.createElement(k,{label:"GPU(s)",value:r.gpu}))}};ro=((e,t,n,r)=>{for(var a,s=r>1?void 0:r?no(t,n):t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([_e("titus.serverGroup.launchConfigSection")],ro);const ao="titus.servergroup.details.launchConfigSection";t(ao,[]).component("titusLaunchConfigSection",jt(nt(ro,"titusLaunchConfigSection"),["serverGroup"]));class so extends pt.Component{static show(e){return Me.show(so,e)}submit(e,t){const{application:n,serverGroup:r}=this.props,a={type:"upsertDisruptionBudget",cloudProvider:"titus",credentials:r.account,region:r.region,jobId:r.id,disruptionBudget:e.disruptionBudget};t.submit(()=>rt.executeTask({job:[a],application:n,description:`Update Disruption Budget for ${r.name}`}))}render(){const{application:e,command:t,dismissModal:n}=this.props,r=new Le({application:e,title:"Updating Job Disruption Budget",modalInstance:Le.modalInstanceEmulation(()=>n()),onTaskComplete:()=>e.serverGroups.refresh()});return pt.createElement(pt.Fragment,null,pt.createElement(Ve,{monitor:r}),pt.createElement(Ge,{initialValues:t,onSubmit:e=>this.submit(e,r),render:t=>pt.createElement(pt.Fragment,null,pt.createElement(We,{dismiss:n}),pt.createElement(zt.Header,null,pt.createElement(zt.Title,null,"Update Disruption Budget")),pt.createElement(zt.Body,null,pt.createElement(Ln,{formik:t,app:e})),pt.createElement(zt.Footer,null,pt.createElement("button",{className:"btn btn-default",onClick:n,type:"button"},"Cancel"),pt.createElement(at,{onClick:()=>this.submit(t.values,r),isDisabled:!t.isValid,isFormSubmit:!0,submitting:!1,label:"Update Budget"})))}))}}class io extends pt.Component{constructor(){super(...arguments),this.SectionHeading=({budget:e,options:t,label:n})=>{const r=t.find(t=>!!e[t.field]);return r?pt.createElement("div",null,pt.createElement("div",{className:"bold"},n),r.label," ",pt.createElement(ae,{content:r.description})):null},this.Policy=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.availabilityPercentageLimit?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Percentage of Healthy Containers"),e.availabilityPercentageLimit.percentageOfHealthyContainers," percent"):e.relocationLimit?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Limit"),e.relocationLimit.limit," task",1!==e.relocationLimit.limit&&"s"):e.unhealthyTasksLimit?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Limit of Unhealthy Containers"),e.unhealthyTasksLimit.limitOfUnhealthyContainers," container",1!==e.unhealthyTasksLimit.limitOfUnhealthyContainers&&"s"):e.selfManaged?pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Relocation Time"),e.selfManaged.relocationTimeMs>0&&pt.createElement(t,{durationMs:e.selfManaged.relocationTimeMs}),0===e.selfManaged.relocationTimeMs&&"0 ms (immediate)"):null},this.ParentheticalDuration=({durationMs:e})=>pt.createElement("span",null,e," ms",e>1e3&&` (${Bt(e)})`),this.Rate=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.ratePerInterval?pt.createElement(pt.Fragment,null,pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Interval"),pt.createElement(t,{durationMs:e.ratePerInterval.intervalMs})),pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Limit"),e.ratePerInterval.limitPerInterval," task",1!==e.ratePerInterval.limitPerInterval&&"s")):e.ratePercentagePerInterval?pt.createElement(pt.Fragment,null,pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Interval"),pt.createElement(t,{durationMs:e.ratePercentagePerInterval.intervalMs})),pt.createElement("div",null,pt.createElement("div",{className:"bold"},"Percentage per Interval"),e.ratePercentagePerInterval.percentageLimitPerInterval," percent")):null},this.groupedDays=e=>{const t=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n=e.sort((e,n)=>t.indexOf(e)-t.indexOf(n)),r=[],a=[];return t.slice(t.indexOf(n[0])).forEach(e=>{n.includes(e)?a.push(e):a.length&&(r.push(this.toDayRangeString(a)),a.length=0)}),a.length&&r.push(this.toDayRangeString(a)),r.join(", ")},this.TimeWindows=({budget:e})=>{const{groupedDays:t}=this,n=e.timeWindows&&e.timeWindows.length>0;return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:"bold"},"When can disruption occur?"),pt.createElement("div",null,n&&e.timeWindows.map((e,n)=>e.hourlyTimeWindows.map((r,a)=>pt.createElement("div",{key:`${n}.${a}`},t(e.days),", ",r.startHour,":00 - ",r.endHour,":00 ",e.timeZone))),!n&&"Any time"))},this.editBudget=()=>{const{app:e,serverGroup:t}=this.props;Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(e,t).then(n=>{so.show({command:n,application:e,serverGroup:t})})}}toDayRangeString(e){return e.length?1===e.length?e[0].substr(0,3):`${e[0].substr(0,3)}-${e[e.length-1].substr(0,3)}`:null}render(){const{Policy:e,SectionHeading:t,Rate:n,TimeWindows:r}=this,a=this.props.serverGroup,s=!a.migrationPolicy||"SystemDefault"===a.migrationPolicy.type,i=An(this.props.app),o=a.disruptionBudget||i,l=!s&&Gt(o,i);return pt.createElement(pt.Fragment,null,pt.createElement(On,null),l&&pt.createElement("div",null,"(default policy)"),pt.createElement("div",{className:"bottom-border"},pt.createElement(t,{budget:o,options:In,label:"Policy"}),pt.createElement(e,{budget:o})),pt.createElement("div",{className:"bottom-border"},pt.createElement(t,{budget:o,options:Dn,label:"Rate"}),pt.createElement(n,{budget:o})),pt.createElement(r,{budget:o}),pt.createElement("div",{className:"sp-margin-l-top"},pt.createElement("a",{className:"clickable",onClick:this.editBudget},"Edit Disruption Budget")))}}const oo="spinnaker.titus.disruptionbudget.section";t(oo,[]).component("titusDisruptionBudgetSection",jt(nt(io,"titusDisruptionBudgetSection"),["serverGroup","app"]));const lo="spinnaker.titus.serverGroup.details.rollback.controller";t(lo,[st]).controller("titusRollbackServerGroupCtrl",["$scope","$uibModalInstance","serverGroupWriter","application","serverGroup","previousServerGroup","disabledServerGroups","allServerGroups",function(e,t,n,r,a,s,i,o){e.serverGroup=a,e.disabledServerGroups=i.sort((e,t)=>t.name.localeCompare(e.name)),e.allServerGroups=o.sort((e,t)=>t.name.localeCompare(e.name)),e.verification={};const l=a.capacity.desired;let c,u="EXPLICIT";if(0===o.length&&a.entityTags){const t=yt(a,"entityTags.creationMetadata.value.previousServerGroup");t&&(u="PREVIOUS_IMAGE",e.previousServerGroup={name:t.name,imageName:t.imageName},t.imageId&&t.imageId!==t.imageName&&(e.previousServerGroup.imageId=t.imageId))}c=l<10?100:l<20?90:95,e.command={rollbackType:u,rollbackContext:{imageId:s?s.imageId:void 0,rollbackServerGroupName:a.name,restoreServerGroupName:s?s.name:void 0,targetHealthyRollbackPercentage:c,delayBeforeDisableSeconds:0},targetGroups:a.targetGroups,securityGroups:a.securityGroups},e.minHealthy=function(e){return Math.ceil(l*e/100)},r&&r.attributes&&(r.attributes.platformHealthOnlyShowOverride&&r.attributes.platformHealthOnly&&(e.command.interestingHealthProviderNames=["Titus"]),e.command.platformHealthOnlyShowOverride=r.attributes.platformHealthOnlyShowOverride),this.isValid=function(){const t=e.command;return!!e.verification.verified&&("PREVIOUS_IMAGE"===u||void 0!==t.rollbackContext.restoreServerGroupName)},e.taskMonitor=new Le({application:r,title:"Rollback "+a.name,modalInstance:t}),this.rollback=function(){if(!this.isValid())return;e.taskMonitor.submit(function(){return n.rollbackServerGroup(a,r,e.command)})},this.cancel=function(){t.dismiss()},this.label=function(e){if(!e)return"";if(!e.buildInfo||!e.buildInfo.images)return e.name;let t=e.buildInfo.images[0];return t.indexOf("/")>0&&(t=t.substring(t.indexOf("/")+1)),e.name+" ("+t+")"},this.group=function(e){return e.isDisabled?"Disabled Server Groups":"Enabled Server Groups"}}]);class co extends pt.Component{constructor(e){super(e),this.handleClick=()=>{this.setState({showSelection:!0})},this.typeSelected=e=>{this.setState({typeSelection:e,showSelection:!1,showModal:!0}),"step"===e&&this.createStepPolicy(),"targetTracking"===e&&this.createTargetTrackingPolicy()},this.showModalCallback=()=>{this.setState({showSelection:!1,showModal:!1,typeSelection:null})},this.state={showSelection:!1,showModal:!1,typeSelection:null,awsAccount:null},T.getAccountDetails(e.serverGroup.account).then(e=>{this.setState({awsAccount:e.awsAccount})})}createStepPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewStepScalingPolicyTemplate(e),serverGroup:e};Me.show(eo,n,{dialogClassName:"wizard-modal modal-lg"})}createTargetTrackingPolicy(){const{serverGroup:e,application:t}=this.props,n={app:t,policy:Zt.titusServerGroupTransformer.constructNewTargetTrackingPolicyTemplate(e),serverGroup:e};Me.show(_i,n,{dialogClassName:"wizard-modal modal-lg"})}render(){const{min:e,max:t}=this.props.serverGroup.capacity;return pt.createElement("div",null,this.state.awsAccount?pt.createElement("a",{className:"clickable",onClick:this.handleClick},"Create new scaling policy"):null,this.state.showSelection&&pt.createElement(b,{warnOnMinMaxCapacity:e===t,typeSelectedCallback:this.typeSelected,showCallback:this.showModalCallback}))}}const uo="spinnaker.titus.serverGroup.details.scaling.policy.button";t(uo,[]).component("titusCreateScalingPolicyButton",jt(nt(co,"titusCreateScalingPolicyButton"),["application","serverGroup"]));const mo=O(()=>null,"titus.serverGroup.details.customScaling"),po="spinnaker.application.titus.serverGroup.customScaling.component";t(po,[]).component("titusCustomScalingPolicy",jt(nt(mo,"titusCustomScalingPolicy"),["application","serverGroup"]));const go="spinnaker.titus.scalingPolicy.module";t(go,[uo,po]);const ho=e=>{const{application:t,serverGroup:n}=e,{region:r,id:a,account:s,cloudProvider:i}=n,o=(l=n.serviceJobProcesses,Object.keys(l).reduce((e,t)=>(l[t]&&e.push(t),e),[]));var l;return pt.createElement(tt,{...e,title:`Modify Service Job Processes for ${n.name}`,description:`Update Service Job Processes for ${n.name}`,initialValues:{serviceJobProcesses:o},render:()=>pt.createElement(pt.Fragment,null,pt.createElement(de,{label:"Service Job Processes",name:"serviceJobProcesses",input:e=>pt.createElement(be,{...e,options:Object.keys(n.serviceJobProcesses).map(e=>({value:e,label:ye(e)}))})}),pt.createElement(de,{label:"Reason",name:"reason",input:e=>pt.createElement(it,{...e,rows:3,placeholder:"(Optional) anything that might be helpful to explain the reason for this change; HTML is okay"})})),mapValuesToTask:({serviceJobProcesses:e,reason:o})=>({job:[{type:"updateJobProcesses",serviceJobProcesses:Object.keys(n.serviceJobProcesses).reduce((t,n)=>(t[n]=!!e.includes(n),t),{}),reason:o,region:r,jobId:a,credentials:s,cloudProvider:i}],application:t.name})})};class fo extends pt.Component{constructor(){super(...arguments),this.toggleServiceJobProcesses=()=>{const{app:e,serverGroup:t}=this.props;Me.show(ho,{application:e,serverGroup:t})}}render(){const{serviceJobProcesses:e}=this.props.serverGroup;return pt.createElement(pt.Fragment,null,pt.createElement("ul",{className:"scaling-processes"},Object.keys(e).map(t=>pt.createElement("li",{key:t},pt.createElement("span",{style:{visibility:e[t]?"visible":"hidden"},className:"fa fa-check small"}),pt.createElement("span",{className:e[t]?"":"text-disabled"},ye(t)," ")))),pt.createElement("a",{className:"clickable",onClick:this.toggleServiceJobProcesses},"Edit Service Job Processes"))}}const vo="spinnaker.titus.servicejobprocesses.section";t(vo,[]).component("titusServiceJobProcessesSection",jt(nt(fo,"titusServiceJobProcessesSection"),["serverGroup","app"]));const yo="spinnaker.titus.serverGroup.details.packageDetails.component";t(yo,[]).component("titusPackageDetailsSection",jt(nt(({buildInfo:e})=>{var t,n;const r=e.jenkins||{},a=Boolean(Object.keys(r).length),{commitId:s,host:i,name:o,number:l,version:c}=r,u=`${i}job/${o}/${l}`;return mt.createElement(w,{heading:"Package"},!a&&mt.createElement("div",null,"No package information available."),a&&mt.createElement(S,{className:"horizontal-when-filters-collapsed"},o&&mt.createElement(k,{label:"Job",value:o}),(null==(t=e.docker)?void 0:t.image)&&mt.createElement(k,{label:"Image Name",value:null==(n=e.docker)?void 0:n.image}),l&&mt.createElement(k,{label:"Build",value:l}),s&&mt.createElement(k,{label:"Commit",value:s.substring(0,8)}),c&&mt.createElement(k,{label:"Version",value:c}),i&&mt.createElement(k,{label:"Build Link",value:mt.createElement("a",{target:"_blank",href:u},u)})))},"titusPackageDetailsSection"),["buildInfo"]));const bo="spinnaker.titus.serverGroup.details.securityGroups.component";t(bo,[]).component("titusSecurityGroups",jt(nt(Ut,"titusSecurityGroups"),["app","serverGroup"]));const Co="spinnaker.serverGroup.details.titus.controller";e.module(Co,[It,Rn,oo,st,lo,vo,go,bo,yo]).controller("titusServerGroupDetailsCtrl",["$scope","$state","$templateCache","$interpolate","app","serverGroup","titusServerGroupCommandBuilder","$uibModal","serverGroupWriter","awsServerGroupTransformer",function(t,n,r,a,s,i,o,l,c,u){const d=s;function m(){const n=ft.find(d.serverGroups.data,function(e){return e.name===i.name&&e.account===i.accountId&&e.region===i.region});return Xe.getServerGroup(d.name,i.accountId,i.region,i.name).then(function(r){t.state.loading=!1,r.account=i.accountId,T.getAccountDetails(r.account).then(e=>{r.apiEndpoint=ft.filter(e.regions,{name:r.region})[0].endpoint}),t.buildInfo=r.buildInfo,e.extend(r,n),t.serverGroup=r;const a=t.serverGroup.labels;var s;delete a.name,delete a.source,delete a.spinnakerAccount,delete a[""],Object.keys(a).forEach(e=>{e.startsWith("titus.")&&delete a[e]}),t.labels=a,(s=r).scalingPolicies=(s.scalingPolicies||[]).map(e=>{const{policy:t}=e,{stepPolicyDescriptor:n,targetPolicyDescriptor:r}=t,a=n?"StepScaling":"TargetTrackingScaling";if(n){const t=n.alarmConfig;t.period=t.periodSec,t.namespace=t.metricNamespace,t.disableEditingDimensions=!0,"NFLX/EPIC"!==t.metricNamespace||t.dimensions||(t.dimensions=[{name:"AutoScalingGroupName",value:s.name}]),t.dimensions||(t.dimensions=[]);const r=ft.cloneDeep(n.scalingPolicy);return r.cooldown=r.cooldownSec,r.policyType=a,r.alarms=[t],r.id=e.id,r.stepAdjustments&&r.stepAdjustments.forEach(e=>{e.metricIntervalUpperBound=ft.get(e,"metricIntervalUpperBound",e.MetricIntervalUpperBound),e.metricIntervalLowerBound=ft.get(e,"metricIntervalLowerBound",e.MetricIntervalLowerBound)}),r}{const{customizedMetricSpecification:n}=r;return void 0===n.dimensions&&(n.dimensions=[]),t.id=e.id,t.targetTrackingConfiguration=t.targetPolicyDescriptor,t.targetTrackingConfiguration.scaleOutCooldown=t.targetTrackingConfiguration.scaleOutCooldownSec,t.targetTrackingConfiguration.scaleInCooldown=t.targetTrackingConfiguration.scaleInCooldownSec,t}}).map(e=>u.transformScalingPolicy(e)),ft.isEmpty(t.serverGroup)?p():g()},p)}function p(){t.$$destroyed||n.go("^",{allowModalToStayOpen:!0},{location:"replace"})}this.application=s,t.gateUrl=R.gateUrl,t.state={loading:!0},m().then(()=>{t.$$destroyed||s.serverGroups.onRefresh(t,m)}).catch(()=>{}),T.getAccountDetails(i.accountId).then(e=>{const n=e.awsAccount;t.titusUiEndpoint=ft.filter(e.regions,{name:i.region})[0].endpoint,T.getAccountDetails(n).then(e=>{this.awsAccountId=e.accountId,this.env=e.environment})});const g=()=>{this.entityTagTargets=lt.buildClusterTargets(t.serverGroup)};this.destroyServerGroup=function(){const e=t.serverGroup,r={application:d,title:"Destroying "+e.name,onTaskComplete:function(){n.includes("**.serverGroup",a)&&n.go("^")}},a={name:e.name,accountId:e.account,region:e.region},i={header:"Really destroy "+e.name+"?",buttonText:"Destroy "+e.name,account:e.account,taskMonitorConfig:r,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.destroyServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region})}};ot.addDestroyWarningMessage(s,e,i),et(e,s).then(e=>e&&x.confirm(i))},this.disableServerGroup=function(){const e=t.serverGroup,n={application:d,title:"Disabling "+e.name},r={header:"Really disable "+e.name+"?",buttonText:"Disable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.disableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};ot.addDisableWarningMessage(s,e,r),et(e,s).then(e=>e&&x.confirm(r))},this.enableServerGroup=()=>{et(i,s).then(e=>{if(!e)return;if(!this.isRollbackEnabled())return void this.showEnableServerGroupModal();const t={header:"Rolling back?",body:"Spinnaker provides an orchestrated rollback feature to carefully restore a different version of this\n server group. Do you want to use the orchestrated rollback?",buttonText:"Yes, take me to the rollback settings modal",cancelButtonText:"No, I just want to enable the server group"};x.confirm(t).then(()=>new Promise(e=>setTimeout(e,500))).then(()=>this.rollbackServerGroup()).catch(({source:e})=>{"footer"===e&&this.showEnableServerGroupModal()})})},this.resizeServerGroup=()=>{et(i,s).then(e=>{e&&Me.show(Qn,{serverGroup:t.serverGroup,application:d})})},this.showEnableServerGroupModal=()=>{const e=t.serverGroup,n={application:d,title:"Enabling "+e.name},r={header:"Really enable "+e.name+"?",buttonText:"Enable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:s.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.enableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};x.confirm(r)},this.cloneServerGroup=function(){Zt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(d,t.serverGroup).then(e=>{const t=`Clone ${i.name}`;Hn.show({title:t,application:d,command:e})})},this.isRollbackEnabled=function(){const e=t.serverGroup;return!e.isDisabled||d.getDataSource("serverGroups").data.some(t=>t.cluster===e.cluster&&t.region===e.region&&t.account===e.account&&!1===t.isDisabled)},this.rollbackServerGroup=function(){let e,n=t.serverGroup,r=s.getDataSource("serverGroups").data.filter(e=>e.cluster===n.cluster&&e.region===n.region&&e.account===n.account);n.isDisabled&&(e=n,n=ft.orderBy(r.filter(t=>t.name!==e.name&&!t.isDisabled),["instanceCounts.total","createdTime"],["desc","desc"])[0]),r=r.filter(e=>e.name!==n.name),1!==r.length||e||(e=r[0]),et(n,s).then(t=>{t&&l.open({templateUrl:"titus/src/serverGroup/details/rollback/rollbackServerGroup.html",controller:"titusRollbackServerGroupCtrl as ctrl",resolve:{serverGroup:()=>n,previousServerGroup:()=>e,disabledServerGroups:()=>{const e=ft.find(d.clusters,{name:n.cluster,account:n.account});return ft.filter(e.serverGroups,{isDisabled:!0,region:n.region})},allServerGroups:()=>r,application:()=>d}})})}}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/rollback/rollbackServerGroup.html",'<div modal-page class="confirmation-modal">\n <task-monitor monitor="taskMonitor"></task-monitor>\n <form role="form">\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">Rollback {{serverGroup.name}}</h4>\n </div>\n <div class="modal-body confirmation-modal">\n <div class="row">\n <div class="col-sm-3 sm-label-right">Restore to</div>\n <div class="col-sm-7">\n <ui-select\n ng-model="command.rollbackContext.restoreServerGroupName"\n class="form-control input-sm"\n ng-if="command.rollbackType === \'EXPLICIT\'"\n >\n <ui-select-match placeholder="Select...">{{ctrl.label($select.selected)}}</ui-select-match>\n <ui-select-choices group-by="ctrl.group" repeat="serverGroup.name as serverGroup in allServerGroups">\n <span ng-bind-html="ctrl.label(serverGroup)"></span>\n </ui-select-choices>\n </ui-select>\n <div ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'" style="margin-top: 5px">\n {{ previousServerGroup.name }} <span class="small">(no longer deployed)</span><br />\n <span class="small">\n <strong>Image</strong>: {{ previousServerGroup.imageName}}\n <span ng-if="previousServerGroup.imageId">({{ previousServerGroup.imageId }})</span><br />\n </span>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="command.platformHealthOnlyShowOverride">\n <div class="col-sm-10 col-sm-offset-1">\n <platform-health-override\n command="command"\n platform-health-type="\'Titus\'"\n show-help-details="true"\n field-columns="12"\n >\n </platform-health-override>\n </div>\n </div>\n\n <task-reason command="command"></task-reason>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Wait\n <input\n placeholder="0"\n min="0"\n type="number"\n ng-model="command.rollbackContext.delayBeforeDisableSeconds"\n class="form-control input-sm inline-number"\n />\n seconds before disabling <em>{{ ctrl.label(serverGroup) }}</em>.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-11 col-sm-offset-1">\n Consider rollback successful when\n <input\n type="number"\n min="0"\n max="100"\n ng-model="command.rollbackContext.targetHealthyRollbackPercentage"\n class="form-control input-sm inline-number"\n />\n percent of instances are healthy.\n </div>\n </div>\n\n <div class="row">\n <div class="col-sm-4 sm-label-right">Rollback Operations</div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'EXPLICIT\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>Enable <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em></li>\n <li>\n Resize <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> to [\n <strong>min</strong>: {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max\n }}, <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during rollback)\n </li>\n\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable {{ serverGroup.name }}</li>\n <li>\n Restore minimum capacity of\n <em>{{ command.rollbackContext.restoreServerGroupName || \'previous server group\' }}</em> [\n <strong>min</strong>: {{ serverGroup.capacity.min }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n <div class="row" ng-if="command.rollbackType === \'PREVIOUS_IMAGE\'">\n <div class="col-sm-11 col-sm-offset-1">\n <ol>\n <li>\n Deploy <em>{{ previousServerGroup.imageId }}</em> [ <strong>min</strong>:\n {{serverGroup.capacity.desired}}, <strong>max</strong>: {{ serverGroup.capacity.max }},\n <strong>desired</strong>: {{ serverGroup.capacity.desired }} ]<br />(minimum capacity pinned at\n {{serverGroup.capacity.desired}} to prevent autoscaling down during deploy)\n </li>\n <li ng-if="command.rollbackContext.targetHealthyRollbackPercentage < 100">\n Wait for at least {{minHealthy(command.rollbackContext.targetHealthyRollbackPercentage)}} instances to\n report as healthy\n </li>\n <li>Disable <em>{{ serverGroup.name }}</em></li>\n <li>\n Restore minimum capacity of <em>new server group</em> [ <strong>min</strong>: {{ serverGroup.capacity.min\n }} ]\n </li>\n </ol>\n <p>This rollback will affect server groups in {{ serverGroup.account }} ({{ serverGroup.region }}).</p>\n </div>\n </div>\n </div>\n <aws-footer\n action="ctrl.rollback()"\n cancel="ctrl.cancel()"\n is-valid="ctrl.isValid()"\n account="serverGroup.account"\n verification="verification"\n ></aws-footer>\n </form>\n</div>\n')}]);const Eo="spinnaker.titus.serverGroup.transformer";t(Eo,[]).factory("titusServerGroupTransformer",["$q",function(e){return{convertServerGroupCommandToDeployConfiguration:function(e){const t=ft.defaults({backingData:[],viewState:[]},e);return"clone"!==e.viewState.mode&&delete t.source,t.account=t.credentials,t.efs.mountPoint&&t.efs.efsId&&t.efs.mountPerm||delete t.efs,delete t.viewState,delete t.backingData,delete t.selectedProvider,t},normalizeServerGroup:function(e){return T.getCredentialsKeyedByAccount("titus").then(t=>(e.account&&t[e.account]&&(e.awsAccount=t[e.account].awsAccount),e))},constructNewStepScalingPolicyTemplate:function(e){return{alarms:[{namespace:"NFLX/EPIC",metricName:"",threshold:50,statistic:"Average",comparisonOperator:"GreaterThanThreshold",evaluationPeriods:1,disableEditingDimensions:!0,dimensions:[{name:"AutoScalingGroupName",value:e.name}],period:60}],adjustmentType:"ChangeInCapacity",stepAdjustments:[{scalingAdjustment:1,metricIntervalLowerBound:0}],cooldown:300}},constructNewTargetTrackingPolicyTemplate:function(e){return{alarms:[],targetTrackingConfiguration:{targetValue:null,disableScaleIn:!1,customizedMetricSpecification:{namespace:"NFLX/EPIC",metricName:"",dimensions:[{name:"AutoScalingGroupName",value:e.name}]},scaleInCooldown:300,scaleOutCooldown:300}}}}}]);ct.registerValidator("titus",new class{validateSpecialCharacters(e,t){/^[a-zA-Z_0-9.]*$/g.test(e)||t.push("Only dot(.) and underscore(_) special characters are allowed.")}validateLength(e,t,n){if(e.length>250)n.push("The maximum length for an application in Titus is 250 characters.");else if(e.length>240)if(e.length>=248)t.push(`You will not be able to include a stack or detail field for clusters or ${D.get("firewalls")}.`);else{const n=248-e.length;t.push(`If you plan to include a stack or detail field for clusters, you will only\n have ~${n} characters to do so.`)}}validate(e=""){const t=[],n=[];return e&&e.length&&(this.validateSpecialCharacters(e,n),this.validateLength(e,t,n)),{warnings:t,errors:n}}});vn('.cloud-provider-logo .icon-titus {\n -webkit-mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg width%3D%2247px%22 height%3D%2240px%22 viewBox%3D%220 0 47 40%22 version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E %3Cg transform%3D%22translate(1.000000%2C 1.000000)%22%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746%22 id%3D%22Fill-1%22 fill%3D%22%23000000%22%3E%3C%2Fpath%3E %3Cpath d%3D%22M30.8746%2C26.4746 C27.6746%2C26.4746 25.0746%2C23.8746 25.0746%2C20.6746 C25.0746%2C17.4746 27.6746%2C14.8746 30.8746%2C14.8746 C34.0746%2C14.8746 36.6746%2C17.4746 36.6746%2C20.6746 C36.5746%2C23.8746 34.0746%2C26.4746 30.8746%2C26.4746 L30.8746%2C26.4746 Z M14.2746%2C26.4746 C11.0746%2C26.4746 8.4746%2C23.8746 8.4746%2C20.6746 C8.4746%2C17.4746 11.0746%2C14.8746 14.2746%2C14.8746 C17.4746%2C14.8746 20.0746%2C17.4746 20.0746%2C20.6746 C20.0746%2C23.8746 17.4746%2C26.4746 14.2746%2C26.4746 L14.2746%2C26.4746 Z M38.6746%2C18.0746 L38.6746%2C2.1746 L37.5746%2C2.1746 L37.5746%2C7.5746 L34.8746%2C7.5746 C32.4746%2C3.1746 27.8746%2C0.1746 22.5746%2C0.1746 C17.2746%2C0.1746 12.6746%2C3.1746 10.2746%2C7.5746 L7.0746%2C7.5746 L7.0746%2C2.1746 L5.9746%2C2.1746 L5.9746%2C17.9746 C2.7746%2C17.9746 0.1746%2C20.5746 0.1746%2C23.7746 C0.1746%2C26.9746 2.7746%2C29.5746 5.9746%2C29.5746 C6.1746%2C29.5746 6.3746%2C29.4746 6.4746%2C29.4746 L6.4746%2C37.6746 L38.4746%2C37.6746 L38.4746%2C29.5746 C41.6746%2C29.5746 44.2746%2C26.9746 44.2746%2C23.7746 C44.3746%2C20.5746 41.7746%2C18.0746 38.6746%2C18.0746 L38.6746%2C18.0746 Z%22 id%3D%22Stroke-3%22 stroke%3D%22%23000000%22 stroke-width%3D%222.349%22%3E%3C%2Fpath%3E %3C%2Fg%3E%3C%2Fsvg%3E");\n}\n');const wo="spinnaker.titus";t(wo,[jn,Bn,Co,Rn,Vn,Eo,ln,on,an,rn,cn,nn,sn,zn,Fn,to,ao]).config(()=>{ut.registerProvider("titus",{name:"Titus",logo:{path:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABGCAYAAAB7Xo6TAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAABCVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgIC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Y1lpP7HrIkom6rY2D2WpklDS9a0nug6OqB44IoCOklGJPfV7KCr5KD/nML1q1N56SU4lcX1toakAU6Xs7F4S5QvIGg0iGQU0GsgRIrDLDh4FmKP5rQWIEiEMfXEjhYkcyWzy+KWmpjlbbVxcPCsJRLv7tFc5sgvTZq8q8qZuYO2T1a0nug6OqB44IoCuHsFDVszuxwTeP4sJaxRTubIAfh8pqng7B8Dx+2FL9cvRoRAC2dpDNwFPI0FokkwtzqtNEZC7Q69Cc7U9FnGIi+vTLH5GC3F5iUkSTbT3pt9hOjPNVVTSPdjP1zMpoNVM17bUI+uXdDha1KkMfGS19tO3hvexh039iAG69zjnn3++2GQrq8zPz08HxEMwU/VnnwG4EyCASMAfrg3bbASEEc9x9xZi6A9BsJx6jfs8ufbaGCVaNxGFfgeVS6/m4F7ntDJAE9MTFUVZ1fZyh7/kGezXr9+2Di8eYScFcpJk5T3AcIQ19YA254gDevunwy5dyDlt73nXeFnyqokjhcP5I+HkCXDYDAAtYhjC1h8u7ogCQEdCJGGMAmEaASCSMAgiTJ4+7o3nuHsL4TjCgEjc5BAIx0Ulcq9Xbad7cXrc5fvO2GkJh+aCB3L2sr0rVtnTug9NAw5RLRCyPLVtkha9/B4X7m9z9gj/QXtDQSVvoOLdc3kWeSW1yWmTzqavwcnNraHaqeoQQBhbOO7qCPYJbJkiDAhiMITiF/cH+E48kpikY4UVCPjaIBA3dU57jxhkWkRs6UX9SbRt9ywMKu0okW8Q+dZ2dO1gnqNOcXKJWpr7t3v+38Gs9AgpWxz9DDp+NQ//ryOkTXttBm0VcMXNPfDqGRR8lMQmcHdnE8A9rs9hEOQ6kGzN5pm5JNTLJa2gILm1k9lckrxPXU7uhxhcAJf22sTltZf4I2LQnsWJTuDGr3HPH+lLN9Gkpag2O64P4oS8gze1udD146D2wP8H5JyTFz+hnOcAAAAASUVORK5CYII="},serverGroup:{transformer:"titusServerGroupTransformer",detailsTemplateUrl:"titus/src/serverGroup/details/serverGroupDetails.html",detailsController:"titusServerGroupDetailsCtrl",CloneServerGroupModal:Hn,commandBuilder:"titusServerGroupCommandBuilder",configurationService:"titusServerGroupConfigurationService",skipUpstreamStageCheck:!0,checkForImageProviders:!0,TargetTrackingChart:Qi,UpsertStepPolicyModal:eo,UpsertTargetTrackingModal:_i},securityGroup:{reader:"titusSecurityGroupReader",useProvider:"aws"},loadBalancer:{LoadBalancersTag:C,incompatibleLoadBalancerTypes:[{type:"classic",reason:"Classic Load Balancers cannot be used with Titus as they do not have IP based target groups."}],useProvider:"aws"},instance:{details:en}})}),dt.registerProvider("titus",["custom","redblack","monitored"]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/serverGroupDetails.html",'<div class="details-panel" ng-class="{ disabled: serverGroup.isDisabled }">\n <div class="header" ng-if="state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <h4 class="text-center">\n <span us-spinner="{radius:20, width:6, length: 12}"></span>\n </h4>\n </div>\n\n <div class="header" ng-if="!state.loading">\n <div class="close-button">\n <a class="btn btn-link" ui-sref="^">\n <span class="glyphicon glyphicon-remove"></span>\n </a>\n </div>\n <div class="header-text horizontal middle">\n <cloud-provider-logo provider="serverGroup.type" height="\'36px\'" width="\'36px\'"></cloud-provider-logo>\n <h3 class="horizontal middle space-between flex-1" select-on-dbl-click>\n {{serverGroup.name}}\n <render-if-feature feature="entityTags">\n <entity-notifications\n entity="serverGroup"\n application="ctrl.application"\n placement="bottom"\n h-offset-percent="90%"\n entity-type="serverGroup"\n page-location="details"\n on-update="ctrl.application.serverGroups.refresh()"\n ></entity-notifications>\n </render-if-feature>\n </h3>\n </div>\n <div>\n <div class="actions" ng-class="{ insights: serverGroup.insightActions.length > 0 }">\n <div class="dropdown" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle>\n Server Group Actions <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li><a href ng-if="ctrl.isRollbackEnabled()" ng-click="ctrl.rollbackServerGroup()">Rollback</a></li>\n <li role="presentation" class="divider" ng-if="ctrl.isRollbackEnabled()"></li>\n <li><a href ng-click="ctrl.resizeServerGroup()">Resize</a></li>\n <li><a href ng-if="!serverGroup.isDisabled" ng-click="ctrl.disableServerGroup()">Disable</a></li>\n <li><a href ng-if="serverGroup.isDisabled" ng-click="ctrl.enableServerGroup()">Enable</a></li>\n <li><a href ng-click="ctrl.destroyServerGroup()">Destroy</a></li>\n <li><a href ng-click="ctrl.cloneServerGroup()">Clone</a></li>\n <add-entity-tag-links\n component="serverGroup"\n application="ctrl.application"\n entity-type="serverGroup"\n owner-options="ctrl.entityTagTargets"\n on-update="ctrl.application.serverGroups.refresh"\n ></add-entity-tag-links>\n </ul>\n </div>\n <div class="dropdown" ng-if="serverGroup.insightActions.length > 0" uib-dropdown dropdown-append-to-body>\n <button type="button" class="btn btn-sm btn-default dropdown-toggle" uib-dropdown-toggle>\n Insight <span class="caret"></span>\n </button>\n <ul class="dropdown-menu" uib-dropdown-menu role="menu">\n <li\n ng-repeat="action in serverGroup.insightActions"\n analytics-on="click"\n analytics-category="Insight Menu (Server Group)"\n analytics-event="{{action.label}} clicked"\n analytics-label="{{serverGroup.account}}/{{serverGroup.region}}/{{serverGroup.name}}"\n >\n <a target="_blank" href="{{action.url}}">{{action.label}}</a>\n </li>\n </ul>\n </div>\n <div class="clearfix"></div>\n </div>\n </div>\n </div>\n <div class="content" ng-if="!state.loading">\n <div class="band band-info" ng-if="serverGroup.isDisabled">Job is Disabled</div>\n <managed-resource-details-indicator\n ng-if="!state.loading && serverGroup.isManaged"\n resource-summary="serverGroup.managedResourceSummary"\n application="ctrl.application"\n ></managed-resource-details-indicator>\n <server-group-running-tasks-details\n server-group="serverGroup"\n application="ctrl.application"\n ></server-group-running-tasks-details>\n <collapsible-section heading="Server Group Information" expanded="true">\n <dl class="dl-horizontal dl-narrow">\n <dt>Created</dt>\n <dd>{{serverGroup.createdTime | timestamp}}</dd>\n <dt>In</dt>\n <dd>\n <account-tag account="serverGroup.account" pad="right"></account-tag>\n {{serverGroup.region}}\n </dd>\n <dt>Job Id</dt>\n <dd><a href="{{titusUiEndpoint}}jobs/{{serverGroup.id}}" target="_blank">{{serverGroup.id}}</a></dd>\n <entity-source metadata="serverGroup.entityTags.creationMetadata"></entity-source>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Capacity" expanded="true">\n <titus-capacity-details-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-capacity-details-section>\n </collapsible-section>\n <collapsible-section heading="Health" expanded="true" ng-if="serverGroup.instanceCounts.total > 0">\n <dl class="dl-horizontal dl-narrow" ng-if="serverGroup">\n <dt>Tasks</dt>\n <dd>\n <health-counts container="serverGroup.instanceCounts" class="pull-left"></health-counts>\n </dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Launch Configuration">\n <titus-launch-config-section server-group="serverGroup"></titus-launch-config-section>\n </collapsible-section>\n\n <titus-security-groups\n app="ctrl.application"\n server-group="serverGroup"\n class="collapsible-section"\n style="display: block"\n ></titus-security-groups>\n\n <collapsible-section heading="Service Job Processes">\n <titus-service-job-processes-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-service-job-processes-section>\n </collapsible-section>\n\n <collapsible-section heading="Scaling Policies">\n <scaling-policy-summary\n ng-repeat="policy in serverGroup.scalingPolicies"\n policy="policy"\n server-group="serverGroup"\n application="ctrl.application"\n ></scaling-policy-summary>\n <titus-create-scaling-policy-button\n server-group="serverGroup"\n application="ctrl.application"\n ></titus-create-scaling-policy-button>\n <div ng-if="ctrl.awsAccountId">\n <config-bin-link\n application="ctrl.application"\n aws-account-id="ctrl.awsAccountId"\n cluster-name="serverGroup.cluster"\n region="serverGroup.region"\n env="ctrl.env"\n cloud-provider="\'titus\'"\n ></config-bin-link>\n </div>\n <titus-custom-scaling-policy\n application="ctrl.application"\n server-group="serverGroup"\n ></titus-custom-scaling-policy>\n </collapsible-section>\n <titus-package-details-section build-info="buildInfo"></titus-package-details-section>\n <collapsible-section heading="Job Disruption Budget">\n <titus-disruption-budget-section\n app="ctrl.application"\n server-group="serverGroup"\n ></titus-disruption-budget-section>\n </collapsible-section>\n <collapsible-section heading="Job Attributes">\n <div ng-if="!serverGroup.labels">No job attributes associated with this server group</div>\n <dl ng-if="labels">\n <dt ng-repeat-start="(key, val) in labels">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Container Attributes">\n <div ng-if="!serverGroup.containerAttributes">No container attributes associated with this server group</div>\n <dl ng-if="serverGroup.containerAttributes">\n <dt ng-repeat-start="(key, val) in serverGroup.containerAttributes">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n <collapsible-section heading="Environment Variables">\n <div ng-if="!serverGroup.env">No environment variables associated with this server group</div>\n <dl ng-if="serverGroup.env">\n <dt ng-repeat-start="(key, val) in serverGroup.env">{{key}}</dt>\n <dd ng-repeat-end>{{val}}</dd>\n </dl>\n </collapsible-section>\n </div>\n</div>\n')}]);export{wo as TITUS_MODULE,Yi as TitusCapacityDetailsSection,en as TitusInstanceDetails,Vt as TitusInstanceDns,Wt as TitusInstanceInformation,mn as TitusProviderSettings,Ht as TitusReactInject,Zt as TitusReactInjector,Qn as TitusResizeServerGroupModal,Ki as TitusScalingActivitiesModal,Ut as TitusSecurityGroupsDetailsSection,Qi as TitusTargetTrackingChart,eo as TitusUpsertScalingPolicyModal,_i as TitusUpsertTargetTrackingModal,qt as applyTargetGroupInfoToHealthMetric,$t as buildTaskActions,Jt as extractHealthMetrics};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|