225b5),n=o(0x120c268ad),a=o.n(n),s=o(0x20482ad21),r=o(0x2b7f0bcc),l=o(0x1faa3f1ac);let d=new s.Ay("app_views");function BlockKitModalError({retryHandler:e,align:t=r.AO.left,message:o,type:n=r.QE.boxed,"data-qa":s="block-kit-modal-error"}){let p=d.rt("We had some trouble connecting. <a>Try again?</a>",null,({text:t})=>i.createElement(l.A,{onClick:e},t)),c=d.t("We had some trouble connecting. Please try again."),u=(0,i.useMemo)(()=>e?p:c,[e,p,c]),h="string"==typeof o&&o.includes(`
`),m=a()("margin_bottom_100",{"p-block_kit_modal__error--preline":h});return i.createElement(r.Ay,{type:n,align:t,level:r.A_.error,className:m,"data-qa":s},o||u)}BlockKitModalError.displayName="BlockKitModalError"},0x1c518f2d8:(e,t,o)=>{o.d(t,{m:()=>eO,A:()=>eM});var i=o(0xbad225b5),n=o(0x120c268ad),a=o.n(n),s=o(0x1cbdfeceb),r=o(0x9e671ad),l=o(0x77727995),d=o(0x21f3c49e8),p=o(0x8601851c),c=o(0x1229d92d),u=o(0x40c0d834),h=o(0xb97b797e),m=o(0x20b4dda68),b=o(0x62a17882),w=o(0x20482ad21),v=o(0xb1ea448c),f=o(0x139aa1a7),B=o(0x6cc5eee0),k=o(0x9a0c6349);let x="block-kit-builder";var C=o(0x1db02e304),_=o(0x179bf3aea),A=o(0x10af3b48),y=o(0x1c7cb6e50);let get_initial_view_state=e=>{let{blocks:t=[]}=e,o={};return t.forEach(e=>{let{type:t,block_id:i}=e;if(t===m.WP.input&&"element"in e&&e.element){let{type:t,action_id:n}=e.element;o={...o,...(0,_.F)(t,i,n,(0,A.O)((0,y.A)(e.element)))}}}),{...e.state,values:o}};var S=o(0x113cdbbd7),g=o(0xa58e49e0),E=o(0x221091ef3),I=o(0x178109f89),P=o(0xf9f0d4cb);let blocksArrayContainsStatefulElement=e=>{if(!e)return!1;let t=!1;for(let o of e){switch(o.type){case m.WP.section:o.accessory&&o.accessory.type&&(0,P.d)(o.accessory.type)&&(t=!0);break;case m.WP.actions:for(let e of o.elements)if((0,P.d)(e.type)){t=!0;break}break;case m.WP.input:o.element&&o.element.type&&(0,P.d)(o.element.type)&&(t=!0)}if(t)break}return t};var V=o(0x108430f6d),T=o(0x170cf6ee1),O=o(0x23c853006),F=o(0x1cf0d97e1),N=o(0x14149c126);let D=(0,F.Ay)(e=>"on"===(0,N._Z)(e,"workflow_details_history"));D.meta={name:"isWorkflowDetailsHistoryOn",key:"createSelectorIsWorkflowDetailsHistoryOn",description:e=>"on"===(0,N._Z)(e,"workflow_details_history")};var M=o(0xd6ba6894),K=o(0x11a296110),R=o(0xe28ad2a3),W=o(0x101c0e66c);let L=new w.Ay("wizard_modal"),z="close",U="back",q="next",H=class extends i.Component{static defaultProps={backButton:void 0,showBackButton:!0,nextButton:void 0,showNextButton:!0,nextButtonTooltip:void 0,nextButtonIsDisabled:!1,nextButtonIsPending:!1,onClose:()=>{},onBack:()=>{},onNext:()=>{},isSpeedBumpEnabled:!0,getShouldShowSpeedBump:()=>!1,speedBumpHeader:void 0,speedBumpBody:void 0,speedBumpCancelButton:void 0,speedBumpContinueButtonType:"danger",speedBumpContinueButton:void 0,"data-qa":"wizard_modal",autoClogProps:void 0,windowId:void 0};static getDerivedStateFromProps(e){let{isSpeedBumpEnabled:t}=e;return t?null:{isShowingSpeedBump:!1,speedBumpButton:""}}closeButton;keyCommands;constructor(e){super(e),(0,h.v)(this,["handleNextClick","handleBackClick","handleClose","handleSpeedBumpCancel","handleSpeedBumpContinue","renderFooter"]),this.state={}}componentDidMount(){let{isSpeedBumpEnabled:e}=this.props;e&&M.J.requestAnimationFrame(()=>{this.closeButton=M.J.document.getElementsByClassName("c-dialog__close")[0]})}componentWillUnmount(){this.keyCommands&&this.keyCommands.reset()}handleBackClick(){this.props.getShouldShowSpeedBump?.(U)?this.setState(()=>({isShowingSpeedBump:!0,speedBumpButton:U})):this.props.onBack?.()}handleClose(e){let t=e&&"currentTarget"in e&&e.currentTarget.classList.contains("c-dialog__close");return this.props.getShouldShowSpeedBump?.(t?z:null)?this.setState(()=>({isShowingSpeedBump:!0,speedBumpButton:z})):this.props.onClose?.(),!1}handleNextClick(){this.props.getShouldShowSpeedBump?.(q)?this.setState(()=>({isShowingSpeedBump:!0,speedBumpButton:q})):this.props.onNext?.()}handleSpeedBumpCancel(){this.setState(()=>({isShowingSpeedBump:!1})),this.closeButton?.focus()}handleSpeedBumpContinue(){this.setState(()=>({isShowingSpeedBump:!1}));let{speedBumpButton:e}=this.state,{onNext:t,onBack:o,onClose:i}=this.props;e===q?t?.():e===U?o?.():e===z&&i?.(),this.closeButton&&this.closeButton.focus()}renderBackButton({cancelButtonRef:e}={}){let t=L.t("Back"),{showBackButton:o,backButton:n=t,autoClogProps:a,"data-qa":s}=this.props;return!!o&&i.createElement(K.Ay,{ref:e,type:"outline",className:"c-wizard_modal__back",onClick:this.handleBackClick,autoClogProps:a?.backButton,"data-qa":`${s}_back`},n)}renderFooter({goButtonRef:e,cancelButtonRef:t}={}){let{showBackButton:o,showNextButton:n}=this.props;return!!(o||n)&&i.createElement("div",{className:"c-wizard_modal__footer"},this.renderBackButton({cancelButtonRef:t}),this.renderNextButton({goButtonRef:e}))}renderNextButton({goButtonRef:e}={}){let t=L.t("Next"),{showNextButton:o,nextButton:n=t,nextButtonIsDisabled:a,nextButtonIsPending:s,autoClogProps:r,"data-qa":l}=this.props;return!!o&&i.createElement(K.lV,{ref:e,type:"primary",className:"c-wizard_modal__next ",onClick:this.handleNextClick,loading:s,disabled:a,autoClogProps:r?.nextButton,"data-qa":`${l}_next`},n)}renderSpeedBump(){let{speedBumpHeader:e,speedBumpBody:t,speedBumpCancelButton:o,speedBumpContinueButton:n,speedBumpContinueButtonType:a,autoClogProps:s,windowId:r}=this.props;return i.createElement(W.A,{header:e,body:t,cancelButton:o,continueButton:n,continueButtonType:a,onCancel:this.handleSpeedBumpCancel,onContinue:this.handleSpeedBumpContinue,autoClogProps:s?.speedBump,windowId:r})}render(){let{children:e,showBackButton:t,showNextButton:o,nextButton:n,backButton:a,isSpeedBumpEnabled:s,getShouldShowSpeedBump:r,onClose:l,...d}=this.props;return i.createElement(R.Ay,{overlayClassName:"c-wizard_modal",isSpeedBumpEnabled:!1,goOnEnterPressed:!1,showGoButton:!1,showCancelButton:!1,onClose:this.handleClose,customFooterContent:this.renderFooter,...d},e,this.state.isShowingSpeedBump&&this.renderSpeedBump())}};H.displayName="WizardModal";var j=o(0x1a7312abf),Z=o(0x182c9b0b0),G=o(0xedbc2765),J=o(0x15f4f83cf),$=o(0x11bf9141b),X=o(0x4d2e7b47),Y=o(0x242503693),Q=o(0x6b345e37),ee=o(0x3711e82d),et=o(0x1a769a9e8),eo=o(0x1ec68d6a3),ei=o(0x2480888d1),en=o(0x1c91944c9),ea=o(0x11bab834e),es=o(0x1742c95b3),er=o(0xbb9da753),el=o(0x5dd1c0f2),ed=o(0x22854503b),ep=o(0x1936e1c6a),ec=o(0x6e87d4ec);let BlockKitModalSubmitCompleteToast=({message:e})=>i.createElement(ec.A,{duration:5e3},i.createElement("span",null,e));BlockKitModalSubmitCompleteToast.displayName="BlockKitModalSubmitCompleteToast";var eu=o(0x11c82607b),eh=o(0x16ffed5ab);let em=(0,eu.Ay)("eneuques a shortcut trigger run toast",async(e,t,o)=>e((0,eh.M)({element:i.createElement(BlockKitModalSubmitCompleteToast,{message:o})})));em.meta={name:"enqueueBlockKitModalSubmitCompleteToast",key:"createThunkEnqueueBlockKitModalSubmitCompleteToast",description:"eneuques a shortcut trigger run toast"};var eb=o(0x11cdf8541),ew=o(0x6d72337),ev=o(0x19895585a);let ef=(0,eu.Ay)("Pops out the current app dialog into its own child window",async(e,t,{appId:o,title:i,submitButton:n,closeButton:a,onSubmitResolved:s,height:r,width:l},d)=>{let p=t(),{windowId:c="main"}=d(eb.C),u=(0,ep.pk)(p,c),h=(0,ep.JW)(p,c),m={[ev.mq.Primary]:{id:u||"app_popout",viewType:f.D.AppPopout,params:{appId:o,title:i,submitButton:n,closeButton:a,onSubmitResolved:s,activeViewId:u,errorState:h}}};e((0,ew.Bb)({viewSet:m,shouldShowSearch:!1,windowFeatures:{height:r||650,width:l||560}}))});ef.meta={name:"openAppDialogInChildWindow",key:"createThunkOpenAppDialogInChildWindow",description:"Pops out the current app dialog into its own child window"};var eB=o(0x1fcbb004d);let ek=(0,eu.Ay)("Pops out the current BK modal into its own window",(e,t,{appId:o,title:i,submitButton:n,closeButton:a,onSubmitResolved:s,height:r,width:l},d)=>{let p=t(),c=(0,eo.default)({state:p}),{windowId:u}=d(eb.C);return(0,ep.pk)(p,u)?e(ef({appId:o,title:i,submitButton:n,closeButton:a,onSubmitResolved:s,height:r,width:l})).then(()=>e((0,eB.O)())):(c.error("BLOCK_KIT_MODALS_POPOUT","Unable to pop out modal -- no active view"),null)});ek.meta={name:"popOutBlockKitModal",key:"createThunkPopOutBlockKitModal",description:"Pops out the current BK modal into its own window"};var ex=o(0x1bb9c210c),eC=o(0x16349a51f),e_=o(0xe9460abe),eA=o(0xe874a88a),ey=o(0x1f3226107),eS=o(0x798b166a),eg=o(0x9b971e7e),eE=o(0xd2640b92),eI=o(0x357dacc7);let eP=(0,eu.Ay)("",async(e,t,{containerId:o})=>{let i=t(),n=(0,e_.au)(i,o);if(!n||0===n.length)return;let a=[];for(let e of n)if(e.files?.length)for(let t of e.files)t.id&&a.push(t.id);let s=Object.keys((0,eI.hP)(t()));if(s.length){let t=(0,eg.ZT)(i),o=(0,eS.iE)(t);eA.S.all(s.map(t=>(o.cancelEagerUpload({pendingFileId:t}),e((0,eE.gO)({pendingFileId:t})))))}a.length&&eA.S.all(a.map(t=>e((0,ey.Ww)({reason:"bk_file_input_remove",fileId:t}))))});eP.meta={name:"removeAllFiles",key:"createThunkRemoveAllFiles",description:""};var eV=o(0x46dbff89);let eT=new w.Ay("app_view"),eO={update:"update",clear:"clear",push:"push",errors:"errors"},eF={activeView:void 0,errorState:void 0,app:void 0,appProfile:void 0,isLoading:!1,loadingFailed:!1,submitButton:void 0,closeButton:void 0,onSubmitResolved:s.A,source:void 0,transitionFocusTo:s.A,experimentSnakeCaseViewApisGroupOn:!1,isChildWindow:!1,isChildWindowPopout:!1,traceId:void 0},eN=class extends i.Component{static defaultProps=eF;mounted;submitAndUpsertViewPromise;initialViewState;shouldFocusOnUpdate;blockKitLogPayload;keyCommands;clogModalInteraction;constructor(e){super(e),this.submitAndUpsertViewPromise=void 0,this.clogModalInteraction=()=>{},this.initialViewState=(0,J.uz)(this.props.activeView)?get_initial_view_state(this.props.activeView):{},this.shouldFocusOnUpdate=!1,this.blockKitLogPayload={},this.mounted=!1,this.state={submittingFailed:!1,isSubmitting:!1,showErrors:!1,errorMsg:void 0,errors:{},viewError:void 0,isShowingConfirm:!1,speedBumpHeader:void 0,speedBumpBody:void 0,speedBumpCancelButton:void 0,speedBumpContinueButton:void 0,speedBumpContinueButtonType:void 0,speedBumpOnContinue:void 0,blockToFocusAfterValidation:void 0},(0,h.v)(this,["renderTitle","retryLoad","showConfirmDialog","openFileViewer","getShouldShowSpeedBump","resetConfirmDialog","submit","maybeRenderError","maybeRenderConfirm","maybeRenderSpinner","handleKeyPressedCmdEnter","handleAction","handleConfirmContinue","handleConfirmCancel","handlePopOut","handleWizardClose","handleWizardNext","handleWizardBack","handleSubmitRejected","handleSubmitResolved"])}componentDidMount(){this.mounted=!0;let e=this.props.windowRef.deref(),t=e?.document;this.keyCommands=new p.A(t||void 0),this.keyCommands.bindAll([{keys:["command+enter"],handler:this.handleKeyPressedCmdEnter}]),this.focusOnContent(),this.props.activeView?.callbackId==="hermes_form"&&(G.LI.stop({label:G.gC.WorkflowsStartWorkflowToOpenFormDuration}),G.LI.stop({label:G.gC.WorkflowsMessageButtonClickToOpenFormDuration})),this.props.windowRef.deref()?.addEventListener("beforeunload",this.handleWizardClose)}componentDidUpdate(e){if(this.props.activeView&&!(0,r.A)(e.activeView,this.props.activeView)&&(this.initialViewState=get_initial_view_state(this.props.activeView)),this.shouldFocusOnUpdate||e.activeView?.id!==this.props.activeView?.id){let{activeView:e,windowRef:t}=this.props;e&&e.blocks&&e.blocks.find(e=>{switch(e.type){case"actions":e.elements&&e.elements.forEach(e=>!!e.focus_on_load);break;case"section":if(e.accessory&&e.accessory?.focus_on_load)return!0;break;case"input":if(e.element&&e.element.focus_on_load)return!0}return!1})||(this.shouldFocusOnUpdate=!1,t.deref()?.requestAnimationFrame(()=>this.focusOnContent()))}let t=Object.keys(this.props.errorState?.errors??{}).length,o=Object.keys(e.errorState?.errors??{}).length;if(!this.state.blockToFocusAfterValidation&&this.state.showErrors&&(t||o)){if(0===t&&null!==this.state.blockToFocusAfterValidation)return void this.setState(()=>({blockToFocusAfterValidation:void 0}));let e=this.props.activeView?.blocks.find(e=>{let t=e.block_id;return this.props.errorState?.errors[t]});e&&e.block_id!==this.state.blockToFocusAfterValidation&&this.setState(()=>({blockToFocusAfterValidation:e.block_id}))}}componentWillUnmount(){this.mounted=!1,this.keyCommands.reset();let{activeView:e,windowId:t}=this.props;this.props.setActiveViewId({windowId:t,activeViewId:null}),this.props.removeErrorState({windowId:t,viewId:e?.id}),this.submitAndUpsertViewPromise&&this.submitAndUpsertViewPromise.cancel&&this.submitAndUpsertViewPromise.cancel(),(this.props.isChildWindow||this.props.isChildWindowPopout)&&this.handleWizardClose(),this.props.windowRef.deref()?.removeEventListener("beforeunload",this.handleWizardClose)}getShouldShowSpeedBump(e){let t;if(this.props.source===x)return!1;let{activeView:o,blockState:i}=this.props;e===U&&o?.id!==o?.rootViewId&&(t=eT.t("Continue")),this.setState(()=>({speedBumpContinueButton:t}));let n=!!o&&blocksArrayContainsStatefulElement(o.blocks);return e!==z&&e!==q&&!!o?.submit&&n&&!(0,r.A)(this.initialViewState?.values,i)}back(){let{activeView:e,windowId:t}=this.props;if(!e)return;let{clearOnClose:o,previousViewId:i,rootViewId:n}=e;o?(this.close(),this.removeView({rootViewId:n,shouldDeleteView:!0,hasFormData:this.hasPendingFormData()})):i?(this.props.setActiveViewId({windowId:t,activeViewId:i}),this.removeView({shouldDeleteView:!0})):(this.close(),this.removeView({shouldDeleteView:!0,hasFormData:this.hasPendingFormData()}))}close(){this.clogCloseInteraction(),this.props.closeModal()}focusOnContent(){this.props.transitionFocusTo({focusKey:Y.Ay.MODAL_ACTIVE_FORM,forceFocus:!0})}hasPendingFormData(){let{activeView:e,blockState:t,experimentWorkflowDetailsHistoryGroupOn:o}=this.props,i=!!e&&blocksArrayContainsStatefulElement(e.blocks);return o?i&&!(0,r.A)(this.initialViewState?.values,t):void 0}handleAction(){this.mounted&&this.setState(()=>({submittingFailed:!1}))}handleConfirmCancel(){this.resetConfirmDialog()}handleConfirmContinue(e){this.resetConfirmDialog(),e()}handleKeyPressedCmdEnter(){(0,l.A)(this.props,"activeView.submit")&&this.submit()}handlePopOut({height:e,width:t}={}){this.props.popOutBlockKitModal({...this.props,height:e,width:t})}handleSubmitRejected(e){this.props.logger?.error("BLOCK-KIT-MODAL",e);let t=e.data;this.setState(()=>({errorMsg:t?.error,errors:t?.errors,viewError:t?.view_error,showErrors:!0,isSubmitting:!1,submittingFailed:!0}))}handleSubmitResolved({responseAction:e,toastMessage:t}={}){let{rootViewId:o,previousViewId:i}=this.props.activeView??{};this.props.onSubmitResolved?.(e),e===eO.update||e===eO.push?(this.shouldFocusOnUpdate=!0,this.setState(()=>({errorMsg:"",errors:{},showErrors:!1,isSubmitting:!1,submittingFailed:!1}))):e===eO.clear?(this.close(),this.removeView({rootViewId:o})):e||(i?(this.shouldFocusOnUpdate=!0,this.setState(()=>({errorMsg:"",errors:{},showErrors:!1,isSubmitting:!1,submittingFailed:!1})),this.props.setActiveViewId({windowId:this.props.windowId,activeViewId:i})):this.close(),this.removeView()),t&&this.props.enqueueBlockKitModalSubmitCompleteToast(t)}handleWizardBack(){this.handleModalClosedAndNotSubmitted(),this.clogModalInteraction({eventId:ee.EventId.BK_USER_INTERACTION,action:ee.UiAction.CLICK,interaction:ee.Interaction.CLOSE,interactionElement:ee.InteractionElement.MODAL}),this.back()}handleWizardClose(){this.handleModalClosedAndNotSubmitted(),this.close(),this.removeView({rootViewId:(0,l.A)(this.props,"activeView.rootViewId"),shouldDeleteView:!0,hasFormData:this.hasPendingFormData()})}handleWizardNext(){this.clogModalInteraction({eventId:ee.EventId.BK_USER_INTERACTION,action:ee.UiAction.CLICK,interaction:ee.Interaction.CONFIRM,interactionElement:ee.InteractionElement.MODAL}),this.submit()}clogCloseInteraction(){this.clogModalInteraction({eventId:ee.EventId.BK_USER_INTERACTION,action:ee.UiAction.CLICK,interaction:ee.Interaction.CLOSE,interactionElement:ee.InteractionElement.MODAL})}maybeRenderConfirm(){let{isShowingConfirm:e,speedBumpBody:t,speedBumpHeader:o,speedBumpCancelButton:n,speedBumpContinueButton:a,speedBumpContinueButtonType:s,speedBumpOnContinue:r}=this.state;return e&&i.createElement(W.A,{header:o,body:t,cancelButton:n,continueButton:a,continueButtonType:s,onContinue:r,onCancel:this.handleConfirmCancel,autoClogProps:{cancelButton:{eventId:ee.EventId.BK_USER_INTERACTION,interaction:ee.Interaction.DENY,interactionElement:ee.InteractionElement.CONFIRM_DIALOG,onClick:{enableClogAction:!0},...this.blockKitLogPayload},continueButton:{eventId:ee.EventId.BK_USER_INTERACTION,interaction:ee.Interaction.CONFIRM,interactionElement:ee.InteractionElement.CONFIRM_DIALOG,onClick:{enableClogAction:!0},...this.blockKitLogPayload}}})}maybeRenderError(){let{isSubmitting:e,submittingFailed:t,errorMsg:o,viewError:n}=this.state,{isLoading:a,loadingFailed:s}=this.props,r=t&&(n||o!==j.LY.validationFailed);return!a&&!e&&(s||r)&&i.createElement(C.f,{retryHandler:t?this.submit:this.retryLoad,message:n})}maybeRenderSpinner(){return(this.state.isSubmitting||this.props.isLoading)&&i.createElement(v.A,{size:"jumbo",className:"p-block_kit_modal__spinner"})}openFileViewer(e){this.props.openModal({element:i.createElement(O.A,{...e,...e.mediaItem||{}}),isStackable:!0})}removeView({rootViewId:e,shouldDeleteView:t,hasFormData:o}={}){let{id:i}=this.props.activeView??{},{experimentWorkflowDetailsHistoryGroupOn:n}=this.props;this.props.removeBlockState(i),e&&e!==i&&this.props.removeBlockState(e),this.props.removeView(e||i),t&&this.props.source!==x&&this.props.deleteView({viewId:i,rootViewId:e,...n?{optionalArgs:{has_form_data:o}}:{}})}resetConfirmDialog(){this.setState(()=>({isShowingConfirm:!1,speedBumpHeader:void 0,speedBumpBody:void 0,speedBumpCancelButton:void 0,speedBumpContinueButton:void 0,speedBumpContinueButtonType:void 0,speedBumpOnContinue:void 0}))}retryLoad(){this.props.reloadView({id:this.props.activeView?.id})}showConfirmDialog({confirm:e,onGo:t}){let o=eT.t("Are you sure?"),n=eT.t("Cancel"),a=eT.t("OK");this.setState(()=>({isShowingConfirm:!0,speedBumpHeader:i.createElement(I.A,{text:e?.title?.text}),speedBumpBody:e.text.type===m.ze.mrkdwn?i.createElement(B.A,{text:e?.text?.text||o}):i.createElement(I.A,{text:e?.text?.text||o}),speedBumpCancelButton:i.createElement(I.A,{text:e?.deny?.text||n}),speedBumpContinueButton:i.createElement(I.A,{text:e?.confirm?.text||a}),speedBumpContinueButtonType:e?.style??"primary",speedBumpOnContinue:()=>{this.handleConfirmContinue(t)}}))}handleModalClosedAndNotSubmitted(){this.props.removeAllFiles({containerId:this.props.activeView?.id})}submit(){if(this.props.source===x)this.close(),this.removeView();else if((0,d.A)(this.props.errorState?.errors)){this.setState(()=>({errorMsg:"",errors:{},showErrors:!1,isSubmitting:!0,submittingFailed:!1,blockToFocusAfterValidation:void 0}));let{experimentSnakeCaseViewApisGroupOn:e,activeView:t,blockState:o,traceId:i}=this.props,n=o;e&&(n=(0,T.T)(n)),this.submitAndUpsertViewPromise=this.props.submitAndUpsertView({view:t,viewState:{values:n||{}},traceId:i}).then(this.handleSubmitResolved).catch(this.handleSubmitRejected)}else{let e=this.props.activeView?.blocks.find(e=>this.props.errorState?.errors[e.block_id]);this.setState(()=>({showErrors:!0,blockToFocusAfterValidation:e?.block_id}))}}shouldDisableNextButton(){let{isSubmitting:e}=this.state;return e}renderBackButton(){let{closeButton:e,activeView:t}=this.props,o=t?.close||e;return o||(o={type:"plain_text",text:eT.t("Close"),emoji:!0}),i.createElement(I.A,o)}renderNextButton(){let{submitButton:e,activeView:t,isLoading:o,loadingFailed:n}=this.props,a=!o&&!n&&t?.submit||(o||n)&&e;return a&&i.createElement(I.A,a)}renderTitle(){let e,t=this.props.activeView?.title||this.props.title,{app:o}=this.props;return o&&(e=(0,et.A)(o,72)),i.createElement("div",{className:"p-block_kit_modal__title"},e?i.createElement("img",{alt:"",className:"p-block_kit_modal__title_icon",src:e}):null,i.createElement(I.A,{className:"p-block_kit_modal__title_text",...t}))}renderTitleAria(){let e=this.props.activeView?.title||this.props.title;return e?.text}renderViewContent(){let{activeView:e,errorState:t,isStateEnabled:o=!0,windowId:n}=this.props,{showErrors:a,errors:s,blockToFocusAfterValidation:r}=this.state;return e?i.createElement(E.A,{key:e.id,view:e,errorState:t,isStateEnabled:o,serverErrors:s,showErrors:a,blockToFocusAfterValidation:r,onError:t=>{this.props.updateErrorState({windowId:n,viewId:e.id,errorState:t})}},i.createElement(k.A,{view:e,containerId:e.id,containerContext:S.pi.modal,onAction:this.handleAction,showConfirmDialog:this.showConfirmDialog,openFileViewer:this.openFileViewer,blockKitLogPayload:this.blockKitLogPayload})):null}render(){let{isLoading:e,appPopoutsEnabled:t,appId:o,activeView:n,isChildWindow:s,isChildWindowPopout:r,windowId:l}=this.props,{isSubmitting:d,speedBumpHeader:p,speedBumpBody:c,speedBumpCancelButton:h,speedBumpContinueButton:m}=this.state,w=this.renderNextButton(),v=a()("p-block_kit_modal",{"p-block_kit_modal--loading":e,"p-block_kit_modal--submitting":d,"p-block_kit_modal--app_popout":r,"p-block_kit_modal--desktop":(0,b.y3)()});this.blockKitLogPayload={blockKitAppId:o,blockKitBotId:n?.botId,surfaceType:(0,ei.A)()||r?ee.SurfaceType.POP_OUT:ee.SurfaceType.MODAL,surfaceId:n?.id,uuid:(0,V.l)(ee.SurfaceType.MODAL,{viewId:n?.id,viewHash:n?.hash})};let f=t&&!s;return i.createElement(u.A,{eventId:ee.EventId.BK_USER_IMPRESSION,...this.blockKitLogPayload,clogImpression:!0,enableClogImpressionOffScreen:!0,trackClogRef:e=>{this.clogModalInteraction=e},disableAutoReferringUiContext:!0},i.createElement(g.$.Consumer,null,({isAllAsyncActionsResolved:e})=>i.createElement(H,{className:v,autoClogProps:{popOutButton:{interactionElement:ee.InteractionElement.POP_OUT},onRequestClose:{enableClogAction:!0},context:{eventId:ee.EventId.APPVIEW_RENDERED,appId:o,viewId:n?.id,type:n?.type}},title:this.renderTitle(),titleAria:this.renderTitleAria(),showNextButton:!!w,nextButton:w,nextButtonIsDisabled:!e||this.shouldDisableNextButton(),onNext:this.handleWizardNext,backButton:this.renderBackButton(),onBack:this.handleWizardBack,onClose:this.handleWizardClose,showPopoutButton:f,showTooltipOnCloseButton:t,onPopOut:this.handlePopOut,getShouldShowSpeedBump:this.getShouldShowSpeedBump,speedBumpHeader:p,speedBumpBody:c,speedBumpCancelButton:h,speedBumpContinueButton:m,isChildWindowPopout:r,windowId:l,role:"dialog"},this.maybeRenderError(),this.renderViewContent(),this.maybeRenderConfirm(),this.maybeRenderSpinner())))}};eN.displayName="BlockKitModal";let eD={openModal:eV.q,closeModal:eB.O,removeView:es._A,deleteView:j.lD,reloadView:er.A,submitAndUpsertView:ex.m,setActiveViewId:ed.DF,removeErrorState:ed.EO,popOutBlockKitModal:ek,removeBlockState:eC.dV,removeAllFiles:eP,enqueueBlockKitModalSubmitCompleteToast:em,updateErrorState:ed.Ho},eM=(0,Z.A)((0,c.A)((0,en.N)((e,{appId:t,windowId:o,getViewSet:i})=>{let n=(0,ep.OM)(e,o),a=i(e);return{activeView:n,errorState:(0,ep.JW)(e,o),app:(0,el.sO)(e,t),appProfile:t?(0,ea.UH)(e,t):void 0,isLoading:(0,J.mX)(n)||(0,X.X)(n),loadingFailed:(0,J.lv)(n),logger:(0,eo.default)({state:e}),appPopoutsEnabled:(0,$.HM)(),blockState:(0,e_.uz)(e,n?.id),isChildWindowPopout:a?.[ev.mq.Primary]?.viewType===f.D.AppPopout,experimentSnakeCaseViewApisGroupOn:"on"===(0,N._Z)(e,"snake_case_view_apis"),experimentWorkflowDetailsHistoryGroupOn:D(e)}},eD)((0,Q.A)(eN))))},0x1c2291e12:(e,t,o)=>{o.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var i=o(0x20b4dda68),n=o(0x17e281cf9),a=o(0x10b9bda60),s=o(0x62fa095f),r=o(0x10af3b48),l=o(0x1c7cb6e50);let __WEBPACK_DEFAULT_EXPORT__=e=>{if(!e)return{};let{blocks:t=[]}=e,o={};return t.forEach(e=>{let{type:t,block_id:d,element:p}=e;if(t===i.WP.input){let t=(0,l.A)(p),i=(0,r.O)(t),c=(0,s._)(i,{...(0,n.hM)(t,e),type:p.type});c&&(o={...o,...(0,a.S)({blockId:d,error:c})})}}),o}},0x101c0e66c:(e,t,o)=>{o.d(t,{A:()=>v});var i=o(0xbad225b5),n=o(0x120c268ad),a=o.n(n),s=o(0x8601851c),r=o(0xd6ba6894),l=o(0xb97b797e),d=o(0x20482ad21),p=o(0xef6027c8),c=o(0x11a296110),u=o(0x44ce343e),h=o(0x1d73a63ad),m=o(0x19895585a);let b=new d.Ay("wizard_modal"),w=class extends i.PureComponent{static defaultProps={header:void 0,body:void 0,cancelButton:void 0,continueButton:void 0,continueButtonType:"danger",onCancel:()=>{},onContinue:()=>{},autoClogProps:void 0,windowId:void 0};speedBump=null;cancelButton=null;continueButton=null;windowDoc=null;keyCommands;constructor(e){super(e),(0,l.v)(this,["handleKeyPressedTab","onCancel","setSpeedBumpRef","setCancelButtonRef","setContinueButtonRef"]),this.state={isHidden:!0}}componentDidMount(){r.J.requestAnimationFrame(()=>{r.J.requestAnimationFrame(()=>{this.setState(()=>({isHidden:!1})),this.cancelButton&&this.cancelButton.focus()})});let e=this.props.windowId===m.N2?r.J:(0,h.ZF)(this.props.windowId)?.childWindowRef;this.windowDoc=e?.document??null,this.keyCommands=new s.A(this.windowDoc);let t=[];t.push({keys:["tab","shift+tab"],handler:this.handleKeyPressedTab}),t.push({keys:["escape"],handler:e=>{e.preventDefault(),this.onCancel()}}),this.keyCommands.bindAll(t)}componentWillUnmount(){this.keyCommands&&this.keyCommands.reset()}onCancel(){this.setState(()=>({isHidden:!0}),()=>{this.speedBump&&(0,p.A)(this.speedBump,"transform").then(this.props.onCancel??(()=>{}))})}handleKeyPressedTab(e){e.preventDefault();let t=e.shiftKey,o=this.windowDoc?.activeElement;o&&this.cancelButton&&this.continueButton?t&&o===this.cancelButton?this.continueButton.focus():t||o===this.continueButton?this.cancelButton.focus():this.continueButton.focus():this.cancelButton?.focus()}setSpeedBumpRef(e){this.speedBump=e}setCancelButtonRef(e){this.cancelButton=e}setContinueButtonRef(e){this.continueButton=e}render(){let e=b.t("Are you sure you want to leave?"),t=b.t("It looks like you\u2019re still working on this. You may lose the info you've entered so far if you leave now."),o=b.t("Keep Editing"),n=b.t("Leave"),{header:s=e,body:r=t,cancelButton:l=o,continueButton:d=n,continueButtonType:p="danger",onContinue:u,autoClogProps:h}=this.props,{isHidden:m}=this.state,w=a()("c-wizard_speed_bump_overlay",{"c-wizard_speed_bump_overlay--hidden":m}),v=a()("c-wizard_speed_bump",{"c-wizard_speed_bump--hidden":m});return i.createElement(i.Fragment,null,i.createElement("div",{className:w}),i.createElement("div",{className:"c-wizard_speed_bump_wrapper"},i.createElement("div",{className:v,ref:this.setSpeedBumpRef},i.createElement("h3",{className:"c-wizard_speed_bump__header"},s),i.createElement("div",{className:"c-wizard_speed_bump__body"},r),i.createElement("div",{className:"c-wizard_speed_bump__button_row"},i.createElement(c.Ay,{autoFocus:!0,className:"c-wizard_speed_bump__button",onClick:this.onCancel,"data-qa":"wizard_speed_bump_cancel",type:"outline",autoClogProps:h?.cancelButton,ref:this.setCancelButtonRef},l),i.createElement(c.Ay,{className:"c-wizard_speed_bump__button",onClick:u,"data-qa":"wizard_speed_bump_continue",type:p,autoClogProps:h?.continueButton,ref:this.setContinueButtonRef},d)))))}};w.displayName="WizardSpeedBump";let v=(0,u.A)(w)},0x582c5f27:(e,t,o)=>{o.d(t,{A:()=>u});var i=o(0xbad225b5),n=o(0xc48503ad),a=o.n(n),s=o(0x1c518f2d8),r=o(0xa58e49e0),l=o(0x24558b75f),d=o(0x11c82607b),p=o(0x46dbff89);let c=(0,d.Ay)("Open an app view in a modal",(e,t,{appId:o,title:n,submitButton:a,closeButton:d,onSubmitResolved:c,source:u,forceTargetWindowId:h,traceId:m}={})=>{let b=i.createElement(r.L,{},i.createElement(s.A,{appId:o,title:n,submitButton:a,closeButton:d,onSubmitResolved:c,source:u,traceId:m}));e((0,l.n3)(t())&&h?(0,p.q)({element:b,isStackable:!0,forceTargetWindowId:h}):(0,p.q)({element:b,isStackable:!0}))});c.meta={name:"openBlockKitModal",key:"createThunkOpenBlockKitModal",description:"Open an app view in a modal"},Object.assign(c,{propTypes:{title:a().object,submitButton:a().object,closeButton:a().object,onSubmitResolved:a().func,traceId:a().string}});let u=c},0xbb9da753:(e,t,o)=>{o.d(t,{A:()=>l});var i=o(0x105b0d320),n=o(0x11c82607b),a=o(0x9b971e7e),s=o(0x1dd8fbd34);let r=(0,n.Ay)("Reload view",(e,t,{id:o})=>{let n=t(),r=(0,a.ZT)(n);(0,i.A)(o)&&r&&(0,s.S)().fetchObjectWithId(r,o)});r.meta={name:"reloadView",key:"createThunkReloadView",description:"Reload view"};let l=r},0x1bb9c210c:(e,t,o)=>{o.d(t,{m:()=>h});var i=o(0xe874a88a),n=o(0x20b4dda68),a=o(0x11cdf8541),s=o(0x1a7312abf),r=o(0x3711e82d),l=o(0x45012309),d=o(0x11c82607b),p=o(0x9d312a09),c=o(0x22854503b),u=o(0x14149c126);let h=(0,d.Ay)("Submit and upsert view",(e,t,{view:o,viewState:d,traceId:h},m)=>{if(!o?.id)return i.S.resolve({responseAction:void 0,toastMessage:void 0});let{windowId:b}=m(a.C);return e((0,s.G0)({viewId:o.id,viewState:d})).then(({updatedView:i,responseAction:a,toastMessage:s}={})=>(h&&"on"===(0,u._Z)(t(),"pcx_better_clogs")&&(0,l.eo)({state:t()}).track(r.EventId.APPVIEW_SUBMITTED,{trace_id:h}),i&&("update"===a?(e((0,p.A)(i)),e((0,c.DF)({activeViewId:i.id,windowId:b})),(0,l.eo)({state:t()}).track(r.EventId.APPVIEW_UPDATED,{contexts:{platform:{app_id:i.app_id},block_kit:{view_id:i.id,type:i.type,app_id:i.app_id}}})):"push"===a&&i.previousViewId===o.id&&(o.type===n.cs.modal&&i.type===n.cs.modal||i.app_notification_subscription_configuration&&n.cs.app_notification_subscription_configuration)&&(e((0,p.A)(i)),e((0,c.DF)({windowId:b,activeViewId:i.id})),(0,l.eo)({state:t()}).track(r.EventId.APPVIEW_STACKED,{contexts:{platform:{app_id:i.app_id},block_kit:{view_id:i.id,type:i.type,app_id:i.app_id}}}))),{responseAction:a,toastMessage:s}))});h.meta={name:"submitAndUpsertView",key:"createThunkSubmitAndUpsertView",description:"Submit and upsert view"}},0x4d2e7b47:(e,t,o)=>{o.d(t,{X:()=>isViewStale});var i=o(0x15f4f83cf);let isViewStale=e=>!!(0,i.uz)(e)&&!!e.isStale}}]);
//# sourceMappingURL=https://slack.com/source-maps/bv1-13/gantry-v2-async-client-app-popout-view.5b48a3dd958a15a2b90a.min.js.mapØA
—Eoúô