@spinnaker/titus 0.4.8 → 0.5.3
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/CHANGELOG.md +40 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/serverGroup/details/scalingPolicy/upsert/TitusScalingPolicyCommandBuilderService.d.ts +9 -0
- package/package.json +5 -5
- package/src/serverGroup/details/scalingPolicy/upsert/TitusScalingPolicyCommandBuilderService.ts +119 -0
- package/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.controller.js +4 -0
- package/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html +8 -6
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 a,InstanceStatus as r,VpcReader as i,ServerGroupSecurityGroupsRemoved as s,SecurityGroupSelector as o,AWSProviderSettings as l,SubnetSelectField as c,ServerGroupCapacity as u,ServerGroupLoadBalancers as d,ServerGroupSecurityGroups as m,ScalingPolicyWriter as p,PolicyTypeSelectionModal as g,MetricAlarmChart as h,AmazonLoadBalancersTag as f}from"@spinnaker/amazon";import{HelpContentsRegistry as v,CollapsibleSection as y,LabeledValueList as b,LabeledValue as C,CopyToClipboard as w,LinkWithClipboard as S,ReactInject as E,AccountService as k,ReactInjector as G,FirewallLabels as T,ConfirmationModalService as A,InstanceWriter as N,overridableComponent as I,useData as P,InstanceReader as x,SETTINGS as D,InstanceDetailsPane as O,Spinner as M,InstanceDetailsHeader as L,InstanceActions as F,InstanceInsights as z,ConsoleOutputLink as j,InstanceLinks as B,RecentHistoryService as R,ClusterState as V,UrlBuilder as W,Registry as H,StageConstants as Z,NameUtils as U,ExecutionDetailsSection as q,AccountTag as J,Markdown as $,RenderOutputFile as K,StageFailureMessage as X,DeployingIntoManagedClusterWarning as Y,AccountSelectInput as Q,RegionSelectField as _,HelpField as ee,ServerGroupDetailsField as te,DeploymentStrategySelector as ne,ServerGroupNamePreview as ae,SpelNumberInput as re,ValidationMessage as ie,FormValidator as se,FormikFormField as oe,TextInput as le,SelectInput as ce,LayoutProvider as ue,MapEditorInput as de,PlatformHealthOverrideInput as me,useFormInputValueMapper as pe,robotToHuman as ge,ChecklistInput as he,CheckboxInput as fe,CACHE_INITIALIZER_SERVICE as ve,LOAD_BALANCER_READ_SERVICE as ye,SECURITY_GROUP_READER as be,setMatchingResourceSummary as Ce,SubnetReader as we,NumberInput as Se,SpinFormik as Ee,ReactSelectInput as ke,ResponsiveFieldLayout as Ge,TetheredSelect as Te,StageConfigField as Ae,MapEditor as Ne,ExecutionDetailsTasks as Ie,TaskMonitor as Pe,ReactModal as xe,DeployInitializer as De,WizardModal as Oe,WizardPage as Me,noop as Le,TaskMonitorWrapper as Fe,ModalClose as ze,PlatformHealthOverride as je,UserVerification as Be,MinMaxDesiredChanges as Re,ModalHeader as Ve,ModalBody as We,ModalFooter as He,ServerGroupReader as Ze,DesiredCapacity as Ue,CurrentCapacity as qe,showModal as Je,Overridable as $e,confirmNotManaged as Ke,withErrorBoundary as Xe,TaskExecutor as Ye,SubmitButton as Qe,SERVER_GROUP_WRITER as _e,ModalInjector as et,TaskMonitorModal as tt,TextAreaInput as nt,ClusterTargetBuilder as at,ServerGroupWarningMessageService as rt,ApplicationNameValidator as it,CloudProviderRegistry as st,DeploymentStrategyRegistry as ot}from"@spinnaker/core";import*as lt from"react";import ct,{useMemo as ut}from"react";import{UISref as dt}from"@uirouter/react";import{UIRouterContextComponent as mt}from"@uirouter/react-hybrid";import pt,{sortBy as gt,get as ht,chain as ft,xor as vt,isUndefined as yt,intersection as bt,set as Ct,union as wt,cloneDeep as St,flatten as Et,isEqual as kt,defaultsDeep as Gt}from"lodash";import Tt from"@uirouter/angularjs";import{DockerImageUtils as At,DockerImageAndTagSelector as Nt}from"@spinnaker/docker";import{$q as It}from"ngimport";import{Field as Pt,Form as xt}from"formik";import Dt from"react-select";import{Subject as Ot}from"rxjs";import{react2angular as Mt}from"react2angular";import{Modal as Lt}from"react-bootstrap";import Ft from"pretty-ms";const zt={"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(zt).forEach((e=>v.register(e,zt[e])));const jt=({containerIp:e,host:t,instancePort:n,ipv6Address:a})=>lt.createElement(y,{heading:"DNS",defaultExpanded:!0},lt.createElement(b,{className:"dl-horizontal dl-narrow"},e&<.createElement(C,{label:"Container IP",value:lt.createElement(lt.Fragment,null,e,lt.createElement(w,{text:e,toolTip:"Copy container IP to clipboard"}))}),a&<.createElement(C,{label:"Container IPv6",value:lt.createElement(S,{text:a,url:`http://${a}:${n}`})}),lt.createElement(C,{label:"Host IP",value:t}))),Bt=({instance:e,titusUiEndpoint:t})=>{const{id:a,jobId:r}=e;return ct.createElement(y,{heading:"Instance Information",defaultExpanded:!0},ct.createElement("dl",{className:"dl-horizontal dl-narrow"},ct.createElement(n,{account:e.account,availabilityZone:e.availabilityZone,instanceType:e.instanceType,launchTime:e.launchTime,provider:e.provider,region:e.region,serverGroup:e.serverGroup}),ct.createElement(C,{label:"Job Id",value:ct.createElement("a",{href:`${t}jobs/${r}`,target:"_blank"},r)}),ct.createElement(C,{label:"Instance Id",value:ct.createElement(S,{text:a,url:`${t}jobs/${r}/tasks/${a}`})})))};class Rt extends E{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 Vt=new Rt;class Wt extends ct.Component{constructor(e){super(e),this.state={}}componentDidMount(){this.configureSecurityGroups(this.props)}configureSecurityGroups(e){const{app:t,serverGroup:n}=e,{region:a}=n;if(t.securityGroupsIndex&&n.accountDetails){const e=n.securityGroups.map((e=>Vt.titusSecurityGroupReader.resolveIndexedSecurityGroup(t.securityGroupsIndex,{account:n.accountDetails.awsAccount,region:a},e)));this.setState({securityGroups:e})}else k.listAllAccounts("titus").then((e=>{const t=e.find((e=>e.name===n.account));t&&t.awsAccount&&G.securityGroupReader.getAllSecurityGroups().then((e=>{const r=e[t.awsAccount].aws[a],i=n.securityGroups.map((e=>r.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:i})}))}))}componentWillReceiveProps(e){this.configureSecurityGroups(e)}render(){const{serverGroup:e}=this.props,{securityGroups:t}=this.state,n=!t&&(e.securityGroups||[]).length;return ct.createElement(y,{heading:T.get("Firewalls"),outerDivClassName:""},ct.createElement("ul",null,n&&e.securityGroups.map((e=>ct.createElement("li",{key:e},"..."))),ct.createElement(mt,null,ct.createElement(ct.Fragment,null,gt(t,"name").map((t=>ct.createElement("li",{key:t.name},ct.createElement(dt,{to:"^.firewallDetails",params:{name:t.name,accountId:t.account,region:e.region,vpcId:t.vpcId,provider:"aws"}},ct.createElement("a",null,t.name," (",t.id,")")))))))))}}const Ht=(e,t,n)=>e.map((e=>{var a;const r=t.find((t=>(t.name===e.name||t.name===e.targetGroupName)&&t.account===n)),i="traffic-port"===(null==r?void 0:r.healthCheckPort)||!(null==r?void 0:r.healthCheckPort);return{...e,name:null==r?void 0:r.name,healthCheckPath:r?`:${i?null==r?void 0:r.port:r.healthCheckPort}${(null==r?void 0:r.healthCheckPath)||""}`:void 0,healthCheckProtocol:null==(a=null==r?void 0:r.healthCheckProtocol)?void 0:a.toLowerCase()}})),Zt=(e,t,n)=>{const r=(e||[]).filter((e=>"Unknown"!==e.state)),i=a(t);return r.map((e=>{if("TargetGroup"===e.type){const t=Ht(e.targetGroups,i,n);return{...e,targetGroups:t}}return e}))},Ut=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id}`,onTaskComplete:()=>{G.$state.includes("**.instanceDetails",{id:e.id})&&G.$state.go("^")}};A.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),N.terminateInstance(e,t,n)}})},qt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id} and shrinking server group`,onTaskComplete:()=>{G.$state.includes("**.instanceDetails",{instanceId:e.id})&&G.$state.go("^")}};A.confirm({header:`Really terminate ${e.id} and shrink ${e.serverGroup}?`,buttonText:`Terminate ${e.id} and shrink ${e.serverGroup}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>N.terminateInstancesAndShrinkServerGroups([{cloudProvider:e.cloudProvider,instanceIds:[e.id],account:e.account,region:e.region,serverGroup:e.serverGroup,instances:[e]}],t)})},Jt=(e,t)=>()=>{const n={application:t,title:`Enabling ${e.id} in discovery`};A.confirm({header:`Really enable ${e.id} in discovery?`,buttonText:`Enable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>N.enableInstanceInDiscovery(e,t)})},$t=(e,t)=>()=>{const n={application:t,title:`Disabling ${e.id} in discovery`};A.confirm({header:`Really disable ${e.id} in discovery?`,buttonText:`Disable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>N.disableInstanceInDiscovery(e,t)})},Kt=(e,t)=>{const n=[{label:"Terminate",triggerAction:Ut(e,t)},{label:"Terminate and Shrink Server Group",triggerAction:qt(e,t)}],a=(e.health||[]).filter((e=>"Discovery"===e.type));a.length&&"OutOfService"===a[0].state&&n.push({label:"Enable in Discovery",triggerAction:Jt(e,t)});return(a||[]).some((e=>"Up"===e.state||"Down"===e.state))&&n.push({label:"Disable in Discovery",triggerAction:$t(e,t)}),n},Xt=I((({account:e,actions:t,app:n,baseIpAddress:a,environment:i,healthMetrics:s,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 lt.createElement("div",{className:"details-panel"},lt.createElement("div",{className:"header"},lt.createElement(L,{healthState:o.healthState,instanceId:l,loading:u,sshLink:v,standalone:n.isStandalone}),lt.createElement("div",{className:"actions"},lt.createElement(F,{actions:t}),Boolean(null==(g=null==o?void 0:o.insightActions)?void 0:g.length)&<.createElement(z,{analytics:!0,insights:o.insightActions,instance:o}))),lt.createElement("div",{className:"content"},lt.createElement(Bt,{instance:o,titusUiEndpoint:o.titusUiEndpoint}),lt.createElement(r,{healthMetrics:s,healthState:o.healthState,metricTypes:["TargetGroup"],privateIpAddress:o.privateIpAddress}),lt.createElement(jt,{containerIp:null==(h=o.placement)?void 0:h.containerIp,host:null==(f=o.placement)?void 0:f.host,instancePort:c,ipv6Address:o.ipv6Address}),lt.createElement("div",{className:"collapsible-section"},lt.createElement(Wt,{app:n,serverGroup:m})),lt.createElement(y,{heading:"Console Output"},lt.createElement(j,{instance:o})),lt.createElement(B,{address:a,application:n,instance:o,environment:i,moniker:d})))}),"titus.instance.details.content"),Yt=({app:e,environment:t,instance:n,moniker:a})=>{var r,i,s;const{instanceId:o}=n,l=e.serverGroups.data.find((e=>e.instances.some((e=>e.id===o)))),{account:c,region:u}=l,d=()=>(R.addExtraDataToLatest("instances",{account:c,region:u,serverGroup:l.name}),Promise.all([x.getInstanceDetails(c,u,o).then((e=>({...e,account:c,region:u}))),k.getAccountDetails(c)])),m=e=>{const[t,n]=e,a=((null==n?void 0:n.regions)||[]).find((e=>e.name===u));return[{titusUiEndpoint:null==a?void 0:a.endpoint,...t},n]},{result:[p,g],status:h}=P((()=>e.isStandalone?d().then((e=>m(e))):e.serverGroups.ready().then(d).then((e=>m(e)))),[{},{}],[o,l]),f=Kt(p,e),v=Zt(p.health,e.loadBalancers.data,g.awsAccount),y="PENDING"===h,b=(null==(r=e.attributes)?void 0:r.instancePort)||D.defaultInstancePort||"80",C=(null==(i=p.placement)?void 0:i.containerIp)||(null==(s=null==p?void 0:p.placement)?void 0:s.host);return y?lt.createElement(O,null,lt.createElement("div",{className:"horizontal center middle"},lt.createElement(M,{size:"small"}))):(null==p?void 0:p.id)?lt.createElement(Xt,{account:g,actions:f,app:e,baseIpAddress:C,environment:t,healthMetrics:v,instance:p,instanceId:n.instanceId,instancePort:b,moniker:a,loading:y,serverGroup:l,region:u}):lt.createElement("div",{className:"details-panel"},lt.createElement("div",{className:"header"},lt.createElement(O,null,lt.createElement("div",{className:"header-text horizontal middle"},lt.createElement("h3",{className:"horizontal middle space-between flex-1"},n.instanceId)))),lt.createElement("div",{className:"content"},lt.createElement("div",{className:"content-section"},lt.createElement("div",{className:"content-body text-center"},lt.createElement("h3",null,"Instance not found.")))))};t("spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller",[Tt]).controller("titusCloneServerGroupExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService",function(e,t,n){e.configSections=["cloneServerGroupConfig","taskStatus"];const a=()=>{const n=a["kato.tasks"][0].resultObjects;e.detailsSection=t.details;const a=e.stage.context||{},r=[];a&&a["kato.tasks"]&&a["kato.tasks"].length&&n&&n.length&&function(e){const i=pt.find(n,e);i&&pt.forEach(i[e],(e=>{if(e.includes(":")){const[n,i]=e.split(":"),s={type:"serverGroups",application:a.application,serverGroup:i,account:a.credentials,region:n,provider:"titus",project:t.project};s.href=W.buildFromMetadata(s),r.push(s)}}))}("serverGroupNames"),e.deployed=r};this.overrideFiltersForUrl=e=>V.filterService.overrideFiltersForUrl(e);const r=()=>n.synchronizeSection(e.configSections,a);r(),e.$on("$stateChangeSuccess",r)}]);t("spinnaker.titus.pipeline.stage.cloneServerGroupStage",["spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller"]).config((function(){H.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},k.listAccounts("titus").then((t=>{e.accounts=t,e.viewState.accountsLoaded=!0})),this.cloneTargets=Z.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=U.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},pt.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)=>{pt.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')}]);t("spinnaker.titus.pipeline.stage.destroyAsgStage",[]).config((function(){H.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},k.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=Z.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')}]);t("spinnaker.titus.pipeline.stage.disableAsgStage",[]).config((function(){H.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},k.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.targets=Z.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')}]);t("spinnaker.titus.pipeline.stage.disableClusterStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.pipeline.stage.enableAsgStage",[]).config((function(){H.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},k.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},e.targets=Z.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')}]);e.module("spinnaker.titus.pipeline.stage.findAmiStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.pipeline.stage.resizeAsgStage",[]).config((function(){H.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},k.listAccounts("titus").then((function(t){e.accounts=t,e.viewState.accountsLoaded=!0})),e.resizeTargets=Z.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 Qt extends ct.Component{constructor(e){super(e),this.mounted=!1,this.state={}}componentDidMount(){this.mounted=!0,this.setEndpoint()}setEndpoint(){const{context:e}=this.props.stage;k.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:a}=this.state,{context:r}=e,{cluster:i}=r,{resources:s,env:o,entryPoint:l,entryPointList:c}=i,u=i?ht(r["deploy.jobs"],i.region,[])[0]:null,d=ht(r,"jobStatus.completionDetails.taskId"),m=this.formatEntryPoint(c,l);return ct.createElement(q,{name:n,current:t},ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-9"},ct.createElement(b,{className:"dl-narrow dl-horizontal"},ct.createElement(C,{label:"Account",value:ct.createElement(J,{account:r.credentials})}),i&&ct.createElement(ct.Fragment,null,ct.createElement(C,{label:"Image",value:i.imageId}),m&&ct.createElement(C,{label:"Entrypoint",value:m})),u&&ct.createElement(C,{label:"Titus Job Id",value:ct.createElement($,{message:`[${u}](${a}jobs/${u})`})}),d&&ct.createElement(C,{label:"Titus Task Id",value:ct.createElement($,{message:`[${d}](${a}jobs/${u}/tasks/${d})`})}),s&&Object.keys(s)&&ct.createElement(C,{label:"Resources",value:ct.createElement("ul",{className:"nostyle"},Object.keys(s).map((e=>ct.createElement("li",{key:e},e,": ",s[e]))))})))),o&&Object.keys(o)&&ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-12"},ct.createElement("h5",{style:{marginBottom:0,paddingBottom:"5px"}},"Environment Variables"),ct.createElement(b,null,Object.keys(o).map((e=>ct.createElement(C,{key:e,label:e,value:o[e]})))))),r.propertyFileContents&&ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-12"},ct.createElement("h5",{style:{marginBottom:"0px",paddingBottom:"5px"}},"Property File"),ct.createElement(K,{outputFileObject:r.propertyFileContents}))),ct.createElement(X,{stage:e,message:e.failureMessage||ht(r,"completionDetails.message")}),d&&ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-12"},ct.createElement("div",{className:"well alert alert-info"},ct.createElement("a",{target:"_blank",href:`${a}jobs/${u}/tasks/${d}/logs`},"View Execution Logs"),ct.createElement("br",null),ct.createElement("a",{target:"_blank",href:`${a}jobs/${u}/tasks/${d}/logs/archived?file=stdout&view=Finished&open=true`},"Stdout"),ct.createElement("br",null),ct.createElement("a",{target:"_blank",href:`${a}jobs/${u}/tasks/${d}/logs/archived?file=stderr&view=Finished&open=true`},"Stderr")))))}}Qt.title="runJobConfig";class _t extends ct.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 ft(e.aws[this.getRegion()]).filter({vpcId:this.getVpcId()}).sortBy("name").value()}refreshSecurityGroups(e){return G.cacheInitializer.refreshCache("securityGroups").then((()=>G.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,a=this.props.groupsToEdit;if(e&&this.props.groupsToEdit){const r=a.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),i=r.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)),s=i.map((e=>e.name));n=vt(r,s),a=i.map((e=>e.id)),this.props.onChange(a)}e=e.sort(((e,t)=>e.name.localeCompare(t.name))),this.setState({availableGroups:e,loaded:!0,removedGroups:n})}componentDidMount(){const e=k.getCredentialsKeyedByAccount("titus").then((e=>{this.credentials=e})),t=G.securityGroupReader.getAllSecurityGroups().then((e=>{this.securityGroups=e})),n=i.listVpcs().then((e=>this.vpcs=e));It.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:a}=this.props,{availableGroups:r,loaded:i,removedGroups:l}=this.state,c=T.get("firewalls");return i?ct.createElement("div",{className:"clearfix"},ct.createElement(s,{removed:l,onClear:this.clearRemoved}),ct.createElement(o,{command:e,hideLabel:t,availableGroups:r,groupsToEdit:n,refresh:()=>this.refreshSecurityGroups(),onChange:this.props.onChange,helpKey:"titus.deploy.securityGroups"}),a&&void 0!==e.credentials&&ct.createElement("div",{className:"small "+(t?"":"col-md-offset-3 col-md-9")},"Uses ",c," from the Amazon account ",ct.createElement(J,{account:a}))):null}}const en=D.providers.titus||{defaults:{}};en&&(en.resetToOriginal=D.resetToOriginal);const tn=e=>e&&!e.includes("${");class nn extends ct.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 a=n.backingData.credentialsKeyedByAccount[e];t("containerAttributes",{...n.containerAttributes,"titusParameter.agent.assignIPv6Address":"test"===a.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:a}=G;a.is("home.applications.application.insight.clusters")?a.go(".serverGroup",n):a.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:a,repository:r,tag:i}=At.splitImageId(t.imageId);n("digest",e),n("organization",a),n("repository",r),n("tag",i)}this.state={...this.getStateFromProps(e)}}getStateFromProps(e){const{app:t}=e,{values:n}=e.formik,a=U.getClusterName(t.name,n.stack,n.freeFormDetails),r=!t.clusters.find((e=>e.name===a)),i=t.serverGroups.data.filter((e=>e.cluster===a&&e.account===n.credentials&&e.region===n.region)).sort(((e,t)=>e.createdTime-t.createdTime)),s=i.length?i.pop():null;return{namePreview:a,createsNewCluster:r,latestServerGroup:s}}validate(e){const t={};var n,a;return n=e.stack,tn(n)&&!/^([\w.]+|\${[^}]+})*$/.test(n)&&(t.stack="Only dot(.) and underscore(_) special characters are allowed in the Stack field."),a=e.freeFormDetails,tn(a)&&!/^([\w.^~-]+|\${[^}]+})*$/.test(a)&&(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:a,formik:r}=this.props,{errors:i,setFieldValue:s,values:o}=r,{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=en.defaults)?void 0:e.subnetType).concat(null==(t=l.defaults)?void 0:t.subnetType).filter((e=>!!e));return ct.createElement("div",{className:"container-fluid form-horizontal"},ct.createElement(Y,{app:a,formik:r}),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Account"),ct.createElement("div",{className:"col-md-7"},ct.createElement(Q,{value:o.credentials,onChange:e=>this.accountUpdated(e.target.value),readOnly:g.credentials,accounts:p,provider:"titus"}),void 0!==o.credentials&&ct.createElement("div",{className:"small"},"Uses resources from the Amazon account"," ",ct.createElement(J,{account:o.backingData.credentialsKeyedByAccount[o.credentials]&&o.backingData.credentialsKeyedByAccount[o.credentials].awsAccount})))),ct.createElement(_,{readOnly:g.region,labelColumns:3,component:o,field:"region",account:o.credentials,regions:o.backingData.filtered.regions,onChange:this.regionUpdated}),ct.createElement(c,{application:a,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=en.serverGroups)?void 0:n.recommendedSubnets,showSubnetWarning:!0}),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Stack ",ct.createElement(ee,{id:"aws.serverGroup.stack"})),ct.createElement("div",{className:"col-md-7"},ct.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:o.stack||"",onChange:e=>this.stackChanged(e.target.value)}))),i.stack&&ct.createElement("div",{className:"form-group row slide-in"},ct.createElement("div",{className:"col-sm-9 col-sm-offset-2 error-message"},ct.createElement("span",null,i.stack))),ct.createElement(te,{app:a,formik:r}),!o.viewState.disableImageSelection&&ct.createElement(Nt,{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&&ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Image")," ",ct.createElement(ee,{id:"titus.deploy.imageId"})),ct.createElement("div",{className:"col-md-7 sp-padding-xs-yaxis"},o.imageId)),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Entrypoint")),ct.createElement("div",{className:"col-md-7"},ct.createElement(Pt,{type:"text",className:"form-control input-sm no-spel",name:"entryPoint"}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Traffic ",ct.createElement(ee,{id:"titus.serverGroup.traffic"})),ct.createElement("div",{className:"col-md-7"},ct.createElement("div",{className:"checkbox"},ct.createElement("label",null,ct.createElement("input",{type:"checkbox",checked:o.inService,onChange:e=>s("inService",e.target.checked),disabled:""!==o.strategy&&"custom"!==o.strategy})," ","Send client requests to new instances")))),!o.viewState.disableStrategySelection&&o.selectedProvider&&ct.createElement(ne,{command:o,onFieldChange:this.onStrategyFieldChange,onStrategyChange:this.strategyChanged}),!o.viewState.hideClusterNamePreview&&ct.createElement(ae,{createsNewCluster:u,latestServerGroupName:null==d?void 0:d.name,mode:o.viewState.mode,namePreview:m,navigateToLatestServerGroup:this.navigateToLatestServerGroup}))}}const an=[{label:"Read and Write",value:"RW"},{label:"Read Only",value:"RO"},{label:"Write Only",value:"WO"}];class rn extends ct.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 ct.createElement("div",{className:"clearfix"},ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"CPU(s)")),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.cpu,onChange:n=>e("resources",{...t.resources,cpu:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Memory (MB)")),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.memory,onChange:n=>e("resources",{...t.resources,memory:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Disk (MB)")),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.disk,onChange:n=>e("resources",{...t.resources,disk:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Network (Mbps)"),ct.createElement(ee,{id:"titus.deploy.network"})),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.networkMbps,onChange:n=>e("resources",{...t.resources,networkMbps:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Gpu"),ct.createElement(ee,{id:"titus.deploy.gpu"})),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.gpu,onChange:n=>e("resources",{...t.resources,gpu:n})}))),ct.createElement("hr",null),ct.createElement("h4",null,ct.createElement("b",null,"Elastic File System Options ",ct.createElement(ee,{id:"titus.deploy.efs"}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Mount Permission "),ct.createElement(ee,{id:"titus.deploy.mountPermissions"})),ct.createElement("div",{className:"col-md-8"},ct.createElement(Dt,{value:t.efs.mountPerm,clearable:!1,options:an,onChange:n=>e("efs",{...t.efs,mountPerm:n.value})}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Mount Point "),ct.createElement(ee,{id:"titus.deploy.mountPoint"})),ct.createElement("div",{className:"col-md-8"},ct.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})}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"EFS ID "),ct.createElement(ee,{id:"titus.deploy.efsId"})),ct.createElement("div",{className:"col-md-8"},ct.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})})),ct.createElement("div",{className:"col-md-offset-3 col-md-8"})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"EFS Relative Mount Point "),ct.createElement(ee,{id:"titus.deploy.efsRelativeMountPoint"})),ct.createElement("div",{className:"col-md-8"},ct.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 sn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}function on(e){const{label:t,help:n,input:a,actions:r,validation:i={}}=e,{hidden:s,messageNode:o,category:l}=i,c=!yt(t)||!yt(n);return ct.createElement("div",{className:"TitusMapLayout flex-container-v"},c&&ct.createElement("h4",null,t," ",n),ct.createElement("div",{className:"flex-container-h baseline margin-between-lg TitusMapLayout_Contents"},a," ",r),!s&&ct.createElement(ie,{message:o,type:l}))}sn(".TitusMapLayout_Contents * {\n -webkit-box-flex: 1;\n -ms-flex: auto;\n flex: auto;\n}\n");const ln=["disableIncreaseDesired","disableDecreaseDesired"];sn(".ServerGroupParameters .StandardFieldLayout_Label {\n min-width: 160px;\n}\n");const cn=[{label:"System Default",value:"systemDefault"},{label:"Self Managed",value:"selfManaged"}];function un(e){const t=wt(ln,Object.keys(e.value)),n=pe(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)),{}))),a=t.map((e=>({label:ge(e),value:e})));return ct.createElement(he,{...n,options:a})}function dn(e){const t=pe(e,(e=>"true"===e),((e,t)=>t.target.checked?"true":"false"));return ct.createElement(fe,{...t})}const mn=e=>{const{awsAccount:t,setDefaultIamProfile:n,...a}=e;return ct.createElement("div",{className:"flex-container-h baseline margin-between-md"},ct.createElement(le,{...a}),e.value?ct.createElement(ct.Fragment,null,ct.createElement("span",null,"in"),ct.createElement(J,{account:t})):ct.createElement("button",{className:"link",style:{whiteSpace:"nowrap"},onClick:n},"Apply default value"))};class pn extends ct.Component{constructor(e){super(e)}validate(e){const t=new se(e);t.field("iamProfile","IAM Instance Profile").required();const n=t.validateForm();return bt(Object.keys(e.constraints.soft),Object.keys(e.constraints.hard)).forEach((e=>{Ct(n,`constraints.soft.${e}`,`Constraint '${e}' must be either soft or hard, not both.`),Ct(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_]*$/)||Ct(n,`env.${e}`,"Environment variable names must contain only letter, numbers, or underscores"):Ct(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,a=()=>t("iamProfile",n.viewState.defaultIamProfile);return ct.createElement("div",{className:"ServerGroupParameters"},ct.createElement(oe,{name:"iamProfile",label:"IAM Instance Profile",help:ct.createElement(ee,{id:"titus.deploy.iamProfile"}),input:e=>{var t;return ct.createElement(mn,{...e,awsAccount:null==(t=n.backingData.credentialsKeyedByAccount[n.credentials])?void 0:t.awsAccount,setDefaultIamProfile:a})}}),ct.createElement(oe,{name:"capacityGroup",label:"Capacity Group",help:ct.createElement(ee,{id:"titus.deploy.capacityGroup"}),input:e=>ct.createElement(le,{...e})}),ct.createElement(oe,{name:"migrationPolicy.type",label:"Migration Policy",help:ct.createElement(ee,{id:"titus.deploy.migrationPolicy"}),input:e=>ct.createElement(ce,{options:cn,...e})}),ct.createElement(oe,{name:"serviceJobProcesses",label:"Service Job Processes",input:e=>ct.createElement(un,{...e})}),ct.createElement(oe,{name:"containerAttributes['titusParameter.agent.assignIPv6Address']",label:"Associate IPv6 Address (Recommended)",help:ct.createElement(ee,{id:"serverGroup.ipv6"}),input:e=>ct.createElement(dn,{...e})}),ct.createElement("hr",null),ct.createElement(ue,{value:on},ct.createElement(oe,{name:"constraints.soft",label:"Soft Constraints ",help:ct.createElement(ee,{id:"titus.deploy.softConstraints"}),input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement(oe,{name:"constraints.hard",label:"Hard Constraints",help:ct.createElement(ee,{id:"titus.deploy.hardConstraints"}),input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement("hr",null),ct.createElement(oe,{name:"labels",label:"Job Attributes",input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement(oe,{name:"containerAttributes",label:"Container Attributes",input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement(oe,{name:"env",label:"Environment Variables",input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})})),e.attributes.platformHealthOnlyShowOverride&&ct.createElement(oe,{name:"interestingHealthProviderNames",label:"Task Completion",input:e=>ct.createElement(me,{...e,platformHealthType:"Titus"})}))}}const gn={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"}]},hn=e=>{const t=St(gn);return e.attributes&&e.attributes.platformHealthOnly&&(t.containerHealthProviders=[]),t};class fn{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 a=this.getCredentials(e);n.subnetPurposes=ft(e.backingData.subnets).filter({account:a.awsAccount,region:e.region}).reject({target:"elb"}).reject({purpose:null}).uniqBy("purpose").value();const r=e.subnetType||"titus (vpc0)",i=ft(e.backingData.subnets).filter({account:a.awsAccount,region:e.region,purpose:r}).map((e=>e.id)).value();return e.containerAttributes["titusParameter.agent.subnets"]=i.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),Ce(e),t},e.regionChanged=e=>(this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),Ce(e),{}),e.clusterChanged=e=>{e.moniker=U.getMoniker(e.application,e.stack,e.freeFormDetails),Ce(e)},e.subnetChanged=e=>this.configureSubnets(e)}configureCommand(e){return e.viewState.accountChangedStream=new Ot,e.viewState.regionChangedStream=new Ot,e.viewState.groupsRemovedStream=new Ot,e.viewState.dirty={},e.onStrategyChange=(e,t)=>{""!==t.key&&"custom"!==t.key&&(e.inService=!0)},e.image=e.viewState.imageId,It.all([k.getCredentialsKeyedByAccount("titus"),this.securityGroupReader.getAllSecurityGroups(),i.listVpcs(),we.listSubnets(),k.getCredentialsKeyedByAccount("aws")]).then((([t,n,a,r,i])=>{var s,o;const l={credentialsKeyedByAccount:t,securityGroups:n,vpcs:a};Object.keys(t).forEach((e=>{const n=t[e].awsAccount,a=i[n].accountId;t[e].accountId=a})),l.credentialsKeyedByAccount=t,e.credentials&&(e.containerAttributes["titusParameter.agent.accountId"]=l.credentialsKeyedByAccount[e.credentials].accountId),l.images=[],l.accounts=Object.keys(t),l.subnets=r,l.filtered={},e.credentials.includes("${")?l.filtered.regions=[{name:e.region}]:l.filtered.regions=null!=(o=null==(s=t[e.credentials])?void 0:s.regions)?o:[],e.backingData=l,l.filtered.securityGroups=this.getRegionalSecurityGroups(e);let c=It.when();if(e.securityGroups&&e.securityGroups.length){const t=l.filtered.securityGroups.map((e=>e.id));bt(e.securityGroups,t).length<e.securityGroups.length&&(c=this.refreshSecurityGroups(e,!1))}return It.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 ft(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),a="string"==typeof e.securityGroups&&e.securityGroups.includes("${");if(t&&e.securityGroups&&!a){const a=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),r=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)),i=r.map((e=>e.name)),s=vt(a,i);e.securityGroups=r.map((e=>e.id)),s.length&&(e.viewState.dirty.securityGroups=s)}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 Et(t.map((e=>e.targetGroups.filter((e=>"ip"===e.targetType))))).map((e=>e.name)).sort()}getLoadBalancerMap(e){return ft(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 a=bt(n,t),r=vt(a,t);e.targetGroups=bt(n,a),r&&r.length>0?e.viewState.dirty.targetGroups=r: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)}))}}fn.$inject=["cacheInitializer","loadBalancerReader","securityGroupReader"];t("spinnaker.titus.serverGroup.configure.service",[ve,ye,be]).service("titusServerGroupConfigurationService",fn);const vn=[{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:gn.availabilityPercentageLimit,fieldComponent:e=>ct.createElement(oe,{name:"disruptionBudget.availabilityPercentageLimit.percentageOfHealthyContainers",label:"Percentage of Healthy Containers",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,disabled:e.isDisabled}),ct.createElement(ee,{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:()=>ct.createElement(oe,{name:"disruptionBudget.relocationLimit.limit",label:"Limit",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{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:()=>ct.createElement(oe,{name:"disruptionBudget.unhealthyTasksLimit.limitOfUnhealthyContainers",label:"Limit of Unhealthy Containers",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{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:()=>ct.createElement(oe,{name:"disruptionBudget.selfManaged.relocationTimeMs",label:"Relocation Time",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{expand:!0,content:"(milliseconds)"}))})}],yn=[{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:gn.ratePercentagePerInterval,fieldComponent:e=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{name:"disruptionBudget.ratePercentagePerInterval.intervalMs",label:"Interval",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,disabled:e.isDisabled}),ct.createElement(ee,{expand:!0,content:"(milliseconds)"}))}),ct.createElement(oe,{name:"disruptionBudget.ratePercentagePerInterval.percentageLimitPerInterval",label:"Percentage Per Interval",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,disabled:e.isDisabled}),ct.createElement(ee,{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:()=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{name:"disruptionBudget.ratePerInterval.intervalMs",label:"Interval",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{expand:!0,content:"(milliseconds)"}))}),ct.createElement(oe,{name:"disruptionBudget.ratePerInterval.limitPerInterval",label:"Limit Per Interval",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{expand:!0,content:"(tasks)"}))}))}],bn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];class Cn extends ct.Component{constructor(e){super(e),this.configureNewWindow=()=>{this.setState({addingNewWindow:!0})},this.addNewWindow=e=>{const{values:t,setFieldValue:n}=this.props.formik,{days:a,startHour:r,endHour:i,timeZone:s}=e,o={days:a,hourlyTimeWindows:[{startHour:r,endHour:i}],timeZone:s};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 ct.createElement("div",{className:"sp-formItem"},ct.createElement("div",{className:"sp-formItem__left"}),ct.createElement("div",{className:"sp-formItem__right"},n.map(((e,n)=>e.hourlyTimeWindows.map(((a,r)=>ct.createElement("div",{className:"sp-margin-l-yaxis sp-margin-m-right",style:{display:"inline-block"},key:`${n}.${r}`},ct.createElement("div",{key:`${n}.${r}`,className:"horizontal center top sp-padding-m-yaxis sp-padding-s-xaxis",style:{backgroundColor:"var(--color-dovegray)",borderRadius:"4px"}},ct.createElement("div",{className:"sp-padding-m-right",style:{color:"var(--color-text-on-dark)",fontSize:"12px"}},ct.createElement("div",null,ct.createElement("b",null,e.days.map((e=>e.substr(0,3))).join(", "))),ct.createElement("div",null,ct.createElement("em",null,a.startHour,":00 - ",a.endHour,":00 ",e.timeZone))),!t&&ct.createElement("a",{className:"clickable",style:{color:"var(--color-text-on-dark)"},onClick:()=>this.removeWindow(n,r)},ct.createElement("span",{className:"glyphicon glyphicon-remove"}))))))))))},this.NewWindowComponent=()=>this.state.addingNewWindow?ct.createElement(Ee,{initialValues:{days:[],startHour:10,endHour:16,timeZone:ht(this.props.formik.values.disruptionBudget,"timeWindows[0].timeZone","PST")},onSubmit:this.addNewWindow,render:e=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{name:"days",label:"Define a New Window",input:e=>ct.createElement(he,{...e,stringOptions:bn})}),ct.createElement(oe,{name:"startHour",label:"Start",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,min:0,max:e.values.endHour}),ct.createElement(ee,{expand:!0,content:"hour (0-24)"}))}),ct.createElement(oe,{name:"endHour",label:"End",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,min:e.values.startHour,max:23}),ct.createElement(ee,{expand:!0,content:"hour (0-24)"}))}),ct.createElement(oe,{name:"timeZone",label:"Timezone",input:e=>ct.createElement(ke,{...e,clearable:!1,stringOptions:["PST","UTC"]})}),ct.createElement("div",{className:"sp-formItem"},ct.createElement("div",{className:"sp-formItem__left"}),ct.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},ct.createElement("button",{className:"primary",type:"submit",onClick:()=>this.addNewWindow(e.values)}," ","Add Window"))))}):ct.createElement("div",{className:"sp-formItem"},ct.createElement("div",{className:"sp-formItem__left"}),ct.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},ct.createElement("a",{className:"button primary",onClick:this.configureNewWindow},ct.createElement("i",{className:"fas fa-plus-circle"})," Define New Window"))),this.state={addingNewWindow:!1}}removeWindow(e,t){const{values:n,setFieldValue:a}=this.props.formik,{timeWindows:r}=n.disruptionBudget,i=r[e];if(1===i.hourlyTimeWindows.length)a("disruptionBudget.timeWindows",r.filter((e=>e!==i)));else{const n=i.hourlyTimeWindows[t];a(`disruptionBudget.timeWindows[${e}].hourlyTimeWindows`,i.hourlyTimeWindows.filter((e=>e!==n)))}}render(){const{CurrentWindows:e,NewWindowComponent:t}=this,{isDisabled:n}=this.props;return ct.createElement(ct.Fragment,null,ct.createElement(e,null),!n&&ct.createElement(t,null))}}const wn=()=>ct.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."," ",ct.createElement("a",{href:"http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/",target:"_blank"},"Read the full documentation"));class Sn extends ct.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:gn.timeWindows}],this.toggleUseDefault=()=>{this.state.usingDefault||this.setToDefaultBudget(),this.setState({usingDefault:!this.state.usingDefault})},this.componentDidUpdate=e=>{this.props.onStageChange&&!kt(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,vn),this.rateTypeChanged=e=>this.optionTypeChanged(e,yn),this.timeWindowsChanged=e=>{this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)};const{disruptionBudget:t}=e.formik.values;this.state={usingDefault:!t||kt(t,hn(e.app))},this.state.usingDefault&&this.setToDefaultBudget()}setToDefaultBudget(){this.props.formik.setFieldValue("disruptionBudget",hn(this.props.app))}getSelectionFromFields(e){const{disruptionBudget:t}=this.props.formik.values;return t?e.find((e=>!!t[e.field])):e[0]}getTimeWindowSelection(){return ht(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,a=t.disruptionBudget.containerHealthProviders,r=a.find((t=>t.name===e));n("disruptionBudget.containerHealthProviders",r?a.filter((e=>e!==r)):a.concat({name:e}))}render(){const{runJobView:e}=this.props,{usingDefault:t}=this.state,n=this.props.formik.values.disruptionBudget||hn(this.props.app),a=this.getSelectionFromFields(vn),r=a.fieldComponent,i=this.getSelectionFromFields(yn),s=i.fieldComponent,o=this.getTimeWindowSelection(),l=n.containerHealthProviders.map((e=>e.name)),c=!!n.selfManaged,u=!e||e&&!t;return ct.createElement(ue,{value:Ge},ct.createElement("div",{className:"form-horizontal sp-margin-l-xaxis"},!e&&ct.createElement(wn,null),ct.createElement(oe,{name:"usingDefault",input:()=>ct.createElement(fe,{checked:t,onChange:this.toggleUseDefault,text:ct.createElement("b",null,"Use Netflix Defaults")}),layout:e?({input:e})=>ct.createElement(ct.Fragment,null,e):void 0}),u&&ct.createElement("div",{style:{opacity:t?.5:1}},ct.createElement("div",{className:"sp-formGroup"},ct.createElement("div",{className:"groupHeader"},ct.createElement(oe,{name:"policyType",label:"Policy",input:e=>ct.createElement("div",null,ct.createElement(Te,{...e,menuContainerStyle:{height:"300px"},className:"Select-menu-long",style:{width:"300px"},disabled:t,clearable:!1,onChange:this.policyTypeChanged,value:a,options:vn}),ct.createElement(ee,{expand:!0,content:"A job policy defines container relocation rules and constraints"}))})),ct.createElement("div",{className:"sp-formItem"},ct.createElement("p",null,a.description)),r&&ct.createElement(r,{isDisabled:t})),!c&&ct.createElement("div",null,ct.createElement("div",{className:""+(n.rateUnlimited?"":"sp-formGroup")},ct.createElement("div",{className:""+(n.rateUnlimited?"":"groupHeader")},ct.createElement(oe,{name:"rates",label:"Rates",input:e=>ct.createElement(Te,{...e,style:{width:"300px"},disabled:t,clearable:!1,onChange:this.rateTypeChanged,value:i,options:yn})})),ct.createElement("div",{className:"sp-formItem"},ct.createElement("p",null,i.description)),s&&ct.createElement(s,{isDisabled:t})),ct.createElement("div",{className:""+(n.timeWindows?"sp-formGroup":"")},ct.createElement("div",{className:""+(n.timeWindows?"groupHeader":"")},ct.createElement(oe,{name:"timeWindows",label:"When Can Disruption Occur?",input:e=>ct.createElement(Te,{...e,style:{width:"300px"},disabled:t,clearable:!1,onChange:this.timeWindowsChanged,value:o,options:this.timeWindowOptions})})),n.timeWindows&&ct.createElement(Cn,{isDisabled:t,formik:this.props.formik})),ct.createElement(oe,{name:"healthProviders",label:"Container Health Provider",input:()=>ct.createElement("div",null,ct.createElement(fe,{checked:l.includes("eureka"),onChange:()=>this.toggleHealthProvider("eureka"),text:"Discovery",disabled:t}))})))))}}class En extends ct.Component{constructor(e){super(e),this.credentialsKeyedByAccount={},this.defaultIamProfile="",this.state={credentials:[],regions:[],loaded:!1},this.accountChanged=e=>{Ct(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)=>{Ct(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,At.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 a=en.defaults.iamProfile||"{{application}}InstanceProfile";this.defaultIamProfile=a.replace("{{application}}",t.name);const r={application:t.name,containerAttributes:{},env:{},labels:{},resources:{cpu:1,disk:1e4,gpu:0,memory:512,networkMbps:128},retries:0,runtimeLimitSecs:3600,securityGroups:[]};n.isNew&&(r.iamProfile=this.defaultIamProfile),Gt(n.cluster,r),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;k.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 a="test"===this.credentialsKeyedByAccount[e.credentials].environment&&void 0===e.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"]?"true":"false";this.associateIPv6AddressChanged(a)}))}render(){var e,t;const{application:n,stage:a}=this.props,{credentials:r,loaded:i,regions:s}=this.state,o=(this.credentialsKeyedByAccount[a.credentials]||{awsAccount:""}).awsAccount,l=(null==(e=a.cluster.entryPointList)?void 0:e.length)?a.cluster.entryPointList.join(","):a.cluster.entryPoint,c=(null==(t=a.cluster.cmdList)?void 0:t.length)?a.cluster.cmdList.join(","):a.cluster.cmd;return ct.createElement("div",{className:"form-horizontal"},ct.createElement("div",{className:"form-group"},ct.createElement("label",{className:"col-md-3 sm-label-right"},ct.createElement("span",{className:"label-text"},"Account")),ct.createElement("div",{className:"col-md-5"},ct.createElement(Q,{value:a.credentials,onChange:e=>this.accountChanged(e.target.value),accounts:r,provider:"titus"}),void 0!==a.credentials&&ct.createElement("div",{className:"small"},"Uses resources from the Amazon account ",ct.createElement(J,{account:o})))),ct.createElement(_,{labelColumns:3,fieldColumns:5,component:a.cluster,field:"region",account:a.credentials,regions:s,onChange:e=>this.stageFieldChanged("region",e)}),ct.createElement(Nt,{specifyTagByRegex:!1,account:a.credentials,digest:a.digest,imageId:a.cluster.imageId,organization:a.organization,registry:a.registry,repository:a.repository,tag:a.tag,showRegistry:!1,onChange:this.dockerChanged,deferInitialization:a.deferredInitialization}),ct.createElement(Ae,{label:"CPU(s)"},ct.createElement(re,{value:a.cluster.resources.cpu,onChange:e=>this.stageFieldChanged("cluster.resources.cpu",e),required:!0})),ct.createElement(Ae,{label:"Memory (MB)"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.memory",e),value:a.cluster.resources.memory,required:!0})),ct.createElement(Ae,{label:"Disk (MB)"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.disk",e),value:a.cluster.resources.disk,required:!0})),ct.createElement(Ae,{label:"Network (Mbps)",helpKey:"titus.deploy.network"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.networkMbps",e),value:a.cluster.resources.networkMbps,required:!0})),ct.createElement(Ae,{label:"GPU(s)",helpKey:"titus.deploy.gpu"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.gpu",e),value:a.cluster.resources.gpu,required:!0})),ct.createElement(Ae,{label:"Entrypoint(s)",helpKey:"titus.deploy.entrypoint"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:l,onChange:e=>this.stageFieldChanged("cluster.entryPointList",e.target.value.split(","))})),ct.createElement(Ae,{label:"Command(s)",helpKey:"titus.deploy.command"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:c,onChange:e=>this.stageFieldChanged("cluster.cmdList",e.target.value.split(","))})),ct.createElement(Ae,{label:"Runtime Limit (Seconds)",helpKey:"titus.deploy.runtimeLimitSecs"},ct.createElement(re,{value:a.cluster.runtimeLimitSecs,onChange:e=>this.stageFieldChanged("cluster.runtimeLimitSecs",e),min:1,required:!0})),ct.createElement(Ae,{label:"Retries",helpKey:"titus.deploy.retries"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.retries",e),value:a.cluster.retries,min:0,required:!0})),ct.createElement(Ae,{label:"Property File",helpKey:"titus.deploy.propertyFile"},ct.createElement("input",{type:"text",className:"form-control input-sm",onChange:e=>this.stageFieldChanged("propertyFile",e.target.value),value:a.propertyFile})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-9 col-md-offset-1"},ct.createElement("div",{className:"checkbox"},ct.createElement("label",null,ct.createElement("input",{type:"checkbox",checked:a.showAdvancedOptions,onChange:e=>this.stageFieldChanged("showAdvancedOptions",e.target.checked)}),ct.createElement("strong",null,"Show Advanced Options"))))),ct.createElement("div",{className:""+(!0===a.showAdvancedOptions?"collapse.in":"collapse")},ct.createElement("div",{className:"form-group"},ct.createElement("label",{className:"col-md-3 sm-label-right"},ct.createElement("span",{className:"label-text"},"IAM Instance Profile")," ",ct.createElement(ee,{id:"titus.deploy.iamProfile"})),ct.createElement("div",{className:"col-md-4"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:a.cluster.iamProfile,placeholder:this.defaultIamProfile,required:!0,onChange:e=>this.stageFieldChanged("cluster.iamProfile",e.target.value)}),!a.isNew&&!a.cluster.iamProfile&&ct.createElement("a",{className:"small clickable",onClick:()=>this.stageFieldChanged("cluster.iamProfile",this.defaultIamProfile)},"Use suggested default")),ct.createElement("div",{className:"col-md-1 small",style:{whiteSpace:"nowrap",paddingLeft:"0px",paddingTop:"7px"}},"in ",ct.createElement(J,{account:o}))),ct.createElement(Ae,{label:"Capacity Group",fieldColumns:4,helpKey:"titus.job.capacityGroup"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:a.cluster.capacityGroup||"",onChange:e=>this.stageFieldChanged("cluster.capacityGroup",e.target.value)})),ct.createElement(Ae,{label:T.get("Firewalls"),helpKey:"titus.job.securityGroups"},(!a.credentials||!a.cluster.region)&&ct.createElement("div",null,"Account and region must be selected before ",T.get("firewalls")," can be added"),i&&a.credentials&&a.cluster.region&&ct.createElement(_t,{account:a.credentials,region:a.cluster.region,command:a,amazonAccount:o,hideLabel:!0,groupsToEdit:a.cluster.securityGroups,onChange:this.groupsChanged})),ct.createElement(Ae,{label:"Associate IPv6 Address (Recommended)",helpKey:"serverGroup.ipv6"},ct.createElement(dn,{value:a.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"],onChange:e=>this.associateIPv6AddressChanged(e.target.value)})),ct.createElement(Ae,{label:"Disruption Budget",helpKey:"titus.disruptionbudget.description"},ct.createElement(Ee,{initialValues:a.cluster,onSubmit:()=>{},render:e=>ct.createElement(Sn,{formik:e,app:n,runJobView:!0,onStageChange:this.disruptionBudgetChanged})})),ct.createElement(Ae,{label:"Job Attributes (optional)"},ct.createElement(Ne,{model:a.cluster.labels,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.labels",e)})),ct.createElement(Ae,{label:"Container Attributes (optional)"},ct.createElement(Ne,{model:a.cluster.containerAttributes,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.containerAttributes",e)})),ct.createElement(Ae,{label:"Environment Variables (optional)"},ct.createElement(Ne,{model:a.cluster.env,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.env",e)}))),ct.createElement(Ae,{label:"Wait for results",helpKey:"titus.job.waitForCompletion"},ct.createElement("input",{type:"checkbox",className:"input-sm",name:"waitForCompletion",checked:a.waitForCompletion,onChange:e=>this.stageFieldChanged("waitForCompletion",e.target.checked)})))}}H.pipeline.registerStage({provides:"runJob",useBaseProvider:!0,restartable:!0,key:"runJob",cloudProvider:"titus",providesFor:["aws","titus"],component:En,executionDetailsSections:[Qt,Ie],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"}]});t("spinnaker.titus.pipeline.stage.scaleDownClusterStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.pipeline.stage.shrinkClusterStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.react",[]).run(["$injector",function(e){Vt.initialize(e)}]);t("spinnaker.titus.securityGroup.reader",[]).factory("titusSecurityGroupReader",(function(){return{resolveIndexedSecurityGroup:function(e,t,n){return e[t.awsAccount][t.region][n]}}}));e.module("spinnaker.titus.serverGroupCommandBuilder.service",[]).factory("titusServerGroupCommandBuilder",["$q",function(t){function n(e){return(en.defaults.iamProfile||"{{application}}InstanceProfile").replace("{{application}}",e.name)}function a(e,a){const r=(a=a||{}).account||en.defaults.account,i=a.region||en.defaults.region,s=a.zone||en.defaults.zone,o=n(e),l={application:e.name,credentials:r,region:i,zone:s,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:a.mode||"create"},securityGroups:[],imageId:a.imageId,migrationPolicy:{type:"systemDefault"},digest:"",organization:"",tag:"",registry:"",repository:""};return t.when(l)}return{buildNewServerGroupCommand:a,buildNewServerGroupCommandForPipeline:function(){return t.when({viewState:{requiresTemplateSelection:!0}})},buildServerGroupCommandFromExisting:function(e,a,r){r=r||"clone";const i=U.parseServerGroupName(a.name),s="test"===a.awsAccount,o=a.containerAttributes&&void 0!==a.containerAttributes["titusParameter.agent.assignIPv6Address"]?a.containerAttributes["titusParameter.agent.assignIPv6Address"]:s?"true":"false",l={...a.containerAttributes,"titusParameter.agent.assignIPv6Address":o},c={application:e.name,disruptionBudget:a.disruptionBudget,strategy:"",stack:i.stack,freeFormDetails:i.freeFormDetails,account:a.account,credentials:a.account,region:a.region,env:a.env,labels:a.labels,containerAttributes:l,entryPoint:a.entryPoint,iamProfile:a.iamProfile,capacityGroup:a.capacityGroup,migrationPolicy:a.migrationPolicy?a.migrationPolicy:{type:"systemDefault"},securityGroups:a.securityGroups||[],constraints:{hard:a.constraints&&a.constraints.hard||{},soft:a.constraints&&a.constraints.soft||{}},serviceJobProcesses:Object.assign({},a.serviceJobProcesses),inService:!a.disabled,source:{account:a.account,region:a.region,asgName:a.name},resources:{cpu:a.resources.cpu,gpu:a.resources.gpu,memory:a.resources.memory,disk:a.resources.disk,networkMbps:a.resources.networkMbps},targetGroups:a.targetGroups,capacity:{min:a.capacity.min,max:a.capacity.max,desired:a.capacity.desired},targetHealthyDeployPercentage:100,cloudProvider:"titus",selectedProvider:"titus",viewState:{defaultIamProfile:n(e),useSimpleCapacity:a.capacity.min===a.capacity.max,mode:r},organization:"",tag:"",digest:"",registry:"",repository:""};return a.efs?c.efs={mountPoint:a.efs.mountPoint,mountPerm:a.efs.mountPerm,efsId:a.efs.efsId}:c.efs={mountPerm:"RW"},"editPipeline"!==r&&(c.imageId=a.image.dockerImageName+":"+(a.image.dockerImageVersion?a.image.dockerImageVersion:a.image.dockerImageDigest)),t.when(c)},buildServerGroupCommandFromPipeline:function(t,r){const i=St(r),s={account:i.account,imageId:i.imageId,region:i.region};return a(t,s).then((function(a){a.constraints={hard:r.constraints&&r.constraints.hard||r.hardConstraints&&r.hardConstraints.reduce(((e,t)=>Ct(e,t,"true")),{})||{},soft:r.constraints&&r.constraints.soft||r.softConstraints&&r.softConstraints.reduce(((e,t)=>Ct(e,t,"true")),{})||{}},delete i.hardConstraints,delete i.softConstraints;const s={disableImageSelection:!0,useSimpleCapacity:r.capacity.min===r.capacity.max,mode:"editPipeline",submitButtonLabel:"Done",defaultIamProfile:n(t)},o={region:i.region,credentials:i.account,iamProfile:i.iamProfile,viewState:s};i.strategy=i.strategy||"";return e.extend({},a,i,o)}))}}}]);t("spinnaker.serverGroup.configure.titus",["spinnaker.titus.serverGroup.configure.service"]);const kn=class extends ct.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 a="^.^.^.clusters.serverGroup";G.$state.includes("**.clusters.serverGroup")&&(a="^.serverGroup"),G.$state.includes("**.clusters.cluster.serverGroup")&&(a="^.^.serverGroup"),G.$state.includes("**.clusters")&&(a=".serverGroup"),G.$state.go(a,n)}}},this.configureCommand=()=>{const{command:e}=this.props;Vt.titusServerGroupConfigurationService.configureCommand(e).then((()=>{Vt.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,kt(hn(this.props.application),e.disruptionBudget)&&(n={...e,disruptionBudget:void 0}),t?this.props.closeModal&&this.props.closeModal(n):this.state.taskMonitor.submit((()=>G.serverGroupWriter.cloneServerGroup(n,this.props.application)))},this.getLoadBalancerNote=e=>ct.createElement("div",{className:"form-group small",style:{marginTop:"20px"}},ct.createElement("div",{className:"col-md-8 col-md-offset-3"},ct.createElement("p",null,"Only target groups with target type ",ct.createElement("em",null,"ip")," are supported in Titus. It is not possible to re-use target groups of target type ",ct.createElement("em",null,"instance")," used by Amazon instances."," "),void 0!==e.backingData&&void 0!==e.backingData.credentialsKeyedByAccount&&void 0!==e.credentials&&ct.createElement("p",null,"Uses target groups from the Amazon account"," ",ct.createElement(J,{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?ct.createElement("div",{className:"form-group small"},ct.createElement("div",{className:"col-md-9 col-md-offset-3"},"Uses ",T.get("firewalls")," from the Amazon account ",ct.createElement(J,{account:t}))):null};const t=ht(e,"command.viewState.requiresTemplateSelection",!1);t||this.configureCommand(),this.state={firewallsLabel:T.get("Firewalls"),loaded:!1,requiresTemplateSelection:t,taskMonitor:new Pe({application:e.application,title:"Creating your server group",modalInstance:Pe.modalInstanceEmulation((()=>this.props.dismissModal())),onTaskComplete:this.onTaskComplete})}}static show(e){return xe.show(kn,e,{dialogClassName:"wizard-modal modal-lg"})}componentWillUnmount(){this._isUnmounted=!0,this.refreshUnsubscribe&&this.refreshUnsubscribe()}render(){const{application:e,command:t,dismissModal:n,title:a}=this.props,{loaded:r,taskMonitor:i,requiresTemplateSelection:s}=this.state;return s?ct.createElement(De,{application:e,cloudProvider:"titus",command:t,onDismiss:n,onTemplateSelected:this.templateSelected}):ct.createElement(Oe,{heading:a,initialValues:t,loading:!r,taskMonitor:i,dismissModal:n,closeModal:this.submit,submitButtonLabel:t.viewState.submitButtonLabel,render:({formik:t,nextIdx:n,wizard:a})=>ct.createElement(ct.Fragment,null,ct.createElement(Me,{label:"Basic Settings",wizard:a,order:n(),render:({innerRef:n})=>ct.createElement(nn,{ref:n,formik:t,app:e})}),ct.createElement(Me,{label:"Resources",wizard:a,order:n(),render:({innerRef:e})=>ct.createElement(rn,{ref:e,formik:t})}),ct.createElement(Me,{label:"Capacity",wizard:a,order:n(),render:({innerRef:e})=>ct.createElement(u,{ref:e,formik:t})}),ct.createElement(Me,{label:"Load Balancers",wizard:a,order:n(),note:this.getLoadBalancerNote(t.values),render:({innerRef:e})=>ct.createElement(d,{ref:e,formik:t,hideLoadBalancers:!0,targetGroupTypeHelpText:"ip"})}),ct.createElement(Me,{label:T.get("Firewalls"),wizard:a,order:n(),note:this.getSecurityGroupNote(t.values),render:({innerRef:e})=>ct.createElement(m,{ref:e,formik:t})}),ct.createElement(Me,{label:"Job Disruption Budget",wizard:a,order:n(),render:({innerRef:n})=>ct.createElement(Sn,{ref:n,formik:t,app:e})}),ct.createElement(Me,{label:"Advanced Settings",wizard:a,order:n(),render:({innerRef:n})=>ct.createElement(pn,{ref:n,formik:t,app:e})}))})}};let Gn=kn;Gn.defaultProps={closeModal:Le,dismissModal:Le};const{useState:Tn,useEffect:An,useMemo:Nn}=ct;function In(e){const t=e.errors.capacity||{},{min:n,max:a,desired:r}=t;return[n,a,r].find((e=>!!e))}function Pn({formik:e,serverGroup:t,toggleMode:n}){An((()=>{e.setFieldValue("capacity.min",e.values.capacity.desired),e.setFieldValue("capacity.max",e.values.capacity.desired)}),[e.values.capacity.desired]);const a=In(e);return ct.createElement("div",null,ct.createElement("p",null,"Sets min, max, and desired instance counts to the same value."),ct.createElement("p",null,"To allow autoscaling, use the"," ",ct.createElement("a",{className:"clickable",onClick:n},"Advanced Mode"),"."),ct.createElement("div",{className:"form-group row"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Current size"),ct.createElement("div",{className:"col-md-4"},ct.createElement("div",{className:"horizontal middle"},ct.createElement("input",{type:"number",className:"NumberInput form-control",value:t.capacity.desired,disabled:!0}),ct.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),ct.createElement("div",{className:"col-md-4"},ct.createElement("div",{className:"horizontal middle"},ct.createElement(oe,{name:"capacity.desired",input:e=>ct.createElement(Se,{...e,min:0}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0,onChange:()=>{}}),ct.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),!!a&&ct.createElement("div",{className:"col-md-offset-3 col-md-9"},ct.createElement(ie,{message:a,type:"error"})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),ct.createElement("div",{className:"col-md-9 sm-control-field"},ct.createElement(Re,{current:t.capacity,next:e.values.capacity}))))}function xn({formik:e,serverGroup:t,toggleMode:n}){const{min:a,max:r}=e.values.capacity||{},i=({value:e})=>ct.createElement("div",{className:"col-md-2"},ct.createElement("input",{className:"NumberInput form-control",type:"number",disabled:!0,value:e})),s=In(e);return ct.createElement("div",null,ct.createElement("p",null,"Sets up auto-scaling for this server group."),ct.createElement("p",null,"To disable auto-scaling, use the"," ",ct.createElement("a",{className:"clickable",onClick:n},"Simple Mode"),"."),ct.createElement("div",{className:"form-group bold"},ct.createElement("div",{className:"col-md-2 col-md-offset-3"},"Min"),ct.createElement("div",{className:"col-md-2"},"Max"),ct.createElement("div",{className:"col-md-2"},"Desired")),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Current"),ct.createElement(i,{value:t.capacity.min}),ct.createElement(i,{value:t.capacity.max}),ct.createElement(i,{value:t.capacity.desired})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),ct.createElement("div",{className:"col-md-2"},ct.createElement(oe,{name:"capacity.min",input:e=>ct.createElement(Se,{...e,min:0,max:r}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0})),ct.createElement("div",{className:"col-md-2"},ct.createElement(oe,{name:"capacity.max",input:e=>ct.createElement(Se,{...e,min:a}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0})),ct.createElement("div",{className:"col-md-2"},ct.createElement(oe,{name:"capacity.desired",input:e=>ct.createElement(Se,{...e,min:a,max:r}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0}))),!!s&&ct.createElement("div",{className:"col-md-offset-3 col-md-9"},ct.createElement(ie,{message:s,type:"error"})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),ct.createElement("div",{className:"col-md-9 sm-control-field"},ct.createElement(Re,{current:t.capacity,next:e.values.capacity}))))}function Dn(e){const{min:t,max:n,desired:a}=e.capacity,r={};return t>n?r.min=r.max="Min cannot be larger than Max":a<t?r.desired=r.min="Desired cannot be smaller than Min":a>n&&(r.desired=r.max="Desired cannot be larger than Max"),Object.keys(r).length?{capacity:r}:{}}function On(e){const{serverGroup:t,application:n,dismissModal:a}=e,r=Nn((()=>{const{min:e,max:n,desired:a}=t.capacity;return a!==n||a!==e}),[]),[i,s]=Tn(r),o=n.attributes&&n.attributes.platformHealthOnlyShowOverride,[l,c]=Tn(),u=((e,t)=>{const n=Pe.modalInstanceEmulation((()=>t()));return ut((()=>new Pe({modalInstance:n,...e})),[e.application,e.title])})({application:n,title:`Resizing ${t.name}`,onTaskComplete:()=>n.getDataSource("serverGroups").refresh(!0)},a),d=e=>u.submit((()=>G.serverGroupWriter.resizeServerGroup(t,n,e))),m={capacity:t.capacity};return ct.createElement(ct.Fragment,null,ct.createElement(Fe,{monitor:u}),ct.createElement(Ee,{initialValues:m,validate:Dn,onSubmit:d,render:e=>ct.createElement(ct.Fragment,null,ct.createElement(ze,{dismiss:a}),ct.createElement(Lt.Header,null,ct.createElement(Lt.Title,null,"Resize ",t.name)),ct.createElement(Lt.Body,null,ct.createElement(xt,{className:"form-horizontal"},i?ct.createElement(xn,{formik:e,serverGroup:t,toggleMode:()=>s(!1)}):ct.createElement(Pn,{formik:e,serverGroup:t,toggleMode:()=>s(!0)}),o&&ct.createElement(je,{interestingHealthProviderNames:e.values.interestingHealthProviderNames,platformHealthType:"Titus",showHelpDetails:!0,onChange:t=>e.setFieldValue("interestingHealthProviderNames",t||void 0)}))),ct.createElement(Lt.Footer,null,ct.createElement(Be,{account:t.account,onValidChange:c}),ct.createElement("button",{className:"btn btn-default",onClick:a},"Cancel"),ct.createElement("button",{type:"submit",disabled:!l||!e.isValid,className:"btn btn-primary",onClick:()=>d(e.values)},"Submit")))}))}class Mn extends Error{}class Ln extends Mn{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Fn extends Mn{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class zn extends Mn{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class jn extends Mn{}class Bn extends Mn{constructor(e){super(`Invalid unit ${e}`)}}class Rn extends Mn{}class Vn extends Mn{constructor(){super("Zone is an abstract class")}}const Wn="numeric",Hn="short",Zn="long",Un={year:Wn,month:Wn,day:Wn},qn={year:Wn,month:Hn,day:Wn},Jn={year:Wn,month:Zn,day:Wn},$n={year:Wn,month:Zn,day:Wn,weekday:Zn},Kn={hour:Wn,minute:Wn},Xn={hour:Wn,minute:Wn,second:Wn},Yn={hour:Wn,minute:Wn,second:Wn,timeZoneName:Hn},Qn={hour:Wn,minute:Wn,second:Wn,timeZoneName:Zn},_n={hour:Wn,minute:Wn,hour12:!1},ea={hour:Wn,minute:Wn,second:Wn,hour12:!1},ta={hour:Wn,minute:Wn,second:Wn,hour12:!1,timeZoneName:Hn},na={hour:Wn,minute:Wn,second:Wn,hour12:!1,timeZoneName:Zn},aa={year:Wn,month:Wn,day:Wn,hour:Wn,minute:Wn},ra={year:Wn,month:Wn,day:Wn,hour:Wn,minute:Wn,second:Wn},ia={year:Wn,month:Hn,day:Wn,hour:Wn,minute:Wn},sa={year:Wn,month:Hn,day:Wn,hour:Wn,minute:Wn,second:Wn},oa={year:Wn,month:Hn,day:Wn,weekday:Hn,hour:Wn,minute:Wn},la={year:Wn,month:Zn,day:Wn,hour:Wn,minute:Wn,timeZoneName:Hn},ca={year:Wn,month:Zn,day:Wn,hour:Wn,minute:Wn,second:Wn,timeZoneName:Hn},ua={year:Wn,month:Zn,day:Wn,weekday:Zn,hour:Wn,minute:Wn,timeZoneName:Zn},da={year:Wn,month:Zn,day:Wn,weekday:Zn,hour:Wn,minute:Wn,second:Wn,timeZoneName:Zn};function ma(e){return void 0===e}function pa(e){return"number"==typeof e}function ga(e){return"number"==typeof e&&e%1==0}function ha(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function fa(){return!ma(Intl.DateTimeFormat.prototype.formatToParts)}function va(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function ya(e,t,n){if(0!==e.length)return e.reduce(((e,a)=>{const r=[t(a),a];return e&&n(e[0],r[0])===e[0]?e:r}),null)[1]}function ba(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function Ca(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wa(e,t,n){return ga(e)&&e>=t&&e<=n}function Sa(e,t=2){return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function Ea(e){return ma(e)||null===e||""===e?void 0:parseInt(e,10)}function ka(e){if(!ma(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Ga(e,t,n=!1){const a=10**t;return(n?Math.trunc:Math.round)(e*a)/a}function Ta(e){return e%4==0&&(e%100!=0||e%400==0)}function Aa(e){return Ta(e)?366:365}function Na(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Ta(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Ia(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 Pa(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,a=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===a?53:52}function xa(e){return e>99?e:e>60?1900+e:2e3+e}function Da(e,t,n,a=null){const r=new Date(e),i={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};a&&(i.timeZone=a);const s=Object.assign({timeZoneName:t},i),o=ha();if(o&&fa()){const e=new Intl.DateTimeFormat(n,s).formatToParts(r).find((e=>"timezonename"===e.type.toLowerCase()));return e?e.value:null}if(o){const e=new Intl.DateTimeFormat(n,i).format(r);return new Intl.DateTimeFormat(n,s).format(r).substring(e.length).replace(/^[, \u200e]+/,"")}return null}function Oa(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const a=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-a:a)}function Ma(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new Rn(`Invalid unit value ${e}`);return t}function La(e,t,n){const a={};for(const r in e)if(Ca(e,r)){if(n.indexOf(r)>=0)continue;const i=e[r];if(null==i)continue;a[t(r)]=Ma(i)}return a}function Fa(e,t){const n=Math.trunc(e/60),a=Math.abs(e%60),r=n>=0&&!Object.is(n,-0)?"+":"-",i=`${r}${Math.abs(n)}`;switch(t){case"short":return`${r}${Sa(Math.abs(n),2)}:${Sa(a,2)}`;case"narrow":return a>0?`${i}:${a}`:i;case"techie":return`${r}${Sa(Math.abs(n),2)}${Sa(a,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function za(e){return ba(e,["hour","minute","second","millisecond"])}const ja=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function Ba(e){return JSON.stringify(e,Object.keys(e).sort())}const Ra=["January","February","March","April","May","June","July","August","September","October","November","December"],Va=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wa=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ha(e){switch(e){case"narrow":return Wa;case"short":return Va;case"long":return Ra;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 Za=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ua=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qa=["M","T","W","T","F","S","S"];function Ja(e){switch(e){case"narrow":return qa;case"short":return Ua;case"long":return Za;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $a=["AM","PM"],Ka=["Before Christ","Anno Domini"],Xa=["BC","AD"],Ya=["B","A"];function Qa(e){switch(e){case"narrow":return Ya;case"short":return Xa;case"long":return Ka;default:return null}}function _a(e,t){let n="";for(const a of e)a.literal?n+=a.val:n+=t(a.val);return n}const er={D:Un,DD:qn,DDD:Jn,DDDD:$n,t:Kn,tt:Xn,ttt:Yn,tttt:Qn,T:_n,TT:ea,TTT:ta,TTTT:na,f:aa,ff:ia,fff:la,ffff:ua,F:ra,FF:sa,FFF:ca,FFFF:da};class tr{static create(e,t={}){return new tr(e,t)}static parseFormat(e){let t=null,n="",a=!1;const r=[];for(let i=0;i<e.length;i++){const s=e.charAt(i);"'"===s?(n.length>0&&r.push({literal:a,val:n}),t=null,n="",a=!a):a||s===t?n+=s:(n.length>0&&r.push({literal:!1,val:n}),n=s,t=s)}return n.length>0&&r.push({literal:a,val:n}),r}static macroTokenToFormatOpts(e){return er[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 Sa(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(),a=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&fa(),r=(t,n)=>this.loc.extract(e,t,n),i=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",s=()=>n?function(e){return $a[e.hour<12?0:1]}(e):r({hour:"numeric",hour12:!0},"dayperiod"),o=(t,a)=>n?function(e,t){return Ha(t)[e.month-1]}(e,t):r(a?{month:t}:{month:t,day:"numeric"},"month"),l=(t,a)=>n?function(e,t){return Ja(t)[e.weekday-1]}(e,t):r(a?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=tr.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return Qa(t)[e.year<0?0:1]}(e,t):r({era:t},"era");return _a(tr.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 i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({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 s();case"d":return a?r({day:"numeric"},"day"):this.num(e.day);case"dd":return a?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return a?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return a?r({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 a?r({month:"numeric"},"month"):this.num(e.month);case"MM":return a?r({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 a?r({year:"numeric"},"year"):this.num(e.year);case"yy":return a?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return a?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return a?r({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}},a=tr.parseFormat(t),r=a.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]);return _a(a,(e=>t=>{const a=n(t);return a?this.num(e.get(a),t.length):t})(e.shiftTo(...r.map(n).filter((e=>e)))))}}class nr{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class ar{get type(){throw new Vn}get name(){throw new Vn}get universal(){throw new Vn}offsetName(e,t){throw new Vn}formatOffset(e,t){throw new Vn}offset(e){throw new Vn}equals(e){throw new Vn}get isValid(){throw new Vn}}let rr=null;class ir extends ar{static get instance(){return null===rr&&(rr=new ir),rr}get type(){return"local"}get name(){return ha()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Da(e,t,n)}formatOffset(e,t){return Fa(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"local"===e.type}get isValid(){return!0}}const sr=RegExp(`^${ja.source}$`);let or={};const lr={year:0,month:1,day:2,hour:3,minute:4,second:5};let cr={};class ur extends ar{static create(e){return cr[e]||(cr[e]=new ur(e)),cr[e]}static resetCache(){cr={},or={}}static isValidSpecifier(e){return!(!e||!e.match(sr))}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=ur.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Da(e,t,n,this.name)}formatOffset(e,t){return Fa(this.offset(e),t)}offset(e){const t=new Date(e),n=(c=this.name,or[c]||(or[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"})),or[c]),[a,r,i,s,o,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),a=[];for(let e=0;e<n.length;e++){const{type:t,value:r}=n[e],i=lr[t];ma(i)||(a[i]=parseInt(r,10))}return a}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,r,i,s,o,l,c]=a;return[s,r,i,o,l,c]}(n,t);var c;let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(Ia({year:a,month:r,day:i,hour:24===s?0:s,minute:o,second:l,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let dr=null;class mr extends ar{static get utcInstance(){return null===dr&&(dr=new mr(0)),dr}static instance(e){return 0===e?mr.utcInstance:new mr(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new mr(Oa(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Fa(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Fa(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 pr extends ar{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 gr(e,t){let n;if(ma(e)||null===e)return t;if(e instanceof ar)return e;if("string"==typeof e){const a=e.toLowerCase();return"local"===a?t:"utc"===a||"gmt"===a?mr.utcInstance:null!=(n=ur.parseGMTOffset(e))?mr.instance(n):ur.isValidSpecifier(a)?ur.create(e):mr.parseSpecifier(a)||new pr(e)}return pa(e)?mr.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new pr(e)}let hr=()=>Date.now(),fr=null,vr=null,yr=null,br=null,Cr=!1;class wr{static get now(){return hr}static set now(e){hr=e}static get defaultZoneName(){return wr.defaultZone.name}static set defaultZoneName(e){fr=e?gr(e):null}static get defaultZone(){return fr||ir.instance}static get defaultLocale(){return vr}static set defaultLocale(e){vr=e}static get defaultNumberingSystem(){return yr}static set defaultNumberingSystem(e){yr=e}static get defaultOutputCalendar(){return br}static set defaultOutputCalendar(e){br=e}static get throwOnInvalid(){return Cr}static set throwOnInvalid(e){Cr=e}static resetCaches(){xr.resetCache(),ur.resetCache()}}let Sr={};function Er(e,t={}){const n=JSON.stringify([e,t]);let a=Sr[n];return a||(a=new Intl.DateTimeFormat(e,t),Sr[n]=a),a}let kr={};let Gr={};let Tr=null;function Ar(e,t,n,a,r){const i=e.listingMode(n);return"error"===i?null:"en"===i?a(t):r(t)}class Nr{constructor(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&ha()){const t={useGrouping:!1};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let a=kr[n];return a||(a=new Intl.NumberFormat(e,t),kr[n]=a),a}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Sa(this.floor?Math.floor(e):Ga(e,3),this.padTo)}}class Ir{constructor(e,t,n){let a;if(this.opts=n,this.hasIntl=ha(),e.zone.universal&&this.hasIntl?(a="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Gs.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:(this.dt=e,a=e.zone.name),this.hasIntl){const e=Object.assign({},this.opts);a&&(e.timeZone=a),this.dtf=Er(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(Ba(ba(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case Ba(Un):return"M/d/yyyy";case Ba(qn):return"LLL d, yyyy";case Ba(Jn):return"LLLL d, yyyy";case Ba($n):return"EEEE, LLLL d, yyyy";case Ba(Kn):return"h:mm a";case Ba(Xn):return"h:mm:ss a";case Ba(Yn):case Ba(Qn):return"h:mm a";case Ba(_n):return"HH:mm";case Ba(ea):return"HH:mm:ss";case Ba(ta):case Ba(na):return"HH:mm";case Ba(aa):return"M/d/yyyy, h:mm a";case Ba(ia):return"LLL d, yyyy, h:mm a";case Ba(la):return"LLLL d, yyyy, h:mm a";case Ba(ua):return t;case Ba(ra):return"M/d/yyyy, h:mm:ss a";case Ba(sa):return"LLL d, yyyy, h:mm:ss a";case Ba(oa):return"EEE, d LLL yyyy, h:mm a";case Ba(ca):return"LLLL d, yyyy, h:mm:ss a";case Ba(da):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}(this.opts),t=xr.create("en-US");return tr.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){return this.hasIntl&&fa()?this.dtf.formatToParts(this.dt.toJSDate()):[]}resolvedOptions(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}class Pr{constructor(e,t,n){this.opts=Object.assign({style:"long"},n),!t&&va()&&(this.rtf=function(e,t={}){const{base:n,...a}=t,r=JSON.stringify([e,a]);let i=Gr[r];return i||(i=new Intl.RelativeTimeFormat(e,t),Gr[r]=i),i}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",a=!1){const r={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."]},i=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&i){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${r[e][0]}`;case-1:return n?"yesterday":`last ${r[e][0]}`;case 0:return n?"today":`this ${r[e][0]}`}}const s=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=r[e],u=a?l?c[1]:c[2]||c[1]:l?r[e][0]:e;return s?`${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 xr{static fromOpts(e){return xr.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,a=!1){const r=e||wr.defaultLocale,i=r||(a?"en-US":function(){if(Tr)return Tr;if(ha()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;return Tr=e&&"und"!==e?e:"en-US",Tr}return Tr="en-US",Tr}()),s=t||wr.defaultNumberingSystem,o=n||wr.defaultOutputCalendar;return new xr(i,s,o,r)}static resetCache(){Tr=null,Sr={},kr={},Gr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return xr.create(e,t,n)}constructor(e,t,n,a){const[r,i,s]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const a=e.substring(0,t);try{n=Er(e).resolvedOptions()}catch(e){n=Er(a).resolvedOptions()}const{numberingSystem:r,calendar:i}=n;return[a,r,i]}}(e);this.locale=r,this.numberingSystem=t||i||null,this.outputCalendar=n||s||null,this.intl=function(e,t,n){return ha()?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=a,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")||ha()&&"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(e=!0){const t=ha()&&fa(),n=this.isEnglish(),a=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t||n&&a||e?!t||n&&a?"en":"intl":"error"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?xr.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 Ar(this,e,n,Ha,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},a=t?"format":"standalone";return this.monthsCache[a][e]||(this.monthsCache[a][e]=function(e){const t=[];for(let n=1;n<=12;n++){const a=Gs.utc(2016,n,1);t.push(e(a))}return t}((e=>this.extract(e,n,"month")))),this.monthsCache[a][e]}))}weekdays(e,t=!1,n=!0){return Ar(this,e,n,Ja,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},a=t?"format":"standalone";return this.weekdaysCache[a][e]||(this.weekdaysCache[a][e]=function(e){const t=[];for(let n=1;n<=7;n++){const a=Gs.utc(2016,11,13+n);t.push(e(a))}return t}((e=>this.extract(e,n,"weekday")))),this.weekdaysCache[a][e]}))}meridiems(e=!0){return Ar(this,void 0,e,(()=>$a),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:!0};this.meridiemCache=[Gs.utc(2016,11,13,9),Gs.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Ar(this,e,t,Qa,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Gs.utc(-40,1,1),Gs.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,n){const a=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===n));return a?a.value:null}numberFormatter(e={}){return new Nr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ir(e,this.intl,t)}relFormatter(e={}){return new Pr(this.intl,this.isEnglish(),e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||ha()&&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 Dr(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Or(...e){return t=>e.reduce((([e,n,a],r)=>{const[i,s,o]=r(t,a);return[Object.assign(e,i),n||s,o]}),[{},null,1]).slice(0,2)}function Mr(e,...t){if(null==e)return[null,null];for(const[n,a]of t){const t=n.exec(e);if(t)return a(t)}return[null,null]}function Lr(...e){return(t,n)=>{const a={};let r;for(r=0;r<e.length;r++)a[e[r]]=Ea(t[n+r]);return[a,null,n+r]}}const Fr=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,zr=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,jr=RegExp(`${zr.source}${Fr.source}?`),Br=RegExp(`(?:T${jr.source})?`),Rr=Lr("weekYear","weekNumber","weekDay"),Vr=Lr("year","ordinal"),Wr=RegExp(`${zr.source} ?(?:${Fr.source}|(${ja.source}))?`),Hr=RegExp(`(?: ${Wr.source})?`);function Zr(e,t,n){const a=e[t];return ma(a)?n:Ea(a)}function Ur(e,t){return[{year:Zr(e,t),month:Zr(e,t+1,1),day:Zr(e,t+2,1)},null,t+3]}function qr(e,t){return[{hour:Zr(e,t,0),minute:Zr(e,t+1,0),second:Zr(e,t+2,0),millisecond:ka(e[t+3])},null,t+4]}function Jr(e,t){const n=!e[t]&&!e[t+1],a=Oa(e[t+1],e[t+2]);return[{},n?null:mr.instance(a),t+3]}function $r(e,t){return[{},e[t]?ur.create(e[t]):null,t+1]}const Kr=/^-?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 Xr(e){const[t,n,a,r,i,s,o,l,c]=e,u="-"===t[0],d=e=>e&&u?-e:e;return[{years:d(Ea(n)),months:d(Ea(a)),weeks:d(Ea(r)),days:d(Ea(i)),hours:d(Ea(s)),minutes:d(Ea(o)),seconds:d(Ea(l)),milliseconds:d(ka(c))}]}const Yr={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Qr(e,t,n,a,r,i,s){const o={year:2===t.length?xa(Ea(t)):Ea(t),month:Va.indexOf(n)+1,day:Ea(a),hour:Ea(r),minute:Ea(i)};return s&&(o.second=Ea(s)),e&&(o.weekday=e.length>3?Za.indexOf(e)+1:Ua.indexOf(e)+1),o}const _r=/^(?:(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 ei(e){const[,t,n,a,r,i,s,o,l,c,u,d]=e,m=Qr(t,r,a,n,i,s,o);let p;return p=l?Yr[l]:c?0:Oa(u,d),[m,new mr(p)]}const ti=/^(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$/,ni=/^(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$/,ai=/^(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 ri(e){const[,t,n,a,r,i,s,o]=e;return[Qr(t,r,a,n,i,s,o),mr.utcInstance]}function ii(e){const[,t,n,a,r,i,s,o]=e;return[Qr(t,o,n,a,r,i,s),mr.utcInstance]}const si=Dr(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Br),oi=Dr(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Br),li=Dr(/(\d{4})-?(\d{3})/,Br),ci=Dr(jr),ui=Or(Ur,qr,Jr),di=Or(Rr,qr,Jr),mi=Or(Vr,qr),pi=Or(qr,Jr);const gi=Dr(/(\d{4})-(\d\d)-(\d\d)/,Hr),hi=Dr(Wr),fi=Or(Ur,qr,Jr,$r),vi=Or(qr,Jr,$r);const yi={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}},bi=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}},yi),Ci=Object.assign({years:{months:12,weeks:52.1775,days:365.2425,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:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},yi),wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Si=wi.slice(0).reverse();function Ei(e,t,n=!1){const a={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ti(a)}function ki(e,t,n,a,r){const i=e[r][n],s=t[n]/i,o=!(Math.sign(s)===Math.sign(a[r]))&&0!==a[r]&&Math.abs(s)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(s):Math.trunc(s);a[r]+=o,t[n]-=o*i}function Gi(e,t){Si.reduce(((n,a)=>ma(t[a])?n:(n&&ki(e,t,n,t,a),a)),null)}class Ti{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||xr.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ci:bi,this.isLuxonDuration=!0}static fromMillis(e,t){return Ti.fromObject(Object.assign({milliseconds:e},t))}static fromObject(e){if(null==e||"object"!=typeof e)throw new Rn("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Ti({values:La(e,Ti.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:xr.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromISO(e,t){const[n]=function(e){return Mr(e,[Kr,Xr])}(e);if(n){const e=Object.assign(n,t);return Ti.fromObject(e)}return Ti.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Rn("need to specify a reason the Duration is invalid");const n=e instanceof nr?e:new nr(e,t);if(wr.throwOnInvalid)throw new zn(n);return new Ti({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 Bn(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?tr.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+=Ga(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=Ai(e),n={};for(const e of wi)(Ca(t.values,e)||Ca(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Ei(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Ai(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]=Ma(e(this.values[n],n));return Ei(this,{values:t},!0)}get(e){return this[Ti.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Ei(this,{values:Object.assign(this.values,La(e,Ti.normalizeUnit,[]))})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(a.conversionAccuracy=n),Ei(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Gi(this.matrix,e),Ei(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Ti.normalizeUnit(e)));const t={},n={},a=this.toObject();let r;Gi(this.matrix,a);for(const i of wi)if(e.indexOf(i)>=0){r=i;let e=0;for(const t in n)e+=this.matrix[t][i]*n[t],n[t]=0;pa(a[i])&&(e+=a[i]);const s=Math.trunc(e);t[i]=s,n[i]=e-s;for(const e in a)wi.indexOf(e)>wi.indexOf(i)&&ki(this.matrix,a,e,t,i)}else pa(a[i])&&(n[i]=a[i]);for(const e in n)0!==n[e]&&(t[r]+=e===r?n[e]:n[e]/this.matrix[r][e]);return Ei(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 Ei(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 wi)if(this.values[t]!==e.values[t])return!1;return!0}}function Ai(e){if(pa(e))return Ti.fromMillis(e);if(Ti.isDuration(e))return e;if("object"==typeof e)return Ti.fromObject(e);throw new Rn(`Unknown duration argument ${e} of type ${typeof e}`)}const Ni="Invalid Interval";class Ii{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 Rn("need to specify a reason the Interval is invalid");const n=e instanceof nr?e:new nr(e,t);if(wr.throwOnInvalid)throw new Fn(n);return new Ii({invalid:n})}static fromDateTimes(e,t){const n=Ts(e),a=Ts(t),r=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Ii.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:Ii.invalid("missing or invalid end"):Ii.invalid("missing or invalid start")}(n,a);return null==r?new Ii({start:n,end:a}):r}static after(e,t){const n=Ai(t),a=Ts(e);return Ii.fromDateTimes(a,a.plus(n))}static before(e,t){const n=Ai(t),a=Ts(e);return Ii.fromDateTimes(a.minus(n),a)}static fromISO(e,t){const[n,a]=(e||"").split("/",2);if(n&&a){const e=Gs.fromISO(n,t),r=Gs.fromISO(a,t);if(e.isValid&&r.isValid)return Ii.fromDateTimes(e,r);if(e.isValid){const n=Ti.fromISO(a,t);if(n.isValid)return Ii.after(e,n)}else if(r.isValid){const e=Ti.fromISO(n,t);if(e.isValid)return Ii.before(r,e)}}return Ii.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?Ii.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ts).filter((e=>this.contains(e))).sort(),n=[];let{s:a}=this,r=0;for(;a<this.e;){const e=t[r]||this.e,i=+e>+this.e?this.e:e;n.push(Ii.fromDateTimes(a,i)),a=i,r+=1}return n}splitBy(e){const t=Ai(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,a,{s:r}=this;const i=[];for(;r<this.e;)n=r.plus(t),a=+n>+this.e?this.e:n,i.push(Ii.fromDateTimes(r,a)),r=a;return i}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:Ii.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 Ii.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 a=[],r=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),i=Array.prototype.concat(...r).sort(((e,t)=>e.time-t.time));for(const e of i)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!=+e.time&&a.push(Ii.fromDateTimes(t,e.time)),t=null);return Ii.merge(a)}difference(...e){return Ii.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ni}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ni}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ni}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ni}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ni}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Ti.invalid(this.invalidReason)}mapEndpoints(e){return Ii.fromDateTimes(e(this.s),e(this.e))}}class Pi{static hasDST(e=wr.defaultZone){const t=Gs.local().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ur.isValidSpecifier(e)&&ur.isValidZone(e)}static normalizeZone(e){return gr(e,wr.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:a="gregory"}={}){return xr.create(t,n,a).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:a="gregory"}={}){return xr.create(t,n,a).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null}={}){return xr.create(t,n,null).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null}={}){return xr.create(t,n,null).weekdays(e,!0)}static meridiems({locale:e=null}={}){return xr.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return xr.create(t,null,"gregory").eras(e)}static features(){let e=!1,t=!1,n=!1,a=!1;if(ha()){e=!0,t=fa(),a=va();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:a}}}function xi(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),a=n(t)-n(e);return Math.floor(Ti.fromMillis(a).as("days"))}function Di(e,t,n,a){let[r,i,s,o]=function(e,t,n){const a=[["years",(e,t)=>t.year-e.year],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=xi(e,t);return(n-n%7)/7}],["days",xi]],r={};let i,s;for(const[o,l]of a)if(n.indexOf(o)>=0){i=o;let n=l(e,t);s=e.plus({[o]:n}),s>t?(e=e.plus({[o]:n-1}),n-=1):e=s,r[o]=n}return[e,r,s,i]}(e,t,n);const l=t-r,c=n.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(s<t&&(s=r.plus({[o]:1})),s!==r&&(i[o]=(i[o]||0)+l/(s-r)));const u=Ti.fromObject(Object.assign(i,a));return c.length>0?Ti.fromMillis(l,a).shiftTo(...c).plus(u):u}const Oi={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mi={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]},Li=Oi.hanidec.replace(/[\[|\]]/g,"").split("");function Fi({numberingSystem:e},t=""){return new RegExp(`${Oi[e||"latn"]}${t}`)}function zi(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 a=e.charCodeAt(n);if(-1!==e[n].search(Oi.hanidec))t+=Li.indexOf(e[n]);else for(const e in Mi){const[n,r]=Mi[e];a>=n&&a<=r&&(t+=a-n)}}return parseInt(t,10)}return t}(e))}}function ji(e){return e.replace(/\./,"\\.?")}function Bi(e){return e.replace(/\./,"").toLowerCase()}function Ri(e,t){return null===e?null:{regex:RegExp(e.map(ji).join("|")),deser:([n])=>e.findIndex((e=>Bi(n)===Bi(e)))+t}}function Vi(e,t){return{regex:e,deser:([,e,t])=>Oa(e,t),groups:t}}function Wi(e){return{regex:e,deser:([e])=>e}}const Hi={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 Zi=null;function Ui(e,t){if(e.literal)return e;const n=tr.macroTokenToFormatOpts(e.val);if(!n)return e;const a=tr.create(t,n).formatDateTimeParts((Zi||(Zi=Gs.fromMillis(1555555555555)),Zi)).map((e=>function(e,t,n){const{type:a,value:r}=e;if("literal"===a)return{literal:!0,val:r};const i=n[a];let s=Hi[a];return"object"==typeof s&&(s=s[i]),s?{literal:!1,val:s}:void 0}(e,0,n)));return a.includes(void 0)?e:a}function qi(e,t,n){const a=function(e,t){return Array.prototype.concat(...e.map((e=>Ui(e,t))))}(tr.parseFormat(n),e),r=a.map((t=>function(e,t){const n=Fi(t),a=Fi(t,"{2}"),r=Fi(t,"{3}"),i=Fi(t,"{4}"),s=Fi(t,"{6}"),o=Fi(t,"{1,2}"),l=Fi(t,"{1,3}"),c=Fi(t,"{1,6}"),u=Fi(t,"{1,9}"),d=Fi(t,"{2,4}"),m=Fi(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 Ri(t.eras("short",!1),0);case"GG":return Ri(t.eras("long",!1),0);case"y":return zi(c);case"yy":return zi(d,xa);case"yyyy":return zi(i);case"yyyyy":return zi(m);case"yyyyyy":return zi(s);case"M":return zi(o);case"MM":return zi(a);case"MMM":return Ri(t.months("short",!0,!1),1);case"MMMM":return Ri(t.months("long",!0,!1),1);case"L":return zi(o);case"LL":return zi(a);case"LLL":return Ri(t.months("short",!1,!1),1);case"LLLL":return Ri(t.months("long",!1,!1),1);case"d":return zi(o);case"dd":return zi(a);case"o":return zi(l);case"ooo":return zi(r);case"HH":return zi(a);case"H":return zi(o);case"hh":return zi(a);case"h":return zi(o);case"mm":return zi(a);case"m":case"q":return zi(o);case"qq":return zi(a);case"s":return zi(o);case"ss":return zi(a);case"S":return zi(l);case"SSS":return zi(r);case"u":return Wi(u);case"a":return Ri(t.meridiems(),0);case"kkkk":return zi(i);case"kk":return zi(d,xa);case"W":return zi(o);case"WW":return zi(a);case"E":case"c":return zi(n);case"EEE":return Ri(t.weekdays("short",!1,!1),1);case"EEEE":return Ri(t.weekdays("long",!1,!1),1);case"ccc":return Ri(t.weekdays("short",!0,!1),1);case"cccc":return Ri(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Vi(new RegExp(`([+-]${o.source})(?::(${a.source}))?`),2);case"ZZZ":return Vi(new RegExp(`([+-]${o.source})(${a.source})?`),2);case"z":return Wi(/[a-z_+-/]{1,256}?/i);default:return p(g)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e))),i=r.find((e=>e.invalidReason));if(i)return{input:t,tokens:a,invalidReason:i.invalidReason};{const[e,n]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(r),i=RegExp(e,"i"),[s,o]=function(e,t,n){const a=e.match(t);if(a){const e={};let t=1;for(const r in n)if(Ca(n,r)){const i=n[r],s=i.groups?i.groups+1:1;!i.literal&&i.token&&(e[i.token.val[0]]=i.deser(a.slice(t,t+s))),t+=s}return[a,e]}return[a,{}]}(t,i,n),[l,c]=o?function(e){let t;return t=ma(e.Z)?ma(e.z)?null:ur.create(e.z):new mr(e.Z),ma(e.q)||(e.M=3*(e.q-1)+1),ma(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),ma(e.u)||(e.S=ka(e.u)),[Object.keys(e).reduce(((t,n)=>{const a=(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 a&&(t[a]=e[n]),t}),{}),t]}(o):[null,null];if(Ca(o,"a")&&Ca(o,"H"))throw new jn("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:a,regex:i,rawMatches:s,matches:o,result:l,zone:c}}}const Ji=[0,31,59,90,120,151,181,212,243,273,304,334],$i=[0,31,60,91,121,152,182,213,244,274,305,335];function Ki(e,t){return new nr("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Xi(e,t,n){const a=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===a?7:a}function Yi(e,t,n){return n+(Ta(e)?$i:Ji)[t-1]}function Qi(e,t){const n=Ta(e)?$i:Ji,a=n.findIndex((e=>e<t));return{month:a+1,day:t-n[a]}}function _i(e){const{year:t,month:n,day:a}=e,r=Yi(t,n,a),i=Xi(t,n,a);let s,o=Math.floor((r-i+10)/7);return o<1?(s=t-1,o=Pa(s)):o>Pa(t)?(s=t+1,o=1):s=t,Object.assign({weekYear:s,weekNumber:o,weekday:i},za(e))}function es(e){const{weekYear:t,weekNumber:n,weekday:a}=e,r=Xi(t,1,4),i=Aa(t);let s,o=7*n+a-r-3;o<1?(s=t-1,o+=Aa(s)):o>i?(s=t+1,o-=Aa(t)):s=t;const{month:l,day:c}=Qi(s,o);return Object.assign({year:s,month:l,day:c},za(e))}function ts(e){const{year:t,month:n,day:a}=e,r=Yi(t,n,a);return Object.assign({year:t,ordinal:r},za(e))}function ns(e){const{year:t,ordinal:n}=e,{month:a,day:r}=Qi(t,n);return Object.assign({year:t,month:a,day:r},za(e))}function as(e){const t=ga(e.year),n=wa(e.month,1,12),a=wa(e.day,1,Na(e.year,e.month));return t?n?!a&&Ki("day",e.day):Ki("month",e.month):Ki("year",e.year)}function rs(e){const{hour:t,minute:n,second:a,millisecond:r}=e,i=wa(t,0,23)||24===t&&0===n&&0===a&&0===r,s=wa(n,0,59),o=wa(a,0,59),l=wa(r,0,999);return i?s?o?!l&&Ki("millisecond",r):Ki("second",a):Ki("minute",n):Ki("hour",t)}const is="Invalid DateTime";function ss(e){return new nr("unsupported zone",`the zone "${e.name}" is not supported`)}function os(e){return null===e.weekData&&(e.weekData=_i(e.c)),e.weekData}function ls(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Gs(Object.assign({},n,t,{old:n}))}function cs(e,t,n){let a=e-60*t*1e3;const r=n.offset(a);if(t===r)return[a,t];a-=60*(r-t)*1e3;const i=n.offset(a);return r===i?[a,r]:[e-60*Math.min(r,i)*1e3,Math.max(r,i)]}function us(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 ds(e,t,n){return cs(Ia(e),t,n)}function ms(e,t){const n=Object.keys(t.values);-1===n.indexOf("milliseconds")&&n.push("milliseconds"),t=t.shiftTo(...n);const a=e.o,r=e.c.year+t.years,i=e.c.month+t.months+3*t.quarters,s=Object.assign({},e.c,{year:r,month:i,day:Math.min(e.c.day,Na(r,i))+t.days+7*t.weeks}),o=Ti.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Ia(s);let[c,u]=cs(l,a,e.zone);return 0!==o&&(c+=o,u=e.zone.offset(c)),{ts:c,o:u}}function ps(e,t,n,a,r){const{setZone:i,zone:s}=n;if(e&&0!==Object.keys(e).length){const a=t||s,r=Gs.fromObject(Object.assign(e,n,{zone:a,setZone:void 0}));return i?r:r.setZone(s)}return Gs.invalid(new nr("unparsable",`the input "${r}" can't be parsed as ${a}`))}function gs(e,t,n=!0){return e.isValid?tr.create(xr.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function hs(e,{suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:a,includeZone:r=!1,spaceZone:i=!1,format:s="extended"}){let o="basic"===s?"HHmm":"HH:mm";return t&&0===e.second&&0===e.millisecond||(o+="basic"===s?"ss":":ss",n&&0===e.millisecond||(o+=".SSS")),(r||a)&&i&&(o+=" "),r?o+="z":a&&(o+="basic"===s?"ZZZ":"ZZ"),gs(e,o)}const fs={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ys={ordinal:1,hour:0,minute:0,second:0,millisecond:0},bs=["year","month","day","hour","minute","second","millisecond"],Cs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ws=["year","ordinal","hour","minute","second","millisecond"];function Ss(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 Bn(e);return t}function Es(e,t){for(const t of bs)ma(e[t])&&(e[t]=fs[t]);const n=as(e)||rs(e);if(n)return Gs.invalid(n);const a=wr.now(),r=t.offset(a),[i,s]=ds(e,r,t);return new Gs({ts:i,zone:t,o:s})}function ks(e,t,n){const a=!!ma(n.round)||n.round,r=(e,r)=>{e=Ga(e,a||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,r)},i=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return r(i(n.unit),n.unit);for(const e of n.units){const t=i(e);if(Math.abs(t)>=1)return r(t,e)}return r(0,n.units[n.units.length-1])}class Gs{constructor(e){const t=e.zone||wr.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new nr("invalid input"):null)||(t.isValid?null:ss(t));this.ts=ma(e.ts)?wr.now():e.ts;let a=null,r=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[a,r]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);a=us(this.ts,e),n=Number.isNaN(a.year)?new nr("invalid input"):null,a=n?null:a,r=n?null:e}}this._zone=t,this.loc=e.loc||xr.create(),this.invalid=n,this.weekData=null,this.c=a,this.o=r,this.isLuxonDateTime=!0}static local(e,t,n,a,r,i,s){return ma(e)?new Gs({ts:wr.now()}):Es({year:e,month:t,day:n,hour:a,minute:r,second:i,millisecond:s},wr.defaultZone)}static utc(e,t,n,a,r,i,s){return ma(e)?new Gs({ts:wr.now(),zone:mr.utcInstance}):Es({year:e,month:t,day:n,hour:a,minute:r,second:i,millisecond:s},mr.utcInstance)}static fromJSDate(e,t={}){const n=(a=e,"[object Date]"===Object.prototype.toString.call(a)?e.valueOf():NaN);var a;if(Number.isNaN(n))return Gs.invalid("invalid input");const r=gr(t.zone,wr.defaultZone);return r.isValid?new Gs({ts:n,zone:r,loc:xr.fromObject(t)}):Gs.invalid(ss(r))}static fromMillis(e,t={}){if(pa(e))return e<-864e13||e>864e13?Gs.invalid("Timestamp out of range"):new Gs({ts:e,zone:gr(t.zone,wr.defaultZone),loc:xr.fromObject(t)});throw new Rn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(pa(e))return new Gs({ts:1e3*e,zone:gr(t.zone,wr.defaultZone),loc:xr.fromObject(t)});throw new Rn("fromSeconds requires a numerical input")}static fromObject(e){const t=gr(e.zone,wr.defaultZone);if(!t.isValid)return Gs.invalid(ss(t));const n=wr.now(),a=t.offset(n),r=La(e,Ss,["zone","locale","outputCalendar","numberingSystem"]),i=!ma(r.ordinal),s=!ma(r.year),o=!ma(r.month)||!ma(r.day),l=s||o,c=r.weekYear||r.weekNumber,u=xr.fromObject(e);if((l||i)&&c)throw new jn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new jn("Can't mix ordinal dates with month/day");const d=c||r.weekday&&!l;let m,p,g=us(n,a);d?(m=Cs,p=vs,g=_i(g)):i?(m=ws,p=ys,g=ts(g)):(m=bs,p=fs);let h=!1;for(const e of m){ma(r[e])?r[e]=h?p[e]:g[e]:h=!0}const f=(d?function(e){const t=ga(e.weekYear),n=wa(e.weekNumber,1,Pa(e.weekYear)),a=wa(e.weekday,1,7);return t?n?!a&&Ki("weekday",e.weekday):Ki("week",e.week):Ki("weekYear",e.weekYear)}(r):i?function(e){const t=ga(e.year),n=wa(e.ordinal,1,Aa(e.year));return t?!n&&Ki("ordinal",e.ordinal):Ki("year",e.year)}(r):as(r))||rs(r);if(f)return Gs.invalid(f);const v=d?es(r):i?ns(r):r,[y,b]=ds(v,a,t),C=new Gs({ts:y,zone:t,o:b,loc:u});return r.weekday&&l&&e.weekday!==C.weekday?Gs.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[n,a]=function(e){return Mr(e,[si,ui],[oi,di],[li,mi],[ci,pi])}(e);return ps(n,a,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,a]=function(e){return Mr(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[_r,ei])}(e);return ps(n,a,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,a]=function(e){return Mr(e,[ti,ri],[ni,ri],[ai,ii])}(e);return ps(n,a,t,"HTTP",t)}static fromFormat(e,t,n={}){if(ma(e)||ma(t))throw new Rn("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:r=null}=n,i=xr.fromOpts({locale:a,numberingSystem:r,defaultToEN:!0}),[s,o,l]=function(e,t,n){const{result:a,zone:r,invalidReason:i}=qi(e,t,n);return[a,r,i]}(i,e,t);return l?Gs.invalid(l):ps(s,o,n,`format ${t}`,e)}static fromString(e,t,n={}){return Gs.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,a]=function(e){return Mr(e,[gi,fi],[hi,vi])}(e);return ps(n,a,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Rn("need to specify a reason the DateTime is invalid");const n=e instanceof nr?e:new nr(e,t);if(wr.throwOnInvalid)throw new Ln(n);return new Gs({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?os(this).weekYear:NaN}get weekNumber(){return this.isValid?os(this).weekNumber:NaN}get weekday(){return this.isValid?os(this).weekday:NaN}get ordinal(){return this.isValid?ts(this.c).ordinal:NaN}get monthShort(){return this.isValid?Pi.months("short",{locale:this.locale})[this.month-1]:null}get monthLong(){return this.isValid?Pi.months("long",{locale:this.locale})[this.month-1]:null}get weekdayShort(){return this.isValid?Pi.weekdays("short",{locale:this.locale})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Pi.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 Ta(this.year)}get daysInMonth(){return Na(this.year,this.month)}get daysInYear(){return this.isValid?Aa(this.year):NaN}get weeksInWeekYear(){return this.isValid?Pa(this.weekYear):NaN}resolvedLocaleOpts(e={}){const{locale:t,numberingSystem:n,calendar:a}=tr.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:a}}toUTC(e=0,t={}){return this.setZone(mr.instance(e),t)}toLocal(){return this.setZone(wr.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=gr(e,wr.defaultZone)).equals(this.zone))return this;if(e.isValid){let a=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[a]=ds(n,t,e)}return ls(this,{ts:a,zone:e})}return Gs.invalid(ss(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return ls(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=La(e,Ss,[]);let n;!ma(t.weekYear)||!ma(t.weekNumber)||!ma(t.weekday)?n=es(Object.assign(_i(this.c),t)):ma(t.ordinal)?(n=Object.assign(this.toObject(),t),ma(t.day)&&(n.day=Math.min(Na(n.year,n.month),n.day))):n=ns(Object.assign(ts(this.c),t));const[a,r]=ds(n,this.o,this.zone);return ls(this,{ts:a,o:r})}plus(e){if(!this.isValid)return this;return ls(this,ms(this,Ai(e)))}minus(e){if(!this.isValid)return this;return ls(this,ms(this,Ai(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=Ti.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?tr.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):is}toLocaleString(e=Un){return this.isValid?tr.create(this.loc.clone(e),e).formatDateTime(this):is}toLocaleParts(e={}){return this.isValid?tr.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),gs(this,t)}toISOWeekDate(){return gs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,format:a="extended"}={}){return hs(this,{suppressSeconds:t,suppressMilliseconds:e,includeOffset:n,format:a})}toRFC2822(){return gs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return gs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return gs(this,"yyyy-MM-dd")}toSQLTime({includeOffset:e=!0,includeZone:t=!1}={}){return hs(this,{includeOffset:e,includeZone:t,spaceZone:!0})}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():is}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 Ti.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");const a=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),r=(o=t,Array.isArray(o)?o:[o]).map(Ti.normalizeUnit),i=e.valueOf()>this.valueOf(),s=Di(i?this:e,i?e:this,r,a);var o;return i?s.negate():s}diffNow(e="milliseconds",t={}){return this.diff(Gs.local(),e,t)}until(e){return this.isValid?Ii.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||Gs.fromObject({zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;return ks(t,this.plus(n),Object.assign(e,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}toRelativeCalendar(e={}){return this.isValid?ks(e.base||Gs.fromObject({zone:this.zone}),this,Object.assign(e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(Gs.isDateTime))throw new Rn("min requires all arguments be DateTimes");return ya(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(Gs.isDateTime))throw new Rn("max requires all arguments be DateTimes");return ya(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:a=null,numberingSystem:r=null}=n;return qi(xr.fromOpts({locale:a,numberingSystem:r,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Gs.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return Un}static get DATE_MED(){return qn}static get DATE_FULL(){return Jn}static get DATE_HUGE(){return $n}static get TIME_SIMPLE(){return Kn}static get TIME_WITH_SECONDS(){return Xn}static get TIME_WITH_SHORT_OFFSET(){return Yn}static get TIME_WITH_LONG_OFFSET(){return Qn}static get TIME_24_SIMPLE(){return _n}static get TIME_24_WITH_SECONDS(){return ea}static get TIME_24_WITH_SHORT_OFFSET(){return ta}static get TIME_24_WITH_LONG_OFFSET(){return na}static get DATETIME_SHORT(){return aa}static get DATETIME_SHORT_WITH_SECONDS(){return ra}static get DATETIME_MED(){return ia}static get DATETIME_MED_WITH_SECONDS(){return sa}static get DATETIME_MED_WITH_WEEKDAY(){return oa}static get DATETIME_FULL(){return la}static get DATETIME_FULL_WITH_SECONDS(){return ca}static get DATETIME_HUGE(){return ua}static get DATETIME_HUGE_WITH_SECONDS(){return da}}function Ts(e){if(Gs.isDateTime(e))return e;if(e&&e.valueOf&&pa(e.valueOf()))return Gs.fromJSDate(e);if(e&&"object"==typeof e)return Gs.fromObject(e);throw new Rn(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const As=({dismissModal:e,serverGroup:t})=>{const{result:n,status:a,error:r}=P((()=>Ze.getScalingActivities(t)),[],[t.id]),i="PENDING"===a;return lt.createElement(lt.Fragment,null,lt.createElement(Ve,null,`Scaling activities for ${t.name}`),lt.createElement(We,null,lt.createElement("div",{className:"flex-1 heading-3"},i&<.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},lt.createElement(M,null)),!i&&Boolean(r)&<.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},lt.createElement("h4",null,`There was an error loading scaling activities for ${t.name}. Please try again later.`)),!i&&!r&&!Boolean(n.length)&<.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},lt.createElement("h4",null,`No scaling activities found for ${t.name}.`)),!i&&!r&&Boolean(n.length)&<.createElement("div",{className:"middle sp-margin-xl-yaxis"},n.map(((e,t)=>{var n;return lt.createElement("div",{key:`${t}-${e.jobId}`,className:"sp-margin-xl-yaxis"},lt.createElement("p",{className:"clearfix"},lt.createElement("span",{className:`label label-${"KillInitiated"!==e.jobState?"success":"danger"} pull-left`},e.jobState),lt.createElement("span",{className:"label label-default pull-right"},(e=>{const t=new Date(e);return Gs.fromJSDate(t).toFormat("yyyy-MM-dd HH:mm:ss ZZZZ")})(e.date))),lt.createElement("p",null,`${e.reasonMessage} Desired capacity is ${(null==(n=e.capacity)?void 0:n.desired)||"unknown"}.`))}))))),lt.createElement(He,{primaryActions:lt.createElement("button",{className:"btn btn-primary",onClick:e},"Close")}))};var Ns=Object.defineProperty,Is=Object.getOwnPropertyDescriptor;let Ps=class extends ct.Component{render(){const{serverGroup:e,app:t}=this.props,{capacity:n}=e,a=e.instances.length,r=n.min===n.max;return ct.createElement(ct.Fragment,null,ct.createElement("dl",{className:"dl-horizontal dl-narrow"},ct.createElement(Ue,{capacity:n,simpleMode:r}),ct.createElement(qe,{currentCapacity:a}),e.capacityGroup&&ct.createElement(ct.Fragment,null,ct.createElement("dt",null,"Cap. Group"),ct.createElement("dd",null,e.capacityGroup))),ct.createElement("div",null,ct.createElement("a",{className:"clickable",onClick:()=>Ke(e,t).then((n=>{n&&xe.show(On,{serverGroup:e,application:t})}))},"Resize Server Group")),ct.createElement("div",null,ct.createElement("a",{className:"clickable",onClick:()=>Je(As,{serverGroup:e},{maxWidth:"1000px"})},"View Scaling Activities")))}};Ps=((e,t,n,a)=>{for(var r,i=a>1?void 0:a?Is(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a?r(t,n,i):r(i))||i);return a&&i&&Ns(t,n,i),i})([$e("titus.serverGroup.CapacityDetailsSection")],Ps);t("titus.servergroup.details.capacitydetailssection",[]).component("titusCapacityDetailsSection",Mt(Xe(Ps,"titusCapacityDetailsSection"),["serverGroup","app"]));var xs=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor;let Os=class extends ct.Component{render(){if(!this.props.serverGroup||!this.props.serverGroup.image)return null;const{serverGroup:{image:e,entryPoint:t,iamProfile:n,resources:a}}=this.props;return ct.createElement(b,{className:"horizontal-when-filters-collapsed"},e.dockerImageName&&ct.createElement(C,{label:"Image Name",value:e.dockerImageName}),e.dockerImageVersion&&ct.createElement(C,{label:"Image Version",value:e.dockerImageVersion}),t&&ct.createElement(C,{label:"Entrypoint",value:t}),n&&ct.createElement(C,{label:"IAM Profile",value:n}),ct.createElement(C,{label:"CPU(s)",value:a.cpu}),ct.createElement(C,{label:"Memory",value:`${a.memory} MB`}),ct.createElement(C,{label:"Disk",value:`${a.disk} MB`}),ct.createElement(C,{label:"Network",value:`${a.networkMbps} Mbps`}),ct.createElement(C,{label:"GPU(s)",value:a.gpu}))}};Os=((e,t,n,a)=>{for(var r,i=a>1?void 0:a?Ds(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a?r(t,n,i):r(i))||i);return a&&i&&xs(t,n,i),i})([$e("titus.serverGroup.launchConfigSection")],Os);t("titus.servergroup.details.launchConfigSection",[]).component("titusLaunchConfigSection",Mt(Xe(Os,"titusLaunchConfigSection"),["serverGroup"]));class Ms extends ct.Component{static show(e){return xe.show(Ms,e)}submit(e,t){const{application:n,serverGroup:a}=this.props,r={type:"upsertDisruptionBudget",cloudProvider:"titus",credentials:a.account,region:a.region,jobId:a.id,disruptionBudget:e.disruptionBudget};t.submit((()=>Ye.executeTask({job:[r],application:n,description:`Update Disruption Budget for ${a.name}`})))}render(){const{application:e,command:t,dismissModal:n}=this.props,a=new Pe({application:e,title:"Updating Job Disruption Budget",modalInstance:Pe.modalInstanceEmulation((()=>n())),onTaskComplete:()=>e.serverGroups.refresh()});return ct.createElement(ct.Fragment,null,ct.createElement(Fe,{monitor:a}),ct.createElement(Ee,{initialValues:t,onSubmit:e=>this.submit(e,a),render:t=>ct.createElement(ct.Fragment,null,ct.createElement(ze,{dismiss:n}),ct.createElement(Lt.Header,null,ct.createElement(Lt.Title,null,"Update Disruption Budget")),ct.createElement(Lt.Body,null,ct.createElement(Sn,{formik:t,app:e})),ct.createElement(Lt.Footer,null,ct.createElement("button",{className:"btn btn-default",onClick:n,type:"button"},"Cancel"),ct.createElement(Qe,{onClick:()=>this.submit(t.values,a),isDisabled:!t.isValid,isFormSubmit:!0,submitting:!1,label:"Update Budget"})))}))}}class Ls extends ct.Component{constructor(){super(...arguments),this.SectionHeading=({budget:e,options:t,label:n})=>{const a=t.find((t=>!!e[t.field]));return a?ct.createElement("div",null,ct.createElement("div",{className:"bold"},n),a.label," ",ct.createElement(ee,{content:a.description})):null},this.Policy=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.availabilityPercentageLimit?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Percentage of Healthy Containers"),e.availabilityPercentageLimit.percentageOfHealthyContainers," percent"):e.relocationLimit?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Limit"),e.relocationLimit.limit," task",1!==e.relocationLimit.limit&&"s"):e.unhealthyTasksLimit?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Limit of Unhealthy Containers"),e.unhealthyTasksLimit.limitOfUnhealthyContainers," container",1!==e.unhealthyTasksLimit.limitOfUnhealthyContainers&&"s"):e.selfManaged?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Relocation Time"),e.selfManaged.relocationTimeMs>0&&ct.createElement(t,{durationMs:e.selfManaged.relocationTimeMs}),0===e.selfManaged.relocationTimeMs&&"0 ms (immediate)"):null},this.ParentheticalDuration=({durationMs:e})=>ct.createElement("span",null,e," ms",e>1e3&&` (${Ft(e)})`),this.Rate=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.ratePerInterval?ct.createElement(ct.Fragment,null,ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Interval"),ct.createElement(t,{durationMs:e.ratePerInterval.intervalMs})),ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Limit"),e.ratePerInterval.limitPerInterval," task",1!==e.ratePerInterval.limitPerInterval&&"s")):e.ratePercentagePerInterval?ct.createElement(ct.Fragment,null,ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Interval"),ct.createElement(t,{durationMs:e.ratePercentagePerInterval.intervalMs})),ct.createElement("div",null,ct.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))),a=[],r=[];return t.slice(t.indexOf(n[0])).forEach((e=>{n.includes(e)?r.push(e):r.length&&(a.push(this.toDayRangeString(r)),r.length=0)})),r.length&&a.push(this.toDayRangeString(r)),a.join(", ")},this.TimeWindows=({budget:e})=>{const{groupedDays:t}=this,n=e.timeWindows&&e.timeWindows.length>0;return ct.createElement(ct.Fragment,null,ct.createElement("div",{className:"bold"},"When can disruption occur?"),ct.createElement("div",null,n&&e.timeWindows.map(((e,n)=>e.hourlyTimeWindows.map(((a,r)=>ct.createElement("div",{key:`${n}.${r}`},t(e.days),", ",a.startHour,":00 - ",a.endHour,":00 ",e.timeZone))))),!n&&"Any time"))},this.editBudget=()=>{const{app:e,serverGroup:t}=this.props;Vt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(e,t).then((n=>{Ms.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:a}=this,r=this.props.serverGroup,i=!r.migrationPolicy||"SystemDefault"===r.migrationPolicy.type,s=hn(this.props.app),o=r.disruptionBudget||s,l=!i&&kt(o,s);return ct.createElement(ct.Fragment,null,ct.createElement(wn,null),l&&ct.createElement("div",null,"(default policy)"),ct.createElement("div",{className:"bottom-border"},ct.createElement(t,{budget:o,options:vn,label:"Policy"}),ct.createElement(e,{budget:o})),ct.createElement("div",{className:"bottom-border"},ct.createElement(t,{budget:o,options:yn,label:"Rate"}),ct.createElement(n,{budget:o})),ct.createElement(a,{budget:o}),ct.createElement("div",{className:"sp-margin-l-top"},ct.createElement("a",{className:"clickable",onClick:this.editBudget},"Edit Disruption Budget")))}}t("spinnaker.titus.disruptionbudget.section",[]).component("titusDisruptionBudgetSection",Mt(Xe(Ls,"titusDisruptionBudgetSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.rollback.controller",[_e]).controller("titusRollbackServerGroupCtrl",["$scope","$uibModalInstance","serverGroupWriter","application","serverGroup","previousServerGroup","disabledServerGroups","allServerGroups",function(e,t,n,a,r,i,s,o){e.serverGroup=r,e.disabledServerGroups=s.sort(((e,t)=>t.name.localeCompare(e.name))),e.allServerGroups=o.sort(((e,t)=>t.name.localeCompare(e.name))),e.verification={};const l=r.capacity.desired;let c,u="EXPLICIT";if(0===o.length&&r.entityTags){const t=ht(r,"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:i?i.imageId:void 0,rollbackServerGroupName:r.name,restoreServerGroupName:i?i.name:void 0,targetHealthyRollbackPercentage:c,delayBeforeDisableSeconds:0},targetGroups:r.targetGroups,securityGroups:r.securityGroups},e.minHealthy=function(e){return Math.ceil(l*e/100)},a&&a.attributes&&(a.attributes.platformHealthOnlyShowOverride&&a.attributes.platformHealthOnly&&(e.command.interestingHealthProviderNames=["Titus"]),e.command.platformHealthOnlyShowOverride=a.attributes.platformHealthOnlyShowOverride),this.isValid=function(){const t=e.command;return!!e.verification.verified&&("PREVIOUS_IMAGE"===u||void 0!==t.rollbackContext.restoreServerGroupName)},e.taskMonitor=new Pe({application:a,title:"Rollback "+r.name,modalInstance:t}),this.rollback=function(){if(!this.isValid())return;e.taskMonitor.submit((function(){return n.rollbackServerGroup(r,a,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"}}]);t("spinnaker.titus.serverGroup.details.scalingPolicy.upsertScalingPolicy.controller",[]).controller("titusUpsertScalingPolicyCtrl",["$uibModalInstance","alarmServerGroup","serverGroup","application","policy",function(e,t,n,a,r){this.serverGroup=n,this.alarmServerGroup=t,this.viewState={isNew:!r.id,multipleAlarms:r.alarms.length>1,metricsLoaded:!1,namespacesLoaded:!1},this.initialize=()=>{const e={scalingPolicyID:r.id,jobId:n.id,serverGroupName:n.name,credentials:n.account,region:n.region,cloudProvider:"titus",adjustmentType:r.adjustmentType,minAdjustmentMagnitude:r.minAdjustmentMagnitude||1};if(function(e,t){const a=t.alarms[0];e.alarm={region:n.region,comparisonOperator:a.comparisonOperator,dimensions:a.dimensions,disableEditingDimensions:a.disableEditingDimensions,evaluationPeriods:a.evaluationPeriods,period:a.period,threshold:a.threshold,namespace:a.namespace,metricName:a.metricName,statistic:a.statistic,unit:a.unit}}(e,r),"ExactCapacity"===e.adjustmentType)this.viewState.operator="Set to",this.viewState.adjustmentType="instances";else{let e=r.scalingAdjustment;r.stepAdjustments&&r.stepAdjustments.length&&(e=r.stepAdjustments[0].scalingAdjustment),this.viewState.operator=e>0?"Add":"Remove",this.viewState.adjustmentType="ChangeInCapacity"===r.adjustmentType?"instances":"percent of group"}!function(e,t){const n=e.alarm.threshold;e.step={cooldown:t.cooldown||300,metricAggregationType:"Average"},e.step.stepAdjustments=t.stepAdjustments.map((e=>{const t={scalingAdjustment:Math.abs(e.scalingAdjustment)};return void 0!==e.metricIntervalUpperBound&&(t.metricIntervalUpperBound=e.metricIntervalUpperBound+n),void 0!==e.metricIntervalLowerBound&&(t.metricIntervalLowerBound=e.metricIntervalLowerBound+n),t}))}(e,r),this.command=e},this.stepsChanged=e=>{this.command.step.stepAdjustments=e,this.boundsChanged()},this.adjustmentTypeChanged=(e,t)=>{this.viewState.operator=e,this.viewState.adjustmentType=t;const n="instances"!==t?"PercentChangeInCapacity":"Set to"===e?"ExactCapacity":"ChangeInCapacity";this.command.adjustmentType=n},this.boundsChanged=()=>{const e="min"===this.viewState.comparatorBound?"metricIntervalLowerBound":"metricIntervalUpperBound",t="metricIntervalLowerBound"===e?"metricIntervalUpperBound":"metricIntervalLowerBound";if(this.command.step){const n=this.command.step.stepAdjustments;n.forEach(((a,r)=>{n.length>r+1&&(n[r+1][t]=a[e])})),delete n[n.length-1][e]}},this.action=this.viewState.isNew?"Create":"Edit";const i=()=>{const e=St(this.command);return"PercentChangeInCapacity"!==e.adjustmentType&&delete e.minAdjustmentMagnitude,e.step?e.step.stepAdjustments.forEach((t=>{"Remove"===this.viewState.operator&&(t.scalingAdjustment=0-t.scalingAdjustment,delete e.step.estimatedInstanceWarmup),void 0!==t.metricIntervalLowerBound&&(t.metricIntervalLowerBound-=e.alarm.threshold),void 0!==t.metricIntervalUpperBound&&(t.metricIntervalUpperBound-=e.alarm.threshold)})):"Remove"===this.viewState.operator&&(e.simple.scalingAdjustment=0-e.simple.scalingAdjustment),e};this.taskMonitor=new Pe({application:a,title:this.action+" scaling policy for "+n.name,modalInstance:e}),this.save=()=>{const e=i();this.taskMonitor.submit((()=>p.upsertScalingPolicy(a,e)))},this.cancel=e.dismiss,this.initialize()}]);sn("titus-scaling-policy-summary .alarm-name {\n word-break: break-all;\n}\ntitus-scaling-policy-summary .actions {\n font-size: 85%;\n margin: 0 0 15px 0;\n border-bottom: 1px solid var(--color-alto);\n}\ntitus-scaling-policy-summary .actions .btn-left {\n padding-left: 0;\n border-left-width: 0;\n}\n");t("spinnaker.titus.serverGroup.details.scalingPolicy.alarmBasedSummary.component",["spinnaker.titus.serverGroup.details.scalingPolicy.upsertScalingPolicy.controller"]).component("titusAlarmBasedSummary",{bindings:{policy:"=",serverGroup:"=",application:"="},templateUrl:"titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.component.html",controller:["$uibModal",function(e){this.$onInit=()=>{k.getAccountDetails(this.serverGroup.account).then((e=>{this.alarmServerGroup={type:"aws",name:this.serverGroup.name,account:e.awsAccount,region:this.serverGroup.region}}))},this.popoverTemplate="titus/src/serverGroup/details/scalingPolicy/popover/scalingPolicyDetails.popover.html",this.editPolicy=()=>{e.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",controller:"titusUpsertScalingPolicyCtrl",controllerAs:"ctrl",size:"lg",resolve:{policy:()=>this.policy,alarmServerGroup:()=>this.alarmServerGroup,serverGroup:()=>this.serverGroup,application:()=>this.application}})},this.deletePolicy=()=>{const{application:e,policy:t,serverGroup:n}=this,a={application:e,title:"Deleting scaling policy "+t.id};A.confirm({header:`Really delete ${t.id}?`,buttonText:"Delete scaling policy",account:n.account,taskMonitorConfig:a,submitMethod:()=>Ye.executeTask({application:e,description:"Delete scaling policy "+t.id,job:[{type:"deleteScalingPolicy",cloudProvider:"titus",credentials:n.account,region:n.region,scalingPolicyID:t.id,serverGroupName:n.name}]})})}}]}),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.component.html",'<span class="label label-default">{{ $ctrl.policy.policyType | robotToHuman | uppercase }}</span>\n<span class="label small" ng-if="$ctrl.policy.status.state !== \'Applied\'">({{ $ctrl.policy.status.state }})</span>\n<div ng-repeat="alarm in $ctrl.policy.alarms track by $index">\n <div\n uib-popover-template="$ctrl.popoverTemplate"\n popover-placement="left"\n popover-title="{{ $ctrl.policy.policyName }}"\n popover-trigger="\'mouseenter\'"\n >\n <div>\n <strong>Whenever</strong>\n {{ alarm.statistic }} of <span class="alarm-name">{{ alarm.metricName }}</span> is\n <span ng-bind-html="alarm.comparator"></span> {{ alarm.threshold }}\n </div>\n <div>\n <strong>for at least</strong>\n {{ alarm.evaluationPeriods }} consecutive periods of {{ alarm.period }} seconds\n </div>\n </div>\n <div class="actions text-right">\n <button class="btn btn-xs btn-link" ng-click="$ctrl.editPolicy()">\n <span class="glyphicon glyphicon-cog" uib-tooltip="Edit policy"></span>\n <span class="sr-only">Edit policy</span>\n </button>\n <button class="btn btn-xs btn-link" ng-click="$ctrl.deletePolicy()">\n <span class="glyphicon glyphicon-trash" uib-tooltip="Delete policy"></span>\n <span class="sr-only">Delete policy</span>\n </button>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/popover/scalingPolicyDetails.popover.html",'<aws-scaling-policy-popover policy="$ctrl.policy" server-group="$ctrl.alarmServerGroup"></aws-scaling-policy-popover>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{ctrl.action}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Conditions</h4>\n <div class="section-body">\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <aws-alarm-configurer\n command="ctrl.command"\n modal-view-state="ctrl.viewState"\n server-group="ctrl.alarmServerGroup"\n bounds-changed="ctrl.boundsChanged()"\n ></aws-alarm-configurer>\n </div>\n\n <h4 class="section-heading">Actions</h4>\n <div class="section-body" ng-if="!ctrl.command.alarm.metricName">\n <h4 class="text-center">Select a metric</h4>\n </div>\n <div class="section-body" ng-if="ctrl.command.alarm.metricName">\n <step-policy-action\n adjustment-type="ctrl.viewState.adjustmentType"\n adjustment-type-changed="ctrl.adjustmentTypeChanged"\n alarm="ctrl.command.alarm"\n is-min="ctrl.viewState.comparatorBound === \'min\'"\n operator="ctrl.viewState.operator"\n step="ctrl.command.step"\n step-adjustments="ctrl.command.step.stepAdjustments"\n steps-changed="ctrl.stepsChanged"\n ></step-policy-action>\n </div>\n\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row" ng-if="ctrl.viewState.adjustmentType !== \'instances\'">\n <div class="col-md-2 sm-label-right">Adjustment Step</div>\n <div class="col-md-10 content-fields">\n <span class="form-control-static select-placeholder">\n <span ng-bind="ctrl.viewState.operator"></span>\n instances in increments of at least\n </span>\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.minAdjustmentMagnitude"\n />\n <span class="input-label"> instance(s) </span>\n </div>\n </div>\n <div class="row" ng-if="ctrl.viewState.operator !== \'Remove\'">\n <div class="col-md-2 sm-label-right">Cooldown <help-field key="titus.autoscaling.cooldown"></help-field></div>\n <div class="col-md-10 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.step.cooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid"\n submitting="taskMonitor.submitting"\n on-click="ctrl.save()"\n is-new="ctrl.viewState.isNew"\n ></submit-button>\n </div>\n</div>\n')}]);class Fs{constructor(e,t,n,a,r){this.$uibModalInstance=e,this.policy=t,this.serverGroup=n,this.alarmServerGroup=a,this.application=r,this.statistics=["Average","Maximum","Minimum","SampleCount","Sum"],this.alarmUpdated=new Ot,this.updateUnit=e=>{this.state.unit=e}}$onInit(){this.command=this.buildCommand(),this.state={unit:null,scaleInChanged:!1}}scaleInChanged(){this.state.scaleInChanged=!0}cancel(){this.$uibModalInstance.dismiss()}save(){const e=this.policy.id?"Update":"Create",t=St(this.command);this.taskMonitor=new Pe({application:this.application,title:`${e} scaling policy for ${this.serverGroup.name}`,modalInstance:this.$uibModalInstance,submitMethod:()=>p.upsertScalingPolicy(this.application,t)}),this.taskMonitor.submit()}buildCommand(){return{scalingPolicyID:this.policy.id,type:"upsertScalingPolicy",cloudProvider:"titus",jobId:this.serverGroup.id,credentials:this.serverGroup.account,region:this.serverGroup.region,serverGroupName:this.serverGroup.name,adjustmentType:null,name:this.policy.id,targetTrackingConfiguration:{...this.policy.targetTrackingConfiguration}}}}Fs.$inject=["$uibModalInstance","policy","serverGroup","alarmServerGroup","application"];class zs extends ct.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},k.getAccountDetails(e.serverGroup.account).then((e=>{this.setState({awsAccount:e.awsAccount})}))}createStepPolicy(){const{serverGroup:e,application:t}=this.props;et.modalService.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",controller:"titusUpsertScalingPolicyCtrl",controllerAs:"ctrl",size:"lg",resolve:{policy:()=>Vt.titusServerGroupTransformer.constructNewStepScalingPolicyTemplate(e),serverGroup:()=>e,alarmServerGroup:()=>({type:"aws",account:this.state.awsAccount,region:e.region,name:e.name}),application:()=>t}}).result.catch((()=>{}))}createTargetTrackingPolicy(){const{serverGroup:e,application:t}=this.props;et.modalService.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",controller:Fs,controllerAs:"$ctrl",size:"lg",resolve:{policy:()=>Vt.titusServerGroupTransformer.constructNewTargetTrackingPolicyTemplate(e),serverGroup:()=>e,alarmServerGroup:()=>({type:"aws",account:this.state.awsAccount,region:e.region,name:e.name}),application:()=>t}}).result.catch((()=>{}))}render(){const{min:e,max:t}=this.props.serverGroup.capacity;return ct.createElement("div",null,this.state.awsAccount?ct.createElement("a",{className:"clickable",onClick:this.handleClick},"Create new scaling policy"):null,this.state.showSelection&&ct.createElement(g,{warnOnMinMaxCapacity:e===t,typeSelectedCallback:this.typeSelected,showCallback:this.showModalCallback}))}}window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{ctrl.action}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Conditions</h4>\n <div class="section-body">\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <aws-alarm-configurer\n command="ctrl.command"\n modal-view-state="ctrl.viewState"\n server-group="ctrl.alarmServerGroup"\n bounds-changed="ctrl.boundsChanged()"\n ></aws-alarm-configurer>\n </div>\n\n <h4 class="section-heading">Actions</h4>\n <div class="section-body" ng-if="!ctrl.command.alarm.metricName">\n <h4 class="text-center">Select a metric</h4>\n </div>\n <div class="section-body" ng-if="ctrl.command.alarm.metricName">\n <step-policy-action\n adjustment-type="ctrl.viewState.adjustmentType"\n adjustment-type-changed="ctrl.adjustmentTypeChanged"\n alarm="ctrl.command.alarm"\n is-min="ctrl.viewState.comparatorBound === \'min\'"\n operator="ctrl.viewState.operator"\n step="ctrl.command.step"\n step-adjustments="ctrl.command.step.stepAdjustments"\n steps-changed="ctrl.stepsChanged"\n ></step-policy-action>\n </div>\n\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row" ng-if="ctrl.viewState.adjustmentType !== \'instances\'">\n <div class="col-md-2 sm-label-right">Adjustment Step</div>\n <div class="col-md-10 content-fields">\n <span class="form-control-static select-placeholder">\n <span ng-bind="ctrl.viewState.operator"></span>\n instances in increments of at least\n </span>\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.minAdjustmentMagnitude"\n />\n <span class="input-label"> instance(s) </span>\n </div>\n </div>\n <div class="row" ng-if="ctrl.viewState.operator !== \'Remove\'">\n <div class="col-md-2 sm-label-right">Cooldown <help-field key="titus.autoscaling.cooldown"></help-field></div>\n <div class="col-md-10 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.step.cooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid"\n submitting="taskMonitor.submitting"\n on-click="ctrl.save()"\n is-new="ctrl.viewState.isNew"\n ></submit-button>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="$ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{$ctrl.policy.id ? "Update" : "Create"}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Target Metric</h4>\n <div class="section-body">\n <p>\n With target tracking policies, Amazon will automatically adjust the size of your job to keep the selected\n metric as close as possible to the selected value.\n </p>\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Metric</div>\n <div class="col-md-10 content-fields">\n <aws-metric-selector\n alarm-updated="$ctrl.alarmUpdated"\n alarm="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification"\n server-group="$ctrl.alarmServerGroup"\n ></aws-metric-selector>\n </div>\n </div>\n\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Target</div>\n <div class="col-md-10 content-fields">\n <select\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification.statistic"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-options="stat for stat in $ctrl.statistics"\n ></select>\n <span class="input-label" style="vertical-align: top; margin-top: 7px"> of </span>\n <div style="display: inline-block">\n <input\n type="number"\n class="form-control input-sm"\n style="width: 100px"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-model="$ctrl.command.targetTrackingConfiguration.targetValue"\n />\n <span class="input-label" ng-bind="$ctrl.state.unit" ng-if="$ctrl.state.unit !== \'None\'"></span>\n </div>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-10 col-md-offset-1">\n <div>\n <target-tracking-chart\n config="$ctrl.command.targetTrackingConfiguration"\n alarm-updated="$ctrl.alarmUpdated"\n server-group="$ctrl.alarmServerGroup"\n unit="$ctrl.state.unit"\n update-unit="$ctrl.updateUnit"\n ></target-tracking-chart>\n </div>\n </div>\n </div>\n </div>\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row">\n <div class="col-md-3 sm-label-right">Scale In</div>\n <div class="col-md-9">\n <div class="checkbox" style="margin-top: 5px">\n <label>\n <input\n type="checkbox"\n ng-model="$ctrl.command.targetTrackingConfiguration.disableScaleIn"\n ng-change="$ctrl.scaleInChanged()"\n />\n Disable Scale-downs\n </label>\n <div class="small" style="margin-top: 5px">\n <p>\n This option disables scale-downs for the target tracking policy, while keeping the scale-ups. This\n means that Server Group will not scale down unless you explicitly set up a separate step policy to\n scale it down.\n </p>\n <p>This is useful when you have special requirements, such as gradual or delayed scale-down.</p>\n </div>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="$ctrl.state.scaleInChanged">\n <div class="col-md-10 col-md-offset-1 well">\n <div ng-if="$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will not scale down. Make sure you have another policy (either TT or Step) that will scale in\n this ASG.\n </div>\n <div ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will scale both in and out. Make sure you don\'t have other scaling policies, as they will\n likely interfere with each other.\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n <div class="col-md-3 sm-label-right">\n Scale In Cooldown\n <help-field key="titus.autoscaling.scaleIn.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleInCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-3 sm-label-right">\n Scale Out Cooldown\n <help-field key="titus.autoscaling.scaleOut.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleOutCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="$ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid || $ctrl.taskMonitor.submitting"\n submitting="$ctrl.taskMonitor.submitting"\n on-click="$ctrl.save()"\n is-new="!$ctrl.policy.id"\n ></submit-button>\n </div>\n</div>\n')}]);t("spinnaker.titus.serverGroup.details.scaling.policy.button",[]).component("titusCreateScalingPolicyButton",Mt(Xe(zs,"titusCreateScalingPolicyButton"),["application","serverGroup"]));const js={bindings:{policy:"<",serverGroup:"<",application:"<"},controller:class{$onInit(){this.policy.targetPolicyDescriptor?this.templateUrl="titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingSummary.html":this.templateUrl="titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.template.html"}},template:'<div ng-include src="$ctrl.templateUrl"></div>'};t("spinnaker.titus.scalingPolicy.details.summary.component",[]).component("titusScalingPolicySummary",js),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingSummary.html",'<titus-target-tracking-summary\n policy="$ctrl.policy"\n server-group="$ctrl.serverGroup"\n application="$ctrl.application"\n></titus-target-tracking-summary>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.template.html",'<titus-alarm-based-summary\n policy="$ctrl.policy"\n server-group="$ctrl.serverGroup"\n application="$ctrl.application"\n></titus-alarm-based-summary>\n')}]);t("spinnaker.titus.scalingPolicy.targetTracking.chart.component",[]).component("titusTargetTrackingChart",Mt(Xe((({alarmUpdated:e,config:t,serverGroup:n,unit:a,updateUnit:r})=>{const[i,s]=lt.useState({alarmName:null,alarmArn:null,metricName:null,namespace:null,statistic:"Average",dimensions:[],period:60,threshold:t.targetValue,comparisonOperator:"GreaterThanThreshold",okactions:[],insufficientDataActions:[],alarmActions:[],evaluationPeriods:null,alarmDescription:null,unit:null});lt.useEffect((()=>{(()=>{const e=null==t?void 0:t.customizedMetricSpecification,n={...i,dimensions:null==e?void 0:e.dimensions,metricName:null==e?void 0:e.metricName,namespace:null==e?void 0:e.namespace,statistic:null==e?void 0:e.statistic,threshold:null==t?void 0:t.targetValue};s(n)})()}),[t]);return lt.createElement(h,{alarm:i,alarmUpdated:e,onChartLoaded:t=>{a&&r(t.unit),null==e||e.next()},serverGroup:n})}),"targetTrackingChart"),["alarmUpdated","config","serverGroup","unit","updateUnit"]));class Bs{constructor(e){this.$uibModal=e,this.popoverTemplate="titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingPopover.html"}$onInit(){this.config=this.policy.targetTrackingConfiguration,k.getAccountDetails(this.serverGroup.account).then((e=>{this.alarmServerGroup={type:"aws",name:this.serverGroup.name,account:e.awsAccount,region:this.serverGroup.region}}))}editPolicy(){this.$uibModal.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",controller:Fs,controllerAs:"$ctrl",size:"lg",resolve:{policy:()=>this.policy,alarmServerGroup:()=>this.alarmServerGroup,serverGroup:()=>this.serverGroup,application:()=>this.application}}).result.catch((()=>{}))}deletePolicy(){const{application:e,serverGroup:t,policy:n}=this,a={application:this.application,title:"Deleting scaling policy "+this.policy.id};A.confirm({header:`Really delete ${n.id}?`,buttonText:"Delete scaling policy",account:this.serverGroup.account,taskMonitorConfig:a,submitMethod:()=>Ye.executeTask({application:e,description:"Delete scaling policy "+n.id,job:[{type:"deleteScalingPolicy",cloudProvider:"titus",credentials:t.account,region:t.region,scalingPolicyID:n.id,serverGroupName:t.name}]})})}}Bs.$inject=["$uibModal"];const Rs={bindings:{policy:"<",serverGroup:"<",application:"<"},controller:Bs,template:'\n <div uib-popover-template="$ctrl.popoverTemplate"\n popover-placement="left"\n popover-title="Policy {{$ctrl.policy.id}}"\n popover-trigger="\'mouseenter\'">\n <p>\n <span class="label label-default">TARGET TRACKING</span>\n <span class="label small" ng-if="$ctrl.policy.status.state !== \'Applied\'">({{$ctrl.policy.status.state}})</span>\n <div>\n <strong>Target</strong>\n {{$ctrl.config.predefinedMetricSpecification.predefinedMetricType}}\n {{$ctrl.config.customizedMetricSpecification.metricName}}\n <span ng-if="$ctrl.config.customizedMetricSpecification">({{$ctrl.config.customizedMetricSpecification.statistic}})</span>\n @ {{$ctrl.config.targetValue}}\n </div>\n </p>\n <div class="actions text-right">\n <button class="btn btn-xs btn-link" ng-click="$ctrl.editPolicy()">\n <span class="glyphicon glyphicon-cog" uib-tooltip="Edit policy"></span>\n <span class="sr-only">Edit policy</span>\n </button>\n <button class="btn btn-xs btn-link" ng-click="$ctrl.deletePolicy()">\n <span class="glyphicon glyphicon-trash" uib-tooltip="Delete policy"></span>\n <span class="sr-only">Delete policy</span>\n </button>\n </div>\n </div>\n '};t("spinnaker.titus.scalingPolicy.targetTracking.summary.component",[]).component("titusTargetTrackingSummary",Rs),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingPopover.html",'<titus-target-tracking-chart\n config="$ctrl.policy.targetTrackingConfiguration"\n server-group="$ctrl.alarmServerGroup"\n></titus-target-tracking-chart>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="$ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{$ctrl.policy.id ? "Update" : "Create"}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Target Metric</h4>\n <div class="section-body">\n <p>\n With target tracking policies, Amazon will automatically adjust the size of your job to keep the selected\n metric as close as possible to the selected value.\n </p>\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Metric</div>\n <div class="col-md-10 content-fields">\n <aws-metric-selector\n alarm-updated="$ctrl.alarmUpdated"\n alarm="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification"\n server-group="$ctrl.alarmServerGroup"\n ></aws-metric-selector>\n </div>\n </div>\n\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Target</div>\n <div class="col-md-10 content-fields">\n <select\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification.statistic"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-options="stat for stat in $ctrl.statistics"\n ></select>\n <span class="input-label" style="vertical-align: top; margin-top: 7px"> of </span>\n <div style="display: inline-block">\n <input\n type="number"\n class="form-control input-sm"\n style="width: 100px"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-model="$ctrl.command.targetTrackingConfiguration.targetValue"\n />\n <span class="input-label" ng-bind="$ctrl.state.unit" ng-if="$ctrl.state.unit !== \'None\'"></span>\n </div>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-10 col-md-offset-1">\n <div>\n <target-tracking-chart\n config="$ctrl.command.targetTrackingConfiguration"\n alarm-updated="$ctrl.alarmUpdated"\n server-group="$ctrl.alarmServerGroup"\n unit="$ctrl.state.unit"\n update-unit="$ctrl.updateUnit"\n ></target-tracking-chart>\n </div>\n </div>\n </div>\n </div>\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row">\n <div class="col-md-3 sm-label-right">Scale In</div>\n <div class="col-md-9">\n <div class="checkbox" style="margin-top: 5px">\n <label>\n <input\n type="checkbox"\n ng-model="$ctrl.command.targetTrackingConfiguration.disableScaleIn"\n ng-change="$ctrl.scaleInChanged()"\n />\n Disable Scale-downs\n </label>\n <div class="small" style="margin-top: 5px">\n <p>\n This option disables scale-downs for the target tracking policy, while keeping the scale-ups. This\n means that Server Group will not scale down unless you explicitly set up a separate step policy to\n scale it down.\n </p>\n <p>This is useful when you have special requirements, such as gradual or delayed scale-down.</p>\n </div>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="$ctrl.state.scaleInChanged">\n <div class="col-md-10 col-md-offset-1 well">\n <div ng-if="$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will not scale down. Make sure you have another policy (either TT or Step) that will scale in\n this ASG.\n </div>\n <div ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will scale both in and out. Make sure you don\'t have other scaling policies, as they will\n likely interfere with each other.\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n <div class="col-md-3 sm-label-right">\n Scale In Cooldown\n <help-field key="titus.autoscaling.scaleIn.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleInCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-3 sm-label-right">\n Scale Out Cooldown\n <help-field key="titus.autoscaling.scaleOut.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleOutCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="$ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid || $ctrl.taskMonitor.submitting"\n submitting="$ctrl.taskMonitor.submitting"\n on-click="$ctrl.save()"\n is-new="!$ctrl.policy.id"\n ></submit-button>\n </div>\n</div>\n')}]);t("spinnaker.titus.scalingPolicy.targetTracking",["spinnaker.titus.scalingPolicy.targetTracking.chart.component","spinnaker.titus.scalingPolicy.targetTracking.summary.component"]);const Vs=I((()=>null),"titus.serverGroup.details.customScaling");t("spinnaker.application.titus.serverGroup.customScaling.component",[]).component("titusCustomScalingPolicy",Mt(Xe(Vs,"titusCustomScalingPolicy"),["application","serverGroup"]));t("spinnaker.titus.scalingPolicy.module",["spinnaker.titus.scalingPolicy.details.summary.component","spinnaker.titus.serverGroup.details.scaling.policy.button","spinnaker.titus.scalingPolicy.targetTracking","spinnaker.titus.serverGroup.details.scalingPolicy.alarmBasedSummary.component","spinnaker.application.titus.serverGroup.customScaling.component"]);const Ws=e=>{const{application:t,serverGroup:n}=e,{region:a,id:r,account:i,cloudProvider:s}=n,o=(l=n.serviceJobProcesses,Object.keys(l).reduce(((e,t)=>(l[t]&&e.push(t),e)),[]));var l;return ct.createElement(tt,{...e,title:`Modify Service Job Processes for ${n.name}`,description:`Update Service Job Processes for ${n.name}`,initialValues:{serviceJobProcesses:o},render:()=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{label:"Service Job Processes",name:"serviceJobProcesses",input:e=>ct.createElement(he,{...e,options:Object.keys(n.serviceJobProcesses).map((e=>({value:e,label:ge(e)})))})}),ct.createElement(oe,{label:"Reason",name:"reason",input:e=>ct.createElement(nt,{...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:a,jobId:r,credentials:i,cloudProvider:s}],application:t.name})})};class Hs extends ct.Component{constructor(){super(...arguments),this.toggleServiceJobProcesses=()=>{const{app:e,serverGroup:t}=this.props;xe.show(Ws,{application:e,serverGroup:t})}}render(){const{serviceJobProcesses:e}=this.props.serverGroup;return ct.createElement(ct.Fragment,null,ct.createElement("ul",{className:"scaling-processes"},Object.keys(e).map((t=>ct.createElement("li",{key:t},ct.createElement("span",{style:{visibility:e[t]?"visible":"hidden"},className:"fa fa-check small"}),ct.createElement("span",{className:e[t]?"":"text-disabled"},ge(t)," "))))),ct.createElement("a",{className:"clickable",onClick:this.toggleServiceJobProcesses},"Edit Service Job Processes"))}}t("spinnaker.titus.servicejobprocesses.section",[]).component("titusServiceJobProcessesSection",Mt(Xe(Hs,"titusServiceJobProcessesSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.packageDetails.component",[]).component("titusPackageDetailsSection",Mt(Xe((({buildInfo:e})=>{var t,n;const a=e.jenkins||{},r=Boolean(Object.keys(a).length),{commitId:i,host:s,name:o,number:l,version:c}=a,u=`${s}job/${o}/${l}`;return lt.createElement(y,{heading:"Package"},!r&<.createElement("div",null,"No package information available."),r&<.createElement(b,{className:"horizontal-when-filters-collapsed"},o&<.createElement(C,{label:"Job",value:o}),(null==(t=e.docker)?void 0:t.image)&<.createElement(C,{label:"Image Name",value:null==(n=e.docker)?void 0:n.image}),l&<.createElement(C,{label:"Build",value:l}),i&<.createElement(C,{label:"Commit",value:i.substring(0,8)}),c&<.createElement(C,{label:"Version",value:c}),s&<.createElement(C,{label:"Build Link",value:lt.createElement("a",{target:"_blank",href:u},u)})))}),"titusPackageDetailsSection"),["buildInfo"]));t("spinnaker.titus.serverGroup.details.securityGroups.component",[]).component("titusSecurityGroups",Mt(Xe(Wt,"titusSecurityGroups"),["app","serverGroup"]));e.module("spinnaker.serverGroup.details.titus.controller",[Tt,"spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.titus.disruptionbudget.section",_e,"spinnaker.titus.serverGroup.details.rollback.controller","spinnaker.titus.servicejobprocesses.section","spinnaker.titus.scalingPolicy.module","spinnaker.titus.serverGroup.details.securityGroups.component","spinnaker.titus.serverGroup.details.packageDetails.component"]).controller("titusServerGroupDetailsCtrl",["$scope","$state","$templateCache","$interpolate","app","serverGroup","titusServerGroupCommandBuilder","$uibModal","serverGroupWriter","awsServerGroupTransformer",function(t,n,a,r,i,s,o,l,c,u){const d=i;function m(){const n=pt.find(d.serverGroups.data,(function(e){return e.name===s.name&&e.account===s.accountId&&e.region===s.region}));return Ze.getServerGroup(d.name,s.accountId,s.region,s.name).then((function(a){t.state.loading=!1,a.account=s.accountId,k.getAccountDetails(a.account).then((e=>{a.apiEndpoint=pt.filter(e.regions,{name:a.region})[0].endpoint})),t.buildInfo=a.buildInfo,e.extend(a,n),t.serverGroup=a;const r=t.serverGroup.labels;var i;delete r.name,delete r.source,delete r.spinnakerAccount,delete r[""],Object.keys(r).forEach((e=>{e.startsWith("titus.")&&delete r[e]})),t.labels=r,(i=a).scalingPolicies=(i.scalingPolicies||[]).map((e=>{const{policy:t}=e,{stepPolicyDescriptor:n,targetPolicyDescriptor:a}=t,r=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:i.name}]),t.dimensions||(t.dimensions=[]);const a=pt.cloneDeep(n.scalingPolicy);return a.cooldown=a.cooldownSec,a.policyType=r,a.alarms=[t],a.id=e.id,a.stepAdjustments&&a.stepAdjustments.forEach((e=>{e.metricIntervalUpperBound=pt.get(e,"metricIntervalUpperBound",e.MetricIntervalUpperBound),e.metricIntervalLowerBound=pt.get(e,"metricIntervalLowerBound",e.MetricIntervalLowerBound)})),a}{const{customizedMetricSpecification:n}=a;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))),pt.isEmpty(t.serverGroup)?p():g()}),p)}function p(){t.$$destroyed||n.go("^",{allowModalToStayOpen:!0},{location:"replace"})}this.application=i,t.gateUrl=D.gateUrl,t.state={loading:!0},m().then((()=>{t.$$destroyed||i.serverGroups.onRefresh(t,m)})).catch((()=>{})),k.getAccountDetails(s.accountId).then((e=>{const n=e.awsAccount;t.titusUiEndpoint=pt.filter(e.regions,{name:s.region})[0].endpoint,k.getAccountDetails(n).then((e=>{this.awsAccountId=e.accountId,this.env=e.environment}))}));const g=()=>{this.entityTagTargets=at.buildClusterTargets(t.serverGroup)};this.destroyServerGroup=function(){const e=t.serverGroup,a={application:d,title:"Destroying "+e.name,onTaskComplete:function(){n.includes("**.serverGroup",r)&&n.go("^")}},r={name:e.name,accountId:e.account,region:e.region},s={header:"Really destroy "+e.name+"?",buttonText:"Destroy "+e.name,account:e.account,taskMonitorConfig:a,platformHealthOnlyShowOverride:i.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.destroyServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region})}};rt.addDestroyWarningMessage(i,e,s),Ke(e,i).then((e=>e&&A.confirm(s)))},this.disableServerGroup=function(){const e=t.serverGroup,n={application:d,title:"Disabling "+e.name},a={header:"Really disable "+e.name+"?",buttonText:"Disable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:i.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.disableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};rt.addDisableWarningMessage(i,e,a),Ke(e,i).then((e=>e&&A.confirm(a)))},this.enableServerGroup=()=>{Ke(s,i).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"};A.confirm(t).then((()=>new Promise((e=>setTimeout(e,500))))).then((()=>this.rollbackServerGroup())).catch((({source:e})=>{"footer"===e&&this.showEnableServerGroupModal()}))}))},this.resizeServerGroup=()=>{Ke(s,i).then((e=>{e&&xe.show(On,{serverGroup:t.serverGroup,application:d})}))},this.showEnableServerGroupModal=()=>{const e=t.serverGroup,n={application:d,title:"Enabling "+e.name},a={header:"Really enable "+e.name+"?",buttonText:"Enable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:i.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.enableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};A.confirm(a)},this.cloneServerGroup=function(){Vt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(d,t.serverGroup).then((e=>{const t=`Clone ${s.name}`;Gn.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,a=i.getDataSource("serverGroups").data.filter((e=>e.cluster===n.cluster&&e.region===n.region&&e.account===n.account));n.isDisabled&&(e=n,n=pt.orderBy(a.filter((t=>t.name!==e.name&&!t.isDisabled)),["instanceCounts.total","createdTime"],["desc","desc"])[0]),a=a.filter((e=>e.name!==n.name)),1!==a.length||e||(e=a[0]),Ke(n,i).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=pt.find(d.clusters,{name:n.cluster,account:n.account});return pt.filter(e.serverGroups,{isDisabled:!0,region:n.region})},allServerGroups:()=>a,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')}]);t("spinnaker.titus.serverGroup.transformer",[]).factory("titusServerGroupTransformer",["$q",function(e){return{convertServerGroupCommandToDeployConfiguration:function(e){const t=pt.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 k.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}}}}}]);it.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 ${T.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}}});sn('.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 Zs="spinnaker.titus";t("spinnaker.titus",["spinnaker.titus.react","spinnaker.titus.securityGroup.reader","spinnaker.serverGroup.details.titus.controller","spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.serverGroup.configure.titus","spinnaker.titus.serverGroup.transformer","spinnaker.titus.pipeline.stage.findAmiStage","spinnaker.titus.pipeline.stage.enableAsgStage","spinnaker.titus.pipeline.stage.disableAsgStage","spinnaker.titus.pipeline.stage.destroyAsgStage","spinnaker.titus.pipeline.stage.resizeAsgStage","spinnaker.titus.pipeline.stage.cloneServerGroupStage","spinnaker.titus.pipeline.stage.disableClusterStage","spinnaker.titus.pipeline.stage.shrinkClusterStage","spinnaker.titus.pipeline.stage.scaleDownClusterStage","titus.servergroup.details.capacitydetailssection","titus.servergroup.details.launchConfigSection"]).config((()=>{st.registerProvider("titus",{name:"Titus",logo:{path:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABGCAYAAAB7Xo6TAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAABCVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjU8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjE4NjwvZXhpZjpQaXhlbFhEaW1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cq9Xbad7cXrc5fvO2GkJh+aCB3L2sr0rVtnTug9NAw5RLRCyPLVtkha9/B4X7m9z9gj/QXtDQSVvoOLdc3kWeSW1yWmTzqavwcnNraHaqeoQQBhbOO7qCPYJbJkiDAhiMITiF/cH+E48kpikY4UVCPjaIBA3dU57jxhkWkRs6UX9SbRt9ywMKu0okW8Q+dZ2dO1gnqNOcXKJWpr7t3v+38Gs9AgpWxz9DDp+NQ//ryOkTXttBm0VcMXNPfDqGRR8lMQmcHdnE8A9rs9hEOQ6kGzN5pm5JNTLJa2gILm1k9lckrxPXU7uhxhcAJf22sTltZf4I2LQnsWJTuDGr3HPH+lLN9Gkpag2O64P4oS8gze1udD146D2wP8H5JyTFz+hnOcAAAAASUVORK5CYII="},serverGroup:{transformer:"titusServerGroupTransformer",detailsTemplateUrl:"titus/src/serverGroup/details/serverGroupDetails.html",detailsController:"titusServerGroupDetailsCtrl",CloneServerGroupModal:Gn,commandBuilder:"titusServerGroupCommandBuilder",configurationService:"titusServerGroupConfigurationService",skipUpstreamStageCheck:!0,checkForImageProviders:!0},securityGroup:{reader:"titusSecurityGroupReader",useProvider:"aws"},loadBalancer:{LoadBalancersTag:f,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:Yt}})})),ot.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 <titus-scaling-policy-summary\n ng-repeat="policy in serverGroup.scalingPolicies"\n policy="policy"\n server-group="serverGroup"\n application="ctrl.application"\n ></titus-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{Zs as TITUS_MODULE,Ps as TitusCapacityDetailsSection,Yt as TitusInstanceDetails,jt as TitusInstanceDns,Bt as TitusInstanceInformation,en as TitusProviderSettings,Rt as TitusReactInject,Vt as TitusReactInjector,On as TitusResizeServerGroupModal,As as TitusScalingActivitiesModal,Wt as TitusSecurityGroupsDetailsSection,Ht as applyTargetGroupInfoToHealthMetric,Kt as buildTaskActions,Zt as extractHealthMetrics};
|
|
1
|
+
import*as e from"angular";import{module as t}from"angular";import{InstanceInformation as n,getAllTargetGroups as a,InstanceStatus as r,VpcReader as i,ServerGroupSecurityGroupsRemoved as s,SecurityGroupSelector as o,AWSProviderSettings as l,SubnetSelectField as c,ServerGroupCapacity as u,ServerGroupLoadBalancers as d,ServerGroupSecurityGroups as m,ScalingPolicyWriter as p,PolicyTypeSelectionModal as g,MetricAlarmChart as h,AmazonLoadBalancersTag as f}from"@spinnaker/amazon";import{HelpContentsRegistry as v,CollapsibleSection as y,LabeledValueList as b,LabeledValue as C,CopyToClipboard as w,LinkWithClipboard as S,ReactInject as E,AccountService as k,ReactInjector as G,FirewallLabels as T,ConfirmationModalService as A,InstanceWriter as N,overridableComponent as I,useData as P,InstanceReader as x,SETTINGS as D,InstanceDetailsPane as O,Spinner as M,InstanceDetailsHeader as L,InstanceActions as F,InstanceInsights as z,ConsoleOutputLink as j,InstanceLinks as B,RecentHistoryService as R,ClusterState as V,UrlBuilder as W,Registry as H,StageConstants as Z,NameUtils as U,ExecutionDetailsSection as q,AccountTag as J,Markdown as $,RenderOutputFile as K,StageFailureMessage as X,DeployingIntoManagedClusterWarning as Y,AccountSelectInput as Q,RegionSelectField as _,HelpField as ee,ServerGroupDetailsField as te,DeploymentStrategySelector as ne,ServerGroupNamePreview as ae,SpelNumberInput as re,ValidationMessage as ie,FormValidator as se,FormikFormField as oe,TextInput as le,SelectInput as ce,LayoutProvider as ue,MapEditorInput as de,PlatformHealthOverrideInput as me,useFormInputValueMapper as pe,robotToHuman as ge,ChecklistInput as he,CheckboxInput as fe,CACHE_INITIALIZER_SERVICE as ve,LOAD_BALANCER_READ_SERVICE as ye,SECURITY_GROUP_READER as be,setMatchingResourceSummary as Ce,SubnetReader as we,NumberInput as Se,SpinFormik as Ee,ReactSelectInput as ke,ResponsiveFieldLayout as Ge,TetheredSelect as Te,StageConfigField as Ae,MapEditor as Ne,ExecutionDetailsTasks as Ie,TaskMonitor as Pe,ReactModal as xe,DeployInitializer as De,WizardModal as Oe,WizardPage as Me,noop as Le,TaskMonitorWrapper as Fe,ModalClose as ze,PlatformHealthOverride as je,UserVerification as Be,MinMaxDesiredChanges as Re,ModalHeader as Ve,ModalBody as We,ModalFooter as He,ServerGroupReader as Ze,DesiredCapacity as Ue,CurrentCapacity as qe,showModal as Je,Overridable as $e,confirmNotManaged as Ke,withErrorBoundary as Xe,TaskExecutor as Ye,SubmitButton as Qe,SERVER_GROUP_WRITER as _e,ModalInjector as et,TaskMonitorModal as tt,TextAreaInput as nt,ClusterTargetBuilder as at,ServerGroupWarningMessageService as rt,ApplicationNameValidator as it,CloudProviderRegistry as st,DeploymentStrategyRegistry as ot}from"@spinnaker/core";import*as lt from"react";import ct,{useMemo as ut}from"react";import{UISref as dt}from"@uirouter/react";import{UIRouterContextComponent as mt}from"@uirouter/react-hybrid";import pt,{sortBy as gt,get as ht,chain as ft,xor as vt,isUndefined as yt,intersection as bt,set as Ct,union as wt,cloneDeep as St,flatten as Et,isEqual as kt,defaultsDeep as Gt}from"lodash";import Tt from"@uirouter/angularjs";import{DockerImageUtils as At,DockerImageAndTagSelector as Nt}from"@spinnaker/docker";import{$q as It}from"ngimport";import{Field as Pt,Form as xt}from"formik";import Dt from"react-select";import{Subject as Ot}from"rxjs";import{react2angular as Mt}from"react2angular";import{Modal as Lt}from"react-bootstrap";import Ft from"pretty-ms";const zt={"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(zt).forEach((e=>v.register(e,zt[e])));const jt=({containerIp:e,host:t,instancePort:n,ipv6Address:a})=>lt.createElement(y,{heading:"DNS",defaultExpanded:!0},lt.createElement(b,{className:"dl-horizontal dl-narrow"},e&<.createElement(C,{label:"Container IP",value:lt.createElement(lt.Fragment,null,e,lt.createElement(w,{text:e,toolTip:"Copy container IP to clipboard"}))}),a&<.createElement(C,{label:"Container IPv6",value:lt.createElement(S,{text:a,url:`http://${a}:${n}`})}),lt.createElement(C,{label:"Host IP",value:t}))),Bt=({instance:e,titusUiEndpoint:t})=>{const{id:a,jobId:r}=e;return ct.createElement(y,{heading:"Instance Information",defaultExpanded:!0},ct.createElement("dl",{className:"dl-horizontal dl-narrow"},ct.createElement(n,{account:e.account,availabilityZone:e.availabilityZone,instanceType:e.instanceType,launchTime:e.launchTime,provider:e.provider,region:e.region,serverGroup:e.serverGroup}),ct.createElement(C,{label:"Job Id",value:ct.createElement("a",{href:`${t}jobs/${r}`,target:"_blank"},r)}),ct.createElement(C,{label:"Instance Id",value:ct.createElement(S,{text:a,url:`${t}jobs/${r}/tasks/${a}`})})))};class Rt extends E{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 Vt=new Rt;class Wt extends ct.Component{constructor(e){super(e),this.state={}}componentDidMount(){this.configureSecurityGroups(this.props)}configureSecurityGroups(e){const{app:t,serverGroup:n}=e,{region:a}=n;if(t.securityGroupsIndex&&n.accountDetails){const e=n.securityGroups.map((e=>Vt.titusSecurityGroupReader.resolveIndexedSecurityGroup(t.securityGroupsIndex,{account:n.accountDetails.awsAccount,region:a},e)));this.setState({securityGroups:e})}else k.listAllAccounts("titus").then((e=>{const t=e.find((e=>e.name===n.account));t&&t.awsAccount&&G.securityGroupReader.getAllSecurityGroups().then((e=>{const r=e[t.awsAccount].aws[a],i=n.securityGroups.map((e=>r.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:i})}))}))}componentWillReceiveProps(e){this.configureSecurityGroups(e)}render(){const{serverGroup:e}=this.props,{securityGroups:t}=this.state,n=!t&&(e.securityGroups||[]).length;return ct.createElement(y,{heading:T.get("Firewalls"),outerDivClassName:""},ct.createElement("ul",null,n&&e.securityGroups.map((e=>ct.createElement("li",{key:e},"..."))),ct.createElement(mt,null,ct.createElement(ct.Fragment,null,gt(t,"name").map((t=>ct.createElement("li",{key:t.name},ct.createElement(dt,{to:"^.firewallDetails",params:{name:t.name,accountId:t.account,region:e.region,vpcId:t.vpcId,provider:"aws"}},ct.createElement("a",null,t.name," (",t.id,")")))))))))}}const Ht=(e,t,n)=>e.map((e=>{var a;const r=t.find((t=>(t.name===e.name||t.name===e.targetGroupName)&&t.account===n)),i="traffic-port"===(null==r?void 0:r.healthCheckPort)||!(null==r?void 0:r.healthCheckPort);return{...e,name:null==r?void 0:r.name,healthCheckPath:r?`:${i?null==r?void 0:r.port:r.healthCheckPort}${(null==r?void 0:r.healthCheckPath)||""}`:void 0,healthCheckProtocol:null==(a=null==r?void 0:r.healthCheckProtocol)?void 0:a.toLowerCase()}})),Zt=(e,t,n)=>{const r=(e||[]).filter((e=>"Unknown"!==e.state)),i=a(t);return r.map((e=>{if("TargetGroup"===e.type){const t=Ht(e.targetGroups,i,n);return{...e,targetGroups:t}}return e}))},Ut=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id}`,onTaskComplete:()=>{G.$state.includes("**.instanceDetails",{id:e.id})&&G.$state.go("^")}};A.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),N.terminateInstance(e,t,n)}})},qt=(e,t)=>()=>{const n={application:t,title:`Terminating ${e.id} and shrinking server group`,onTaskComplete:()=>{G.$state.includes("**.instanceDetails",{instanceId:e.id})&&G.$state.go("^")}};A.confirm({header:`Really terminate ${e.id} and shrink ${e.serverGroup}?`,buttonText:`Terminate ${e.id} and shrink ${e.serverGroup}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>N.terminateInstancesAndShrinkServerGroups([{cloudProvider:e.cloudProvider,instanceIds:[e.id],account:e.account,region:e.region,serverGroup:e.serverGroup,instances:[e]}],t)})},Jt=(e,t)=>()=>{const n={application:t,title:`Enabling ${e.id} in discovery`};A.confirm({header:`Really enable ${e.id} in discovery?`,buttonText:`Enable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>N.enableInstanceInDiscovery(e,t)})},$t=(e,t)=>()=>{const n={application:t,title:`Disabling ${e.id} in discovery`};A.confirm({header:`Really disable ${e.id} in discovery?`,buttonText:`Disable ${e.id}`,account:e.account,taskMonitorConfig:n,submitMethod:()=>N.disableInstanceInDiscovery(e,t)})},Kt=(e,t)=>{const n=[{label:"Terminate",triggerAction:Ut(e,t)},{label:"Terminate and Shrink Server Group",triggerAction:qt(e,t)}],a=(e.health||[]).filter((e=>"Discovery"===e.type));a.length&&"OutOfService"===a[0].state&&n.push({label:"Enable in Discovery",triggerAction:Jt(e,t)});return(a||[]).some((e=>"Up"===e.state||"Down"===e.state))&&n.push({label:"Disable in Discovery",triggerAction:$t(e,t)}),n},Xt=I((({account:e,actions:t,app:n,baseIpAddress:a,environment:i,healthMetrics:s,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 lt.createElement("div",{className:"details-panel"},lt.createElement("div",{className:"header"},lt.createElement(L,{healthState:o.healthState,instanceId:l,loading:u,sshLink:v,standalone:n.isStandalone}),lt.createElement("div",{className:"actions"},lt.createElement(F,{actions:t}),Boolean(null==(g=null==o?void 0:o.insightActions)?void 0:g.length)&<.createElement(z,{analytics:!0,insights:o.insightActions,instance:o}))),lt.createElement("div",{className:"content"},lt.createElement(Bt,{instance:o,titusUiEndpoint:o.titusUiEndpoint}),lt.createElement(r,{healthMetrics:s,healthState:o.healthState,metricTypes:["TargetGroup"],privateIpAddress:o.privateIpAddress}),lt.createElement(jt,{containerIp:null==(h=o.placement)?void 0:h.containerIp,host:null==(f=o.placement)?void 0:f.host,instancePort:c,ipv6Address:o.ipv6Address}),lt.createElement("div",{className:"collapsible-section"},lt.createElement(Wt,{app:n,serverGroup:m})),lt.createElement(y,{heading:"Console Output"},lt.createElement(j,{instance:o})),lt.createElement(B,{address:a,application:n,instance:o,environment:i,moniker:d})))}),"titus.instance.details.content"),Yt=({app:e,environment:t,instance:n,moniker:a})=>{var r,i,s;const{instanceId:o}=n,l=e.serverGroups.data.find((e=>e.instances.some((e=>e.id===o)))),{account:c,region:u}=l,d=()=>(R.addExtraDataToLatest("instances",{account:c,region:u,serverGroup:l.name}),Promise.all([x.getInstanceDetails(c,u,o).then((e=>({...e,account:c,region:u}))),k.getAccountDetails(c)])),m=e=>{const[t,n]=e,a=((null==n?void 0:n.regions)||[]).find((e=>e.name===u));return[{titusUiEndpoint:null==a?void 0:a.endpoint,...t},n]},{result:[p,g],status:h}=P((()=>e.isStandalone?d().then((e=>m(e))):e.serverGroups.ready().then(d).then((e=>m(e)))),[{},{}],[o,l]),f=Kt(p,e),v=Zt(p.health,e.loadBalancers.data,g.awsAccount),y="PENDING"===h,b=(null==(r=e.attributes)?void 0:r.instancePort)||D.defaultInstancePort||"80",C=(null==(i=p.placement)?void 0:i.containerIp)||(null==(s=null==p?void 0:p.placement)?void 0:s.host);return y?lt.createElement(O,null,lt.createElement("div",{className:"horizontal center middle"},lt.createElement(M,{size:"small"}))):(null==p?void 0:p.id)?lt.createElement(Xt,{account:g,actions:f,app:e,baseIpAddress:C,environment:t,healthMetrics:v,instance:p,instanceId:n.instanceId,instancePort:b,moniker:a,loading:y,serverGroup:l,region:u}):lt.createElement("div",{className:"details-panel"},lt.createElement("div",{className:"header"},lt.createElement(O,null,lt.createElement("div",{className:"header-text horizontal middle"},lt.createElement("h3",{className:"horizontal middle space-between flex-1"},n.instanceId)))),lt.createElement("div",{className:"content"},lt.createElement("div",{className:"content-section"},lt.createElement("div",{className:"content-body text-center"},lt.createElement("h3",null,"Instance not found.")))))};t("spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller",[Tt]).controller("titusCloneServerGroupExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService",function(e,t,n){e.configSections=["cloneServerGroupConfig","taskStatus"];const a=()=>{const n=a["kato.tasks"][0].resultObjects;e.detailsSection=t.details;const a=e.stage.context||{},r=[];a&&a["kato.tasks"]&&a["kato.tasks"].length&&n&&n.length&&function(e){const i=pt.find(n,e);i&&pt.forEach(i[e],(e=>{if(e.includes(":")){const[n,i]=e.split(":"),s={type:"serverGroups",application:a.application,serverGroup:i,account:a.credentials,region:n,provider:"titus",project:t.project};s.href=W.buildFromMetadata(s),r.push(s)}}))}("serverGroupNames"),e.deployed=r};this.overrideFiltersForUrl=e=>V.filterService.overrideFiltersForUrl(e);const r=()=>n.synchronizeSection(e.configSections,a);r(),e.$on("$stateChangeSuccess",r)}]);t("spinnaker.titus.pipeline.stage.cloneServerGroupStage",["spinnaker.titus.pipeline.stage.cloneServerGroup.executionDetails.controller"]).config((function(){H.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},k.listAccounts("titus").then((t=>{e.accounts=t,e.viewState.accountsLoaded=!0})),this.cloneTargets=Z.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=U.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},pt.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)=>{pt.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')}]);t("spinnaker.titus.pipeline.stage.destroyAsgStage",[]).config((function(){H.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},k.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=Z.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')}]);t("spinnaker.titus.pipeline.stage.disableAsgStage",[]).config((function(){H.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},k.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),e.targets=Z.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')}]);t("spinnaker.titus.pipeline.stage.disableClusterStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.pipeline.stage.enableAsgStage",[]).config((function(){H.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},k.listAccounts("titus").then((function(t){e.accounts=t,e.state.accounts=!0})),t.reset=()=>{t.accountUpdated(),t.resetSelectedCluster()},e.targets=Z.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')}]);e.module("spinnaker.titus.pipeline.stage.findAmiStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.pipeline.stage.resizeAsgStage",[]).config((function(){H.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},k.listAccounts("titus").then((function(t){e.accounts=t,e.viewState.accountsLoaded=!0})),e.resizeTargets=Z.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 Qt extends ct.Component{constructor(e){super(e),this.mounted=!1,this.state={}}componentDidMount(){this.mounted=!0,this.setEndpoint()}setEndpoint(){const{context:e}=this.props.stage;k.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:a}=this.state,{context:r}=e,{cluster:i}=r,{resources:s,env:o,entryPoint:l,entryPointList:c}=i,u=i?ht(r["deploy.jobs"],i.region,[])[0]:null,d=ht(r,"jobStatus.completionDetails.taskId"),m=this.formatEntryPoint(c,l);return ct.createElement(q,{name:n,current:t},ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-9"},ct.createElement(b,{className:"dl-narrow dl-horizontal"},ct.createElement(C,{label:"Account",value:ct.createElement(J,{account:r.credentials})}),i&&ct.createElement(ct.Fragment,null,ct.createElement(C,{label:"Image",value:i.imageId}),m&&ct.createElement(C,{label:"Entrypoint",value:m})),u&&ct.createElement(C,{label:"Titus Job Id",value:ct.createElement($,{message:`[${u}](${a}jobs/${u})`})}),d&&ct.createElement(C,{label:"Titus Task Id",value:ct.createElement($,{message:`[${d}](${a}jobs/${u}/tasks/${d})`})}),s&&Object.keys(s)&&ct.createElement(C,{label:"Resources",value:ct.createElement("ul",{className:"nostyle"},Object.keys(s).map((e=>ct.createElement("li",{key:e},e,": ",s[e]))))})))),o&&Object.keys(o)&&ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-12"},ct.createElement("h5",{style:{marginBottom:0,paddingBottom:"5px"}},"Environment Variables"),ct.createElement(b,null,Object.keys(o).map((e=>ct.createElement(C,{key:e,label:e,value:o[e]})))))),r.propertyFileContents&&ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-12"},ct.createElement("h5",{style:{marginBottom:"0px",paddingBottom:"5px"}},"Property File"),ct.createElement(K,{outputFileObject:r.propertyFileContents}))),ct.createElement(X,{stage:e,message:e.failureMessage||ht(r,"completionDetails.message")}),d&&ct.createElement("div",{className:"row"},ct.createElement("div",{className:"col-md-12"},ct.createElement("div",{className:"well alert alert-info"},ct.createElement("a",{target:"_blank",href:`${a}jobs/${u}/tasks/${d}/logs`},"View Execution Logs"),ct.createElement("br",null),ct.createElement("a",{target:"_blank",href:`${a}jobs/${u}/tasks/${d}/logs/archived?file=stdout&view=Finished&open=true`},"Stdout"),ct.createElement("br",null),ct.createElement("a",{target:"_blank",href:`${a}jobs/${u}/tasks/${d}/logs/archived?file=stderr&view=Finished&open=true`},"Stderr")))))}}Qt.title="runJobConfig";class _t extends ct.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 ft(e.aws[this.getRegion()]).filter({vpcId:this.getVpcId()}).sortBy("name").value()}refreshSecurityGroups(e){return G.cacheInitializer.refreshCache("securityGroups").then((()=>G.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,a=this.props.groupsToEdit;if(e&&this.props.groupsToEdit){const r=a.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),i=r.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)),s=i.map((e=>e.name));n=vt(r,s),a=i.map((e=>e.id)),this.props.onChange(a)}e=e.sort(((e,t)=>e.name.localeCompare(t.name))),this.setState({availableGroups:e,loaded:!0,removedGroups:n})}componentDidMount(){const e=k.getCredentialsKeyedByAccount("titus").then((e=>{this.credentials=e})),t=G.securityGroupReader.getAllSecurityGroups().then((e=>{this.securityGroups=e})),n=i.listVpcs().then((e=>this.vpcs=e));It.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:a}=this.props,{availableGroups:r,loaded:i,removedGroups:l}=this.state,c=T.get("firewalls");return i?ct.createElement("div",{className:"clearfix"},ct.createElement(s,{removed:l,onClear:this.clearRemoved}),ct.createElement(o,{command:e,hideLabel:t,availableGroups:r,groupsToEdit:n,refresh:()=>this.refreshSecurityGroups(),onChange:this.props.onChange,helpKey:"titus.deploy.securityGroups"}),a&&void 0!==e.credentials&&ct.createElement("div",{className:"small "+(t?"":"col-md-offset-3 col-md-9")},"Uses ",c," from the Amazon account ",ct.createElement(J,{account:a}))):null}}const en=D.providers.titus||{defaults:{}};en&&(en.resetToOriginal=D.resetToOriginal);const tn=e=>e&&!e.includes("${");class nn extends ct.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 a=n.backingData.credentialsKeyedByAccount[e];t("containerAttributes",{...n.containerAttributes,"titusParameter.agent.assignIPv6Address":"test"===a.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:a}=G;a.is("home.applications.application.insight.clusters")?a.go(".serverGroup",n):a.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:a,repository:r,tag:i}=At.splitImageId(t.imageId);n("digest",e),n("organization",a),n("repository",r),n("tag",i)}this.state={...this.getStateFromProps(e)}}getStateFromProps(e){const{app:t}=e,{values:n}=e.formik,a=U.getClusterName(t.name,n.stack,n.freeFormDetails),r=!t.clusters.find((e=>e.name===a)),i=t.serverGroups.data.filter((e=>e.cluster===a&&e.account===n.credentials&&e.region===n.region)).sort(((e,t)=>e.createdTime-t.createdTime)),s=i.length?i.pop():null;return{namePreview:a,createsNewCluster:r,latestServerGroup:s}}validate(e){const t={};var n,a;return n=e.stack,tn(n)&&!/^([\w.]+|\${[^}]+})*$/.test(n)&&(t.stack="Only dot(.) and underscore(_) special characters are allowed in the Stack field."),a=e.freeFormDetails,tn(a)&&!/^([\w.^~-]+|\${[^}]+})*$/.test(a)&&(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:a,formik:r}=this.props,{errors:i,setFieldValue:s,values:o}=r,{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=en.defaults)?void 0:e.subnetType).concat(null==(t=l.defaults)?void 0:t.subnetType).filter((e=>!!e));return ct.createElement("div",{className:"container-fluid form-horizontal"},ct.createElement(Y,{app:a,formik:r}),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Account"),ct.createElement("div",{className:"col-md-7"},ct.createElement(Q,{value:o.credentials,onChange:e=>this.accountUpdated(e.target.value),readOnly:g.credentials,accounts:p,provider:"titus"}),void 0!==o.credentials&&ct.createElement("div",{className:"small"},"Uses resources from the Amazon account"," ",ct.createElement(J,{account:o.backingData.credentialsKeyedByAccount[o.credentials]&&o.backingData.credentialsKeyedByAccount[o.credentials].awsAccount})))),ct.createElement(_,{readOnly:g.region,labelColumns:3,component:o,field:"region",account:o.credentials,regions:o.backingData.filtered.regions,onChange:this.regionUpdated}),ct.createElement(c,{application:a,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=en.serverGroups)?void 0:n.recommendedSubnets,showSubnetWarning:!0}),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Stack ",ct.createElement(ee,{id:"aws.serverGroup.stack"})),ct.createElement("div",{className:"col-md-7"},ct.createElement("input",{type:"text",className:"form-control input-sm no-spel",value:o.stack||"",onChange:e=>this.stackChanged(e.target.value)}))),i.stack&&ct.createElement("div",{className:"form-group row slide-in"},ct.createElement("div",{className:"col-sm-9 col-sm-offset-2 error-message"},ct.createElement("span",null,i.stack))),ct.createElement(te,{app:a,formik:r}),!o.viewState.disableImageSelection&&ct.createElement(Nt,{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&&ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Image")," ",ct.createElement(ee,{id:"titus.deploy.imageId"})),ct.createElement("div",{className:"col-md-7 sp-padding-xs-yaxis"},o.imageId)),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Entrypoint")),ct.createElement("div",{className:"col-md-7"},ct.createElement(Pt,{type:"text",className:"form-control input-sm no-spel",name:"entryPoint"}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Traffic ",ct.createElement(ee,{id:"titus.serverGroup.traffic"})),ct.createElement("div",{className:"col-md-7"},ct.createElement("div",{className:"checkbox"},ct.createElement("label",null,ct.createElement("input",{type:"checkbox",checked:o.inService,onChange:e=>s("inService",e.target.checked),disabled:""!==o.strategy&&"custom"!==o.strategy})," ","Send client requests to new instances")))),!o.viewState.disableStrategySelection&&o.selectedProvider&&ct.createElement(ne,{command:o,onFieldChange:this.onStrategyFieldChange,onStrategyChange:this.strategyChanged}),!o.viewState.hideClusterNamePreview&&ct.createElement(ae,{createsNewCluster:u,latestServerGroupName:null==d?void 0:d.name,mode:o.viewState.mode,namePreview:m,navigateToLatestServerGroup:this.navigateToLatestServerGroup}))}}const an=[{label:"Read and Write",value:"RW"},{label:"Read Only",value:"RO"},{label:"Write Only",value:"WO"}];class rn extends ct.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 ct.createElement("div",{className:"clearfix"},ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"CPU(s)")),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.cpu,onChange:n=>e("resources",{...t.resources,cpu:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Memory (MB)")),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.memory,onChange:n=>e("resources",{...t.resources,memory:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Disk (MB)")),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.disk,onChange:n=>e("resources",{...t.resources,disk:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Network (Mbps)"),ct.createElement(ee,{id:"titus.deploy.network"})),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.networkMbps,onChange:n=>e("resources",{...t.resources,networkMbps:n}),required:!0}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Gpu"),ct.createElement(ee,{id:"titus.deploy.gpu"})),ct.createElement("div",{className:"col-md-8"},ct.createElement(re,{value:t.resources.gpu,onChange:n=>e("resources",{...t.resources,gpu:n})}))),ct.createElement("hr",null),ct.createElement("h4",null,ct.createElement("b",null,"Elastic File System Options ",ct.createElement(ee,{id:"titus.deploy.efs"}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Mount Permission "),ct.createElement(ee,{id:"titus.deploy.mountPermissions"})),ct.createElement("div",{className:"col-md-8"},ct.createElement(Dt,{value:t.efs.mountPerm,clearable:!1,options:an,onChange:n=>e("efs",{...t.efs,mountPerm:n.value})}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"Mount Point "),ct.createElement(ee,{id:"titus.deploy.mountPoint"})),ct.createElement("div",{className:"col-md-8"},ct.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})}))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"EFS ID "),ct.createElement(ee,{id:"titus.deploy.efsId"})),ct.createElement("div",{className:"col-md-8"},ct.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})})),ct.createElement("div",{className:"col-md-offset-3 col-md-8"})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},ct.createElement("b",null,"EFS Relative Mount Point "),ct.createElement(ee,{id:"titus.deploy.efsRelativeMountPoint"})),ct.createElement("div",{className:"col-md-8"},ct.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 sn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}function on(e){const{label:t,help:n,input:a,actions:r,validation:i={}}=e,{hidden:s,messageNode:o,category:l}=i,c=!yt(t)||!yt(n);return ct.createElement("div",{className:"TitusMapLayout flex-container-v"},c&&ct.createElement("h4",null,t," ",n),ct.createElement("div",{className:"flex-container-h baseline margin-between-lg TitusMapLayout_Contents"},a," ",r),!s&&ct.createElement(ie,{message:o,type:l}))}sn(".TitusMapLayout_Contents * {\n -webkit-box-flex: 1;\n -ms-flex: auto;\n flex: auto;\n}\n");const ln=["disableIncreaseDesired","disableDecreaseDesired"];sn(".ServerGroupParameters .StandardFieldLayout_Label {\n min-width: 160px;\n}\n");const cn=[{label:"System Default",value:"systemDefault"},{label:"Self Managed",value:"selfManaged"}];function un(e){const t=wt(ln,Object.keys(e.value)),n=pe(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)),{}))),a=t.map((e=>({label:ge(e),value:e})));return ct.createElement(he,{...n,options:a})}function dn(e){const t=pe(e,(e=>"true"===e),((e,t)=>t.target.checked?"true":"false"));return ct.createElement(fe,{...t})}const mn=e=>{const{awsAccount:t,setDefaultIamProfile:n,...a}=e;return ct.createElement("div",{className:"flex-container-h baseline margin-between-md"},ct.createElement(le,{...a}),e.value?ct.createElement(ct.Fragment,null,ct.createElement("span",null,"in"),ct.createElement(J,{account:t})):ct.createElement("button",{className:"link",style:{whiteSpace:"nowrap"},onClick:n},"Apply default value"))};class pn extends ct.Component{constructor(e){super(e)}validate(e){const t=new se(e);t.field("iamProfile","IAM Instance Profile").required();const n=t.validateForm();return bt(Object.keys(e.constraints.soft),Object.keys(e.constraints.hard)).forEach((e=>{Ct(n,`constraints.soft.${e}`,`Constraint '${e}' must be either soft or hard, not both.`),Ct(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_]*$/)||Ct(n,`env.${e}`,"Environment variable names must contain only letter, numbers, or underscores"):Ct(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,a=()=>t("iamProfile",n.viewState.defaultIamProfile);return ct.createElement("div",{className:"ServerGroupParameters"},ct.createElement(oe,{name:"iamProfile",label:"IAM Instance Profile",help:ct.createElement(ee,{id:"titus.deploy.iamProfile"}),input:e=>{var t;return ct.createElement(mn,{...e,awsAccount:null==(t=n.backingData.credentialsKeyedByAccount[n.credentials])?void 0:t.awsAccount,setDefaultIamProfile:a})}}),ct.createElement(oe,{name:"capacityGroup",label:"Capacity Group",help:ct.createElement(ee,{id:"titus.deploy.capacityGroup"}),input:e=>ct.createElement(le,{...e})}),ct.createElement(oe,{name:"migrationPolicy.type",label:"Migration Policy",help:ct.createElement(ee,{id:"titus.deploy.migrationPolicy"}),input:e=>ct.createElement(ce,{options:cn,...e})}),ct.createElement(oe,{name:"serviceJobProcesses",label:"Service Job Processes",input:e=>ct.createElement(un,{...e})}),ct.createElement(oe,{name:"containerAttributes['titusParameter.agent.assignIPv6Address']",label:"Associate IPv6 Address (Recommended)",help:ct.createElement(ee,{id:"serverGroup.ipv6"}),input:e=>ct.createElement(dn,{...e})}),ct.createElement("hr",null),ct.createElement(ue,{value:on},ct.createElement(oe,{name:"constraints.soft",label:"Soft Constraints ",help:ct.createElement(ee,{id:"titus.deploy.softConstraints"}),input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement(oe,{name:"constraints.hard",label:"Hard Constraints",help:ct.createElement(ee,{id:"titus.deploy.hardConstraints"}),input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement("hr",null),ct.createElement(oe,{name:"labels",label:"Job Attributes",input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement(oe,{name:"containerAttributes",label:"Container Attributes",input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})}),ct.createElement(oe,{name:"env",label:"Environment Variables",input:e=>ct.createElement(de,{allowEmptyValues:!0,...e})})),e.attributes.platformHealthOnlyShowOverride&&ct.createElement(oe,{name:"interestingHealthProviderNames",label:"Task Completion",input:e=>ct.createElement(me,{...e,platformHealthType:"Titus"})}))}}const gn={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"}]},hn=e=>{const t=St(gn);return e.attributes&&e.attributes.platformHealthOnly&&(t.containerHealthProviders=[]),t};class fn{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 a=this.getCredentials(e);n.subnetPurposes=ft(e.backingData.subnets).filter({account:a.awsAccount,region:e.region}).reject({target:"elb"}).reject({purpose:null}).uniqBy("purpose").value();const r=e.subnetType||"titus (vpc0)",i=ft(e.backingData.subnets).filter({account:a.awsAccount,region:e.region,purpose:r}).map((e=>e.id)).value();return e.containerAttributes["titusParameter.agent.subnets"]=i.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),Ce(e),t},e.regionChanged=e=>(this.configureLoadBalancerOptions(e),this.configureSecurityGroupOptions(e),this.configureSubnets(e),Ce(e),{}),e.clusterChanged=e=>{e.moniker=U.getMoniker(e.application,e.stack,e.freeFormDetails),Ce(e)},e.subnetChanged=e=>this.configureSubnets(e)}configureCommand(e){return e.viewState.accountChangedStream=new Ot,e.viewState.regionChangedStream=new Ot,e.viewState.groupsRemovedStream=new Ot,e.viewState.dirty={},e.onStrategyChange=(e,t)=>{""!==t.key&&"custom"!==t.key&&(e.inService=!0)},e.image=e.viewState.imageId,It.all([k.getCredentialsKeyedByAccount("titus"),this.securityGroupReader.getAllSecurityGroups(),i.listVpcs(),we.listSubnets(),k.getCredentialsKeyedByAccount("aws")]).then((([t,n,a,r,i])=>{var s,o;const l={credentialsKeyedByAccount:t,securityGroups:n,vpcs:a};Object.keys(t).forEach((e=>{const n=t[e].awsAccount,a=i[n].accountId;t[e].accountId=a})),l.credentialsKeyedByAccount=t,e.credentials&&(e.containerAttributes["titusParameter.agent.accountId"]=l.credentialsKeyedByAccount[e.credentials].accountId),l.images=[],l.accounts=Object.keys(t),l.subnets=r,l.filtered={},e.credentials.includes("${")?l.filtered.regions=[{name:e.region}]:l.filtered.regions=null!=(o=null==(s=t[e.credentials])?void 0:s.regions)?o:[],e.backingData=l,l.filtered.securityGroups=this.getRegionalSecurityGroups(e);let c=It.when();if(e.securityGroups&&e.securityGroups.length){const t=l.filtered.securityGroups.map((e=>e.id));bt(e.securityGroups,t).length<e.securityGroups.length&&(c=this.refreshSecurityGroups(e,!1))}return It.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 ft(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),a="string"==typeof e.securityGroups&&e.securityGroups.includes("${");if(t&&e.securityGroups&&!a){const a=e.securityGroups.map((e=>{const n=t.find((t=>t.id===e));return n?n.name:e})),r=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)),i=r.map((e=>e.name)),s=vt(a,i);e.securityGroups=r.map((e=>e.id)),s.length&&(e.viewState.dirty.securityGroups=s)}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 Et(t.map((e=>e.targetGroups.filter((e=>"ip"===e.targetType))))).map((e=>e.name)).sort()}getLoadBalancerMap(e){return ft(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 a=bt(n,t),r=vt(a,t);e.targetGroups=bt(n,a),r&&r.length>0?e.viewState.dirty.targetGroups=r: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)}))}}fn.$inject=["cacheInitializer","loadBalancerReader","securityGroupReader"];t("spinnaker.titus.serverGroup.configure.service",[ve,ye,be]).service("titusServerGroupConfigurationService",fn);const vn=[{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:gn.availabilityPercentageLimit,fieldComponent:e=>ct.createElement(oe,{name:"disruptionBudget.availabilityPercentageLimit.percentageOfHealthyContainers",label:"Percentage of Healthy Containers",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,disabled:e.isDisabled}),ct.createElement(ee,{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:()=>ct.createElement(oe,{name:"disruptionBudget.relocationLimit.limit",label:"Limit",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{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:()=>ct.createElement(oe,{name:"disruptionBudget.unhealthyTasksLimit.limitOfUnhealthyContainers",label:"Limit of Unhealthy Containers",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{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:()=>ct.createElement(oe,{name:"disruptionBudget.selfManaged.relocationTimeMs",label:"Relocation Time",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{expand:!0,content:"(milliseconds)"}))})}],yn=[{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:gn.ratePercentagePerInterval,fieldComponent:e=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{name:"disruptionBudget.ratePercentagePerInterval.intervalMs",label:"Interval",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,disabled:e.isDisabled}),ct.createElement(ee,{expand:!0,content:"(milliseconds)"}))}),ct.createElement(oe,{name:"disruptionBudget.ratePercentagePerInterval.percentageLimitPerInterval",label:"Percentage Per Interval",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,disabled:e.isDisabled}),ct.createElement(ee,{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:()=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{name:"disruptionBudget.ratePerInterval.intervalMs",label:"Interval",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{expand:!0,content:"(milliseconds)"}))}),ct.createElement(oe,{name:"disruptionBudget.ratePerInterval.limitPerInterval",label:"Limit Per Interval",input:e=>ct.createElement("div",null,ct.createElement(Se,{...e}),ct.createElement(ee,{expand:!0,content:"(tasks)"}))}))}],bn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];class Cn extends ct.Component{constructor(e){super(e),this.configureNewWindow=()=>{this.setState({addingNewWindow:!0})},this.addNewWindow=e=>{const{values:t,setFieldValue:n}=this.props.formik,{days:a,startHour:r,endHour:i,timeZone:s}=e,o={days:a,hourlyTimeWindows:[{startHour:r,endHour:i}],timeZone:s};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 ct.createElement("div",{className:"sp-formItem"},ct.createElement("div",{className:"sp-formItem__left"}),ct.createElement("div",{className:"sp-formItem__right"},n.map(((e,n)=>e.hourlyTimeWindows.map(((a,r)=>ct.createElement("div",{className:"sp-margin-l-yaxis sp-margin-m-right",style:{display:"inline-block"},key:`${n}.${r}`},ct.createElement("div",{key:`${n}.${r}`,className:"horizontal center top sp-padding-m-yaxis sp-padding-s-xaxis",style:{backgroundColor:"var(--color-dovegray)",borderRadius:"4px"}},ct.createElement("div",{className:"sp-padding-m-right",style:{color:"var(--color-text-on-dark)",fontSize:"12px"}},ct.createElement("div",null,ct.createElement("b",null,e.days.map((e=>e.substr(0,3))).join(", "))),ct.createElement("div",null,ct.createElement("em",null,a.startHour,":00 - ",a.endHour,":00 ",e.timeZone))),!t&&ct.createElement("a",{className:"clickable",style:{color:"var(--color-text-on-dark)"},onClick:()=>this.removeWindow(n,r)},ct.createElement("span",{className:"glyphicon glyphicon-remove"}))))))))))},this.NewWindowComponent=()=>this.state.addingNewWindow?ct.createElement(Ee,{initialValues:{days:[],startHour:10,endHour:16,timeZone:ht(this.props.formik.values.disruptionBudget,"timeWindows[0].timeZone","PST")},onSubmit:this.addNewWindow,render:e=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{name:"days",label:"Define a New Window",input:e=>ct.createElement(he,{...e,stringOptions:bn})}),ct.createElement(oe,{name:"startHour",label:"Start",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,min:0,max:e.values.endHour}),ct.createElement(ee,{expand:!0,content:"hour (0-24)"}))}),ct.createElement(oe,{name:"endHour",label:"End",input:t=>ct.createElement("div",null,ct.createElement(Se,{...t,min:e.values.startHour,max:23}),ct.createElement(ee,{expand:!0,content:"hour (0-24)"}))}),ct.createElement(oe,{name:"timeZone",label:"Timezone",input:e=>ct.createElement(ke,{...e,clearable:!1,stringOptions:["PST","UTC"]})}),ct.createElement("div",{className:"sp-formItem"},ct.createElement("div",{className:"sp-formItem__left"}),ct.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},ct.createElement("button",{className:"primary",type:"submit",onClick:()=>this.addNewWindow(e.values)}," ","Add Window"))))}):ct.createElement("div",{className:"sp-formItem"},ct.createElement("div",{className:"sp-formItem__left"}),ct.createElement("div",{className:"sp-formItem__right sp-margin-l-bottom"},ct.createElement("a",{className:"button primary",onClick:this.configureNewWindow},ct.createElement("i",{className:"fas fa-plus-circle"})," Define New Window"))),this.state={addingNewWindow:!1}}removeWindow(e,t){const{values:n,setFieldValue:a}=this.props.formik,{timeWindows:r}=n.disruptionBudget,i=r[e];if(1===i.hourlyTimeWindows.length)a("disruptionBudget.timeWindows",r.filter((e=>e!==i)));else{const n=i.hourlyTimeWindows[t];a(`disruptionBudget.timeWindows[${e}].hourlyTimeWindows`,i.hourlyTimeWindows.filter((e=>e!==n)))}}render(){const{CurrentWindows:e,NewWindowComponent:t}=this,{isDisabled:n}=this.props;return ct.createElement(ct.Fragment,null,ct.createElement(e,null),!n&&ct.createElement(t,null))}}const wn=()=>ct.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."," ",ct.createElement("a",{href:"http://manuals.test.netflix.net/view/titus-docs/mkdocs/master/disruption_budget/",target:"_blank"},"Read the full documentation"));class Sn extends ct.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:gn.timeWindows}],this.toggleUseDefault=()=>{this.state.usingDefault||this.setToDefaultBudget(),this.setState({usingDefault:!this.state.usingDefault})},this.componentDidUpdate=e=>{this.props.onStageChange&&!kt(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,vn),this.rateTypeChanged=e=>this.optionTypeChanged(e,yn),this.timeWindowsChanged=e=>{this.props.formik.setFieldValue("disruptionBudget."+e.field,e.defaultValues)};const{disruptionBudget:t}=e.formik.values;this.state={usingDefault:!t||kt(t,hn(e.app))},this.state.usingDefault&&this.setToDefaultBudget()}setToDefaultBudget(){this.props.formik.setFieldValue("disruptionBudget",hn(this.props.app))}getSelectionFromFields(e){const{disruptionBudget:t}=this.props.formik.values;return t?e.find((e=>!!t[e.field])):e[0]}getTimeWindowSelection(){return ht(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,a=t.disruptionBudget.containerHealthProviders,r=a.find((t=>t.name===e));n("disruptionBudget.containerHealthProviders",r?a.filter((e=>e!==r)):a.concat({name:e}))}render(){const{runJobView:e}=this.props,{usingDefault:t}=this.state,n=this.props.formik.values.disruptionBudget||hn(this.props.app),a=this.getSelectionFromFields(vn),r=a.fieldComponent,i=this.getSelectionFromFields(yn),s=i.fieldComponent,o=this.getTimeWindowSelection(),l=n.containerHealthProviders.map((e=>e.name)),c=!!n.selfManaged,u=!e||e&&!t;return ct.createElement(ue,{value:Ge},ct.createElement("div",{className:"form-horizontal sp-margin-l-xaxis"},!e&&ct.createElement(wn,null),ct.createElement(oe,{name:"usingDefault",input:()=>ct.createElement(fe,{checked:t,onChange:this.toggleUseDefault,text:ct.createElement("b",null,"Use Netflix Defaults")}),layout:e?({input:e})=>ct.createElement(ct.Fragment,null,e):void 0}),u&&ct.createElement("div",{style:{opacity:t?.5:1}},ct.createElement("div",{className:"sp-formGroup"},ct.createElement("div",{className:"groupHeader"},ct.createElement(oe,{name:"policyType",label:"Policy",input:e=>ct.createElement("div",null,ct.createElement(Te,{...e,menuContainerStyle:{height:"300px"},className:"Select-menu-long",style:{width:"300px"},disabled:t,clearable:!1,onChange:this.policyTypeChanged,value:a,options:vn}),ct.createElement(ee,{expand:!0,content:"A job policy defines container relocation rules and constraints"}))})),ct.createElement("div",{className:"sp-formItem"},ct.createElement("p",null,a.description)),r&&ct.createElement(r,{isDisabled:t})),!c&&ct.createElement("div",null,ct.createElement("div",{className:""+(n.rateUnlimited?"":"sp-formGroup")},ct.createElement("div",{className:""+(n.rateUnlimited?"":"groupHeader")},ct.createElement(oe,{name:"rates",label:"Rates",input:e=>ct.createElement(Te,{...e,style:{width:"300px"},disabled:t,clearable:!1,onChange:this.rateTypeChanged,value:i,options:yn})})),ct.createElement("div",{className:"sp-formItem"},ct.createElement("p",null,i.description)),s&&ct.createElement(s,{isDisabled:t})),ct.createElement("div",{className:""+(n.timeWindows?"sp-formGroup":"")},ct.createElement("div",{className:""+(n.timeWindows?"groupHeader":"")},ct.createElement(oe,{name:"timeWindows",label:"When Can Disruption Occur?",input:e=>ct.createElement(Te,{...e,style:{width:"300px"},disabled:t,clearable:!1,onChange:this.timeWindowsChanged,value:o,options:this.timeWindowOptions})})),n.timeWindows&&ct.createElement(Cn,{isDisabled:t,formik:this.props.formik})),ct.createElement(oe,{name:"healthProviders",label:"Container Health Provider",input:()=>ct.createElement("div",null,ct.createElement(fe,{checked:l.includes("eureka"),onChange:()=>this.toggleHealthProvider("eureka"),text:"Discovery",disabled:t}))})))))}}class En extends ct.Component{constructor(e){super(e),this.credentialsKeyedByAccount={},this.defaultIamProfile="",this.state={credentials:[],regions:[],loaded:!1},this.accountChanged=e=>{Ct(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)=>{Ct(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,At.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 a=en.defaults.iamProfile||"{{application}}InstanceProfile";this.defaultIamProfile=a.replace("{{application}}",t.name);const r={application:t.name,containerAttributes:{},env:{},labels:{},resources:{cpu:1,disk:1e4,gpu:0,memory:512,networkMbps:128},retries:0,runtimeLimitSecs:3600,securityGroups:[]};n.isNew&&(r.iamProfile=this.defaultIamProfile),Gt(n.cluster,r),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;k.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 a="test"===this.credentialsKeyedByAccount[e.credentials].environment&&void 0===e.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"]?"true":"false";this.associateIPv6AddressChanged(a)}))}render(){var e,t;const{application:n,stage:a}=this.props,{credentials:r,loaded:i,regions:s}=this.state,o=(this.credentialsKeyedByAccount[a.credentials]||{awsAccount:""}).awsAccount,l=(null==(e=a.cluster.entryPointList)?void 0:e.length)?a.cluster.entryPointList.join(","):a.cluster.entryPoint,c=(null==(t=a.cluster.cmdList)?void 0:t.length)?a.cluster.cmdList.join(","):a.cluster.cmd;return ct.createElement("div",{className:"form-horizontal"},ct.createElement("div",{className:"form-group"},ct.createElement("label",{className:"col-md-3 sm-label-right"},ct.createElement("span",{className:"label-text"},"Account")),ct.createElement("div",{className:"col-md-5"},ct.createElement(Q,{value:a.credentials,onChange:e=>this.accountChanged(e.target.value),accounts:r,provider:"titus"}),void 0!==a.credentials&&ct.createElement("div",{className:"small"},"Uses resources from the Amazon account ",ct.createElement(J,{account:o})))),ct.createElement(_,{labelColumns:3,fieldColumns:5,component:a.cluster,field:"region",account:a.credentials,regions:s,onChange:e=>this.stageFieldChanged("region",e)}),ct.createElement(Nt,{specifyTagByRegex:!1,account:a.credentials,digest:a.digest,imageId:a.cluster.imageId,organization:a.organization,registry:a.registry,repository:a.repository,tag:a.tag,showRegistry:!1,onChange:this.dockerChanged,deferInitialization:a.deferredInitialization}),ct.createElement(Ae,{label:"CPU(s)"},ct.createElement(re,{value:a.cluster.resources.cpu,onChange:e=>this.stageFieldChanged("cluster.resources.cpu",e),required:!0})),ct.createElement(Ae,{label:"Memory (MB)"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.memory",e),value:a.cluster.resources.memory,required:!0})),ct.createElement(Ae,{label:"Disk (MB)"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.disk",e),value:a.cluster.resources.disk,required:!0})),ct.createElement(Ae,{label:"Network (Mbps)",helpKey:"titus.deploy.network"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.networkMbps",e),value:a.cluster.resources.networkMbps,required:!0})),ct.createElement(Ae,{label:"GPU(s)",helpKey:"titus.deploy.gpu"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.resources.gpu",e),value:a.cluster.resources.gpu,required:!0})),ct.createElement(Ae,{label:"Entrypoint(s)",helpKey:"titus.deploy.entrypoint"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:l,onChange:e=>this.stageFieldChanged("cluster.entryPointList",e.target.value.split(","))})),ct.createElement(Ae,{label:"Command(s)",helpKey:"titus.deploy.command"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:c,onChange:e=>this.stageFieldChanged("cluster.cmdList",e.target.value.split(","))})),ct.createElement(Ae,{label:"Runtime Limit (Seconds)",helpKey:"titus.deploy.runtimeLimitSecs"},ct.createElement(re,{value:a.cluster.runtimeLimitSecs,onChange:e=>this.stageFieldChanged("cluster.runtimeLimitSecs",e),min:1,required:!0})),ct.createElement(Ae,{label:"Retries",helpKey:"titus.deploy.retries"},ct.createElement(re,{onChange:e=>this.stageFieldChanged("cluster.retries",e),value:a.cluster.retries,min:0,required:!0})),ct.createElement(Ae,{label:"Property File",helpKey:"titus.deploy.propertyFile"},ct.createElement("input",{type:"text",className:"form-control input-sm",onChange:e=>this.stageFieldChanged("propertyFile",e.target.value),value:a.propertyFile})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-9 col-md-offset-1"},ct.createElement("div",{className:"checkbox"},ct.createElement("label",null,ct.createElement("input",{type:"checkbox",checked:a.showAdvancedOptions,onChange:e=>this.stageFieldChanged("showAdvancedOptions",e.target.checked)}),ct.createElement("strong",null,"Show Advanced Options"))))),ct.createElement("div",{className:""+(!0===a.showAdvancedOptions?"collapse.in":"collapse")},ct.createElement("div",{className:"form-group"},ct.createElement("label",{className:"col-md-3 sm-label-right"},ct.createElement("span",{className:"label-text"},"IAM Instance Profile")," ",ct.createElement(ee,{id:"titus.deploy.iamProfile"})),ct.createElement("div",{className:"col-md-4"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:a.cluster.iamProfile,placeholder:this.defaultIamProfile,required:!0,onChange:e=>this.stageFieldChanged("cluster.iamProfile",e.target.value)}),!a.isNew&&!a.cluster.iamProfile&&ct.createElement("a",{className:"small clickable",onClick:()=>this.stageFieldChanged("cluster.iamProfile",this.defaultIamProfile)},"Use suggested default")),ct.createElement("div",{className:"col-md-1 small",style:{whiteSpace:"nowrap",paddingLeft:"0px",paddingTop:"7px"}},"in ",ct.createElement(J,{account:o}))),ct.createElement(Ae,{label:"Capacity Group",fieldColumns:4,helpKey:"titus.job.capacityGroup"},ct.createElement("input",{type:"text",className:"form-control input-sm",value:a.cluster.capacityGroup||"",onChange:e=>this.stageFieldChanged("cluster.capacityGroup",e.target.value)})),ct.createElement(Ae,{label:T.get("Firewalls"),helpKey:"titus.job.securityGroups"},(!a.credentials||!a.cluster.region)&&ct.createElement("div",null,"Account and region must be selected before ",T.get("firewalls")," can be added"),i&&a.credentials&&a.cluster.region&&ct.createElement(_t,{account:a.credentials,region:a.cluster.region,command:a,amazonAccount:o,hideLabel:!0,groupsToEdit:a.cluster.securityGroups,onChange:this.groupsChanged})),ct.createElement(Ae,{label:"Associate IPv6 Address (Recommended)",helpKey:"serverGroup.ipv6"},ct.createElement(dn,{value:a.cluster.containerAttributes["titusParameter.agent.assignIPv6Address"],onChange:e=>this.associateIPv6AddressChanged(e.target.value)})),ct.createElement(Ae,{label:"Disruption Budget",helpKey:"titus.disruptionbudget.description"},ct.createElement(Ee,{initialValues:a.cluster,onSubmit:()=>{},render:e=>ct.createElement(Sn,{formik:e,app:n,runJobView:!0,onStageChange:this.disruptionBudgetChanged})})),ct.createElement(Ae,{label:"Job Attributes (optional)"},ct.createElement(Ne,{model:a.cluster.labels,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.labels",e)})),ct.createElement(Ae,{label:"Container Attributes (optional)"},ct.createElement(Ne,{model:a.cluster.containerAttributes,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.containerAttributes",e)})),ct.createElement(Ae,{label:"Environment Variables (optional)"},ct.createElement(Ne,{model:a.cluster.env,allowEmpty:!0,onChange:e=>this.mapChanged("cluster.env",e)}))),ct.createElement(Ae,{label:"Wait for results",helpKey:"titus.job.waitForCompletion"},ct.createElement("input",{type:"checkbox",className:"input-sm",name:"waitForCompletion",checked:a.waitForCompletion,onChange:e=>this.stageFieldChanged("waitForCompletion",e.target.checked)})))}}H.pipeline.registerStage({provides:"runJob",useBaseProvider:!0,restartable:!0,key:"runJob",cloudProvider:"titus",providesFor:["aws","titus"],component:En,executionDetailsSections:[Qt,Ie],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"}]});t("spinnaker.titus.pipeline.stage.scaleDownClusterStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.pipeline.stage.shrinkClusterStage",[]).config((function(){H.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},k.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')}]);t("spinnaker.titus.react",[]).run(["$injector",function(e){Vt.initialize(e)}]);t("spinnaker.titus.securityGroup.reader",[]).factory("titusSecurityGroupReader",(function(){return{resolveIndexedSecurityGroup:function(e,t,n){return e[t.awsAccount][t.region][n]}}}));e.module("spinnaker.titus.serverGroupCommandBuilder.service",[]).factory("titusServerGroupCommandBuilder",["$q",function(t){function n(e){return(en.defaults.iamProfile||"{{application}}InstanceProfile").replace("{{application}}",e.name)}function a(e,a){const r=(a=a||{}).account||en.defaults.account,i=a.region||en.defaults.region,s=a.zone||en.defaults.zone,o=n(e),l={application:e.name,credentials:r,region:i,zone:s,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:a.mode||"create"},securityGroups:[],imageId:a.imageId,migrationPolicy:{type:"systemDefault"},digest:"",organization:"",tag:"",registry:"",repository:""};return t.when(l)}return{buildNewServerGroupCommand:a,buildNewServerGroupCommandForPipeline:function(){return t.when({viewState:{requiresTemplateSelection:!0}})},buildServerGroupCommandFromExisting:function(e,a,r){r=r||"clone";const i=U.parseServerGroupName(a.name),s="test"===a.awsAccount,o=a.containerAttributes&&void 0!==a.containerAttributes["titusParameter.agent.assignIPv6Address"]?a.containerAttributes["titusParameter.agent.assignIPv6Address"]:s?"true":"false",l={...a.containerAttributes,"titusParameter.agent.assignIPv6Address":o},c={application:e.name,disruptionBudget:a.disruptionBudget,strategy:"",stack:i.stack,freeFormDetails:i.freeFormDetails,account:a.account,credentials:a.account,region:a.region,env:a.env,labels:a.labels,containerAttributes:l,entryPoint:a.entryPoint,iamProfile:a.iamProfile,capacityGroup:a.capacityGroup,migrationPolicy:a.migrationPolicy?a.migrationPolicy:{type:"systemDefault"},securityGroups:a.securityGroups||[],constraints:{hard:a.constraints&&a.constraints.hard||{},soft:a.constraints&&a.constraints.soft||{}},serviceJobProcesses:Object.assign({},a.serviceJobProcesses),inService:!a.disabled,source:{account:a.account,region:a.region,asgName:a.name},resources:{cpu:a.resources.cpu,gpu:a.resources.gpu,memory:a.resources.memory,disk:a.resources.disk,networkMbps:a.resources.networkMbps},targetGroups:a.targetGroups,capacity:{min:a.capacity.min,max:a.capacity.max,desired:a.capacity.desired},targetHealthyDeployPercentage:100,cloudProvider:"titus",selectedProvider:"titus",viewState:{defaultIamProfile:n(e),useSimpleCapacity:a.capacity.min===a.capacity.max,mode:r},organization:"",tag:"",digest:"",registry:"",repository:""};return a.efs?c.efs={mountPoint:a.efs.mountPoint,mountPerm:a.efs.mountPerm,efsId:a.efs.efsId}:c.efs={mountPerm:"RW"},"editPipeline"!==r&&(c.imageId=a.image.dockerImageName+":"+(a.image.dockerImageVersion?a.image.dockerImageVersion:a.image.dockerImageDigest)),t.when(c)},buildServerGroupCommandFromPipeline:function(t,r){const i=St(r),s={account:i.account,imageId:i.imageId,region:i.region};return a(t,s).then((function(a){a.constraints={hard:r.constraints&&r.constraints.hard||r.hardConstraints&&r.hardConstraints.reduce(((e,t)=>Ct(e,t,"true")),{})||{},soft:r.constraints&&r.constraints.soft||r.softConstraints&&r.softConstraints.reduce(((e,t)=>Ct(e,t,"true")),{})||{}},delete i.hardConstraints,delete i.softConstraints;const s={disableImageSelection:!0,useSimpleCapacity:r.capacity.min===r.capacity.max,mode:"editPipeline",submitButtonLabel:"Done",defaultIamProfile:n(t)},o={region:i.region,credentials:i.account,iamProfile:i.iamProfile,viewState:s};i.strategy=i.strategy||"";return e.extend({},a,i,o)}))}}}]);t("spinnaker.serverGroup.configure.titus",["spinnaker.titus.serverGroup.configure.service"]);const kn=class extends ct.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 a="^.^.^.clusters.serverGroup";G.$state.includes("**.clusters.serverGroup")&&(a="^.serverGroup"),G.$state.includes("**.clusters.cluster.serverGroup")&&(a="^.^.serverGroup"),G.$state.includes("**.clusters")&&(a=".serverGroup"),G.$state.go(a,n)}}},this.configureCommand=()=>{const{command:e}=this.props;Vt.titusServerGroupConfigurationService.configureCommand(e).then((()=>{Vt.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,kt(hn(this.props.application),e.disruptionBudget)&&(n={...e,disruptionBudget:void 0}),t?this.props.closeModal&&this.props.closeModal(n):this.state.taskMonitor.submit((()=>G.serverGroupWriter.cloneServerGroup(n,this.props.application)))},this.getLoadBalancerNote=e=>ct.createElement("div",{className:"form-group small",style:{marginTop:"20px"}},ct.createElement("div",{className:"col-md-8 col-md-offset-3"},ct.createElement("p",null,"Only target groups with target type ",ct.createElement("em",null,"ip")," are supported in Titus. It is not possible to re-use target groups of target type ",ct.createElement("em",null,"instance")," used by Amazon instances."," "),void 0!==e.backingData&&void 0!==e.backingData.credentialsKeyedByAccount&&void 0!==e.credentials&&ct.createElement("p",null,"Uses target groups from the Amazon account"," ",ct.createElement(J,{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?ct.createElement("div",{className:"form-group small"},ct.createElement("div",{className:"col-md-9 col-md-offset-3"},"Uses ",T.get("firewalls")," from the Amazon account ",ct.createElement(J,{account:t}))):null};const t=ht(e,"command.viewState.requiresTemplateSelection",!1);t||this.configureCommand(),this.state={firewallsLabel:T.get("Firewalls"),loaded:!1,requiresTemplateSelection:t,taskMonitor:new Pe({application:e.application,title:"Creating your server group",modalInstance:Pe.modalInstanceEmulation((()=>this.props.dismissModal())),onTaskComplete:this.onTaskComplete})}}static show(e){return xe.show(kn,e,{dialogClassName:"wizard-modal modal-lg"})}componentWillUnmount(){this._isUnmounted=!0,this.refreshUnsubscribe&&this.refreshUnsubscribe()}render(){const{application:e,command:t,dismissModal:n,title:a}=this.props,{loaded:r,taskMonitor:i,requiresTemplateSelection:s}=this.state;return s?ct.createElement(De,{application:e,cloudProvider:"titus",command:t,onDismiss:n,onTemplateSelected:this.templateSelected}):ct.createElement(Oe,{heading:a,initialValues:t,loading:!r,taskMonitor:i,dismissModal:n,closeModal:this.submit,submitButtonLabel:t.viewState.submitButtonLabel,render:({formik:t,nextIdx:n,wizard:a})=>ct.createElement(ct.Fragment,null,ct.createElement(Me,{label:"Basic Settings",wizard:a,order:n(),render:({innerRef:n})=>ct.createElement(nn,{ref:n,formik:t,app:e})}),ct.createElement(Me,{label:"Resources",wizard:a,order:n(),render:({innerRef:e})=>ct.createElement(rn,{ref:e,formik:t})}),ct.createElement(Me,{label:"Capacity",wizard:a,order:n(),render:({innerRef:e})=>ct.createElement(u,{ref:e,formik:t})}),ct.createElement(Me,{label:"Load Balancers",wizard:a,order:n(),note:this.getLoadBalancerNote(t.values),render:({innerRef:e})=>ct.createElement(d,{ref:e,formik:t,hideLoadBalancers:!0,targetGroupTypeHelpText:"ip"})}),ct.createElement(Me,{label:T.get("Firewalls"),wizard:a,order:n(),note:this.getSecurityGroupNote(t.values),render:({innerRef:e})=>ct.createElement(m,{ref:e,formik:t})}),ct.createElement(Me,{label:"Job Disruption Budget",wizard:a,order:n(),render:({innerRef:n})=>ct.createElement(Sn,{ref:n,formik:t,app:e})}),ct.createElement(Me,{label:"Advanced Settings",wizard:a,order:n(),render:({innerRef:n})=>ct.createElement(pn,{ref:n,formik:t,app:e})}))})}};let Gn=kn;Gn.defaultProps={closeModal:Le,dismissModal:Le};const{useState:Tn,useEffect:An,useMemo:Nn}=ct;function In(e){const t=e.errors.capacity||{},{min:n,max:a,desired:r}=t;return[n,a,r].find((e=>!!e))}function Pn({formik:e,serverGroup:t,toggleMode:n}){An((()=>{e.setFieldValue("capacity.min",e.values.capacity.desired),e.setFieldValue("capacity.max",e.values.capacity.desired)}),[e.values.capacity.desired]);const a=In(e);return ct.createElement("div",null,ct.createElement("p",null,"Sets min, max, and desired instance counts to the same value."),ct.createElement("p",null,"To allow autoscaling, use the"," ",ct.createElement("a",{className:"clickable",onClick:n},"Advanced Mode"),"."),ct.createElement("div",{className:"form-group row"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Current size"),ct.createElement("div",{className:"col-md-4"},ct.createElement("div",{className:"horizontal middle"},ct.createElement("input",{type:"number",className:"NumberInput form-control",value:t.capacity.desired,disabled:!0}),ct.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),ct.createElement("div",{className:"col-md-4"},ct.createElement("div",{className:"horizontal middle"},ct.createElement(oe,{name:"capacity.desired",input:e=>ct.createElement(Se,{...e,min:0}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0,onChange:()=>{}}),ct.createElement("div",{className:"sp-padding-xs-xaxis"},"instances")))),!!a&&ct.createElement("div",{className:"col-md-offset-3 col-md-9"},ct.createElement(ie,{message:a,type:"error"})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),ct.createElement("div",{className:"col-md-9 sm-control-field"},ct.createElement(Re,{current:t.capacity,next:e.values.capacity}))))}function xn({formik:e,serverGroup:t,toggleMode:n}){const{min:a,max:r}=e.values.capacity||{},i=({value:e})=>ct.createElement("div",{className:"col-md-2"},ct.createElement("input",{className:"NumberInput form-control",type:"number",disabled:!0,value:e})),s=In(e);return ct.createElement("div",null,ct.createElement("p",null,"Sets up auto-scaling for this server group."),ct.createElement("p",null,"To disable auto-scaling, use the"," ",ct.createElement("a",{className:"clickable",onClick:n},"Simple Mode"),"."),ct.createElement("div",{className:"form-group bold"},ct.createElement("div",{className:"col-md-2 col-md-offset-3"},"Min"),ct.createElement("div",{className:"col-md-2"},"Max"),ct.createElement("div",{className:"col-md-2"},"Desired")),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Current"),ct.createElement(i,{value:t.capacity.min}),ct.createElement(i,{value:t.capacity.max}),ct.createElement(i,{value:t.capacity.desired})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Resize to"),ct.createElement("div",{className:"col-md-2"},ct.createElement(oe,{name:"capacity.min",input:e=>ct.createElement(Se,{...e,min:0,max:r}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0})),ct.createElement("div",{className:"col-md-2"},ct.createElement(oe,{name:"capacity.max",input:e=>ct.createElement(Se,{...e,min:a}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0})),ct.createElement("div",{className:"col-md-2"},ct.createElement(oe,{name:"capacity.desired",input:e=>ct.createElement(Se,{...e,min:a,max:r}),layout:({input:e})=>ct.createElement(ct.Fragment,null,e),touched:!0}))),!!s&&ct.createElement("div",{className:"col-md-offset-3 col-md-9"},ct.createElement(ie,{message:s,type:"error"})),ct.createElement("div",{className:"form-group"},ct.createElement("div",{className:"col-md-3 sm-label-right"},"Changes"),ct.createElement("div",{className:"col-md-9 sm-control-field"},ct.createElement(Re,{current:t.capacity,next:e.values.capacity}))))}function Dn(e){const{min:t,max:n,desired:a}=e.capacity,r={};return t>n?r.min=r.max="Min cannot be larger than Max":a<t?r.desired=r.min="Desired cannot be smaller than Min":a>n&&(r.desired=r.max="Desired cannot be larger than Max"),Object.keys(r).length?{capacity:r}:{}}function On(e){const{serverGroup:t,application:n,dismissModal:a}=e,r=Nn((()=>{const{min:e,max:n,desired:a}=t.capacity;return a!==n||a!==e}),[]),[i,s]=Tn(r),o=n.attributes&&n.attributes.platformHealthOnlyShowOverride,[l,c]=Tn(),u=((e,t)=>{const n=Pe.modalInstanceEmulation((()=>t()));return ut((()=>new Pe({modalInstance:n,...e})),[e.application,e.title])})({application:n,title:`Resizing ${t.name}`,onTaskComplete:()=>n.getDataSource("serverGroups").refresh(!0)},a),d=e=>u.submit((()=>G.serverGroupWriter.resizeServerGroup(t,n,e))),m={capacity:t.capacity};return ct.createElement(ct.Fragment,null,ct.createElement(Fe,{monitor:u}),ct.createElement(Ee,{initialValues:m,validate:Dn,onSubmit:d,render:e=>ct.createElement(ct.Fragment,null,ct.createElement(ze,{dismiss:a}),ct.createElement(Lt.Header,null,ct.createElement(Lt.Title,null,"Resize ",t.name)),ct.createElement(Lt.Body,null,ct.createElement(xt,{className:"form-horizontal"},i?ct.createElement(xn,{formik:e,serverGroup:t,toggleMode:()=>s(!1)}):ct.createElement(Pn,{formik:e,serverGroup:t,toggleMode:()=>s(!0)}),o&&ct.createElement(je,{interestingHealthProviderNames:e.values.interestingHealthProviderNames,platformHealthType:"Titus",showHelpDetails:!0,onChange:t=>e.setFieldValue("interestingHealthProviderNames",t||void 0)}))),ct.createElement(Lt.Footer,null,ct.createElement(Be,{account:t.account,onValidChange:c}),ct.createElement("button",{className:"btn btn-default",onClick:a},"Cancel"),ct.createElement("button",{type:"submit",disabled:!l||!e.isValid,className:"btn btn-primary",onClick:()=>d(e.values)},"Submit")))}))}class Mn extends Error{}class Ln extends Mn{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Fn extends Mn{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class zn extends Mn{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class jn extends Mn{}class Bn extends Mn{constructor(e){super(`Invalid unit ${e}`)}}class Rn extends Mn{}class Vn extends Mn{constructor(){super("Zone is an abstract class")}}const Wn="numeric",Hn="short",Zn="long",Un={year:Wn,month:Wn,day:Wn},qn={year:Wn,month:Hn,day:Wn},Jn={year:Wn,month:Zn,day:Wn},$n={year:Wn,month:Zn,day:Wn,weekday:Zn},Kn={hour:Wn,minute:Wn},Xn={hour:Wn,minute:Wn,second:Wn},Yn={hour:Wn,minute:Wn,second:Wn,timeZoneName:Hn},Qn={hour:Wn,minute:Wn,second:Wn,timeZoneName:Zn},_n={hour:Wn,minute:Wn,hour12:!1},ea={hour:Wn,minute:Wn,second:Wn,hour12:!1},ta={hour:Wn,minute:Wn,second:Wn,hour12:!1,timeZoneName:Hn},na={hour:Wn,minute:Wn,second:Wn,hour12:!1,timeZoneName:Zn},aa={year:Wn,month:Wn,day:Wn,hour:Wn,minute:Wn},ra={year:Wn,month:Wn,day:Wn,hour:Wn,minute:Wn,second:Wn},ia={year:Wn,month:Hn,day:Wn,hour:Wn,minute:Wn},sa={year:Wn,month:Hn,day:Wn,hour:Wn,minute:Wn,second:Wn},oa={year:Wn,month:Hn,day:Wn,weekday:Hn,hour:Wn,minute:Wn},la={year:Wn,month:Zn,day:Wn,hour:Wn,minute:Wn,timeZoneName:Hn},ca={year:Wn,month:Zn,day:Wn,hour:Wn,minute:Wn,second:Wn,timeZoneName:Hn},ua={year:Wn,month:Zn,day:Wn,weekday:Zn,hour:Wn,minute:Wn,timeZoneName:Zn},da={year:Wn,month:Zn,day:Wn,weekday:Zn,hour:Wn,minute:Wn,second:Wn,timeZoneName:Zn};function ma(e){return void 0===e}function pa(e){return"number"==typeof e}function ga(e){return"number"==typeof e&&e%1==0}function ha(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function fa(){return!ma(Intl.DateTimeFormat.prototype.formatToParts)}function va(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function ya(e,t,n){if(0!==e.length)return e.reduce(((e,a)=>{const r=[t(a),a];return e&&n(e[0],r[0])===e[0]?e:r}),null)[1]}function ba(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function Ca(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wa(e,t,n){return ga(e)&&e>=t&&e<=n}function Sa(e,t=2){return e.toString().length<t?("0".repeat(t)+e).slice(-t):e.toString()}function Ea(e){return ma(e)||null===e||""===e?void 0:parseInt(e,10)}function ka(e){if(!ma(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Ga(e,t,n=!1){const a=10**t;return(n?Math.trunc:Math.round)(e*a)/a}function Ta(e){return e%4==0&&(e%100!=0||e%400==0)}function Aa(e){return Ta(e)?366:365}function Na(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Ta(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Ia(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 Pa(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,a=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===a?53:52}function xa(e){return e>99?e:e>60?1900+e:2e3+e}function Da(e,t,n,a=null){const r=new Date(e),i={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};a&&(i.timeZone=a);const s=Object.assign({timeZoneName:t},i),o=ha();if(o&&fa()){const e=new Intl.DateTimeFormat(n,s).formatToParts(r).find((e=>"timezonename"===e.type.toLowerCase()));return e?e.value:null}if(o){const e=new Intl.DateTimeFormat(n,i).format(r);return new Intl.DateTimeFormat(n,s).format(r).substring(e.length).replace(/^[, \u200e]+/,"")}return null}function Oa(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const a=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-a:a)}function Ma(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new Rn(`Invalid unit value ${e}`);return t}function La(e,t,n){const a={};for(const r in e)if(Ca(e,r)){if(n.indexOf(r)>=0)continue;const i=e[r];if(null==i)continue;a[t(r)]=Ma(i)}return a}function Fa(e,t){const n=Math.trunc(e/60),a=Math.abs(e%60),r=n>=0&&!Object.is(n,-0)?"+":"-",i=`${r}${Math.abs(n)}`;switch(t){case"short":return`${r}${Sa(Math.abs(n),2)}:${Sa(a,2)}`;case"narrow":return a>0?`${i}:${a}`:i;case"techie":return`${r}${Sa(Math.abs(n),2)}${Sa(a,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function za(e){return ba(e,["hour","minute","second","millisecond"])}const ja=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function Ba(e){return JSON.stringify(e,Object.keys(e).sort())}const Ra=["January","February","March","April","May","June","July","August","September","October","November","December"],Va=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wa=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ha(e){switch(e){case"narrow":return Wa;case"short":return Va;case"long":return Ra;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 Za=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ua=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qa=["M","T","W","T","F","S","S"];function Ja(e){switch(e){case"narrow":return qa;case"short":return Ua;case"long":return Za;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $a=["AM","PM"],Ka=["Before Christ","Anno Domini"],Xa=["BC","AD"],Ya=["B","A"];function Qa(e){switch(e){case"narrow":return Ya;case"short":return Xa;case"long":return Ka;default:return null}}function _a(e,t){let n="";for(const a of e)a.literal?n+=a.val:n+=t(a.val);return n}const er={D:Un,DD:qn,DDD:Jn,DDDD:$n,t:Kn,tt:Xn,ttt:Yn,tttt:Qn,T:_n,TT:ea,TTT:ta,TTTT:na,f:aa,ff:ia,fff:la,ffff:ua,F:ra,FF:sa,FFF:ca,FFFF:da};class tr{static create(e,t={}){return new tr(e,t)}static parseFormat(e){let t=null,n="",a=!1;const r=[];for(let i=0;i<e.length;i++){const s=e.charAt(i);"'"===s?(n.length>0&&r.push({literal:a,val:n}),t=null,n="",a=!a):a||s===t?n+=s:(n.length>0&&r.push({literal:!1,val:n}),n=s,t=s)}return n.length>0&&r.push({literal:a,val:n}),r}static macroTokenToFormatOpts(e){return er[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 Sa(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(),a=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&fa(),r=(t,n)=>this.loc.extract(e,t,n),i=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",s=()=>n?function(e){return $a[e.hour<12?0:1]}(e):r({hour:"numeric",hour12:!0},"dayperiod"),o=(t,a)=>n?function(e,t){return Ha(t)[e.month-1]}(e,t):r(a?{month:t}:{month:t,day:"numeric"},"month"),l=(t,a)=>n?function(e,t){return Ja(t)[e.weekday-1]}(e,t):r(a?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const n=tr.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},u=t=>n?function(e,t){return Qa(t)[e.year<0?0:1]}(e,t):r({era:t},"era");return _a(tr.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 i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({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 s();case"d":return a?r({day:"numeric"},"day"):this.num(e.day);case"dd":return a?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return a?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return a?r({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 a?r({month:"numeric"},"month"):this.num(e.month);case"MM":return a?r({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 a?r({year:"numeric"},"year"):this.num(e.year);case"yy":return a?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return a?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return a?r({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}},a=tr.parseFormat(t),r=a.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]);return _a(a,(e=>t=>{const a=n(t);return a?this.num(e.get(a),t.length):t})(e.shiftTo(...r.map(n).filter((e=>e)))))}}class nr{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class ar{get type(){throw new Vn}get name(){throw new Vn}get universal(){throw new Vn}offsetName(e,t){throw new Vn}formatOffset(e,t){throw new Vn}offset(e){throw new Vn}equals(e){throw new Vn}get isValid(){throw new Vn}}let rr=null;class ir extends ar{static get instance(){return null===rr&&(rr=new ir),rr}get type(){return"local"}get name(){return ha()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Da(e,t,n)}formatOffset(e,t){return Fa(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"local"===e.type}get isValid(){return!0}}const sr=RegExp(`^${ja.source}$`);let or={};const lr={year:0,month:1,day:2,hour:3,minute:4,second:5};let cr={};class ur extends ar{static create(e){return cr[e]||(cr[e]=new ur(e)),cr[e]}static resetCache(){cr={},or={}}static isValidSpecifier(e){return!(!e||!e.match(sr))}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=ur.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get universal(){return!1}offsetName(e,{format:t,locale:n}){return Da(e,t,n,this.name)}formatOffset(e,t){return Fa(this.offset(e),t)}offset(e){const t=new Date(e),n=(c=this.name,or[c]||(or[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"})),or[c]),[a,r,i,s,o,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),a=[];for(let e=0;e<n.length;e++){const{type:t,value:r}=n[e],i=lr[t];ma(i)||(a[i]=parseInt(r,10))}return a}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n),[,r,i,s,o,l,c]=a;return[s,r,i,o,l,c]}(n,t);var c;let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(Ia({year:a,month:r,day:i,hour:24===s?0:s,minute:o,second:l,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let dr=null;class mr extends ar{static get utcInstance(){return null===dr&&(dr=new mr(0)),dr}static instance(e){return 0===e?mr.utcInstance:new mr(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new mr(Oa(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Fa(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Fa(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 pr extends ar{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 gr(e,t){let n;if(ma(e)||null===e)return t;if(e instanceof ar)return e;if("string"==typeof e){const a=e.toLowerCase();return"local"===a?t:"utc"===a||"gmt"===a?mr.utcInstance:null!=(n=ur.parseGMTOffset(e))?mr.instance(n):ur.isValidSpecifier(a)?ur.create(e):mr.parseSpecifier(a)||new pr(e)}return pa(e)?mr.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new pr(e)}let hr=()=>Date.now(),fr=null,vr=null,yr=null,br=null,Cr=!1;class wr{static get now(){return hr}static set now(e){hr=e}static get defaultZoneName(){return wr.defaultZone.name}static set defaultZoneName(e){fr=e?gr(e):null}static get defaultZone(){return fr||ir.instance}static get defaultLocale(){return vr}static set defaultLocale(e){vr=e}static get defaultNumberingSystem(){return yr}static set defaultNumberingSystem(e){yr=e}static get defaultOutputCalendar(){return br}static set defaultOutputCalendar(e){br=e}static get throwOnInvalid(){return Cr}static set throwOnInvalid(e){Cr=e}static resetCaches(){xr.resetCache(),ur.resetCache()}}let Sr={};function Er(e,t={}){const n=JSON.stringify([e,t]);let a=Sr[n];return a||(a=new Intl.DateTimeFormat(e,t),Sr[n]=a),a}let kr={};let Gr={};let Tr=null;function Ar(e,t,n,a,r){const i=e.listingMode(n);return"error"===i?null:"en"===i?a(t):r(t)}class Nr{constructor(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&ha()){const t={useGrouping:!1};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let a=kr[n];return a||(a=new Intl.NumberFormat(e,t),kr[n]=a),a}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Sa(this.floor?Math.floor(e):Ga(e,3),this.padTo)}}class Ir{constructor(e,t,n){let a;if(this.opts=n,this.hasIntl=ha(),e.zone.universal&&this.hasIntl?(a="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Gs.fromMillis(e.ts+60*e.offset*1e3)):"local"===e.zone.type?this.dt=e:(this.dt=e,a=e.zone.name),this.hasIntl){const e=Object.assign({},this.opts);a&&(e.timeZone=a),this.dtf=Er(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(Ba(ba(e,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case Ba(Un):return"M/d/yyyy";case Ba(qn):return"LLL d, yyyy";case Ba(Jn):return"LLLL d, yyyy";case Ba($n):return"EEEE, LLLL d, yyyy";case Ba(Kn):return"h:mm a";case Ba(Xn):return"h:mm:ss a";case Ba(Yn):case Ba(Qn):return"h:mm a";case Ba(_n):return"HH:mm";case Ba(ea):return"HH:mm:ss";case Ba(ta):case Ba(na):return"HH:mm";case Ba(aa):return"M/d/yyyy, h:mm a";case Ba(ia):return"LLL d, yyyy, h:mm a";case Ba(la):return"LLLL d, yyyy, h:mm a";case Ba(ua):return t;case Ba(ra):return"M/d/yyyy, h:mm:ss a";case Ba(sa):return"LLL d, yyyy, h:mm:ss a";case Ba(oa):return"EEE, d LLL yyyy, h:mm a";case Ba(ca):return"LLLL d, yyyy, h:mm:ss a";case Ba(da):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return t}}(this.opts),t=xr.create("en-US");return tr.create(t).formatDateTimeFromString(this.dt,e)}}formatToParts(){return this.hasIntl&&fa()?this.dtf.formatToParts(this.dt.toJSDate()):[]}resolvedOptions(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}}}class Pr{constructor(e,t,n){this.opts=Object.assign({style:"long"},n),!t&&va()&&(this.rtf=function(e,t={}){const{base:n,...a}=t,r=JSON.stringify([e,a]);let i=Gr[r];return i||(i=new Intl.RelativeTimeFormat(e,t),Gr[r]=i),i}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",a=!1){const r={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."]},i=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&i){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${r[e][0]}`;case-1:return n?"yesterday":`last ${r[e][0]}`;case 0:return n?"today":`this ${r[e][0]}`}}const s=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=r[e],u=a?l?c[1]:c[2]||c[1]:l?r[e][0]:e;return s?`${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 xr{static fromOpts(e){return xr.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,a=!1){const r=e||wr.defaultLocale,i=r||(a?"en-US":function(){if(Tr)return Tr;if(ha()){const e=(new Intl.DateTimeFormat).resolvedOptions().locale;return Tr=e&&"und"!==e?e:"en-US",Tr}return Tr="en-US",Tr}()),s=t||wr.defaultNumberingSystem,o=n||wr.defaultOutputCalendar;return new xr(i,s,o,r)}static resetCache(){Tr=null,Sr={},kr={},Gr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return xr.create(e,t,n)}constructor(e,t,n,a){const[r,i,s]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const a=e.substring(0,t);try{n=Er(e).resolvedOptions()}catch(e){n=Er(a).resolvedOptions()}const{numberingSystem:r,calendar:i}=n;return[a,r,i]}}(e);this.locale=r,this.numberingSystem=t||i||null,this.outputCalendar=n||s||null,this.intl=function(e,t,n){return ha()?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=a,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")||ha()&&"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(e=!0){const t=ha()&&fa(),n=this.isEnglish(),a=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t||n&&a||e?!t||n&&a?"en":"intl":"error"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?xr.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 Ar(this,e,n,Ha,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},a=t?"format":"standalone";return this.monthsCache[a][e]||(this.monthsCache[a][e]=function(e){const t=[];for(let n=1;n<=12;n++){const a=Gs.utc(2016,n,1);t.push(e(a))}return t}((e=>this.extract(e,n,"month")))),this.monthsCache[a][e]}))}weekdays(e,t=!1,n=!0){return Ar(this,e,n,Ja,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},a=t?"format":"standalone";return this.weekdaysCache[a][e]||(this.weekdaysCache[a][e]=function(e){const t=[];for(let n=1;n<=7;n++){const a=Gs.utc(2016,11,13+n);t.push(e(a))}return t}((e=>this.extract(e,n,"weekday")))),this.weekdaysCache[a][e]}))}meridiems(e=!0){return Ar(this,void 0,e,(()=>$a),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hour12:!0};this.meridiemCache=[Gs.utc(2016,11,13,9),Gs.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Ar(this,e,t,Qa,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Gs.utc(-40,1,1),Gs.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,n){const a=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===n));return a?a.value:null}numberFormatter(e={}){return new Nr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ir(e,this.intl,t)}relFormatter(e={}){return new Pr(this.intl,this.isEnglish(),e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||ha()&&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 Dr(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Or(...e){return t=>e.reduce((([e,n,a],r)=>{const[i,s,o]=r(t,a);return[Object.assign(e,i),n||s,o]}),[{},null,1]).slice(0,2)}function Mr(e,...t){if(null==e)return[null,null];for(const[n,a]of t){const t=n.exec(e);if(t)return a(t)}return[null,null]}function Lr(...e){return(t,n)=>{const a={};let r;for(r=0;r<e.length;r++)a[e[r]]=Ea(t[n+r]);return[a,null,n+r]}}const Fr=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,zr=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,9}))?)?)?/,jr=RegExp(`${zr.source}${Fr.source}?`),Br=RegExp(`(?:T${jr.source})?`),Rr=Lr("weekYear","weekNumber","weekDay"),Vr=Lr("year","ordinal"),Wr=RegExp(`${zr.source} ?(?:${Fr.source}|(${ja.source}))?`),Hr=RegExp(`(?: ${Wr.source})?`);function Zr(e,t,n){const a=e[t];return ma(a)?n:Ea(a)}function Ur(e,t){return[{year:Zr(e,t),month:Zr(e,t+1,1),day:Zr(e,t+2,1)},null,t+3]}function qr(e,t){return[{hour:Zr(e,t,0),minute:Zr(e,t+1,0),second:Zr(e,t+2,0),millisecond:ka(e[t+3])},null,t+4]}function Jr(e,t){const n=!e[t]&&!e[t+1],a=Oa(e[t+1],e[t+2]);return[{},n?null:mr.instance(a),t+3]}function $r(e,t){return[{},e[t]?ur.create(e[t]):null,t+1]}const Kr=/^-?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 Xr(e){const[t,n,a,r,i,s,o,l,c]=e,u="-"===t[0],d=e=>e&&u?-e:e;return[{years:d(Ea(n)),months:d(Ea(a)),weeks:d(Ea(r)),days:d(Ea(i)),hours:d(Ea(s)),minutes:d(Ea(o)),seconds:d(Ea(l)),milliseconds:d(ka(c))}]}const Yr={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Qr(e,t,n,a,r,i,s){const o={year:2===t.length?xa(Ea(t)):Ea(t),month:Va.indexOf(n)+1,day:Ea(a),hour:Ea(r),minute:Ea(i)};return s&&(o.second=Ea(s)),e&&(o.weekday=e.length>3?Za.indexOf(e)+1:Ua.indexOf(e)+1),o}const _r=/^(?:(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 ei(e){const[,t,n,a,r,i,s,o,l,c,u,d]=e,m=Qr(t,r,a,n,i,s,o);let p;return p=l?Yr[l]:c?0:Oa(u,d),[m,new mr(p)]}const ti=/^(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$/,ni=/^(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$/,ai=/^(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 ri(e){const[,t,n,a,r,i,s,o]=e;return[Qr(t,r,a,n,i,s,o),mr.utcInstance]}function ii(e){const[,t,n,a,r,i,s,o]=e;return[Qr(t,o,n,a,r,i,s),mr.utcInstance]}const si=Dr(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Br),oi=Dr(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Br),li=Dr(/(\d{4})-?(\d{3})/,Br),ci=Dr(jr),ui=Or(Ur,qr,Jr),di=Or(Rr,qr,Jr),mi=Or(Vr,qr),pi=Or(qr,Jr);const gi=Dr(/(\d{4})-(\d\d)-(\d\d)/,Hr),hi=Dr(Wr),fi=Or(Ur,qr,Jr,$r),vi=Or(qr,Jr,$r);const yi={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}},bi=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}},yi),Ci=Object.assign({years:{months:12,weeks:52.1775,days:365.2425,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:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},yi),wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Si=wi.slice(0).reverse();function Ei(e,t,n=!1){const a={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ti(a)}function ki(e,t,n,a,r){const i=e[r][n],s=t[n]/i,o=!(Math.sign(s)===Math.sign(a[r]))&&0!==a[r]&&Math.abs(s)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(s):Math.trunc(s);a[r]+=o,t[n]-=o*i}function Gi(e,t){Si.reduce(((n,a)=>ma(t[a])?n:(n&&ki(e,t,n,t,a),a)),null)}class Ti{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||xr.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ci:bi,this.isLuxonDuration=!0}static fromMillis(e,t){return Ti.fromObject(Object.assign({milliseconds:e},t))}static fromObject(e){if(null==e||"object"!=typeof e)throw new Rn("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Ti({values:La(e,Ti.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:xr.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromISO(e,t){const[n]=function(e){return Mr(e,[Kr,Xr])}(e);if(n){const e=Object.assign(n,t);return Ti.fromObject(e)}return Ti.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Rn("need to specify a reason the Duration is invalid");const n=e instanceof nr?e:new nr(e,t);if(wr.throwOnInvalid)throw new zn(n);return new Ti({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 Bn(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?tr.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+=Ga(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=Ai(e),n={};for(const e of wi)(Ca(t.values,e)||Ca(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Ei(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Ai(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]=Ma(e(this.values[n],n));return Ei(this,{values:t},!0)}get(e){return this[Ti.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Ei(this,{values:Object.assign(this.values,La(e,Ti.normalizeUnit,[]))})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(a.conversionAccuracy=n),Ei(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Gi(this.matrix,e),Ei(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Ti.normalizeUnit(e)));const t={},n={},a=this.toObject();let r;Gi(this.matrix,a);for(const i of wi)if(e.indexOf(i)>=0){r=i;let e=0;for(const t in n)e+=this.matrix[t][i]*n[t],n[t]=0;pa(a[i])&&(e+=a[i]);const s=Math.trunc(e);t[i]=s,n[i]=e-s;for(const e in a)wi.indexOf(e)>wi.indexOf(i)&&ki(this.matrix,a,e,t,i)}else pa(a[i])&&(n[i]=a[i]);for(const e in n)0!==n[e]&&(t[r]+=e===r?n[e]:n[e]/this.matrix[r][e]);return Ei(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 Ei(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 wi)if(this.values[t]!==e.values[t])return!1;return!0}}function Ai(e){if(pa(e))return Ti.fromMillis(e);if(Ti.isDuration(e))return e;if("object"==typeof e)return Ti.fromObject(e);throw new Rn(`Unknown duration argument ${e} of type ${typeof e}`)}const Ni="Invalid Interval";class Ii{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 Rn("need to specify a reason the Interval is invalid");const n=e instanceof nr?e:new nr(e,t);if(wr.throwOnInvalid)throw new Fn(n);return new Ii({invalid:n})}static fromDateTimes(e,t){const n=Ts(e),a=Ts(t),r=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Ii.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:Ii.invalid("missing or invalid end"):Ii.invalid("missing or invalid start")}(n,a);return null==r?new Ii({start:n,end:a}):r}static after(e,t){const n=Ai(t),a=Ts(e);return Ii.fromDateTimes(a,a.plus(n))}static before(e,t){const n=Ai(t),a=Ts(e);return Ii.fromDateTimes(a.minus(n),a)}static fromISO(e,t){const[n,a]=(e||"").split("/",2);if(n&&a){const e=Gs.fromISO(n,t),r=Gs.fromISO(a,t);if(e.isValid&&r.isValid)return Ii.fromDateTimes(e,r);if(e.isValid){const n=Ti.fromISO(a,t);if(n.isValid)return Ii.after(e,n)}else if(r.isValid){const e=Ti.fromISO(n,t);if(e.isValid)return Ii.before(r,e)}}return Ii.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?Ii.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ts).filter((e=>this.contains(e))).sort(),n=[];let{s:a}=this,r=0;for(;a<this.e;){const e=t[r]||this.e,i=+e>+this.e?this.e:e;n.push(Ii.fromDateTimes(a,i)),a=i,r+=1}return n}splitBy(e){const t=Ai(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,a,{s:r}=this;const i=[];for(;r<this.e;)n=r.plus(t),a=+n>+this.e?this.e:n,i.push(Ii.fromDateTimes(r,a)),r=a;return i}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:Ii.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 Ii.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 a=[],r=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),i=Array.prototype.concat(...r).sort(((e,t)=>e.time-t.time));for(const e of i)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!=+e.time&&a.push(Ii.fromDateTimes(t,e.time)),t=null);return Ii.merge(a)}difference(...e){return Ii.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ni}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ni}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ni}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ni}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ni}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Ti.invalid(this.invalidReason)}mapEndpoints(e){return Ii.fromDateTimes(e(this.s),e(this.e))}}class Pi{static hasDST(e=wr.defaultZone){const t=Gs.local().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ur.isValidSpecifier(e)&&ur.isValidZone(e)}static normalizeZone(e){return gr(e,wr.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:a="gregory"}={}){return xr.create(t,n,a).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,outputCalendar:a="gregory"}={}){return xr.create(t,n,a).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null}={}){return xr.create(t,n,null).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null}={}){return xr.create(t,n,null).weekdays(e,!0)}static meridiems({locale:e=null}={}){return xr.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return xr.create(t,null,"gregory").eras(e)}static features(){let e=!1,t=!1,n=!1,a=!1;if(ha()){e=!0,t=fa(),a=va();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:a}}}function xi(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),a=n(t)-n(e);return Math.floor(Ti.fromMillis(a).as("days"))}function Di(e,t,n,a){let[r,i,s,o]=function(e,t,n){const a=[["years",(e,t)=>t.year-e.year],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=xi(e,t);return(n-n%7)/7}],["days",xi]],r={};let i,s;for(const[o,l]of a)if(n.indexOf(o)>=0){i=o;let n=l(e,t);s=e.plus({[o]:n}),s>t?(e=e.plus({[o]:n-1}),n-=1):e=s,r[o]=n}return[e,r,s,i]}(e,t,n);const l=t-r,c=n.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(s<t&&(s=r.plus({[o]:1})),s!==r&&(i[o]=(i[o]||0)+l/(s-r)));const u=Ti.fromObject(Object.assign(i,a));return c.length>0?Ti.fromMillis(l,a).shiftTo(...c).plus(u):u}const Oi={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mi={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]},Li=Oi.hanidec.replace(/[\[|\]]/g,"").split("");function Fi({numberingSystem:e},t=""){return new RegExp(`${Oi[e||"latn"]}${t}`)}function zi(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 a=e.charCodeAt(n);if(-1!==e[n].search(Oi.hanidec))t+=Li.indexOf(e[n]);else for(const e in Mi){const[n,r]=Mi[e];a>=n&&a<=r&&(t+=a-n)}}return parseInt(t,10)}return t}(e))}}function ji(e){return e.replace(/\./,"\\.?")}function Bi(e){return e.replace(/\./,"").toLowerCase()}function Ri(e,t){return null===e?null:{regex:RegExp(e.map(ji).join("|")),deser:([n])=>e.findIndex((e=>Bi(n)===Bi(e)))+t}}function Vi(e,t){return{regex:e,deser:([,e,t])=>Oa(e,t),groups:t}}function Wi(e){return{regex:e,deser:([e])=>e}}const Hi={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 Zi=null;function Ui(e,t){if(e.literal)return e;const n=tr.macroTokenToFormatOpts(e.val);if(!n)return e;const a=tr.create(t,n).formatDateTimeParts((Zi||(Zi=Gs.fromMillis(1555555555555)),Zi)).map((e=>function(e,t,n){const{type:a,value:r}=e;if("literal"===a)return{literal:!0,val:r};const i=n[a];let s=Hi[a];return"object"==typeof s&&(s=s[i]),s?{literal:!1,val:s}:void 0}(e,0,n)));return a.includes(void 0)?e:a}function qi(e,t,n){const a=function(e,t){return Array.prototype.concat(...e.map((e=>Ui(e,t))))}(tr.parseFormat(n),e),r=a.map((t=>function(e,t){const n=Fi(t),a=Fi(t,"{2}"),r=Fi(t,"{3}"),i=Fi(t,"{4}"),s=Fi(t,"{6}"),o=Fi(t,"{1,2}"),l=Fi(t,"{1,3}"),c=Fi(t,"{1,6}"),u=Fi(t,"{1,9}"),d=Fi(t,"{2,4}"),m=Fi(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 Ri(t.eras("short",!1),0);case"GG":return Ri(t.eras("long",!1),0);case"y":return zi(c);case"yy":return zi(d,xa);case"yyyy":return zi(i);case"yyyyy":return zi(m);case"yyyyyy":return zi(s);case"M":return zi(o);case"MM":return zi(a);case"MMM":return Ri(t.months("short",!0,!1),1);case"MMMM":return Ri(t.months("long",!0,!1),1);case"L":return zi(o);case"LL":return zi(a);case"LLL":return Ri(t.months("short",!1,!1),1);case"LLLL":return Ri(t.months("long",!1,!1),1);case"d":return zi(o);case"dd":return zi(a);case"o":return zi(l);case"ooo":return zi(r);case"HH":return zi(a);case"H":return zi(o);case"hh":return zi(a);case"h":return zi(o);case"mm":return zi(a);case"m":case"q":return zi(o);case"qq":return zi(a);case"s":return zi(o);case"ss":return zi(a);case"S":return zi(l);case"SSS":return zi(r);case"u":return Wi(u);case"a":return Ri(t.meridiems(),0);case"kkkk":return zi(i);case"kk":return zi(d,xa);case"W":return zi(o);case"WW":return zi(a);case"E":case"c":return zi(n);case"EEE":return Ri(t.weekdays("short",!1,!1),1);case"EEEE":return Ri(t.weekdays("long",!1,!1),1);case"ccc":return Ri(t.weekdays("short",!0,!1),1);case"cccc":return Ri(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Vi(new RegExp(`([+-]${o.source})(?::(${a.source}))?`),2);case"ZZZ":return Vi(new RegExp(`([+-]${o.source})(${a.source})?`),2);case"z":return Wi(/[a-z_+-/]{1,256}?/i);default:return p(g)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e))),i=r.find((e=>e.invalidReason));if(i)return{input:t,tokens:a,invalidReason:i.invalidReason};{const[e,n]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(r),i=RegExp(e,"i"),[s,o]=function(e,t,n){const a=e.match(t);if(a){const e={};let t=1;for(const r in n)if(Ca(n,r)){const i=n[r],s=i.groups?i.groups+1:1;!i.literal&&i.token&&(e[i.token.val[0]]=i.deser(a.slice(t,t+s))),t+=s}return[a,e]}return[a,{}]}(t,i,n),[l,c]=o?function(e){let t;return t=ma(e.Z)?ma(e.z)?null:ur.create(e.z):new mr(e.Z),ma(e.q)||(e.M=3*(e.q-1)+1),ma(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),ma(e.u)||(e.S=ka(e.u)),[Object.keys(e).reduce(((t,n)=>{const a=(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 a&&(t[a]=e[n]),t}),{}),t]}(o):[null,null];if(Ca(o,"a")&&Ca(o,"H"))throw new jn("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:a,regex:i,rawMatches:s,matches:o,result:l,zone:c}}}const Ji=[0,31,59,90,120,151,181,212,243,273,304,334],$i=[0,31,60,91,121,152,182,213,244,274,305,335];function Ki(e,t){return new nr("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Xi(e,t,n){const a=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===a?7:a}function Yi(e,t,n){return n+(Ta(e)?$i:Ji)[t-1]}function Qi(e,t){const n=Ta(e)?$i:Ji,a=n.findIndex((e=>e<t));return{month:a+1,day:t-n[a]}}function _i(e){const{year:t,month:n,day:a}=e,r=Yi(t,n,a),i=Xi(t,n,a);let s,o=Math.floor((r-i+10)/7);return o<1?(s=t-1,o=Pa(s)):o>Pa(t)?(s=t+1,o=1):s=t,Object.assign({weekYear:s,weekNumber:o,weekday:i},za(e))}function es(e){const{weekYear:t,weekNumber:n,weekday:a}=e,r=Xi(t,1,4),i=Aa(t);let s,o=7*n+a-r-3;o<1?(s=t-1,o+=Aa(s)):o>i?(s=t+1,o-=Aa(t)):s=t;const{month:l,day:c}=Qi(s,o);return Object.assign({year:s,month:l,day:c},za(e))}function ts(e){const{year:t,month:n,day:a}=e,r=Yi(t,n,a);return Object.assign({year:t,ordinal:r},za(e))}function ns(e){const{year:t,ordinal:n}=e,{month:a,day:r}=Qi(t,n);return Object.assign({year:t,month:a,day:r},za(e))}function as(e){const t=ga(e.year),n=wa(e.month,1,12),a=wa(e.day,1,Na(e.year,e.month));return t?n?!a&&Ki("day",e.day):Ki("month",e.month):Ki("year",e.year)}function rs(e){const{hour:t,minute:n,second:a,millisecond:r}=e,i=wa(t,0,23)||24===t&&0===n&&0===a&&0===r,s=wa(n,0,59),o=wa(a,0,59),l=wa(r,0,999);return i?s?o?!l&&Ki("millisecond",r):Ki("second",a):Ki("minute",n):Ki("hour",t)}const is="Invalid DateTime";function ss(e){return new nr("unsupported zone",`the zone "${e.name}" is not supported`)}function os(e){return null===e.weekData&&(e.weekData=_i(e.c)),e.weekData}function ls(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Gs(Object.assign({},n,t,{old:n}))}function cs(e,t,n){let a=e-60*t*1e3;const r=n.offset(a);if(t===r)return[a,t];a-=60*(r-t)*1e3;const i=n.offset(a);return r===i?[a,r]:[e-60*Math.min(r,i)*1e3,Math.max(r,i)]}function us(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 ds(e,t,n){return cs(Ia(e),t,n)}function ms(e,t){const n=Object.keys(t.values);-1===n.indexOf("milliseconds")&&n.push("milliseconds"),t=t.shiftTo(...n);const a=e.o,r=e.c.year+t.years,i=e.c.month+t.months+3*t.quarters,s=Object.assign({},e.c,{year:r,month:i,day:Math.min(e.c.day,Na(r,i))+t.days+7*t.weeks}),o=Ti.fromObject({hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Ia(s);let[c,u]=cs(l,a,e.zone);return 0!==o&&(c+=o,u=e.zone.offset(c)),{ts:c,o:u}}function ps(e,t,n,a,r){const{setZone:i,zone:s}=n;if(e&&0!==Object.keys(e).length){const a=t||s,r=Gs.fromObject(Object.assign(e,n,{zone:a,setZone:void 0}));return i?r:r.setZone(s)}return Gs.invalid(new nr("unparsable",`the input "${r}" can't be parsed as ${a}`))}function gs(e,t,n=!0){return e.isValid?tr.create(xr.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function hs(e,{suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:a,includeZone:r=!1,spaceZone:i=!1,format:s="extended"}){let o="basic"===s?"HHmm":"HH:mm";return t&&0===e.second&&0===e.millisecond||(o+="basic"===s?"ss":":ss",n&&0===e.millisecond||(o+=".SSS")),(r||a)&&i&&(o+=" "),r?o+="z":a&&(o+="basic"===s?"ZZZ":"ZZ"),gs(e,o)}const fs={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ys={ordinal:1,hour:0,minute:0,second:0,millisecond:0},bs=["year","month","day","hour","minute","second","millisecond"],Cs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ws=["year","ordinal","hour","minute","second","millisecond"];function Ss(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 Bn(e);return t}function Es(e,t){for(const t of bs)ma(e[t])&&(e[t]=fs[t]);const n=as(e)||rs(e);if(n)return Gs.invalid(n);const a=wr.now(),r=t.offset(a),[i,s]=ds(e,r,t);return new Gs({ts:i,zone:t,o:s})}function ks(e,t,n){const a=!!ma(n.round)||n.round,r=(e,r)=>{e=Ga(e,a||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,r)},i=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return r(i(n.unit),n.unit);for(const e of n.units){const t=i(e);if(Math.abs(t)>=1)return r(t,e)}return r(0,n.units[n.units.length-1])}class Gs{constructor(e){const t=e.zone||wr.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new nr("invalid input"):null)||(t.isValid?null:ss(t));this.ts=ma(e.ts)?wr.now():e.ts;let a=null,r=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[a,r]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);a=us(this.ts,e),n=Number.isNaN(a.year)?new nr("invalid input"):null,a=n?null:a,r=n?null:e}}this._zone=t,this.loc=e.loc||xr.create(),this.invalid=n,this.weekData=null,this.c=a,this.o=r,this.isLuxonDateTime=!0}static local(e,t,n,a,r,i,s){return ma(e)?new Gs({ts:wr.now()}):Es({year:e,month:t,day:n,hour:a,minute:r,second:i,millisecond:s},wr.defaultZone)}static utc(e,t,n,a,r,i,s){return ma(e)?new Gs({ts:wr.now(),zone:mr.utcInstance}):Es({year:e,month:t,day:n,hour:a,minute:r,second:i,millisecond:s},mr.utcInstance)}static fromJSDate(e,t={}){const n=(a=e,"[object Date]"===Object.prototype.toString.call(a)?e.valueOf():NaN);var a;if(Number.isNaN(n))return Gs.invalid("invalid input");const r=gr(t.zone,wr.defaultZone);return r.isValid?new Gs({ts:n,zone:r,loc:xr.fromObject(t)}):Gs.invalid(ss(r))}static fromMillis(e,t={}){if(pa(e))return e<-864e13||e>864e13?Gs.invalid("Timestamp out of range"):new Gs({ts:e,zone:gr(t.zone,wr.defaultZone),loc:xr.fromObject(t)});throw new Rn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(pa(e))return new Gs({ts:1e3*e,zone:gr(t.zone,wr.defaultZone),loc:xr.fromObject(t)});throw new Rn("fromSeconds requires a numerical input")}static fromObject(e){const t=gr(e.zone,wr.defaultZone);if(!t.isValid)return Gs.invalid(ss(t));const n=wr.now(),a=t.offset(n),r=La(e,Ss,["zone","locale","outputCalendar","numberingSystem"]),i=!ma(r.ordinal),s=!ma(r.year),o=!ma(r.month)||!ma(r.day),l=s||o,c=r.weekYear||r.weekNumber,u=xr.fromObject(e);if((l||i)&&c)throw new jn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new jn("Can't mix ordinal dates with month/day");const d=c||r.weekday&&!l;let m,p,g=us(n,a);d?(m=Cs,p=vs,g=_i(g)):i?(m=ws,p=ys,g=ts(g)):(m=bs,p=fs);let h=!1;for(const e of m){ma(r[e])?r[e]=h?p[e]:g[e]:h=!0}const f=(d?function(e){const t=ga(e.weekYear),n=wa(e.weekNumber,1,Pa(e.weekYear)),a=wa(e.weekday,1,7);return t?n?!a&&Ki("weekday",e.weekday):Ki("week",e.week):Ki("weekYear",e.weekYear)}(r):i?function(e){const t=ga(e.year),n=wa(e.ordinal,1,Aa(e.year));return t?!n&&Ki("ordinal",e.ordinal):Ki("year",e.year)}(r):as(r))||rs(r);if(f)return Gs.invalid(f);const v=d?es(r):i?ns(r):r,[y,b]=ds(v,a,t),C=new Gs({ts:y,zone:t,o:b,loc:u});return r.weekday&&l&&e.weekday!==C.weekday?Gs.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[n,a]=function(e){return Mr(e,[si,ui],[oi,di],[li,mi],[ci,pi])}(e);return ps(n,a,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,a]=function(e){return Mr(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[_r,ei])}(e);return ps(n,a,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,a]=function(e){return Mr(e,[ti,ri],[ni,ri],[ai,ii])}(e);return ps(n,a,t,"HTTP",t)}static fromFormat(e,t,n={}){if(ma(e)||ma(t))throw new Rn("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:r=null}=n,i=xr.fromOpts({locale:a,numberingSystem:r,defaultToEN:!0}),[s,o,l]=function(e,t,n){const{result:a,zone:r,invalidReason:i}=qi(e,t,n);return[a,r,i]}(i,e,t);return l?Gs.invalid(l):ps(s,o,n,`format ${t}`,e)}static fromString(e,t,n={}){return Gs.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,a]=function(e){return Mr(e,[gi,fi],[hi,vi])}(e);return ps(n,a,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Rn("need to specify a reason the DateTime is invalid");const n=e instanceof nr?e:new nr(e,t);if(wr.throwOnInvalid)throw new Ln(n);return new Gs({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?os(this).weekYear:NaN}get weekNumber(){return this.isValid?os(this).weekNumber:NaN}get weekday(){return this.isValid?os(this).weekday:NaN}get ordinal(){return this.isValid?ts(this.c).ordinal:NaN}get monthShort(){return this.isValid?Pi.months("short",{locale:this.locale})[this.month-1]:null}get monthLong(){return this.isValid?Pi.months("long",{locale:this.locale})[this.month-1]:null}get weekdayShort(){return this.isValid?Pi.weekdays("short",{locale:this.locale})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Pi.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 Ta(this.year)}get daysInMonth(){return Na(this.year,this.month)}get daysInYear(){return this.isValid?Aa(this.year):NaN}get weeksInWeekYear(){return this.isValid?Pa(this.weekYear):NaN}resolvedLocaleOpts(e={}){const{locale:t,numberingSystem:n,calendar:a}=tr.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:a}}toUTC(e=0,t={}){return this.setZone(mr.instance(e),t)}toLocal(){return this.setZone(wr.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=gr(e,wr.defaultZone)).equals(this.zone))return this;if(e.isValid){let a=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[a]=ds(n,t,e)}return ls(this,{ts:a,zone:e})}return Gs.invalid(ss(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return ls(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=La(e,Ss,[]);let n;!ma(t.weekYear)||!ma(t.weekNumber)||!ma(t.weekday)?n=es(Object.assign(_i(this.c),t)):ma(t.ordinal)?(n=Object.assign(this.toObject(),t),ma(t.day)&&(n.day=Math.min(Na(n.year,n.month),n.day))):n=ns(Object.assign(ts(this.c),t));const[a,r]=ds(n,this.o,this.zone);return ls(this,{ts:a,o:r})}plus(e){if(!this.isValid)return this;return ls(this,ms(this,Ai(e)))}minus(e){if(!this.isValid)return this;return ls(this,ms(this,Ai(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=Ti.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?tr.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):is}toLocaleString(e=Un){return this.isValid?tr.create(this.loc.clone(e),e).formatDateTime(this):is}toLocaleParts(e={}){return this.isValid?tr.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),gs(this,t)}toISOWeekDate(){return gs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,format:a="extended"}={}){return hs(this,{suppressSeconds:t,suppressMilliseconds:e,includeOffset:n,format:a})}toRFC2822(){return gs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return gs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return gs(this,"yyyy-MM-dd")}toSQLTime({includeOffset:e=!0,includeZone:t=!1}={}){return hs(this,{includeOffset:e,includeZone:t,spaceZone:!0})}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():is}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 Ti.invalid(this.invalid||e.invalid,"created by diffing an invalid DateTime");const a=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),r=(o=t,Array.isArray(o)?o:[o]).map(Ti.normalizeUnit),i=e.valueOf()>this.valueOf(),s=Di(i?this:e,i?e:this,r,a);var o;return i?s.negate():s}diffNow(e="milliseconds",t={}){return this.diff(Gs.local(),e,t)}until(e){return this.isValid?Ii.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||Gs.fromObject({zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;return ks(t,this.plus(n),Object.assign(e,{numeric:"always",units:["years","months","days","hours","minutes","seconds"]}))}toRelativeCalendar(e={}){return this.isValid?ks(e.base||Gs.fromObject({zone:this.zone}),this,Object.assign(e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(Gs.isDateTime))throw new Rn("min requires all arguments be DateTimes");return ya(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(Gs.isDateTime))throw new Rn("max requires all arguments be DateTimes");return ya(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:a=null,numberingSystem:r=null}=n;return qi(xr.fromOpts({locale:a,numberingSystem:r,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Gs.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return Un}static get DATE_MED(){return qn}static get DATE_FULL(){return Jn}static get DATE_HUGE(){return $n}static get TIME_SIMPLE(){return Kn}static get TIME_WITH_SECONDS(){return Xn}static get TIME_WITH_SHORT_OFFSET(){return Yn}static get TIME_WITH_LONG_OFFSET(){return Qn}static get TIME_24_SIMPLE(){return _n}static get TIME_24_WITH_SECONDS(){return ea}static get TIME_24_WITH_SHORT_OFFSET(){return ta}static get TIME_24_WITH_LONG_OFFSET(){return na}static get DATETIME_SHORT(){return aa}static get DATETIME_SHORT_WITH_SECONDS(){return ra}static get DATETIME_MED(){return ia}static get DATETIME_MED_WITH_SECONDS(){return sa}static get DATETIME_MED_WITH_WEEKDAY(){return oa}static get DATETIME_FULL(){return la}static get DATETIME_FULL_WITH_SECONDS(){return ca}static get DATETIME_HUGE(){return ua}static get DATETIME_HUGE_WITH_SECONDS(){return da}}function Ts(e){if(Gs.isDateTime(e))return e;if(e&&e.valueOf&&pa(e.valueOf()))return Gs.fromJSDate(e);if(e&&"object"==typeof e)return Gs.fromObject(e);throw new Rn(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const As=({dismissModal:e,serverGroup:t})=>{const{result:n,status:a,error:r}=P((()=>Ze.getScalingActivities(t)),[],[t.id]),i="PENDING"===a;return lt.createElement(lt.Fragment,null,lt.createElement(Ve,null,`Scaling activities for ${t.name}`),lt.createElement(We,null,lt.createElement("div",{className:"flex-1 heading-3"},i&<.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},lt.createElement(M,null)),!i&&Boolean(r)&<.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},lt.createElement("h4",null,`There was an error loading scaling activities for ${t.name}. Please try again later.`)),!i&&!r&&!Boolean(n.length)&<.createElement("div",{className:"horizontal center sp-margin-xl-yaxis"},lt.createElement("h4",null,`No scaling activities found for ${t.name}.`)),!i&&!r&&Boolean(n.length)&<.createElement("div",{className:"middle sp-margin-xl-yaxis"},n.map(((e,t)=>{var n;return lt.createElement("div",{key:`${t}-${e.jobId}`,className:"sp-margin-xl-yaxis"},lt.createElement("p",{className:"clearfix"},lt.createElement("span",{className:`label label-${"KillInitiated"!==e.jobState?"success":"danger"} pull-left`},e.jobState),lt.createElement("span",{className:"label label-default pull-right"},(e=>{const t=new Date(e);return Gs.fromJSDate(t).toFormat("yyyy-MM-dd HH:mm:ss ZZZZ")})(e.date))),lt.createElement("p",null,`${e.reasonMessage} Desired capacity is ${(null==(n=e.capacity)?void 0:n.desired)||"unknown"}.`))}))))),lt.createElement(He,{primaryActions:lt.createElement("button",{className:"btn btn-primary",onClick:e},"Close")}))};var Ns=Object.defineProperty,Is=Object.getOwnPropertyDescriptor;let Ps=class extends ct.Component{render(){const{serverGroup:e,app:t}=this.props,{capacity:n}=e,a=e.instances.length,r=n.min===n.max;return ct.createElement(ct.Fragment,null,ct.createElement("dl",{className:"dl-horizontal dl-narrow"},ct.createElement(Ue,{capacity:n,simpleMode:r}),ct.createElement(qe,{currentCapacity:a}),e.capacityGroup&&ct.createElement(ct.Fragment,null,ct.createElement("dt",null,"Cap. Group"),ct.createElement("dd",null,e.capacityGroup))),ct.createElement("div",null,ct.createElement("a",{className:"clickable",onClick:()=>Ke(e,t).then((n=>{n&&xe.show(On,{serverGroup:e,application:t})}))},"Resize Server Group")),ct.createElement("div",null,ct.createElement("a",{className:"clickable",onClick:()=>Je(As,{serverGroup:e},{maxWidth:"1000px"})},"View Scaling Activities")))}};Ps=((e,t,n,a)=>{for(var r,i=a>1?void 0:a?Is(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a?r(t,n,i):r(i))||i);return a&&i&&Ns(t,n,i),i})([$e("titus.serverGroup.CapacityDetailsSection")],Ps);t("titus.servergroup.details.capacitydetailssection",[]).component("titusCapacityDetailsSection",Mt(Xe(Ps,"titusCapacityDetailsSection"),["serverGroup","app"]));var xs=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor;let Os=class extends ct.Component{render(){if(!this.props.serverGroup||!this.props.serverGroup.image)return null;const{serverGroup:{image:e,entryPoint:t,iamProfile:n,resources:a}}=this.props;return ct.createElement(b,{className:"horizontal-when-filters-collapsed"},e.dockerImageName&&ct.createElement(C,{label:"Image Name",value:e.dockerImageName}),e.dockerImageVersion&&ct.createElement(C,{label:"Image Version",value:e.dockerImageVersion}),t&&ct.createElement(C,{label:"Entrypoint",value:t}),n&&ct.createElement(C,{label:"IAM Profile",value:n}),ct.createElement(C,{label:"CPU(s)",value:a.cpu}),ct.createElement(C,{label:"Memory",value:`${a.memory} MB`}),ct.createElement(C,{label:"Disk",value:`${a.disk} MB`}),ct.createElement(C,{label:"Network",value:`${a.networkMbps} Mbps`}),ct.createElement(C,{label:"GPU(s)",value:a.gpu}))}};Os=((e,t,n,a)=>{for(var r,i=a>1?void 0:a?Ds(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a?r(t,n,i):r(i))||i);return a&&i&&xs(t,n,i),i})([$e("titus.serverGroup.launchConfigSection")],Os);t("titus.servergroup.details.launchConfigSection",[]).component("titusLaunchConfigSection",Mt(Xe(Os,"titusLaunchConfigSection"),["serverGroup"]));class Ms extends ct.Component{static show(e){return xe.show(Ms,e)}submit(e,t){const{application:n,serverGroup:a}=this.props,r={type:"upsertDisruptionBudget",cloudProvider:"titus",credentials:a.account,region:a.region,jobId:a.id,disruptionBudget:e.disruptionBudget};t.submit((()=>Ye.executeTask({job:[r],application:n,description:`Update Disruption Budget for ${a.name}`})))}render(){const{application:e,command:t,dismissModal:n}=this.props,a=new Pe({application:e,title:"Updating Job Disruption Budget",modalInstance:Pe.modalInstanceEmulation((()=>n())),onTaskComplete:()=>e.serverGroups.refresh()});return ct.createElement(ct.Fragment,null,ct.createElement(Fe,{monitor:a}),ct.createElement(Ee,{initialValues:t,onSubmit:e=>this.submit(e,a),render:t=>ct.createElement(ct.Fragment,null,ct.createElement(ze,{dismiss:n}),ct.createElement(Lt.Header,null,ct.createElement(Lt.Title,null,"Update Disruption Budget")),ct.createElement(Lt.Body,null,ct.createElement(Sn,{formik:t,app:e})),ct.createElement(Lt.Footer,null,ct.createElement("button",{className:"btn btn-default",onClick:n,type:"button"},"Cancel"),ct.createElement(Qe,{onClick:()=>this.submit(t.values,a),isDisabled:!t.isValid,isFormSubmit:!0,submitting:!1,label:"Update Budget"})))}))}}class Ls extends ct.Component{constructor(){super(...arguments),this.SectionHeading=({budget:e,options:t,label:n})=>{const a=t.find((t=>!!e[t.field]));return a?ct.createElement("div",null,ct.createElement("div",{className:"bold"},n),a.label," ",ct.createElement(ee,{content:a.description})):null},this.Policy=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.availabilityPercentageLimit?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Percentage of Healthy Containers"),e.availabilityPercentageLimit.percentageOfHealthyContainers," percent"):e.relocationLimit?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Limit"),e.relocationLimit.limit," task",1!==e.relocationLimit.limit&&"s"):e.unhealthyTasksLimit?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Limit of Unhealthy Containers"),e.unhealthyTasksLimit.limitOfUnhealthyContainers," container",1!==e.unhealthyTasksLimit.limitOfUnhealthyContainers&&"s"):e.selfManaged?ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Relocation Time"),e.selfManaged.relocationTimeMs>0&&ct.createElement(t,{durationMs:e.selfManaged.relocationTimeMs}),0===e.selfManaged.relocationTimeMs&&"0 ms (immediate)"):null},this.ParentheticalDuration=({durationMs:e})=>ct.createElement("span",null,e," ms",e>1e3&&` (${Ft(e)})`),this.Rate=({budget:e})=>{const{ParentheticalDuration:t}=this;return e.ratePerInterval?ct.createElement(ct.Fragment,null,ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Interval"),ct.createElement(t,{durationMs:e.ratePerInterval.intervalMs})),ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Limit"),e.ratePerInterval.limitPerInterval," task",1!==e.ratePerInterval.limitPerInterval&&"s")):e.ratePercentagePerInterval?ct.createElement(ct.Fragment,null,ct.createElement("div",null,ct.createElement("div",{className:"bold"},"Interval"),ct.createElement(t,{durationMs:e.ratePercentagePerInterval.intervalMs})),ct.createElement("div",null,ct.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))),a=[],r=[];return t.slice(t.indexOf(n[0])).forEach((e=>{n.includes(e)?r.push(e):r.length&&(a.push(this.toDayRangeString(r)),r.length=0)})),r.length&&a.push(this.toDayRangeString(r)),a.join(", ")},this.TimeWindows=({budget:e})=>{const{groupedDays:t}=this,n=e.timeWindows&&e.timeWindows.length>0;return ct.createElement(ct.Fragment,null,ct.createElement("div",{className:"bold"},"When can disruption occur?"),ct.createElement("div",null,n&&e.timeWindows.map(((e,n)=>e.hourlyTimeWindows.map(((a,r)=>ct.createElement("div",{key:`${n}.${r}`},t(e.days),", ",a.startHour,":00 - ",a.endHour,":00 ",e.timeZone))))),!n&&"Any time"))},this.editBudget=()=>{const{app:e,serverGroup:t}=this.props;Vt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(e,t).then((n=>{Ms.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:a}=this,r=this.props.serverGroup,i=!r.migrationPolicy||"SystemDefault"===r.migrationPolicy.type,s=hn(this.props.app),o=r.disruptionBudget||s,l=!i&&kt(o,s);return ct.createElement(ct.Fragment,null,ct.createElement(wn,null),l&&ct.createElement("div",null,"(default policy)"),ct.createElement("div",{className:"bottom-border"},ct.createElement(t,{budget:o,options:vn,label:"Policy"}),ct.createElement(e,{budget:o})),ct.createElement("div",{className:"bottom-border"},ct.createElement(t,{budget:o,options:yn,label:"Rate"}),ct.createElement(n,{budget:o})),ct.createElement(a,{budget:o}),ct.createElement("div",{className:"sp-margin-l-top"},ct.createElement("a",{className:"clickable",onClick:this.editBudget},"Edit Disruption Budget")))}}t("spinnaker.titus.disruptionbudget.section",[]).component("titusDisruptionBudgetSection",Mt(Xe(Ls,"titusDisruptionBudgetSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.rollback.controller",[_e]).controller("titusRollbackServerGroupCtrl",["$scope","$uibModalInstance","serverGroupWriter","application","serverGroup","previousServerGroup","disabledServerGroups","allServerGroups",function(e,t,n,a,r,i,s,o){e.serverGroup=r,e.disabledServerGroups=s.sort(((e,t)=>t.name.localeCompare(e.name))),e.allServerGroups=o.sort(((e,t)=>t.name.localeCompare(e.name))),e.verification={};const l=r.capacity.desired;let c,u="EXPLICIT";if(0===o.length&&r.entityTags){const t=ht(r,"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:i?i.imageId:void 0,rollbackServerGroupName:r.name,restoreServerGroupName:i?i.name:void 0,targetHealthyRollbackPercentage:c,delayBeforeDisableSeconds:0},targetGroups:r.targetGroups,securityGroups:r.securityGroups},e.minHealthy=function(e){return Math.ceil(l*e/100)},a&&a.attributes&&(a.attributes.platformHealthOnlyShowOverride&&a.attributes.platformHealthOnly&&(e.command.interestingHealthProviderNames=["Titus"]),e.command.platformHealthOnlyShowOverride=a.attributes.platformHealthOnlyShowOverride),this.isValid=function(){const t=e.command;return!!e.verification.verified&&("PREVIOUS_IMAGE"===u||void 0!==t.rollbackContext.restoreServerGroupName)},e.taskMonitor=new Pe({application:a,title:"Rollback "+r.name,modalInstance:t}),this.rollback=function(){if(!this.isValid())return;e.taskMonitor.submit((function(){return n.rollbackServerGroup(r,a,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"}}]);t("spinnaker.titus.serverGroup.details.scalingPolicy.upsertScalingPolicy.controller",[]).controller("titusUpsertScalingPolicyCtrl",["$uibModalInstance","alarmServerGroup","serverGroup","application","policy",function(e,t,n,a,r){this.serverGroup=n,this.alarmServerGroup=t,this.viewState={isNew:!r.id,multipleAlarms:r.alarms.length>1,metricsLoaded:!1,namespacesLoaded:!1},this.initialize=()=>{const e={scalingPolicyID:r.id,jobId:n.id,serverGroupName:n.name,credentials:n.account,region:n.region,cloudProvider:"titus",adjustmentType:r.adjustmentType,minAdjustmentMagnitude:r.minAdjustmentMagnitude||1};if(function(e,t){const a=t.alarms[0];e.alarm={region:n.region,comparisonOperator:a.comparisonOperator,dimensions:a.dimensions,disableEditingDimensions:a.disableEditingDimensions,evaluationPeriods:a.evaluationPeriods,period:a.period,threshold:a.threshold,namespace:a.namespace,metricName:a.metricName,statistic:a.statistic,unit:a.unit}}(e,r),"ExactCapacity"===e.adjustmentType)this.viewState.operator="Set to",this.viewState.adjustmentType="instances";else{let e=r.scalingAdjustment;r.stepAdjustments&&r.stepAdjustments.length&&(e=r.stepAdjustments[0].scalingAdjustment),this.viewState.operator=e>0?"Add":"Remove",this.viewState.adjustmentType="ChangeInCapacity"===r.adjustmentType?"instances":"percent of group"}!function(e,t){const n=e.alarm.threshold;e.step={cooldown:t.cooldown||300,metricAggregationType:"Average"},e.step.stepAdjustments=t.stepAdjustments.map((e=>{const t={scalingAdjustment:Math.abs(e.scalingAdjustment)};return void 0!==e.metricIntervalUpperBound&&(t.metricIntervalUpperBound=e.metricIntervalUpperBound+n),void 0!==e.metricIntervalLowerBound&&(t.metricIntervalLowerBound=e.metricIntervalLowerBound+n),t}))}(e,r),this.command=e},this.stepsChanged=e=>{this.command.step.stepAdjustments=e,this.boundsChanged()},this.alarmChanged=e=>{this.command.alarm=e},this.adjustmentTypeChanged=(e,t)=>{this.viewState.operator=e,this.viewState.adjustmentType=t;const n="instances"!==t?"PercentChangeInCapacity":"Set to"===e?"ExactCapacity":"ChangeInCapacity";this.command.adjustmentType=n},this.boundsChanged=()=>{const e="min"===this.viewState.comparatorBound?"metricIntervalLowerBound":"metricIntervalUpperBound",t="metricIntervalLowerBound"===e?"metricIntervalUpperBound":"metricIntervalLowerBound";if(this.command.step){const n=this.command.step.stepAdjustments;n.forEach(((a,r)=>{n.length>r+1&&(n[r+1][t]=a[e])})),delete n[n.length-1][e]}},this.action=this.viewState.isNew?"Create":"Edit";const i=()=>{const e=St(this.command);return"PercentChangeInCapacity"!==e.adjustmentType&&delete e.minAdjustmentMagnitude,e.step?e.step.stepAdjustments.forEach((t=>{"Remove"===this.viewState.operator&&(t.scalingAdjustment=0-t.scalingAdjustment,delete e.step.estimatedInstanceWarmup),void 0!==t.metricIntervalLowerBound&&(t.metricIntervalLowerBound-=e.alarm.threshold),void 0!==t.metricIntervalUpperBound&&(t.metricIntervalUpperBound-=e.alarm.threshold)})):"Remove"===this.viewState.operator&&(e.simple.scalingAdjustment=0-e.simple.scalingAdjustment),e};this.taskMonitor=new Pe({application:a,title:this.action+" scaling policy for "+n.name,modalInstance:e}),this.save=()=>{const e=i();this.taskMonitor.submit((()=>p.upsertScalingPolicy(a,e)))},this.cancel=e.dismiss,this.initialize()}]);sn("titus-scaling-policy-summary .alarm-name {\n word-break: break-all;\n}\ntitus-scaling-policy-summary .actions {\n font-size: 85%;\n margin: 0 0 15px 0;\n border-bottom: 1px solid var(--color-alto);\n}\ntitus-scaling-policy-summary .actions .btn-left {\n padding-left: 0;\n border-left-width: 0;\n}\n");t("spinnaker.titus.serverGroup.details.scalingPolicy.alarmBasedSummary.component",["spinnaker.titus.serverGroup.details.scalingPolicy.upsertScalingPolicy.controller"]).component("titusAlarmBasedSummary",{bindings:{policy:"=",serverGroup:"=",application:"="},templateUrl:"titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.component.html",controller:["$uibModal",function(e){this.$onInit=()=>{k.getAccountDetails(this.serverGroup.account).then((e=>{this.alarmServerGroup={type:"aws",name:this.serverGroup.name,account:e.awsAccount,region:this.serverGroup.region}}))},this.popoverTemplate="titus/src/serverGroup/details/scalingPolicy/popover/scalingPolicyDetails.popover.html",this.editPolicy=()=>{e.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",controller:"titusUpsertScalingPolicyCtrl",controllerAs:"ctrl",size:"lg",resolve:{policy:()=>this.policy,alarmServerGroup:()=>this.alarmServerGroup,serverGroup:()=>this.serverGroup,application:()=>this.application}})},this.deletePolicy=()=>{const{application:e,policy:t,serverGroup:n}=this,a={application:e,title:"Deleting scaling policy "+t.id};A.confirm({header:`Really delete ${t.id}?`,buttonText:"Delete scaling policy",account:n.account,taskMonitorConfig:a,submitMethod:()=>Ye.executeTask({application:e,description:"Delete scaling policy "+t.id,job:[{type:"deleteScalingPolicy",cloudProvider:"titus",credentials:n.account,region:n.region,scalingPolicyID:t.id,serverGroupName:n.name}]})})}}]}),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.component.html",'<span class="label label-default">{{ $ctrl.policy.policyType | robotToHuman | uppercase }}</span>\n<span class="label small" ng-if="$ctrl.policy.status.state !== \'Applied\'">({{ $ctrl.policy.status.state }})</span>\n<div ng-repeat="alarm in $ctrl.policy.alarms track by $index">\n <div\n uib-popover-template="$ctrl.popoverTemplate"\n popover-placement="left"\n popover-title="{{ $ctrl.policy.policyName }}"\n popover-trigger="\'mouseenter\'"\n >\n <div>\n <strong>Whenever</strong>\n {{ alarm.statistic }} of <span class="alarm-name">{{ alarm.metricName }}</span> is\n <span ng-bind-html="alarm.comparator"></span> {{ alarm.threshold }}\n </div>\n <div>\n <strong>for at least</strong>\n {{ alarm.evaluationPeriods }} consecutive periods of {{ alarm.period }} seconds\n </div>\n </div>\n <div class="actions text-right">\n <button class="btn btn-xs btn-link" ng-click="$ctrl.editPolicy()">\n <span class="glyphicon glyphicon-cog" uib-tooltip="Edit policy"></span>\n <span class="sr-only">Edit policy</span>\n </button>\n <button class="btn btn-xs btn-link" ng-click="$ctrl.deletePolicy()">\n <span class="glyphicon glyphicon-trash" uib-tooltip="Delete policy"></span>\n <span class="sr-only">Delete policy</span>\n </button>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/popover/scalingPolicyDetails.popover.html",'<aws-scaling-policy-popover policy="$ctrl.policy" server-group="$ctrl.alarmServerGroup"></aws-scaling-policy-popover>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{ctrl.action}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Conditions</h4>\n <div class="section-body">\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <alarm-configurer\n alarm="ctrl.command.alarm"\n multiple-alarms="ctrl.viewState.multipleAlarms"\n server-group="ctrl.alarmServerGroup"\n step-adjustments="ctrl.command.step.stepAdjustments"\n steps-changed="ctrl.stepsChanged"\n update-alarm="ctrl.alarmChanged"\n ></alarm-configurer>\n </div>\n\n <h4 class="section-heading">Actions</h4>\n <div class="section-body" ng-if="!ctrl.command.alarm.metricName && !ctrl.command.alarm.name">\n <h4 class="text-center">Select a metric</h4>\n </div>\n <div class="section-body" ng-if="ctrl.command.alarm.metricName">\n <step-policy-action\n adjustment-type="ctrl.viewState.adjustmentType"\n adjustment-type-changed="ctrl.adjustmentTypeChanged"\n alarm="ctrl.command.alarm"\n is-min="ctrl.viewState.comparatorBound === \'min\'"\n operator="ctrl.viewState.operator"\n step="ctrl.command.step"\n step-adjustments="ctrl.command.step.stepAdjustments"\n steps-changed="ctrl.stepsChanged"\n ></step-policy-action>\n </div>\n\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row" ng-if="ctrl.viewState.adjustmentType !== \'instances\'">\n <div class="col-md-2 sm-label-right">Adjustment Step</div>\n <div class="col-md-10 content-fields">\n <span class="form-control-static select-placeholder">\n <span ng-bind="ctrl.viewState.operator"></span>\n instances in increments of at least\n </span>\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.minAdjustmentMagnitude"\n />\n <span class="input-label"> instance(s) </span>\n </div>\n </div>\n <div class="row" ng-if="ctrl.viewState.operator !== \'Remove\'">\n <div class="col-md-2 sm-label-right">Cooldown <help-field key="titus.autoscaling.cooldown"></help-field></div>\n <div class="col-md-10 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.step.cooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid"\n submitting="taskMonitor.submitting"\n on-click="ctrl.save()"\n is-new="ctrl.viewState.isNew"\n ></submit-button>\n </div>\n</div>\n')}]);class Fs{constructor(e,t,n,a,r){this.$uibModalInstance=e,this.policy=t,this.serverGroup=n,this.alarmServerGroup=a,this.application=r,this.statistics=["Average","Maximum","Minimum","SampleCount","Sum"],this.alarmUpdated=new Ot,this.updateUnit=e=>{this.state.unit=e}}$onInit(){this.command=this.buildCommand(),this.state={unit:null,scaleInChanged:!1}}scaleInChanged(){this.state.scaleInChanged=!0}cancel(){this.$uibModalInstance.dismiss()}save(){const e=this.policy.id?"Update":"Create",t=St(this.command);this.taskMonitor=new Pe({application:this.application,title:`${e} scaling policy for ${this.serverGroup.name}`,modalInstance:this.$uibModalInstance,submitMethod:()=>p.upsertScalingPolicy(this.application,t)}),this.taskMonitor.submit()}buildCommand(){return{scalingPolicyID:this.policy.id,type:"upsertScalingPolicy",cloudProvider:"titus",jobId:this.serverGroup.id,credentials:this.serverGroup.account,region:this.serverGroup.region,serverGroupName:this.serverGroup.name,adjustmentType:null,name:this.policy.id,targetTrackingConfiguration:{...this.policy.targetTrackingConfiguration}}}}Fs.$inject=["$uibModalInstance","policy","serverGroup","alarmServerGroup","application"];class zs extends ct.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},k.getAccountDetails(e.serverGroup.account).then((e=>{this.setState({awsAccount:e.awsAccount})}))}createStepPolicy(){const{serverGroup:e,application:t}=this.props;et.modalService.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",controller:"titusUpsertScalingPolicyCtrl",controllerAs:"ctrl",size:"lg",resolve:{policy:()=>Vt.titusServerGroupTransformer.constructNewStepScalingPolicyTemplate(e),serverGroup:()=>e,alarmServerGroup:()=>({type:"aws",account:this.state.awsAccount,region:e.region,name:e.name}),application:()=>t}}).result.catch((()=>{}))}createTargetTrackingPolicy(){const{serverGroup:e,application:t}=this.props;et.modalService.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",controller:Fs,controllerAs:"$ctrl",size:"lg",resolve:{policy:()=>Vt.titusServerGroupTransformer.constructNewTargetTrackingPolicyTemplate(e),serverGroup:()=>e,alarmServerGroup:()=>({type:"aws",account:this.state.awsAccount,region:e.region,name:e.name}),application:()=>t}}).result.catch((()=>{}))}render(){const{min:e,max:t}=this.props.serverGroup.capacity;return ct.createElement("div",null,this.state.awsAccount?ct.createElement("a",{className:"clickable",onClick:this.handleClick},"Create new scaling policy"):null,this.state.showSelection&&ct.createElement(g,{warnOnMinMaxCapacity:e===t,typeSelectedCallback:this.typeSelected,showCallback:this.showModalCallback}))}}window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/upsert/upsertScalingPolicy.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{ctrl.action}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Conditions</h4>\n <div class="section-body">\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <alarm-configurer\n alarm="ctrl.command.alarm"\n multiple-alarms="ctrl.viewState.multipleAlarms"\n server-group="ctrl.alarmServerGroup"\n step-adjustments="ctrl.command.step.stepAdjustments"\n steps-changed="ctrl.stepsChanged"\n update-alarm="ctrl.alarmChanged"\n ></alarm-configurer>\n </div>\n\n <h4 class="section-heading">Actions</h4>\n <div class="section-body" ng-if="!ctrl.command.alarm.metricName && !ctrl.command.alarm.name">\n <h4 class="text-center">Select a metric</h4>\n </div>\n <div class="section-body" ng-if="ctrl.command.alarm.metricName">\n <step-policy-action\n adjustment-type="ctrl.viewState.adjustmentType"\n adjustment-type-changed="ctrl.adjustmentTypeChanged"\n alarm="ctrl.command.alarm"\n is-min="ctrl.viewState.comparatorBound === \'min\'"\n operator="ctrl.viewState.operator"\n step="ctrl.command.step"\n step-adjustments="ctrl.command.step.stepAdjustments"\n steps-changed="ctrl.stepsChanged"\n ></step-policy-action>\n </div>\n\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row" ng-if="ctrl.viewState.adjustmentType !== \'instances\'">\n <div class="col-md-2 sm-label-right">Adjustment Step</div>\n <div class="col-md-10 content-fields">\n <span class="form-control-static select-placeholder">\n <span ng-bind="ctrl.viewState.operator"></span>\n instances in increments of at least\n </span>\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.minAdjustmentMagnitude"\n />\n <span class="input-label"> instance(s) </span>\n </div>\n </div>\n <div class="row" ng-if="ctrl.viewState.operator !== \'Remove\'">\n <div class="col-md-2 sm-label-right">Cooldown <help-field key="titus.autoscaling.cooldown"></help-field></div>\n <div class="col-md-10 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="ctrl.command.step.cooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid"\n submitting="taskMonitor.submitting"\n on-click="ctrl.save()"\n is-new="ctrl.viewState.isNew"\n ></submit-button>\n </div>\n</div>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="$ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{$ctrl.policy.id ? "Update" : "Create"}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Target Metric</h4>\n <div class="section-body">\n <p>\n With target tracking policies, Amazon will automatically adjust the size of your job to keep the selected\n metric as close as possible to the selected value.\n </p>\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Metric</div>\n <div class="col-md-10 content-fields">\n <aws-metric-selector\n alarm-updated="$ctrl.alarmUpdated"\n alarm="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification"\n server-group="$ctrl.alarmServerGroup"\n ></aws-metric-selector>\n </div>\n </div>\n\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Target</div>\n <div class="col-md-10 content-fields">\n <select\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification.statistic"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-options="stat for stat in $ctrl.statistics"\n ></select>\n <span class="input-label" style="vertical-align: top; margin-top: 7px"> of </span>\n <div style="display: inline-block">\n <input\n type="number"\n class="form-control input-sm"\n style="width: 100px"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-model="$ctrl.command.targetTrackingConfiguration.targetValue"\n />\n <span class="input-label" ng-bind="$ctrl.state.unit" ng-if="$ctrl.state.unit !== \'None\'"></span>\n </div>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-10 col-md-offset-1">\n <div>\n <target-tracking-chart\n config="$ctrl.command.targetTrackingConfiguration"\n alarm-updated="$ctrl.alarmUpdated"\n server-group="$ctrl.alarmServerGroup"\n unit="$ctrl.state.unit"\n update-unit="$ctrl.updateUnit"\n ></target-tracking-chart>\n </div>\n </div>\n </div>\n </div>\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row">\n <div class="col-md-3 sm-label-right">Scale In</div>\n <div class="col-md-9">\n <div class="checkbox" style="margin-top: 5px">\n <label>\n <input\n type="checkbox"\n ng-model="$ctrl.command.targetTrackingConfiguration.disableScaleIn"\n ng-change="$ctrl.scaleInChanged()"\n />\n Disable Scale-downs\n </label>\n <div class="small" style="margin-top: 5px">\n <p>\n This option disables scale-downs for the target tracking policy, while keeping the scale-ups. This\n means that Server Group will not scale down unless you explicitly set up a separate step policy to\n scale it down.\n </p>\n <p>This is useful when you have special requirements, such as gradual or delayed scale-down.</p>\n </div>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="$ctrl.state.scaleInChanged">\n <div class="col-md-10 col-md-offset-1 well">\n <div ng-if="$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will not scale down. Make sure you have another policy (either TT or Step) that will scale in\n this ASG.\n </div>\n <div ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will scale both in and out. Make sure you don\'t have other scaling policies, as they will\n likely interfere with each other.\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n <div class="col-md-3 sm-label-right">\n Scale In Cooldown\n <help-field key="titus.autoscaling.scaleIn.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleInCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-3 sm-label-right">\n Scale Out Cooldown\n <help-field key="titus.autoscaling.scaleOut.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleOutCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="$ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid || $ctrl.taskMonitor.submitting"\n submitting="$ctrl.taskMonitor.submitting"\n on-click="$ctrl.save()"\n is-new="!$ctrl.policy.id"\n ></submit-button>\n </div>\n</div>\n')}]);t("spinnaker.titus.serverGroup.details.scaling.policy.button",[]).component("titusCreateScalingPolicyButton",Mt(Xe(zs,"titusCreateScalingPolicyButton"),["application","serverGroup"]));const js={bindings:{policy:"<",serverGroup:"<",application:"<"},controller:class{$onInit(){this.policy.targetPolicyDescriptor?this.templateUrl="titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingSummary.html":this.templateUrl="titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.template.html"}},template:'<div ng-include src="$ctrl.templateUrl"></div>'};t("spinnaker.titus.scalingPolicy.details.summary.component",[]).component("titusScalingPolicySummary",js),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingSummary.html",'<titus-target-tracking-summary\n policy="$ctrl.policy"\n server-group="$ctrl.serverGroup"\n application="$ctrl.application"\n></titus-target-tracking-summary>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/alarmBasedSummary.template.html",'<titus-alarm-based-summary\n policy="$ctrl.policy"\n server-group="$ctrl.serverGroup"\n application="$ctrl.application"\n></titus-alarm-based-summary>\n')}]);t("spinnaker.titus.scalingPolicy.targetTracking.chart.component",[]).component("titusTargetTrackingChart",Mt(Xe((({alarmUpdated:e,config:t,serverGroup:n,unit:a,updateUnit:r})=>{const[i,s]=lt.useState({alarmName:null,alarmArn:null,metricName:null,namespace:null,statistic:"Average",dimensions:[],period:60,threshold:t.targetValue,comparisonOperator:"GreaterThanThreshold",okactions:[],insufficientDataActions:[],alarmActions:[],evaluationPeriods:null,alarmDescription:null,unit:null});lt.useEffect((()=>{(()=>{const e=null==t?void 0:t.customizedMetricSpecification,n={...i,dimensions:null==e?void 0:e.dimensions,metricName:null==e?void 0:e.metricName,namespace:null==e?void 0:e.namespace,statistic:null==e?void 0:e.statistic,threshold:null==t?void 0:t.targetValue};s(n)})()}),[t]);return lt.createElement(h,{alarm:i,alarmUpdated:e,onChartLoaded:t=>{a&&r(t.unit),null==e||e.next()},serverGroup:n})}),"targetTrackingChart"),["alarmUpdated","config","serverGroup","unit","updateUnit"]));class Bs{constructor(e){this.$uibModal=e,this.popoverTemplate="titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingPopover.html"}$onInit(){this.config=this.policy.targetTrackingConfiguration,k.getAccountDetails(this.serverGroup.account).then((e=>{this.alarmServerGroup={type:"aws",name:this.serverGroup.name,account:e.awsAccount,region:this.serverGroup.region}}))}editPolicy(){this.$uibModal.open({templateUrl:"titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",controller:Fs,controllerAs:"$ctrl",size:"lg",resolve:{policy:()=>this.policy,alarmServerGroup:()=>this.alarmServerGroup,serverGroup:()=>this.serverGroup,application:()=>this.application}}).result.catch((()=>{}))}deletePolicy(){const{application:e,serverGroup:t,policy:n}=this,a={application:this.application,title:"Deleting scaling policy "+this.policy.id};A.confirm({header:`Really delete ${n.id}?`,buttonText:"Delete scaling policy",account:this.serverGroup.account,taskMonitorConfig:a,submitMethod:()=>Ye.executeTask({application:e,description:"Delete scaling policy "+n.id,job:[{type:"deleteScalingPolicy",cloudProvider:"titus",credentials:t.account,region:t.region,scalingPolicyID:n.id,serverGroupName:t.name}]})})}}Bs.$inject=["$uibModal"];const Rs={bindings:{policy:"<",serverGroup:"<",application:"<"},controller:Bs,template:'\n <div uib-popover-template="$ctrl.popoverTemplate"\n popover-placement="left"\n popover-title="Policy {{$ctrl.policy.id}}"\n popover-trigger="\'mouseenter\'">\n <p>\n <span class="label label-default">TARGET TRACKING</span>\n <span class="label small" ng-if="$ctrl.policy.status.state !== \'Applied\'">({{$ctrl.policy.status.state}})</span>\n <div>\n <strong>Target</strong>\n {{$ctrl.config.predefinedMetricSpecification.predefinedMetricType}}\n {{$ctrl.config.customizedMetricSpecification.metricName}}\n <span ng-if="$ctrl.config.customizedMetricSpecification">({{$ctrl.config.customizedMetricSpecification.statistic}})</span>\n @ {{$ctrl.config.targetValue}}\n </div>\n </p>\n <div class="actions text-right">\n <button class="btn btn-xs btn-link" ng-click="$ctrl.editPolicy()">\n <span class="glyphicon glyphicon-cog" uib-tooltip="Edit policy"></span>\n <span class="sr-only">Edit policy</span>\n </button>\n <button class="btn btn-xs btn-link" ng-click="$ctrl.deletePolicy()">\n <span class="glyphicon glyphicon-trash" uib-tooltip="Delete policy"></span>\n <span class="sr-only">Delete policy</span>\n </button>\n </div>\n </div>\n '};t("spinnaker.titus.scalingPolicy.targetTracking.summary.component",[]).component("titusTargetTrackingSummary",Rs),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingPopover.html",'<titus-target-tracking-chart\n config="$ctrl.policy.targetTrackingConfiguration"\n server-group="$ctrl.alarmServerGroup"\n></titus-target-tracking-chart>\n')}]),window.angular.module("ng").run(["$templateCache",function(e){e.put("titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.modal.html",'<div modal-page class="scaling-policy-modal form-inline">\n <task-monitor monitor="$ctrl.taskMonitor"></task-monitor>\n <modal-close dismiss="$dismiss()"></modal-close>\n <div class="modal-header">\n <h4 class="modal-title">{{$ctrl.policy.id ? "Update" : "Create"}} scaling policy</h4>\n </div>\n <div class="modal-body">\n <form name="form" novalidate>\n <h4 class="section-heading">Target Metric</h4>\n <div class="section-body">\n <p>\n With target tracking policies, Amazon will automatically adjust the size of your job to keep the selected\n metric as close as possible to the selected value.\n </p>\n <p>\n <b>Note:</b> metrics must be sent to Amazon CloudWatch before they can be used in auto scaling. If you do not\n see a metric below, click "Configure available metrics" in the server group details to set up forwarding from\n Atlas to CloudWatch.\n </p>\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Metric</div>\n <div class="col-md-10 content-fields">\n <aws-metric-selector\n alarm-updated="$ctrl.alarmUpdated"\n alarm="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification"\n server-group="$ctrl.alarmServerGroup"\n ></aws-metric-selector>\n </div>\n </div>\n\n <div class="row" style="margin-bottom: 10px">\n <div class="col-md-2 sm-label-right">Target</div>\n <div class="col-md-10 content-fields">\n <select\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.customizedMetricSpecification.statistic"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-options="stat for stat in $ctrl.statistics"\n ></select>\n <span class="input-label" style="vertical-align: top; margin-top: 7px"> of </span>\n <div style="display: inline-block">\n <input\n type="number"\n class="form-control input-sm"\n style="width: 100px"\n ng-change="$ctrl.alarmUpdated.next()"\n ng-model="$ctrl.command.targetTrackingConfiguration.targetValue"\n />\n <span class="input-label" ng-bind="$ctrl.state.unit" ng-if="$ctrl.state.unit !== \'None\'"></span>\n </div>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-10 col-md-offset-1">\n <div>\n <target-tracking-chart\n config="$ctrl.command.targetTrackingConfiguration"\n alarm-updated="$ctrl.alarmUpdated"\n server-group="$ctrl.alarmServerGroup"\n unit="$ctrl.state.unit"\n update-unit="$ctrl.updateUnit"\n ></target-tracking-chart>\n </div>\n </div>\n </div>\n </div>\n <h4 class="section-heading">Additional Settings</h4>\n <div class="section-body section-additional-settings">\n <div class="row">\n <div class="col-md-3 sm-label-right">Scale In</div>\n <div class="col-md-9">\n <div class="checkbox" style="margin-top: 5px">\n <label>\n <input\n type="checkbox"\n ng-model="$ctrl.command.targetTrackingConfiguration.disableScaleIn"\n ng-change="$ctrl.scaleInChanged()"\n />\n Disable Scale-downs\n </label>\n <div class="small" style="margin-top: 5px">\n <p>\n This option disables scale-downs for the target tracking policy, while keeping the scale-ups. This\n means that Server Group will not scale down unless you explicitly set up a separate step policy to\n scale it down.\n </p>\n <p>This is useful when you have special requirements, such as gradual or delayed scale-down.</p>\n </div>\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="$ctrl.state.scaleInChanged">\n <div class="col-md-10 col-md-offset-1 well">\n <div ng-if="$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will not scale down. Make sure you have another policy (either TT or Step) that will scale in\n this ASG.\n </div>\n <div ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n This policy will scale both in and out. Make sure you don\'t have other scaling policies, as they will\n likely interfere with each other.\n </div>\n </div>\n </div>\n\n <div class="row" ng-if="!$ctrl.command.targetTrackingConfiguration.disableScaleIn">\n <div class="col-md-3 sm-label-right">\n Scale In Cooldown\n <help-field key="titus.autoscaling.scaleIn.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleInCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n\n <div class="row">\n <div class="col-md-3 sm-label-right">\n Scale Out Cooldown\n <help-field key="titus.autoscaling.scaleOut.cooldown"></help-field>\n </div>\n <div class="col-md-9 content-fields">\n <input\n type="number"\n style="width: 60px"\n class="form-control input-sm"\n required\n ng-model="$ctrl.command.targetTrackingConfiguration.scaleOutCooldown"\n />\n <span class="input-label"> seconds </span>\n </div>\n </div>\n </div>\n </form>\n </div>\n\n <div class="modal-footer">\n <button class="btn btn-default" ng-click="$ctrl.cancel()">Cancel</button>\n <submit-button\n is-disabled="!form.$valid || $ctrl.taskMonitor.submitting"\n submitting="$ctrl.taskMonitor.submitting"\n on-click="$ctrl.save()"\n is-new="!$ctrl.policy.id"\n ></submit-button>\n </div>\n</div>\n')}]);t("spinnaker.titus.scalingPolicy.targetTracking",["spinnaker.titus.scalingPolicy.targetTracking.chart.component","spinnaker.titus.scalingPolicy.targetTracking.summary.component"]);const Vs=I((()=>null),"titus.serverGroup.details.customScaling");t("spinnaker.application.titus.serverGroup.customScaling.component",[]).component("titusCustomScalingPolicy",Mt(Xe(Vs,"titusCustomScalingPolicy"),["application","serverGroup"]));t("spinnaker.titus.scalingPolicy.module",["spinnaker.titus.scalingPolicy.details.summary.component","spinnaker.titus.serverGroup.details.scaling.policy.button","spinnaker.titus.scalingPolicy.targetTracking","spinnaker.titus.serverGroup.details.scalingPolicy.alarmBasedSummary.component","spinnaker.application.titus.serverGroup.customScaling.component"]);const Ws=e=>{const{application:t,serverGroup:n}=e,{region:a,id:r,account:i,cloudProvider:s}=n,o=(l=n.serviceJobProcesses,Object.keys(l).reduce(((e,t)=>(l[t]&&e.push(t),e)),[]));var l;return ct.createElement(tt,{...e,title:`Modify Service Job Processes for ${n.name}`,description:`Update Service Job Processes for ${n.name}`,initialValues:{serviceJobProcesses:o},render:()=>ct.createElement(ct.Fragment,null,ct.createElement(oe,{label:"Service Job Processes",name:"serviceJobProcesses",input:e=>ct.createElement(he,{...e,options:Object.keys(n.serviceJobProcesses).map((e=>({value:e,label:ge(e)})))})}),ct.createElement(oe,{label:"Reason",name:"reason",input:e=>ct.createElement(nt,{...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:a,jobId:r,credentials:i,cloudProvider:s}],application:t.name})})};class Hs extends ct.Component{constructor(){super(...arguments),this.toggleServiceJobProcesses=()=>{const{app:e,serverGroup:t}=this.props;xe.show(Ws,{application:e,serverGroup:t})}}render(){const{serviceJobProcesses:e}=this.props.serverGroup;return ct.createElement(ct.Fragment,null,ct.createElement("ul",{className:"scaling-processes"},Object.keys(e).map((t=>ct.createElement("li",{key:t},ct.createElement("span",{style:{visibility:e[t]?"visible":"hidden"},className:"fa fa-check small"}),ct.createElement("span",{className:e[t]?"":"text-disabled"},ge(t)," "))))),ct.createElement("a",{className:"clickable",onClick:this.toggleServiceJobProcesses},"Edit Service Job Processes"))}}t("spinnaker.titus.servicejobprocesses.section",[]).component("titusServiceJobProcessesSection",Mt(Xe(Hs,"titusServiceJobProcessesSection"),["serverGroup","app"]));t("spinnaker.titus.serverGroup.details.packageDetails.component",[]).component("titusPackageDetailsSection",Mt(Xe((({buildInfo:e})=>{var t,n;const a=e.jenkins||{},r=Boolean(Object.keys(a).length),{commitId:i,host:s,name:o,number:l,version:c}=a,u=`${s}job/${o}/${l}`;return lt.createElement(y,{heading:"Package"},!r&<.createElement("div",null,"No package information available."),r&<.createElement(b,{className:"horizontal-when-filters-collapsed"},o&<.createElement(C,{label:"Job",value:o}),(null==(t=e.docker)?void 0:t.image)&<.createElement(C,{label:"Image Name",value:null==(n=e.docker)?void 0:n.image}),l&<.createElement(C,{label:"Build",value:l}),i&<.createElement(C,{label:"Commit",value:i.substring(0,8)}),c&<.createElement(C,{label:"Version",value:c}),s&<.createElement(C,{label:"Build Link",value:lt.createElement("a",{target:"_blank",href:u},u)})))}),"titusPackageDetailsSection"),["buildInfo"]));t("spinnaker.titus.serverGroup.details.securityGroups.component",[]).component("titusSecurityGroups",Mt(Xe(Wt,"titusSecurityGroups"),["app","serverGroup"]));e.module("spinnaker.serverGroup.details.titus.controller",[Tt,"spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.titus.disruptionbudget.section",_e,"spinnaker.titus.serverGroup.details.rollback.controller","spinnaker.titus.servicejobprocesses.section","spinnaker.titus.scalingPolicy.module","spinnaker.titus.serverGroup.details.securityGroups.component","spinnaker.titus.serverGroup.details.packageDetails.component"]).controller("titusServerGroupDetailsCtrl",["$scope","$state","$templateCache","$interpolate","app","serverGroup","titusServerGroupCommandBuilder","$uibModal","serverGroupWriter","awsServerGroupTransformer",function(t,n,a,r,i,s,o,l,c,u){const d=i;function m(){const n=pt.find(d.serverGroups.data,(function(e){return e.name===s.name&&e.account===s.accountId&&e.region===s.region}));return Ze.getServerGroup(d.name,s.accountId,s.region,s.name).then((function(a){t.state.loading=!1,a.account=s.accountId,k.getAccountDetails(a.account).then((e=>{a.apiEndpoint=pt.filter(e.regions,{name:a.region})[0].endpoint})),t.buildInfo=a.buildInfo,e.extend(a,n),t.serverGroup=a;const r=t.serverGroup.labels;var i;delete r.name,delete r.source,delete r.spinnakerAccount,delete r[""],Object.keys(r).forEach((e=>{e.startsWith("titus.")&&delete r[e]})),t.labels=r,(i=a).scalingPolicies=(i.scalingPolicies||[]).map((e=>{const{policy:t}=e,{stepPolicyDescriptor:n,targetPolicyDescriptor:a}=t,r=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:i.name}]),t.dimensions||(t.dimensions=[]);const a=pt.cloneDeep(n.scalingPolicy);return a.cooldown=a.cooldownSec,a.policyType=r,a.alarms=[t],a.id=e.id,a.stepAdjustments&&a.stepAdjustments.forEach((e=>{e.metricIntervalUpperBound=pt.get(e,"metricIntervalUpperBound",e.MetricIntervalUpperBound),e.metricIntervalLowerBound=pt.get(e,"metricIntervalLowerBound",e.MetricIntervalLowerBound)})),a}{const{customizedMetricSpecification:n}=a;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))),pt.isEmpty(t.serverGroup)?p():g()}),p)}function p(){t.$$destroyed||n.go("^",{allowModalToStayOpen:!0},{location:"replace"})}this.application=i,t.gateUrl=D.gateUrl,t.state={loading:!0},m().then((()=>{t.$$destroyed||i.serverGroups.onRefresh(t,m)})).catch((()=>{})),k.getAccountDetails(s.accountId).then((e=>{const n=e.awsAccount;t.titusUiEndpoint=pt.filter(e.regions,{name:s.region})[0].endpoint,k.getAccountDetails(n).then((e=>{this.awsAccountId=e.accountId,this.env=e.environment}))}));const g=()=>{this.entityTagTargets=at.buildClusterTargets(t.serverGroup)};this.destroyServerGroup=function(){const e=t.serverGroup,a={application:d,title:"Destroying "+e.name,onTaskComplete:function(){n.includes("**.serverGroup",r)&&n.go("^")}},r={name:e.name,accountId:e.account,region:e.region},s={header:"Really destroy "+e.name+"?",buttonText:"Destroy "+e.name,account:e.account,taskMonitorConfig:a,platformHealthOnlyShowOverride:i.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.destroyServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region})}};rt.addDestroyWarningMessage(i,e,s),Ke(e,i).then((e=>e&&A.confirm(s)))},this.disableServerGroup=function(){const e=t.serverGroup,n={application:d,title:"Disabling "+e.name},a={header:"Really disable "+e.name+"?",buttonText:"Disable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:i.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.disableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};rt.addDisableWarningMessage(i,e,a),Ke(e,i).then((e=>e&&A.confirm(a)))},this.enableServerGroup=()=>{Ke(s,i).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"};A.confirm(t).then((()=>new Promise((e=>setTimeout(e,500))))).then((()=>this.rollbackServerGroup())).catch((({source:e})=>{"footer"===e&&this.showEnableServerGroupModal()}))}))},this.resizeServerGroup=()=>{Ke(s,i).then((e=>{e&&xe.show(On,{serverGroup:t.serverGroup,application:d})}))},this.showEnableServerGroupModal=()=>{const e=t.serverGroup,n={application:d,title:"Enabling "+e.name},a={header:"Really enable "+e.name+"?",buttonText:"Enable "+e.name,account:e.account,taskMonitorConfig:n,platformHealthOnlyShowOverride:i.attributes.platformHealthOnlyShowOverride,platformHealthType:"Titus",submitMethod:function(){return c.enableServerGroup(e,d,{cloudProvider:"titus",serverGroupName:e.name,region:e.region,zone:e.zones[0]})}};A.confirm(a)},this.cloneServerGroup=function(){Vt.titusServerGroupCommandBuilder.buildServerGroupCommandFromExisting(d,t.serverGroup).then((e=>{const t=`Clone ${s.name}`;Gn.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,a=i.getDataSource("serverGroups").data.filter((e=>e.cluster===n.cluster&&e.region===n.region&&e.account===n.account));n.isDisabled&&(e=n,n=pt.orderBy(a.filter((t=>t.name!==e.name&&!t.isDisabled)),["instanceCounts.total","createdTime"],["desc","desc"])[0]),a=a.filter((e=>e.name!==n.name)),1!==a.length||e||(e=a[0]),Ke(n,i).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=pt.find(d.clusters,{name:n.cluster,account:n.account});return pt.filter(e.serverGroups,{isDisabled:!0,region:n.region})},allServerGroups:()=>a,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')}]);t("spinnaker.titus.serverGroup.transformer",[]).factory("titusServerGroupTransformer",["$q",function(e){return{convertServerGroupCommandToDeployConfiguration:function(e){const t=pt.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 k.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}}}}}]);it.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 ${T.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}}});sn('.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 Zs="spinnaker.titus";t("spinnaker.titus",["spinnaker.titus.react","spinnaker.titus.securityGroup.reader","spinnaker.serverGroup.details.titus.controller","spinnaker.titus.serverGroupCommandBuilder.service","spinnaker.serverGroup.configure.titus","spinnaker.titus.serverGroup.transformer","spinnaker.titus.pipeline.stage.findAmiStage","spinnaker.titus.pipeline.stage.enableAsgStage","spinnaker.titus.pipeline.stage.disableAsgStage","spinnaker.titus.pipeline.stage.destroyAsgStage","spinnaker.titus.pipeline.stage.resizeAsgStage","spinnaker.titus.pipeline.stage.cloneServerGroupStage","spinnaker.titus.pipeline.stage.disableClusterStage","spinnaker.titus.pipeline.stage.shrinkClusterStage","spinnaker.titus.pipeline.stage.scaleDownClusterStage","titus.servergroup.details.capacitydetailssection","titus.servergroup.details.launchConfigSection"]).config((()=>{st.registerProvider("titus",{name:"Titus",logo:{path:"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Tug9NAw5RLRCyPLVtkha9/B4X7m9z9gj/QXtDQSVvoOLdc3kWeSW1yWmTzqavwcnNraHaqeoQQBhbOO7qCPYJbJkiDAhiMITiF/cH+E48kpikY4UVCPjaIBA3dU57jxhkWkRs6UX9SbRt9ywMKu0okW8Q+dZ2dO1gnqNOcXKJWpr7t3v+38Gs9AgpWxz9DDp+NQ//ryOkTXttBm0VcMXNPfDqGRR8lMQmcHdnE8A9rs9hEOQ6kGzN5pm5JNTLJa2gILm1k9lckrxPXU7uhxhcAJf22sTltZf4I2LQnsWJTuDGr3HPH+lLN9Gkpag2O64P4oS8gze1udD146D2wP8H5JyTFz+hnOcAAAAASUVORK5CYII="},serverGroup:{transformer:"titusServerGroupTransformer",detailsTemplateUrl:"titus/src/serverGroup/details/serverGroupDetails.html",detailsController:"titusServerGroupDetailsCtrl",CloneServerGroupModal:Gn,commandBuilder:"titusServerGroupCommandBuilder",configurationService:"titusServerGroupConfigurationService",skipUpstreamStageCheck:!0,checkForImageProviders:!0},securityGroup:{reader:"titusSecurityGroupReader",useProvider:"aws"},loadBalancer:{LoadBalancersTag:f,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:Yt}})})),ot.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 <titus-scaling-policy-summary\n ng-repeat="policy in serverGroup.scalingPolicies"\n policy="policy"\n server-group="serverGroup"\n application="ctrl.application"\n ></titus-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{Zs as TITUS_MODULE,Ps as TitusCapacityDetailsSection,Yt as TitusInstanceDetails,jt as TitusInstanceDns,Bt as TitusInstanceInformation,en as TitusProviderSettings,Rt as TitusReactInject,Vt as TitusReactInjector,On as TitusResizeServerGroupModal,As as TitusScalingActivitiesModal,Wt as TitusSecurityGroupsDetailsSection,Ht as applyTargetGroupInfoToHealthMetric,Kt as buildTaskActions,Zt as extractHealthMetrics};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|