lows.templates.update generated fetcher"}},0x1f26a5878:(e,t,a)=>{"use strict";a.d(t,{W:()=>o});var l=a(0xe874a88a),r=a(0x22a29f141),n=a(0x1dfdeb1c8),i=a(0x1ec68d6a3),s=a(0xe747dd27);let o=(0,n.A)("workflows.triggers.summarize generated fetcher",(e,t,a)=>new l.S((l,n)=>{let{abortSignal:o,reason:c,...d}=a,m=(0,s.VA)(d);e((0,r.apiCall)({method:"workflows.triggers.summarize",args:m,abortSignal:o,reason:c})).then(e=>{l(e)}).catch(e=>{(0,i.default)({getState:t}).error(`API call to workflows.triggers.summarize
						with reason ${c} failed, initiated by generated fetcher`),n(e)})}));o.meta={name:"workflowsTriggersSummarizeFetcher",key:"createFetcherWorkflowsTriggersSummarizeFetcher",description:"workflows.triggers.summarize generated fetcher"}},0x3b8174d2:(e,t,a)=>{"use strict";a.d(t,{Jk:()=>b,Ui:()=>f,W1:()=>x,Z0:()=>h,cq:()=>_,gL:()=>p,hj:()=>u,oS:()=>g,pk:()=>w,sw:()=>k,vp:()=>E,zy:()=>y});var l=a(0xbe0b63ff),r=a(0x1df96de4c),n=a(0x1846f5916),i=a(0x9b971e7e),s=a(0xdf55e8f3),o=a(0x58fa6f7f),c=a(0xa7a4ed65),d=a(0xea788d49),m=a(0x1be8212b1);let u=(0,s.eI)((e,t,a=!0)=>{let r=e?.hermesFunctions?.functionsById?.[t],n=(0,i.ZT)(e);return n?r?((0,o.J)().maybeRefetch(n,t),r):a?(0,d.Ss)().fetchObjectWithId(n,t):(0,l.WQ)(t):(0,l.WQ)(t)}),p=(0,s.eI)((e,{ids:t})=>t.length?t.map(t=>u(e,t,!0)):r.Ml),_=(0,s.eI)(e=>e.hermesFunctions.functionsById),b=(0,s.eI)(e=>e.hermesFunctions.categories),f=(0,s.eI)(e=>Object.entries(_(e)).reduce((e,[t,a])=>(a&&!a.is_hidden&&(e[t]=a),e),{})),h=(0,s.eI)(e=>Object.entries(b(e)).reduce((e,[t,a])=>(a.isHidden||(e[t]=a),e),{}));(0,s.eI)(e=>e.hermesFunctions.collections);let g=(0,s.eI)(e=>{let t=_(e);return Object.values(e.hermesFunctions.collections).reduce((e,a)=>{let l=Object.keys(a.functionIds.reduce((e,a)=>{let l=t[a],r=l?.app_id||l?.category_id;return r&&(e[r]=!0),e},{}));return l.length>=n.$x&&(e[a.id]={...a,categories:l}),e},{})}),x=(0,s.eI)((e,t)=>{let a=_(e),l=(0,m.g)(t),r=[],n=Object.values(a),i={};for(let{app_id:e,id:s,title:o,category_label:c,callback_id:d,type:m,is_hidden:u}of n){if(!o||!o.length||u)continue;let n=RegExp(`\\b${t}\\b`,"i"),p=o.search(n),_=l.customMatch(o);_=p>-1?-5:_;let b=l.customMatch(c||""),f=Math.min(l.fuzzyMatcher.normalizeAndScore(o)-1,_,c?l.fuzzyMatcher.normalizeAndScore(c||"")+1:1/0,b);isFinite(f)&&(i[s]=f,r.push({id:s,title:o||s,categoryLabel:c,type:m,appId:e||d,isCategory:!1,productLevelAvailability:{isAvailable:a[s]?.product_level_availability?.is_available??!0,availableTo:a[s]?.product_level_availability?.available_to}}))}return r.sort((e,t)=>i[e.id]-i[t.id]).slice(0,10)}),w=(0,s.eI)((e,t)=>{let a=h(e),l=(0,m.g)(t),r=[],n=Object.entries(a),i={};for(let e of n){let[t,{name:a,type:n}]=e,s=Math.min(l.fuzzyMatcher.normalizeAndScore(a),l.customMatch(a));a.length&&isFinite(s)&&(i[a]=s,r.push({id:t,title:a,type:n,appId:t,isCategory:!0}))}return r.sort((e,t)=>i[e.id]-i[t.id]).slice(0,2)}),y=(0,s.eI)(e=>{let t=u(e,c.Ez.case_step,!0);return!(0,l.lv)(t)}),E=(0,s.eI)(e=>{let t=u(e,c.Ez.case_step,!0);return t?.product_level_availability?.is_available??!0}),k=(0,s.eI)((e,t)=>Object.values(_(e)).filter(e=>e&&e.callback_id&&t.includes(e.callback_id)))},0xcefedbca:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var l=a(0xe874a88a),r=a(0x22a29f141),n=a(0x1dfdeb1c8),i=a(0x1ec68d6a3),s=a(0xe747dd27);let o=(0,n.A)("salesHome.workflows.get generated fetcher",(e,t,a)=>new l.S((l,n)=>{let{abortSignal:o,reason:c,...d}=a,m=(0,s.VA)(d);e((0,r.apiCall)({method:"salesHome.workflows.get",args:m,abortSignal:o,reason:c})).then(e=>{l(e)}).catch(e=>{(0,i.default)({getState:t}).error(`API call to salesHome.workflows.get
						with reason ${c} failed, initiated by generated fetcher`),n(e)})}));o.meta={name:"salesHomeWorkflowsGetFetcher",key:"createFetcherSalesHomeWorkflowsGetFetcher",description:"salesHome.workflows.get generated fetcher"};var c=a(0x11c82607b),d=a(0x16b708a7f),m=a(0x2fd935d8),u=a(0x1d104c491);let p={ADMIN_SALES_HOME_DEAL_WON:u.Lb.adminDealWon,ADMIN_SALES_HOME_FORECAST_REMINDER:u.Lb.adminForecastReminder,ADMIN_SALES_HOME_NEW_OPPORTUNITY:u.Lb.adminNewOpportunityAlert,ADMIN_SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED:u.Lb.adminAmountChanged,ADMIN_SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED:u.Lb.adminCloseDateChanged,ADMIN_SALES_HOME_OPPORTUNITY_STAGE_CHANGED:u.Lb.adminStageChanged,ADMIN_SALES_HOME_OPPORTUNITY_CLOSING_SOON:u.Lb.adminClosingSoonAlert,ADMIN_SALES_HOME_OPPORTUNITY_PAST_CLOSE_DATE:u.Lb.adminPastCloseDateAlert,ADMIN_SALES_HOME_OUTDATED_FIELD:u.YB.adminOutdatedFields,ADMIN_SALES_HOME_MISSING_FIELD:u.YB.adminMissingFields},_={SALES_HOME_DEAL_WON:u.Lb.userDealWon,SALES_HOME_FORECAST_REMINDER:u.Lb.userForecastReminder,SALES_HOME_NEW_OPPORTUNITY:u.Lb.userNewOpportunityAlert,SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED:u.Lb.userAmountChanged,SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED:u.Lb.userCloseDateChanged,SALES_HOME_OPPORTUNITY_STAGE_CHANGED:u.Lb.userStageChanged},b=(0,c.Ay)("Fetches data for existing workflow, hydrates form data and opens notification builder",(e,t,{workflowId:a,isAdmin:l=!1,reason:r="modern-selling"})=>(l?e((0,d.MB)(!0)):e((0,d.gG)(!0)),e(o({workflowId:a,reason:r})).then(({template_id:t,payload:a,salesforce_org_id:r})=>{let n=a.acn?.account?.id||a.condition?.account?.id,i=a.acn?.opportunity?.id||a.condition?.opportunity?.id;if(n||i){let s;return e((0,m.R)({sobjects:[{sobjectApiName:n?"Account":"Opportunity",fields:["Name"]}],asIntegrationUser:l,query:(s=n||i||"",`https://fake.com/sobjects/?record_id=${s}`),...r&&{salesforceOrgId:r},reason:"edit_workflow"})).then(({records:e})=>{let[s]=e,o={...a};return s&&(l&&n?o.acn.account.name=s.label:l&&i?o.acn.opportunity.name=s.label:!l&&n?o.condition.account.name=s.label:o.condition.opportunity.name=s.label),{templateId:t,payload:o,salesforceOrgId:r}})}return{templateId:t,payload:a,salesforceOrgId:r}}).then(({templateId:t,payload:r,salesforceOrgId:n})=>{if(l){let l=p[t];e((0,d.kC)({workflowView:l,workflowId:a,payload:r,salesforceOrgId:n}))}else{let l=_[t];e((0,d.yK)({workflowView:l,workflowId:a,payload:r,salesforceOrgId:n}))}}).finally(()=>{l?e((0,d.MB)(!1)):e((0,d.gG)(!1))})));b.meta={name:"openEditWorkflow",key:"createThunkOpenEditWorkflow",description:"Fetches data for existing workflow, hydrates form data and opens notification builder"};let f=b},0x1cbba0fb:(e,t,a)=>{"use strict";a.d(t,{S_:()=>n,VN:()=>i,yz:()=>r});var l=a(0x1cf0d97e1);let r=(0,l.Ay)((e,t)=>e?.slackConnectExternalTeamsList[t].teamIdList);r.meta={name:"getSlackConnectExternalTeamListByConnectionType",key:"createSelectorGetSlackConnectExternalTeamListByConnectionType",description:(e,t)=>e?.slackConnectExternalTeamsList[t].teamIdList};let n=(0,l.Ay)((e,t)=>e.slackConnectExternalTeamsList[t].marker);n.meta={name:"getSlackConnectExternalTeamListMarkerByConnectionType",key:"createSelectorGetSlackConnectExternalTeamListMarkerByConnectionType",description:(e,t)=>e.slackConnectExternalTeamsList[t].marker};let i=(0,l.Ay)((e,t)=>e.slackConnectExternalTeamsList[t].lastUpdated);i.meta={name:"getSlackConnectExternalTeamListLastUpdatedByConnectionType",key:"createSelectorGetSlackConnectExternalTeamListLastUpdatedByConnectionType",description:(e,t)=>e.slackConnectExternalTeamsList[t].lastUpdated}},0x42654967:(e,t,a)=>{"use strict";a.d(t,{$n:()=>x,$z:()=>resolveNextCursorMark,BQ:()=>b,CS:()=>T,F6:()=>S,H3:()=>E,HC:()=>formatDateInterval,HM:()=>getNumberAnnotation,IV:()=>f,Nq:()=>getUiPageForType,Ph:()=>A,S5:()=>I,VZ:()=>createQuery,Yx:()=>k,Zq:()=>y,a$:()=>h,cU:()=>formatYYYYMMDDToUnixTime,lV:()=>g,mB:()=>N,p5:()=>_,r5:()=>w,uL:()=>v,w5:()=>C});var l,r,n,i,s,o,c,d,m=a(0x205f4fb61),u=a(0x3711e82d),p=a(0x6960d8b9);a(0xb1f0729f);let _=350;var b=((l={}).Channels="channels",l.Messages="messages",l.Users="users",l.Files="files",l.Apps="apps",l.Teams="teams",l),f=((r={}).Overview="overview",r.Teams="teams",r.Channels="channels",r.Members="users",r.Apps="apps",r.Huddles="huddles",r.Clips="clips",r.SlackAi="slack-ai",r.Canvas="canvas",r.Workflows="workflows",r.Lists="lists",r),h=((n={}).TwentyEightDays="28d",n.SevenDays="7d",n.OneDay="1d",n.Custom="custom",n);let g={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"},x={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"},w={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"};var y=((i={}).ThirtyDays="30d",i.AllTime="all",i.Custom="custom",i.PrevMonth="prevMonth",i);let E={ThirtyDays:"30d",TwentyEightDays:"28d",ThirteenMonths:"13mo",AllTime:"all",Custom:"custom",PrevMonth:"prevMonth",SelectNewRange:"selectNewRange"},k={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"},S={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"};var v=((s={}).Default="default",s.Daily="daily",s.Monthly="monthly",s),A=((o={}).Number="number",o.Percentage="percentage",o.Date="date",o.String="string",o),T=((c={}).All="all",c.Audio="audio",c.Video="video",c),C=((d={}).All="all",d.Standalone="standalone",d.Channel="channel_canvas",d);let N=6,I={number:m.Ay,percentage:e=>(0,m.KN)(e/100),date:e=>(0,p.Yq)(e,"{date_num}"),string:e=>e},getUiPageForType=(e,t)=>t?({overview:u.UiPage.ADMIN_ANALYTICS_TEAM_SITE_OVERVIEW,channels:u.UiPage.ADMIN_ANALYTICS_TEAM_SITE_CHANNELS,users:u.UiPage.ADMIN_ANALYTICS_TEAM_SITE_MEMBERS,apps:u.UiPage.ADMIN_ANALYTICS_TEAM_SITE_APPS,"slack-ai":u.UiPage.ADMIN_ANALYTICS_TEAM_SITE_SLACK_AI})[e]:({overview:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_OVERVIEW,channels:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_CHANNELS,teams:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_TEAMS,users:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_MEMBERS,apps:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_APPS,clips:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_CLIPS,canvas:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_CANVAS,huddles:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_HUDDLES,"slack-ai":u.UiPage.ADMIN_ANALYTICS_TEAM_SITE_SLACK_AI,workflows:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_WORKFLOWS,lists:u.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_LISTS})[e];function getNumberAnnotation(e,t){let a="";if("ja-JP"===e)switch(t){case"channels":case"messages":a="\u4EF6";break;case"users":a="\u4EBA";break;case"files":case"apps":a="\u500B"}return a}let resolveNextCursorMark=({cursorMark:e,numFound:t,countRequested:a,countReturned:l,countSoFar:r})=>0===l||t<=a||t===r+l?null:e,formatYYYYMMDDToUnixTime=e=>{let t=new Date(e),a=6e4*t.getTimezoneOffset();return new Date(t.getTime()+a).getTime()};function formatDateInterval(e){let[t="",a=""]=e?.startDate.split("-")??[];return`${t}-${a}`}function createQuery({searchQuery:e,searchType:t="fuzzy_with_email"}){try{if("string"!=typeof e||!e.trim().length)return;let a=e.trim().split(/\s+/).map(e=>({type:t,value:e})),l=1===a.length?a[0]:{type:"and",clauses:a};return JSON.stringify(l)}catch{return}}},0xccd97fa5:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x120c268ad),i=a.n(n),s=a(0x20482ad21),o=a(0xdb33a144);let c=new s.Ay("threads");function ThreadSeparatorRowGeneric({replyCount:e=0,separatorType:t="default",clientTheme:a="light",ghost:n=!1,unreadMarkerKey:s,willPulse:d,threadsUnreadDataQa:m="",messageContainerType:u}){let p=(0,r.wA)(),_=Math.max(1,e),b=c.t("{count, plural, =1 {# reply} other {# replies}}",{count:_}),f=c.t("New"),h=i()("p-thread_separator_row_generic",{"p-thread_separator_row_generic--dark":"dark"===a,"p-thread_separator_row_generic--ghost":n}),[g,x]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e;return!n&&d&&(x(!0),e=window.setTimeout(()=>{x(!1),p((0,o.S)({unreadMarkerKey:s||"",messageContainerType:u,willPulse:!1}))},600)),()=>{e&&clearTimeout(e)}},[n,d,p,s,u]),l.createElement("div",{className:h},l.createElement("div",{className:"p-threads_flexpane__separator"},l.createElement("span",{className:"p-threads_flexpane__separator_count"},b),"default"===t&&l.createElement("hr",{className:"p-threads_flexpane__separator_line"}),"default"!==t&&l.createElement(l.Fragment,null,l.createElement("hr",{className:i()("p-threads_flexpane__separator_line",`p-threads_flexpane__separator_line__${t}`,{"p-threads_flexpane__separator_line--pulsing":g}),"aria-hidden":"true","data-qa":m}),l.createElement("span",{className:`p-threads_flexpane__${t}_divider__label`},f))))}ThreadSeparatorRowGeneric.displayName="ThreadSeparatorRowGeneric";let d=l.memo(ThreadSeparatorRowGeneric)},0x10490d62c:(e,t,a)=>{"use strict";a.d(t,{A:()=>useMuteNotification});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x6e87d4ec),s=a(0xe874a88a),o=a(0x22a29f141),c=a(0x1dfdeb1c8),d=a(0x1ec68d6a3),m=a(0xe747dd27);let u=(0,c.A)("salesHome.notifications.mutePrefs.update generated fetcher",(e,t,a)=>new s.S((l,r)=>{let{abortSignal:n,reason:i,...s}=a,c=(0,m.VA)(s);e((0,o.apiCall)({method:"salesHome.notifications.mutePrefs.update",args:c,abortSignal:n,reason:i})).then(e=>{l(e)}).catch(e=>{(0,d.default)({getState:t}).error(`API call to salesHome.notifications.mutePrefs.update
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));u.meta={name:"salesHomeNotificationsMutePrefsUpdateFetcher",key:"createFetcherSalesHomeNotificationsMutePrefsUpdateFetcher",description:"salesHome.notifications.mutePrefs.update generated fetcher"};var p=a(0x16ffed5ab);let _=new n.Ay("modernselling");function useMuteNotification(){let e=(0,r.wA)(),t=(0,l.useCallback)(t=>{e((0,p.M)({element:l.createElement(i.A,{svgIconProps:{name:"check"}},t?_.t("Notification muted. You\u2019ll stop receiving notifications with these conditions."):_.t("Notification unmuted"))}))},[e]);return(0,l.useCallback)(async(a,l)=>{await e(u({workflowId:a,isMuted:l,reason:"sales-notifications"})),t(l)},[e,t])}useMuteNotification.displayName="useMuteNotification"},0x1b7f0cd57:(e,t,a)=>{"use strict";a.d(t,{R:()=>WorkflowAvatar});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x85512121),s=a(0x710afd12),o=a.n(s);let WorkflowAvatar=class WorkflowAvatar extends l.PureComponent{static defaultProps={size:"medium",hasDecorativeAltTag:!0};render(){let{size:e,className:t,hasDecorativeAltTag:a,iconSrcUrl:r,altText:s}=this.props,c=r;return c||(c=i),l.createElement("img",{alt:a?"":s,className:n()(o().image,o()[e],t),src:c})}};WorkflowAvatar.displayName="WorkflowAvatar"},0x93d35cfe:(e,t,a)=>{"use strict";a.d(t,{Y:()=>MessagePreview});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x20482ad21),s=a(0x2501a2cee),o=a(0xccd97fa5),c=a(0x1b7f0cd57),d=a(0x668181b3),m=a(0x1ebe91b72),u=a(0x231441bf2),p=a(0x1795d8821),_=a(0x113cdbbd7),b=a(0x1991a9b6d),f=a(0xf1cb9c30),h=a(0x150f8d9c),g=a(0x6792c5b4),x=a(0x1bf20af7f),w=a(0xf271ff9b),y=a(0x1269e55c8),E=a(0x226892387),k=a(0x1fb2d2a87),S=a(0x73cfdc00),v=a.n(S);let A=new i.Ay("workflow_builder"),MessagePreview=({blocks:e,dataList:t,isThread:a,isPinned:r,workflowIcon:i,workflowName:S,workflowId:T,isEditor:C})=>{let N=(0,l.useMemo)(()=>({__meta__:{lastUpdatedTs:""},type:"message",ts:"0",channel:"WFB_MESSAGE_PREVIEW",subtype:"",blocks:e}),[e]),I=(0,l.useMemo)(()=>({item:e,getDefaultOutput:a})=>{if(e.type||!e.text)return a();let r=[],{text:n}=e,i=0;return(n.replace((0,m.gK)(),(e,a,s,o)=>{let c=n.substr(i,o-i);r.push(l.createElement(l.Fragment,{key:r.length},c));let m=(0,d.x)(t,a);if(m){let e=null;if(m.isAvailable)switch(m.type){case p.TE.SlackTypesUserId:case p.TE.SlackTypesUsergroupId:e=l.createElement(u.Dt,{key:r.length,variable:m});break;case p.TE.SlackTypesChannelId:e=l.createElement(u.GZ,{key:r.length,variable:m});break;default:e=l.createElement(u.UR,{key:r.length,variable:m})}else e=l.createElement(u.xH,{workflowId:T,key:r.length});r.push(e)}else r.push(l.createElement(l.Fragment,{key:r.length},e));return i=o+e.length,""}),r.length>0)?(i<n.length&&r.push(l.createElement(l.Fragment,{key:r.length},n.substring(i))),r):a()},[t,T]),M=(0,E.d4)(k.to),D=S;D||(D=A.t("Draft"));let P=(0,l.useMemo)(()=>l.createElement(c.R,{iconSrcUrl:i,altText:S}),[i,S]);return l.createElement(h.A,{subtype:"builder_message_preview",msg:N},l.createElement(u.Zs.Provider,{value:t},l.createElement(u.kA.Provider,{value:C?u.pE.WORKFLOW_EDITOR:null},l.createElement(f.Ay,{msg:N,className:n()("c-message_kit__message",v().container,r?v().pinnedBackground:"",{[v().transparent_background]:C})},a&&l.createElement(o.A,{replyCount:1,clientTheme:M,willPulse:!1}),r&&l.createElement("div",{className:v().pin},l.createElement(s.Ah,{name:"pin-filled"}),l.createElement("span",null,A.t("Pinned by {senderName}",{senderName:D,fallbackHash:"86b41d69dbeaa0f72084093ff87b543afabc99f3",fallbackHashNs:"message"}))),l.createElement(w.A,{msg:N},l.createElement(g.A,{light:P},l.createElement(y.A,{className:"c-message_kit__sender",name:D,memberIsHuman:!1,isUnknown:!1,isInteractive:!1,isWorkflow:!0}),l.createElement(x.A,null,l.createElement(b.A,{msg:N,customFormatHandler:I,blocksContainerContext:_.pi.workflow_message_preview}))))))))};MessagePreview.displayName="MessagePreview"},0x68e1de73:(e,t,a)=>{"use strict";a.d(t,{B:()=>QuestionPreviewList});var l=a(0xbad225b5),r=a(0x2501a2cee),n=a(0xc62077ca),i=a(0xe9c32bb),s=a(0x15a4ffb05),o=a(0xeddc23dd),c=a.n(o);let QuestionPreviewList=({dialogTitle:e,questions:t,showArrow:a=!1,showTitle:o=!1})=>l.createElement(l.Fragment,null,a&&l.createElement("span",{className:c().icon},l.createElement(r.Ah,{name:"arrow-down",inline:!0,size:"20"})),o&&l.createElement(i.nB,{className:c().title,weight:"bold"},l.createElement(s.A,{text:e})),l.createElement("ul",{className:c().list},t.map(e=>l.createElement(n.B,{key:e.name,question:e}))))},0xc62077ca:(e,t,a)=>{"use strict";a.d(t,{B:()=>QuestionPreview,s:()=>getQuestionTypeDef});var l=a(0xbad225b5),r=a(0x2501a2cee),n=a(0x38bda683),i=a(0x23465d793),s=a(0x1795d8821),o=a(0x23efb3294),c=a.n(o);let d={[n.xi.Text]:{questionType:n.xi.Text,baseType:"text",icon:"text-snippet"},[n.xi.Boolean]:{questionType:n.xi.Text,baseType:"boolean",icon:"radio-button"},[n.xi.Integer]:{questionType:n.xi.Integer,baseType:"integer",icon:"number"},[n.xi.Number]:{questionType:n.xi.Number,baseType:"number",icon:"number"},[n.xi.Textarea]:{questionType:n.xi.Textarea,baseType:"textarea",icon:"text-snippet"},[n.xi.RichText]:{questionType:n.xi.RichText,baseType:s.TE.SlackTypesRichText,icon:"formatting"},[n.xi.SelectStatic]:{questionType:n.xi.SelectStatic,baseType:"select",icon:"caret-dropdown"},[n.xi.SelectUser]:{questionType:n.xi.SelectUser,baseType:"select",icon:"user"},[n.xi.SelectConversation]:{questionType:n.xi.SelectConversation,baseType:"select",icon:"channel"},[n.xi.Date]:{questionType:n.xi.Date,baseType:s.TE.SlackTypesDate,icon:"calendar"},[n.xi.DateTime]:{questionType:n.xi.DateTime,baseType:s.TE.SlackTypesTimestamp,icon:"calendar"},[n.xi.ShortText]:{questionType:n.xi.ShortText,baseType:"string",icon:"text-snippet"},[n.xi.LongText]:{questionType:n.xi.LongText,baseType:"string",icon:"text-snippet"},[n.xi.SelectPerson]:{questionType:n.xi.SelectPerson,baseType:s.TE.SlackTypesUserId,icon:"user"},[n.xi.SelectChannel]:{questionType:n.xi.SelectChannel,baseType:s.TE.SlackTypesChannelId,icon:"channel"},[n.xi.Dropdown]:{questionType:n.xi.Dropdown,baseType:s.TE.SlackTypesLimitedRichText,icon:"caret-dropdown"},[n.xi.StaticMultiSelect]:{questionType:n.xi.StaticMultiSelect,baseType:"array",icon:"radio-button"},[n.xi.StaticMultiSelectWithCheckboxes]:{questionType:n.xi.StaticMultiSelectWithCheckboxes,baseType:"array",icon:"checkbox"},[n.xi.UserMultiSelect]:{questionType:n.xi.UserMultiSelect,baseType:"array",icon:"user-groups"},[n.xi.ChannelMultiSelect]:{questionType:n.xi.ChannelMultiSelect,baseType:"array",icon:"channel"},[n.xi.File]:{questionType:n.xi.File,baseType:"array",icon:"file"}},getQuestionTypeDef=e=>d[e]||{},QuestionPreview=({question:e})=>{let t=(0,i.l)(e),{icon:a}=t?getQuestionTypeDef(t):{icon:"text-snippet"};return l.createElement("li",{className:c().container},l.createElement("span",{className:c().icon},l.createElement(r.Ah,{inline:!0,name:a,size:"inherit"})),l.createElement("span",{className:c().label},e.label??e.title))};QuestionPreview.displayName="QuestionPreview"},0x1d1a513a:(e,t,a)=>{"use strict";a.d(t,{u:()=>useSlackConnectPrefsWorkflows});var l=a(0xbad225b5),r=a(0x12cc25ec2),n=a(0x20adb28cd),i=a(0x358bddfc),s=a(0x197981788),o=a(0x226892387),c=a(0x1887ed0ea);let useSlackConnectPrefsWorkflows=(e,t,a)=>{let d=(0,o.d4)(a=>t||(0,n.NN)(a,e)),m=d?.hermes_triggers_trippable_by_slack_connected_teams,u=(0,o.d4)(c.M7),p=(0,o.d4)(t=>void 0!==a?a.is_restricted:(0,n.lW)(t,e)),_=(0,o.d4)(t=>void 0!==a?a.restricted_by_connector_steps_only:(0,n.Yn)(t,e)),b=(0,l.useMemo)(()=>(0,s.Ul)(p??!1,_??!1),[p,_]);return{isTeamValidSCWorkflowTarget:(0,l.useCallback)(e=>{if(!d)return!0;if(u){if(b===i.U.FULL_RESTRICTED)return!1;if(b===i.U.RESTRICTED_BY_ONLY_CONNECTORS)switch(d.hermes_triggers_trippable_by_slack_connected_teams_mcp){case r.HF.NONE:case r.HF.SAFE:return d.allowed_teams_with_3p_connectors?.includes(e);case r.HF.SAFE_AND_3P:return!d.allowed_teams?.includes(e)&&!d.restricted_teams?.includes(e);default:return!0}switch(d?.hermes_triggers_trippable_by_slack_connected_teams_mcp){case r.HF.NONE:return d.allowed_teams.includes(e)||d.allowed_teams_with_3p_connectors?.includes(e);case r.HF.SAFE:case r.HF.SAFE_AND_3P:return!d.restricted_teams.includes(e);default:return!0}}return d.hermes_triggers_trippable_by_slack_connected_teams?!d.restricted_teams.includes(e):d.allowed_teams.includes(e)||(d.allowed_teams_with_3p_connectors?.includes(e)??!1)},[u,d,b]),workflowRestrictedStatus:b,isTrippableByAnySlackConnectedTeamByPrefs:(0,l.useMemo)(()=>u?!!d?.hermes_triggers_trippable_by_slack_connected_teams_mcp&&d?.hermes_triggers_trippable_by_slack_connected_teams_mcp!==r.HF.NONE||(d?.allowed_teams?.length??0)+(d?.allowed_teams_with_3p_connectors?.length??0)>0:!!m||(d?.allowed_teams?.length??0)+(d?.allowed_teams_with_3p_connectors?.length??0)>0,[u,m,d?.allowed_teams?.length,d?.allowed_teams_with_3p_connectors?.length,d?.hermes_triggers_trippable_by_slack_connected_teams_mcp])}}},0x210b99e76:(e,t,a)=>{"use strict";a.d(t,{m:()=>getStepIcon});let l=new Map([["open_form","form"],["send_message","message"],["reply_in_thread","threads"],["send_ephemeral_message","message"],["update_channel_topic","channel"],["create_channel","channel"],["invite_user_to_channel","channel"],["channel start message","channel"],["delay","hourglass"],["archive_channel","channel"],["unarchive_channel","channel"],["create_usergroup","user-groups"],["add_user_to_usergroup","user-groups"],["add_pin","channel"],["remove_pin","channel"],["remove_user_from_usergroup","user-groups"],["send_dm","message"],["create_channel_section","channel"],["add_channel_to_channel_section","channel"],["find_channels_by_keywords","channel"],["add_channel_list_to_section","channel"],["select_channels","channel"],["add_bookmark","bookmark"],["add_channel_manager","channel"],["create_list","lists"],["lists_fetch_columns","lists"],["list_add_record","lists"],["add_list_record","lists"],["share_list_users","lists"],["share_list_channels","lists"],["share_list","lists"],["read_list_record","lists"],["delete_list_record","lists"],["update_list_record","lists"],["copy_list","lists"],["lists_activity_feed","lists"],["send_task_list_alert","lists"],["create_items_due_summary","lists"],["canvas_create","canvas"],["canvas_update_content","canvas"],["canvas_update_content_v2","canvas"],["channel_canvas_create","canvas"],["add_canvas_to_channel_tab","canvas"],["share_canvas","canvas"],["share_canvas_in_thread","canvas"],["find_dm_or_mpdm_channel_canvas","canvas"],["canvas_copy","canvas"],["canvas_fetch_variables","canvas"],["canvas_update_variables","canvas"],["canvas_fetch_header_sections","canvas"],["send_to_sales_home","sales"],["send_to_my_sales_home","sales"],["send_summary_to_sales_home","sales"],["send_summary_to_my_sales_home","sales"],["send_to_record_channel","sales"],["create_record_channel","sales"],["lookup_record_channel","sales"],["lookup_channel_record","sales"],["send_to_salesforce_app","notifications"],["send_to_my_salesforce_app","notifications"],["add_reaction","emoji"],["remove_reaction","emoji"],["summarize_channel","ai-summary"],["search_summary","ai-summary"],["read_message","message"],["share_message","share-message"],["switch_step","branch"],["case_step","add-branch"],["loop_step","refresh"],["ask_agentforce","agentforce-filled"],["add_agent_to_channel","agentforce-filled"],["ai_answer","ai-sparkle"],["lookup_entities","search"],["lookup_from_list","search-files"]]),r=new Set(["send_to_record_channel","create_record_channel","lookup_record_channel","lookup_channel_record"]);function getStepIcon(e){let t=e?l.get(e):void 0;return e&&r.has(e)?"sf-record":t??"slack-logo"}},0x1312f060e:(e,t,a)=>{"use strict";a.d(t,{B:()=>isRichTextSectionElement});let isRichTextSectionElement=e=>!!(e&&"object"==typeof e&&"type"in e&&"rich_text_section"===e.type)},0x250ebc75c:(e,t,a)=>{"use strict";function transformSteps(e,t){function visit(e){return e.map(e=>{let a=t(e);if("steps"in e&&Array.isArray(e.steps)){let t=visit(e.steps);return{...a,steps:t}}return a})}return visit(e)}a.d(t,{c:()=>transformSteps})},0x24430233d:(e,t,a)=>{"use strict";a.d(t,{o:()=>getScheduleFrequencySummary});var l=a(0x20482ad21),r=a(0x1e864b930),n=a(0x124d99cb0),i=a(0x118af79e8);let s=new l.Ay("workflow_builder"),getScheduleFrequencySummary=e=>{let t,a=(0,n.lP)(e.startTime,e.timezone),l=(0,i.k)(e),o=a.isoWeekday();switch(l){case"daily":t=s.t("and repeats daily");break;case"weekdays":t=s.t("and repeats every weekday");break;case"weekly_same_day":t=s.t("and repeats weekly on {dayOfWeek}",{dayOfWeek:(0,n.au)(o,!0)});break;case"monthly_nth_day":t=(0,n.U7)((0,n.nA)(a,!0))(o);break;case"monthly":case"yearly":case"custom":t=(e=>{let t;if(!e.frequency)return"";let a=(0,n.lP)(e.startTime,e.timezone),{type:l,repeatsEvery:i=1,onDays:o,onWeekNum:c}=e.frequency,d=a.format("YYYY-MM-DD"),m=(0,n.Bz)(d),u=c??m,p=u?(0,n.fd)(u)?.(!0):(0,n.nA)(a,!0),_=(0,n.au)(a.isoWeekday(),!1),b=o?.map(e=>(0,n.U6)(e,!1));switch(l){case"hourly":t=1===i?s.t("and repeats hourly"):s.t("and repeats every {repeatsEvery, plural, =1 {hour} other {# hours}}",{repeatsEvery:i});break;case"daily":t=1===i?s.t("and repeats daily"):s.t("and repeats every {repeatsEvery, plural, =1 {day} other {# days}}",{repeatsEvery:i});break;case"weekly":t=b?s.t("and repeats every {repeatsEvery, plural, =1 {week} other {# weeks}} on {daysOfWeekList}",{repeatsEvery:i,daysOfWeekList:(0,r.A)(b).join("")}):s.t("and repeats on a custom schedule");break;case"monthly":t=o||c?s.t("and repeats every {repeatsEvery, plural, =1 {month} other {# months}} on the {dayOfWeekOrdinal} {dayOfWeek}",{repeatsEvery:i,dayOfWeekOrdinal:p,dayOfWeek:_}):1===i?s.t("and repeats monthly"):s.t("and repeats every {repeatsEvery, plural, =1 {month} other {# months}}",{repeatsEvery:i});break;case"yearly":t=1===i?s.t("and repeats annually"):s.t("and repeats every {repeatsEvery, plural, =1 {year} other {# years}}",{repeatsEvery:i});break;default:t=s.t("and repeats on a custom schedule")}return t})(e);break;default:t=""}return t}},0xdfa9cb32:(e,t,a)=>{"use strict";a.d(t,{M:()=>getScheduleSummary});var l=a(0x20482ad21),r=a(0x124d99cb0),n=a(0x24430233d),i=a(0x6960d8b9);let s=new l.Ay("workflow_builder"),getScheduleSummary=(e,t={})=>{let{do24hrTime:a}=t,l=(0,r.lP)(e.startTime,e.timezone),o=(0,i.Od)(l,{excludeYear:!0,uncapitalizedRelativeDay:!0}),c=(0,i.xe)(l,{do24hrTime:a}),d=(0,n.o)(e);return s.t("Starts {humanReadableDate} at {humanReadableTime}{repeat}",{humanReadableDate:o,humanReadableTime:c,repeat:d?` ${d}`:d,fallbackHash:"457f9c0427f3b60305b95dc44d845dc00aa06724"})}},0x146e4ebc8:(e,t,a)=>{"use strict";a.d(t,{V:()=>ActionBarForward});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x8601851c),i=a(0x40c0d834),s=a(0x20482ad21),o=a(0x344bb842),c=a(0x2501a2cee),d=a(0x4c96e5d9),m=a(0x11036d95f),u=a(0xe874a88a),p=a(0x22a29f141),_=a(0x1dfdeb1c8),b=a(0x1ec68d6a3),f=a(0xe747dd27);let h=(0,_.A)("salesHome.notifications.formatShare generated fetcher",(e,t,a)=>new u.S((l,r)=>{let{abortSignal:n,reason:i,...s}=a,o=(0,f.VA)(s);e((0,p.apiCall)({method:"salesHome.notifications.formatShare",args:o,abortSignal:n,reason:i})).then(e=>{l(e)}).catch(e=>{(0,b.default)({getState:t}).error(`API call to salesHome.notifications.formatShare
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));h.meta={name:"salesHomeNotificationsFormatShareFetcher",key:"createFetcherSalesHomeNotificationsFormatShareFetcher",description:"salesHome.notifications.formatShare generated fetcher"};var g=a(0x3711e82d),x=a(0x32d3ef3d),w=a(0xcea4a81c),y=a(0x113cdbbd7),E=a(0x1608420cc),k=a(0x103f48cb9),S=a(0x1506d547b),v=a(0xf7a922a4),A=a(0x181fc1a60);let T=(0,_.A)("salesHome.notifications.share generated fetcher",(e,t,a)=>new u.S((l,r)=>{let{abortSignal:n,reason:i,...s}=a,o=(0,f.VA)(s);e((0,p.apiCall)({method:"salesHome.notifications.share",args:o,abortSignal:n,reason:i})).then(e=>{l(e)}).catch(e=>{(0,b.default)({getState:t}).error(`API call to salesHome.notifications.share
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));T.meta={name:"salesHomeNotificationsShareFetcher",key:"createFetcherSalesHomeNotificationsShareFetcher",description:"salesHome.notifications.share generated fetcher"};var C=a(0x1d600678),N=a(0xa6b90d4b),I=a(0x24cf1145d),M=a(0x226892387);let D=new s.Ay("modernselling"),ForwardNotificationModal=e=>{let{createdTs:t,notificationType:a,isAdminCreated:n,msgOps:s,selectedChannelId:o,opportunityId:c,attachmentBlocks:d,salesforceRecord:m}=e,u=(0,r.wA)(),p="forward-sales-notification-dialog",_=D.t("Forward this notification");c&&(_=D.t("Forward this record update"));let b=D.t("Forward"),f=(0,l.useCallback)(()=>u((0,I.I)({channelOrMemberId:o,reason:p})).then(e=>{let a=u((0,N.A)({msgOps:s,channelId:e}))||[];return u(T({createdTs:t,channelId:e,...a.length&&{shareBlocks:a},reason:"sales-home-forward-notification",opportunityId:c}))}),[u,o,s,t,c]),h=(0,l.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_modal_btn",elementValue:t}),[t]),v=(0,l.useMemo)(()=>d&&l.createElement("div",{className:"c-message_attachment_v2"},l.createElement(k.A,{version2:!0}),l.createElement("div",null,l.createElement(E.A,{blocks:d,service:void 0,channelId:o,blocksContainerContext:y.pi.share_dialog}),m&&l.createElement("div",{className:"margin_top_100"},l.createElement(w.a,{entityState:x.w.enabled,size:x.S.expanded,record:m,showActionsBar:!1,isInteractive:!1})))),[d,m,o]),P=(0,M.d4)(e=>(0,C.x)(e,"salesforce_forwarding")?.default==="speedbump");return l.createElement(i.A,{eventId:g.EventId.LOB_SALES_HOME,uiComponentName:g.UiComponentName.LOB_NOTIFICATION_FORWARD_MODAL,channelId:o,lobNotificationType:a,isLobNotificationWorkflowAdmin:n},l.createElement(S.A,{...e,title:_,goButtonText:b,goButtonAutoClogProps:h,goHandler:f,dialogType:A.hs.NOTIFICATION,shareReason:p,notificationType:a,attachment:v,forwardingSpeedbumpEnabled:P}))};ForwardNotificationModal.displayName="ForwardNotificationModal";let P=(0,v.A)(ForwardNotificationModal);var O=a(0x11c82607b),L=a(0x46dbff89);let R=(0,O.Ay)("Opens the Forward Notification Modal",(e,t,a)=>{e((0,L.q)({element:l.createElement(P,a)}))});R.meta={name:"openForwardNotificationModal",key:"createThunkOpenForwardNotificationModal",description:"Opens the Forward Notification Modal"};let F=new s.Ay("modernselling"),ActionBarForward=({hasFocus:e,createdTs:t,notificationType:a,isAdminCreated:s,opportunityId:u})=>{let p=(0,r.wA)(),{maybeClosePeek:_}=(0,l.useContext)(m.Z),b=F.t("Forward notification");u&&(b=F.t("Forward record update"));let f=(0,l.useCallback)(()=>!e,[e]),x=(0,l.useCallback)(async e=>{e.stopPropagation();let l=await p(h({createdTs:t,opportunityId:u,reason:"sales-home-get-notification-blocks"}));if(l&&l.ok){let{content_blocks:e,attachment_blocks:r,salesforce_record:n}=l;p(R({createdTs:t,notificationType:a,isAdminCreated:s,contentBlocks:e,attachmentBlocks:r,salesforceRecord:n,opportunityId:u}))}_()},[p,t,u,_,a,s]),w=(0,l.useCallback)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_action_bar",elementValue:t}),[t]);return(0,l.useEffect)(()=>{let e=new n.A;return e.bindAll([{keys:["f"],handler:x,filter:f,action:"keyup"}]),()=>e.reset()},[f,x]),l.createElement(i.A,{eventId:g.EventId.LOB_SALES_HOME,uiComponentName:g.UiComponentName.LOB_NOTIFICATION_ACTIONS_BAR,lobNotificationType:a,isLobNotificationWorkflowAdmin:s},l.createElement(d.Ay,{tip:b,position:"top"},l.createElement(o.A,{"aria-label":b,onClick:x,className:"c-message_actions__button",size:"small",autoClogProps:w()},l.createElement(c.Ah,{name:"share-message"}))))};ActionBarForward.displayName="ActionBarForward"},0x1090ee536:(e,t,a)=>{"use strict";a.d(t,{H:()=>ActionBarMore});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x344bb842),i=a(0x99233ecb),s=a(0x4c96e5d9);let o=new r.Ay("modernselling"),ActionBarMore=({children:e,onMenuOpen:t,onMenuClose:a})=>{let r=(0,l.useCallback)(t=>l.createElement(i.Ay,t,e),[e]);return l.createElement(i.cQ,{onOpen:t,onClose:a,renderMenu:r,position:"left-bottom"},l.createElement(s.Ay,{tip:o.t("More actions"),position:"top"},l.createElement(n.A,{"aria-label":o.t("More actions"),className:"c-message_actions__button",size:"small",svgIconProps:{name:"ellipsis-vertical-filled"}})))};ActionBarMore.displayName="ActionBarMore"},0x21b980720:(e,t,a)=>{"use strict";a.d(t,{E:()=>ActionBar});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r);let ActionBar=({children:e,isVisible:t})=>l.createElement("div",{className:n()("p-sales_feed__action_bar",t&&"p-sales_feed__action_bar--visible")},l.createElement("div",{className:"c-message_actions__container"},l.createElement("div",{className:"c-message_actions__group",role:"group"},e)));ActionBar.displayName="ActionBar"},0x139d2f9a8:(e,t,a)=>{"use strict";a.d(t,{_:()=>useMenuItemCreator});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0xf4097f62),s=a(0x13638bd77);let o=new n.Ay("modernselling"),useMenuItemCreator=e=>{let t=(0,r.wA)(),a=(0,l.useCallback)(()=>{t((0,s.b)({memberId:e}))},[t,e]);return{label:o.rt("Notification created by {admin}",{admin:l.createElement(i.A,{id:e})}),onSelect:a}};useMenuItemCreator.displayName="useMenuItemCreator"},0xcdc086ce:(e,t,a)=>{"use strict";a.d(t,{e:()=>useMenuItemEdit});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x156eec78a),s=a(0x139aa1a7),o=a(0xcefedbca);let c=new n.Ay("modernselling"),useMenuItemEdit=(e,t=!1)=>{let a=(0,i.Q)(),n=(0,r.wA)(),d=(0,l.useCallback)(()=>{e&&(a({viewType:t?s.D.SalesAdministration:s.D.SalesNotifications}),n((0,o.A)({workflowId:e,isAdmin:t})))},[e,a,n,t]),m=(0,l.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"lob_notifications_edit",workflowId:e,isLobNotificationWorkflowAdmin:t}),[t,e]);return{label:c.t("Edit notification conditions"),onSelect:d,autoClogProps:m}}},0xc77a8bc3:(e,t,a)=>{"use strict";a.d(t,{z:()=>useMenuItemMute});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x10490d62c);let i=new r.Ay("modernselling"),useMenuItemMute=(e,t)=>{let a=(0,n.A)(),[r,s]=(0,l.useState)(t),o=(0,l.useCallback)(()=>{e&&a(e,!r).then(()=>{s(!r)})},[a,r,e]),c=i.t("Mute notification"),d=i.t("Unmute notification");return{label:r?d:c,onSelect:o}}},0x23b93d6d0:(e,t,a)=>{"use strict";a.d(t,{Z:()=>FeedItemScheduled});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0xb90d5858),i=a(0x2501a2cee),s=a(0x21b980720),o=a(0x1090ee536),c=a(0x139d2f9a8),d=a(0xcdc086ce),m=a(0xc77a8bc3),u=a(0x1e5093c5a),p=a(0xfca33088),_=a(0xbf61ff25);let b=new r.Ay("modernselling"),FeedItemScheduled=({notification:e,isWorkflowPreview:t,isStepPreview:a,...r})=>{let{is_acn:f,is_workflow_deleted:h,is_workflow_editable:g,is_workflow_muted:x,notification_display_columns:w,notification_display_type:y,payload:{opportunities:E,generic_records:k,workflow:S},workflow_created_by:v,workflow_id:A,salesforce_org_id:T,created_ts:C}=e,N=(0,m.z)(A,x),I=(0,d.e)(A,f),M=(0,c._)(v),D=(0,l.useMemo)(()=>l.createElement(i.Ah,{name:"calendar"}),[]),P=(0,l.useCallback)(({isVisible:e,onMenuOpen:t,onMenuClose:a})=>{let r=f&&!!A&&!h,i=g&&!h;return r||i||f?l.createElement(s.E,{isVisible:e},l.createElement(o.H,{onMenuOpen:t,onMenuClose:a},r&&l.createElement(n.A,{onSelected:N.onSelect},N.label),i&&l.createElement(n.A,{onSelected:I.onSelect,autoClogProps:I.autoClogProps},I.label),f&&l.createElement(n.A,{className:"padding_top_75",description:M.label,onSelected:M.onSelect}))):null},[f,A,N,I,M,g,h]),O=(0,l.useCallback)(()=>{let e=k?.length?k:E;return w?.length&&e?.length&&S?.subtitle?l.createElement(p.N,{columns:w,displayType:y,records:e,title:S.subtitle,workflowId:A,salesforceOrgId:T,notificationCreatedTs:C,isWorkflowPreview:t,isStepPreview:a}):null},[k,E,w,S.subtitle,y,A,T,C,t,a]);return l.createElement(u.G,{...r,headerIcon:D,headerText:b.t("Scheduled"),iconFallbackUrl:_,notification:e,renderActionBar:P,renderMore:O,isWorkflowPreview:t,isStepPreview:a})};FeedItemScheduled.displayName="FeedItemScheduled"},0x1e5093c5a:(e,t,a)=>{"use strict";a.d(t,{G:()=>FeedItem});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x120c268ad),i=a.n(n),s=a(0x14fad6485),o=a(0x40c0d834),c=a(0x1faa3f1ac),d=a(0x113cdbbd7),m=a(0x944e06df),u=a(0x754ea859),p=a(0x184825275),_=a(0x6960d8b9),b=a(0xc0b7c558);let FeedItem=({hasFocus:e,headerIcon:t,headerText:a,headerLinkUrl:n,iconFallbackUrl:f,isFirst:h,notification:g,renderActionBar:x,renderInlineActions:w,renderMore:y,withHeaderWrapper:E,isWorkflowPreview:k,isStepPreview:S})=>{let{body:v,workflow_id:A,created_ts:T,icon_url:C,is_unread:N,salesforce_org_id:I,payload:{workflow:{title:M,service_id:D,service_team_id:P},opportunities:O=[],records:L=[]}}=g,{windowRef:R}=(0,l.useContext)(s._0),F=(0,l.useRef)(null),[W,H]=(0,l.useState)(!1),[U,B]=(0,l.useState)(!1),q=e||W||U,z=(0,r.wA)(),V=(0,l.useCallback)(()=>{H(!0)},[]),j=(0,l.useCallback)(()=>{H(!1)},[]),$=(0,l.useCallback)(()=>{B(!0)},[]),Y=(0,l.useCallback)(()=>{B(!1),R.deref()?.requestAnimationFrame(()=>{H(F.current?.matches(":hover")===!0)})},[R]),G=(0,l.useCallback)(()=>{let e=O.length?O[0]?.slack_record_id:(0,b.j)(I,L[0].record_identifier);e&&z((0,u.c)({recordId:e}))},[z,O,L,I]),Q=(0,l.useMemo)(()=>{let e=l.createElement("div",{className:i()("display_flex align_items_center",{sk_foreground_max:!N,sk_primary_foreground:N,bold:N})},t,l.createElement("div",{className:"caption margin_left_25 margin_right_25"},a));if(n){let t=O.length||L.length&&I;e=l.createElement(c.A,{className:"p-sales_feed__item__header__link",href:t?"":n,target:"_blank",onClick:t?G:void 0},e)}return E&&(e=E(e)),e},[N,t,a,n,E,G,O,L,I]),K=(0,l.useMemo)(()=>({hasFocus:e,isVisible:q,onMenuOpen:$,onMenuClose:Y}),[Y,$,e,q]),Z=(0,l.useCallback)(e=>{let t={serviceId:D,serviceTeamId:P,container:{type:d.pi.lob_notification,notificationTs:T},actions:[e]};return z((0,p.W)(t))},[D,P,T,z]);return l.createElement(o.A,{clogImpression:!0,elementName:"lob_sales_notification_item",elementValue:T,workflowId:A},l.createElement("div",{ref:F,onPointerOver:V,onPointerLeave:j,className:i()("p-sales_feed__item",{"p-sales_feed__item--first":h,"p-sales_feed__item--preview":k,"p-sales_feed__item--no-border":k&&!S})},l.createElement("div",{className:i()("p-sales_feed__item__inner",{"p-sales_feed__item__inner--preview":k})},!k&&l.createElement("div",{className:"display_flex justify_content_between align_items_center"},Q,l.createElement("div",{className:"display_flex align_items_center"},l.createElement("div",{className:i()("caption",{bold:N})},(0,_.Yq)(T,"{status_expiration}")),N&&l.createElement("div",{className:"p-sales_feed__item__unread_dot"}))),l.createElement("div",{className:i()("display_flex",{margin_top_50:!k})},l.createElement("img",{className:"p-sales_feed__item__icon",src:C||f,alt:M}),l.createElement("div",{className:"flex_one display_flex"},l.createElement("div",{className:"flex_one"},l.createElement("div",{className:"sk_primary_foreground black"},M),l.createElement(m.A,{blocks:v,blocksContainerContext:d.pi.sales_home_notification,onAction:Z}),y?.()),w&&l.createElement("div",{className:"flex_shrink_none"},w()))),x?.(K))))};FeedItem.displayName="FeedItem"},0x129529b49:(e,t,a)=>{"use strict";a.d(t,{E:()=>OpportunityHoverCardTrigger});var l=a(0xbad225b5),r=a(0x1cbdfeceb),n=a(0x217f0c263),i=a(0x14fad6485),s=a(0x1f3598f80),o=a(0xc745739a),c=a(0x20482ad21),d=a(0x2b7f0bcc),m=a(0x102edf836),u=a(0x11a296110),p=a(0x1ee57b3a0),_=a(0x1fa67866c),b=a(0xb1ea448c),f=a(0x128d54e52),h=a(0x1535e80f3),g=a(0x15fb82076),x=a(0x2501a2cee),w=a(0x4c96e5d9),y=a(0x12b6a33fc),E=a(0x16cf1da63),k=a(0xe874a88a),S=a(0x22a29f141),v=a(0x1dfdeb1c8),A=a(0x1ec68d6a3),T=a(0xe747dd27);let C=(0,v.A)("sfdc.getOpportunity generated fetcher",(e,t,a)=>new k.S((l,r)=>{let{abortSignal:n,reason:i,...s}=a,o=(0,T.VA)(s);e((0,S.apiCall)({method:"sfdc.getOpportunity",args:o,abortSignal:n,reason:i})).then(e=>{l(e)}).catch(e=>{(0,A.default)({getState:t}).error(`API call to sfdc.getOpportunity
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));function useFetchOpportunityInfo(){let e=(0,E.wA)();return(0,l.useCallback)((t,a)=>e(C({id:t,reason:"sales-home-get-opportunity-info",salesforceOrgId:a})),[e])}C.meta={name:"sfdcGetOpportunityFetcher",key:"createFetcherSfdcGetOpportunityFetcher",description:"sfdc.getOpportunity generated fetcher"};var N=a(0x1c659cbb1),I=a(0x110b4f809),M=a(0xe38b5635),D=a(0x1ed767a16),P=a(0x6960d8b9),O=a(0x226892387),L=a(0x1c8beab7f);let R=a.p+"crown-f27246b.svg",F=new c.Ay("modernselling"),W={elementName:"open_in_salesforce",onClick:{enableClogAction:!0}},H={elementName:"copy_opportunity_link",onClick:{enableClogAction:!0}},U=new RegExp(/\bhttps?:\/\/[^\s]+\b/g),OpportunityNextStep=({nextStep:e})=>{let t=e.split(U),a=e.match(U)||[],r=t.reduce((e,t,r)=>{if(e.push(t),r<a.length){let t=a[r];e.push(l.createElement(g.A,{key:r+t,href:t}))}return e},[]);return l.createElement(l.Fragment,null,r)};OpportunityNextStep.displayName="OpportunityNextStep";let OpportunityHoverCard=({opportunity:e,record:t,salesforceOrgId:a})=>{let r,n=e?.id??t?.record_identifier,i=e?.record_link??t?.record_link,s=useFetchOpportunityInfo(),o=(0,O.d4)(L.cc),[c,g]=(0,l.useState)(),[E,k]=(0,l.useState)(!0),[S,v]=(0,l.useState)(!1),[A,T]=(0,I.A)(!1,2e3);(0,l.useEffect)(()=>{n&&s(n,a).then(e=>{g(e)}).catch(()=>{v(!0)}).finally(()=>{k(!1)})},[s,n,a]);let C=(0,l.useCallback)(()=>l.createElement(N.f1,{className:"p-sales_feed__opp_hover_card_avatar",size:36,imageUrl:R,isInteractive:!1}),[]),U=(0,l.useCallback)(()=>l.createElement(N.Ay,{className:"c-base_entity__avatar",size:h.RG.small,userId:e?.owner.slack_user_id,isInteractive:!1,tabIndex:-1,ariaHidden:!0}),[e]),B=(0,l.useCallback)(()=>{(0,D.x3)(i),T(!0)},[i,T]),q=o.length>1?o.find(e=>e.salesforce_org_id===a)?.name:void 0;return r=c?q?c.account?.name?F.rt("Opportunity in {account_name}, <b>{salesforceOrgName}</b>",{account_name:c.account.name,salesforceOrgName:q}):F.rt("Opportunity in <b>{salesforceOrgName}</b>",{salesforceOrgName:q}):c.account?.name?F.t("Opportunity in {account_name}",{account_name:c.account.name}):F.t("Opportunity"):q?F.rt("Opportunity in <b>{salesforceOrgName}</b>",{salesforceOrgName:q}):"Opportunity",l.createElement(M.A,{elevation:4,size:"medium",className:"p-sales_feed__opp_hover_card"},E&&l.createElement(_.A,{className:"margin_top_200"},l.createElement(b.A,{size:"jumbo"})),S&&l.createElement(_.A,null,l.createElement(d.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},F.rt("Oops\u2026 we had trouble fetching opportunity info"))),c&&l.createElement(l.Fragment,null,l.createElement(p.A,null,l.createElement(f.Ay,{size:"medium",avatar:C,text:l.createElement(f.CG,{className:"black",withTruncationTooltip:!0},c.name),subtext:l.createElement(f.sT,{className:"caption p-sales_feed__opp_hover_card_header_subtext"},r)})),l.createElement(_.A,null,l.createElement("div",{className:"p-sales_feed__opp_hover_card_details_container"},l.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details"},l.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},F.t("Stage")),l.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details_pill"},c.stage)),l.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},l.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},F.t("Close date")),(0,P.Yq)((0,P.$4)(c.close_date,{parseFormat:"YYYY-MM-DD",returnMoment:!0}),"{date_slash}")),l.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},l.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},F.t("Amount")),c.amount.display_value),l.createElement("div",{className:"p-sales_feed__opp_hover_card_owner_details"},l.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},F.t("Owner")),l.createElement(f.Ay,{avatar:U,className:"c-member c-member--small",text:l.createElement("span",{className:"c-member__primary_content"},l.createElement(f.CG,{className:"c-member_name"},c.owner.name)),size:"small"}))),""!==c.next_step?l.createElement("div",{className:"p-sales_feed__opp_hover_card_next_steps_details"},l.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},F.t("Next Step")),l.createElement(OpportunityNextStep,{nextStep:c.next_step})):null,l.createElement("div",{className:"p-sales_feed__opp_hover_card_actions"},l.createElement(m.z9,{className:"p-sales_feed__opp_hover_card_linkbutton",size:"medium",type:"outline",href:i,autoClogProps:W},l.createElement("span",{className:"p-sales_feed__opp_hover_card_linkbutton_text"},F.t("Open in Salesforce")),l.createElement(x.Ah,{inline:!0,name:"new-window"})),l.createElement(w.Ay,{tip:A?F.t("Copied!"):F.t("Copy link"),status:A?y.YU.Success:y.YU.Info},l.createElement(u.Ay,{className:"p-sales_feed__opp_hover_card_copybutton",size:"medium",type:"outline",onClick:B,autoClogProps:H,"aria-label":A?F.t("Copied"):F.t("Copy Salesforce Url")},l.createElement(x.Ah,{name:"files"})))))))};OpportunityHoverCard.displayName="OpportunityHoverCard";let OpportunityHoverCardTrigger=({children:e,opportunity:t,record:a,salesforceOrgId:c})=>{let{windowRef:d}=(0,l.useContext)(i._0),[m,u]=(0,l.useState)(null),p=(0,l.useRef)(null),_=(0,l.useCallback)(()=>{let e=(e=>{let{pageYOffset:t,innerWidth:a,innerHeight:l}=e.deref()||{pageYOffset:0,innerWidth:0,innerHeight:0};return{top:(0,o.ci)(t+10),right:a-16,bottom:t+l-10,left:16}})(d),t=p.current.getBoundingClientRect(),a={top:void 0,bottom:void 0,right:void 0,left:void 0},l=t.right+345>e.right,r=t.bottom+250>e.bottom,n=t.top-250<e.top;if(l){let l=e.right-(t.left+345)<0;r&&n?(a.top=t.bottom+12,a.right=e.right-t.left+25):(r?a.bottom=e.bottom-t.y+12:n?a.top=t.bottom+12:a.bottom=e.bottom-t.y+25,a.left=t.left),l&&(a.right=12,a.left="auto")}else n&&r?(a.top=t.top-100,a.left=t.right+12):r?(a.left=t.left,a.bottom=e.bottom-t.y+25):n?(a.top=t.bottom+12,a.left=t.left):(a.left=t.right+12,a.top=t.top);return a},[d]),b=(0,l.useCallback)(()=>{u(null)},[]),f=(0,l.useCallback)(()=>{let e=_();u(l.createElement(n.A,{isOpen:!0,className:"opportunity-hover-modal",overlayClassName:"p-sales_feed__opportunity_hover_card__modal",shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,onRequestClose:b},l.createElement("div",{className:"p-sales_feed__opportunity_hover_card__popover",style:e},l.createElement(OpportunityHoverCard,{record:a,opportunity:t,salesforceOrgId:c}))))},[_,a,t,b,c]),[h,g]=(0,s.i)(f),[x,w]=(0,s.i)(b),y=(0,l.useCallback)(()=>(w(),m)?void g():h(350),[w,h,g,m]),E=(0,l.useCallback)(()=>(g(),m)?x(250):void w(),[g,x,w,m]);return l.createElement("span",{className:"p-sales_feed__opportunity_hover_card",onMouseOver:y,onMouseLeave:E,onClick:y,role:"presentation",onFocus:r.A,ref:p},e,m)};OpportunityHoverCardTrigger.displayName="OpportunityHoverCardTrigger"},0xfca33088:(e,t,a)=>{"use strict";a.d(t,{N:()=>F});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x11a296110),s=a(0x2501a2cee),o=a(0x1fdec3e16),c=a(0x16cf1da63),d=a(0x77727995),m=a(0x130d89881),u=a(0x1a043bf26),p=a(0x20482ad21),_=a(0x1d104c491),b=a(0x2493ba930),f=a.n(b);let h=new p.Ay("workflow_builder");function getColumnSortField(e){return e.sort_payload_field??e.payload_field}let getGenericRecordValue=(e,t)=>{let a=(0,d.A)(e.record_fields,t.key);return a.record_field_sort_value??a.record_field_rendered_value},isGenericRecord=e=>"record_identifier"in e&&void 0!==e.record_identifier;function getRecordKey(e){return isGenericRecord(e)?e.record_identifier:e.id}function getRecordName(e){return isGenericRecord(e)?e.record_name??h.t("Missing Data"):e.name}function getObjectType(e){return isGenericRecord(e)?e.object_identifier:_.Dj.Opportunity}function getRecordField(e,t){return isGenericRecord(e)?getGenericRecordField(e,t)??h.t("Missing Data"):e[t]}function getGenericRecordField(e,t){return e.record_fields[t]?.record_field_rendered_value}function getInitialSortByValue(e){let t=e.find(e=>e.primary_sort)||e[0],a=t?.primary_sort?.toLowerCase();return{key:getColumnSortField(t),dir:"desc"===a||"descending"===a?"desc":"asc"}}function getDisplayTypeClassNames(e){return{text:f()[`${e}_text`]||f().standard_text,border:f()[`${e}_border`]||f().standard_border,borderDark:f()[`${e}_border_dark`]||f().standard_border_dark,lightText:f()[`${e}_light_text`]||f().standard_light_text,background:f()[`${e}_background`]||f().standard_background}}function RecordsListTableHeader({column:e,displayType:t,isSortAsc:a,isSortKey:r,onClick:c}){let d=getDisplayTypeClassNames(t);return l.createElement(i.Nm,{onClick:c,className:n()(f().records_list_table_cell,f().records_list_table_cell_header,d.text)},l.createElement(o.A,{withTooltip:!0,lines:1},e.name),r&&l.createElement(s.Ah,{name:a?"arrow-up":"arrow-down",size:"16"}))}RecordsListTableHeader.displayName="RecordsListTableHeader";let g=new p.Ay("modernselling");function RecordsListTablePagination({pageRange:[e,t],totalItems:a,autoClogProps:r,onNextClick:n,onPrevClick:o}){return l.createElement("div",{className:f().records_list_table_pagination},l.createElement(i.Nm,{"aria-label":g.t("Previous page"),autoClogProps:r,disabled:!o,onClick:o},l.createElement(s.Ah,{name:"caret-left",size:"16"})),l.createElement("span",null,g.t("Showing {start}-{end} of {totalItems}",{start:e+1,end:t,totalItems:a})),l.createElement(i.Nm,{"aria-label":g.t("Next page"),autoClogProps:r,disabled:!n,onClick:n},l.createElement(s.Ah,{name:"caret-right",size:"16"})))}RecordsListTablePagination.displayName="RecordsListTablePagination";var x=a(0x4c96e5d9),w=a(0x146e4ebc8),y=a(0x174bb7323),E=a(0x1faa3f1ac),k=a(0x1feb18f19),S=a(0x129529b49),v=a(0x11928a844),A=a.n(v);let Stage=e=>l.createElement("div",{className:n()(A().stage,{[A().previous]:"previous"===e.type,[A().current]:"current"===e.type})},l.createElement(o.A,{lines:1,withTooltip:!0},e.children));Stage.displayName="Stage";var T=a(0x113cdbbd7),C=a(0x944e06df),N=a(0x81d6854c),I=a(0xf01a9d50);let M=new p.Ay("modernselling");function MaybeHoverCard({record:e,children:t,shouldHide:a,salesforceOrgId:r}){return a||isGenericRecord(e)?l.createElement(l.Fragment,null,t):l.createElement(S.E,{opportunity:e,salesforceOrgId:r},t)}function MaybeLink({record:e,children:t,shouldHide:a}){return a?l.createElement(l.Fragment,null,t):l.createElement(E.A,{href:e.record_link},t)}MaybeHoverCard.displayName="MaybeHoverCard",MaybeLink.displayName="MaybeLink";let renderRecordDeltaValue=e=>{if(isGenericRecord(e)||!e.amount_change||!e.amount_change_raw)return null;let t=e.amount_raw?.amount||0,a=e.amount_change_raw.amount,r=e.amount_change_raw.percent,n=!t&&100===r,i=`${n?"-":""}${r}%`;return 0x7fffffff===r&&(i=M.t("New")),l.createElement("div",{className:n||a<0?f().amount_change_negative:f().amount_change_positive},l.createElement(o.A,{lines:1,withTooltip:!0},l.createElement("span",{className:"bold"},e.amount_change),l.createElement("span",null," (",i,")")))};renderRecordDeltaValue.displayName="renderRecordDeltaValue";let renderRecordNameValue=(e,t,{isPreview:a,showHoverCard:r},n)=>l.createElement(MaybeHoverCard,{record:e,shouldHide:a||!r,salesforceOrgId:n},l.createElement(MaybeLink,{record:e,shouldHide:!r},l.createElement(E.A,null,l.createElement(o.A,{lines:1},l.createElement(s.Ah,{inline:!0,...(0,I.C)(getObjectType(e))}),l.createElement("span",{className:"margin_left_25 bold"},getRecordName(e)))))),renderOpportunityRecordStageChangeValue=e=>l.createElement(k.c,{space:"75"},l.createElement(Stage,{type:"previous"},e.prev_stage),l.createElement(s.Ah,{name:"arrow-right"}),l.createElement(Stage,{type:"current"},e.stage));renderOpportunityRecordStageChangeValue.displayName="renderOpportunityRecordStageChangeValue";let renderOpportunityRecordRichTextValue=(e,t)=>"close_date_change"===t.payload_field?l.createElement(C.A,{blocks:e.close_date_change?.blocks,blocksContainerContext:T.pi.sales_home_notification}):l.createElement(k.c,{space:"75"},l.createElement(N.A,null));renderOpportunityRecordRichTextValue.displayName="renderOpportunityRecordRichTextValue";let renderOpportunityRecordStageValue=e=>l.createElement(Stage,{type:"current"},e.stage);renderOpportunityRecordStageValue.displayName="renderOpportunityRecordStageValue";let renderRecordValueAsString=(e,t)=>l.createElement(o.A,{lines:1,withTooltip:!0},l.createElement("span",{className:t.primary_sort?"bold":void 0},(0,y.A)(getRecordField(e,t.payload_field))));function renderRecordValue(e,t,a,l){return isGenericRecord(e)?renderGenericRecordValue(e,t,a):renderOpportunityRecordValue(e,t,a,l)}function renderOpportunityRecordValue(e,t,a,l){switch(t.type){case"name":return renderRecordNameValue(e,t,a,l);case"stage":return renderOpportunityRecordStageValue(e);case"stage_change":return renderOpportunityRecordStageChangeValue(e);case"rich_text":return renderOpportunityRecordRichTextValue(e,t);case"delta":return renderRecordDeltaValue(e,t,a);default:return renderRecordValueAsString(e,t,a)}}function renderGenericRecordValue(e,t,a,l){return"name"===t.type?renderRecordNameValue(e,t,a,l):renderRecordValueAsString(e,t,a)}let D=new p.Ay("modernselling");function RecordsListTableRow({columns:e,isFocused:t,isPreview:a,record:r,salesforceOrgId:i,notificationCreatedTs:s,isLastRow:o,isWorkflowPreview:c}){let[d,m]=(0,l.useState)(!1),u=(0,l.useMemo)(()=>{if(a)return[];let e=getRecordKey(r);return[{key:"opportunity-share-button",enabled:!!s,render:()=>e&&s&&l.createElement(w.V,{hasFocus:!!t,createdTs:s,notificationType:"record",isAdminCreated:!0,opportunityId:e})}].filter(({enabled:e=!0})=>e)},[a,r,s,t]),p=!a&&u.length>0,_=(0,l.useCallback)(()=>m(!0),[]),b=(0,l.useCallback)(()=>m(!1),[]),h=!a,g=l.createElement("div",{onPointerOver:_,onPointerLeave:b,className:n()(f().records_list_table_row,f().records_list_table_row_body,{[f().records_list_table_row_border]:!o}),style:h?{cursor:"pointer"}:void 0},e.map(t=>c?l.createElement("div",{key:t.name,className:n()(f().records_list_table_cell,f().preview_table_cell,getDisplayTypeClassNames("standard").background)}):l.createElement("div",{key:t.name,className:n()(f().records_list_table_cell,{[f().records_list_table_cell_2_col]:2===e.length})},renderRecordValue(r,t,{isPreview:a,showHoverCard:!1},i))),p&&l.createElement("div",{className:n()(f().records_list_action_bar_container,p&&(t||d)&&f().records_list_action_bar_container_visible)},u.map(({key:e,render:t})=>l.createElement(l.Fragment,{key:e},t()))));return h?l.createElement(x.Ay,{tip:D.t("Open Record"),position:"top"},g):g}RecordsListTableRow.displayName="RecordsListTableRow";var P=a(0x106809bc6);function getPageRange(e,t,a){return[(0,P.A)(e,0,a-1),(0,P.A)(e+t,t,a)]}function usePagination(e,{pageSize:t}){let[a,r]=(0,l.useState)(0);(0,l.useEffect)(()=>r(0),[t]);let n=e.length,i=Math.ceil(n/t),s=a>=t,o=a<n-t,c=(0,l.useCallback)(()=>r(0),[]),d=(0,l.useCallback)(()=>r(e=>e-t),[t]),m=(0,l.useCallback)(()=>r(e=>e+t),[t]),u=(0,l.useMemo)(()=>getPageRange(a,t,n),[a,t,n]);return{page:(0,l.useMemo)(()=>e.slice(...u),[e,u]),prev:s?d:void 0,next:o?m:void 0,range:u,reset:c,totalPages:i}}var O=a(0x754ea859),L=a(0xc0b7c558);function RecordsListTable({columns:e,displayType:t,isPreview:a,records:r,paginationAutoClogProps:i,salesforceOrgId:s,notificationCreatedTs:o,isWorkflowPreview:p,isStepPreview:_}){let[b,h]=(0,l.useState)(!1),[g,x]=(0,l.useState)(()=>getInitialSortByValue(e)),w=getDisplayTypeClassNames(t),{page:y,reset:E,...k}=usePagination((0,l.useMemo)(()=>p?[...r]:[...r].sort((e,t)=>{let a="asc"===g.dir,l=isGenericRecord(e)?getGenericRecordValue(e,g):(0,d.A)(e,g.key),r=isGenericRecord(t)?getGenericRecordValue(t,g):(0,d.A)(t,g.key);return("string"==typeof l&&"string"==typeof r&&(l=l.toLocaleUpperCase(),r=r.toLocaleUpperCase()),void 0===l)?1:void 0===r?-1:l<r?a?-1:1:l>r?a?1:-1:0}),[p,r,g]),{pageSize:5}),S=(0,l.useCallback)(e=>()=>{E(),x(({key:t,dir:a})=>({key:e,dir:e===t&&"asc"===a?"desc":"asc"}))},[E]),v=(0,l.useCallback)(e=>{let a=getColumnSortField(e);return l.createElement(RecordsListTableHeader,{key:e.name,column:e,displayType:t,isSortAsc:"asc"===g.dir,isSortKey:!p&&a===g.key,onClick:S(a)})},[g,S,t,p]),A=(0,l.useCallback)((r,{hasFocus:n,hasFocusWithin:i})=>l.createElement(RecordsListTableRow,{key:getRecordKey(y[r]),columns:e,displayType:t,isFocused:n||i,isPreview:a,record:y[r],salesforceOrgId:s,notificationCreatedTs:o,isLastRow:r===y.length-1,isWorkflowPreview:p}),[y,e,t,a,s,o,p]),T=(0,l.useCallback)(()=>h(!0),[]),C=(0,l.useCallback)(()=>h(!1),[]),N=(0,c.wA)(),I=(0,l.useCallback)(e=>{N((0,O.c)({recordId:y[e.id].slack_record_id??(0,L.j)(s,getRecordKey(y[e.id]))}))},[N,y,s]);return l.createElement("div",{onPointerOver:T,onPointerLeave:C,className:n()(w.background,f().records_list_table,{[f().records_list_table_workflow_preview]:p,[f().records_list_table_workflow_step_preview]:_})},l.createElement("div",{className:f().records_list_table_row},e.map(v)),l.createElement(m.A,{disableHeight:!0},({width:e})=>l.createElement(u.A,{keys:Object.keys(y),width:e,height:51*y.length,rowRenderer:A,onItemClick:a?void 0:I,containerClassName:n()(f().records_list_table_rows_container,b&&!p?w.borderDark:w.border)})),k.totalPages>1&&l.createElement(RecordsListTablePagination,{pageRange:k.range,totalItems:r.length,autoClogProps:i,onNextClick:k.next,onPrevClick:k.prev}))}RecordsListTable.displayName="RecordsListTable";var R=a(0x3711e82d);let F=l.memo(({columns:e,displayType:t="standard",isWorkflowPreview:a,isExpandedByDefault:r=a,isPreview:c,isStepPreview:d,records:m,title:u,workflowId:p,salesforceOrgId:_,notificationCreatedTs:b})=>{let[h,g]=(0,l.useState)(r),x=(0,l.useCallback)(()=>g(e=>!e),[]),w=getDisplayTypeClassNames(t),y=(0,l.useCallback)(e=>{if(!c)return{onClick:{enableClogAction:!0},eventId:R.EventId.LOB_NOTIFICATIONS,elementName:e,workflowId:p}},[p,c]);return l.createElement("div",{className:n()(f().records_list_container,{[f().preview_not_expanded]:a&&!h})},l.createElement(i.Nm,{autoClogProps:y("expand_notification"),className:n()(w.text,w.background,f().records_list_toggle,h&&f().records_list_toggle_expanded),onClick:x},l.createElement(s.Ah,{name:h?"caret-down-filled":"caret-right-filled",size:"20"}),a?l.createElement(o.A,{withTooltip:!0,lines:1},l.createElement("span",{className:f().records_list_title},u)):l.createElement(l.Fragment,null,l.createElement("span",{className:f().records_list_title},u),l.createElement("span",{className:w.text},m.length))),h&&l.createElement(RecordsListTable,{columns:e,displayType:t,isPreview:c,records:m,paginationAutoClogProps:y("show_more"),salesforceOrgId:_,notificationCreatedTs:b,isWorkflowPreview:a,isStepPreview:d}))})},0x1ca293e13:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(0xbad225b5),r=a(0x11ad04567),n=a.n(r);let AvatarPaneContent=({children:e})=>l.createElement("div",{className:n().modal_main_content},e);AvatarPaneContent.displayName="AvatarPaneContent";let i=AvatarPaneContent},0x2440854b3:(e,t,a)=>{"use strict";a.d(t,{DV:()=>d,P1:()=>o,Vt:()=>n,Yh:()=>l,dW:()=>s,fw:()=>c,g_:()=>r,i_:()=>m,w3:()=>i});let l=128,r=2e3,n=460,i=2097152,s="too_small",o="too_large",c="max_size",d="invalid_type",m=["image/gif","image/png","image/jpeg"]},0x15ab42d61:(e,t,a)=>{"use strict";a.d(t,{_:()=>AvatarCropPane});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x11a296110),s=a(0x1e586fbba),o=a(0x127218dbe),c=a(0x1ca293e13),d=a(0x2440854b3),m=a(0x11ad11f0e),u=a(0x339b339c),p=a(0x113a45767),_=a(0x170214077),b=a(0x6792c5b4),f=a(0x1c9784a36),h=a.n(f);let g=new n.Ay("edit_profile"),AvatarCropPreview=({crop:e,minSize:t,maxSize:a,image:r,workflowName:n,workflowDescription:i})=>{let s=(0,l.useMemo)(()=>l.createElement(p.$,{crop:e,image:r,imageDisplaySize:a,previewDisplaySize:t}),[e,r,a,t]),o=(0,l.useMemo)(()=>({type:"message",ts:(0,m.A)(Date.now()),channel:"C12345678",text:"\xa1Hola Mundo!",user:"W1W832GG1"}),[]);return l.createElement("div",{className:h().crop_preview_image_container},l.createElement("div",{className:h().crop_preview_image_label},g.t("Preview")),l.createElement(b.A,{compact:s,light:s},l.createElement("strong",null,n),"\xa0\xa0",l.createElement(_.A,{msg:o}),l.createElement("br",null),l.createElement(l.Fragment,null,i||l.createElement(u.A,{size:"large"}))))};AvatarCropPreview.displayName="AvatarCropPreview";var x=a(0x24de3d958),w=a(0x20e80190e),y=a(0x1ed79bf71),E=a(0x6dbb4c86),k=a.n(E);let S=new n.Ay("workflow_builder"),AvatarCropPane=({onClose:e,setOnCropImagePane:t,switchPane:a,prevPane:n,avatarUrl:m="",workflowName:u,imageId:_="",workflowDescription:b,nextPane:f,showPreview:h=!0,setIconUrl:g})=>{let[E,v]=(0,l.useState)(!1),[A,T]=(0,l.useState)(!1),[C,N]=(0,l.useState)({height:36,width:36,x:0,y:0}),{cropData:I,imageData:M}=(0,x.K)(m,C),D=(0,r.wA)(),P=(0,l.useMemo)(()=>({width:M.width||36,height:M.height||36,src:M.src}),[M]),O=(0,l.useCallback)(()=>{t&&t(!1),a(n)},[n,t,a]),L=(0,l.useCallback)(()=>{v(!0),T(!1),D((0,y.z_)({x:I.fullCropX,y:I.fullCropY,width:I.fullCropSize,id:_})).then(({url:l=""})=>{g(l),f?(t&&t(!1),a(f)):e()}).catch(()=>{T(!0),v(!1)})},[D,I.fullCropX,I.fullCropY,I.fullCropSize,_,g,f,t,a,e]);return l.createElement(l.Fragment,null,l.createElement(w.rQ,null,l.createElement(o.A,{"data-qa":"avatar_crop_pane_back_button",onClick:O}),l.createElement(w.Rc,{"data-qa":"avatar_crop_pane_header",title:S.t("Crop your photo")})),l.createElement(w.$m,null,l.createElement(w.qf,{className:"center_content"},A&&l.createElement(s.A,null,S.t("Sorry! Something went wrong. Please try again.")),l.createElement("div",null,l.createElement(c.A,null,l.createElement(p.A,{className:k().cropper,imageSrc:m,maxSize:d.g_,minSize:d.Yh,onChange:N})),h&&l.createElement("div",{className:"center_content"},l.createElement(AvatarCropPreview,{crop:C,image:P,workflowName:u,workflowDescription:b,minSize:36,maxSize:d.Vt,avatarUrl:m}))))),l.createElement(w.jl,null,l.createElement(w.ox,null,l.createElement(i.Ay,{"data-qa":"avatar_crop_cancel_button",onClick:O,type:"outline"},S.t("Cancel")),l.createElement(i.lV,{"data-qa":"avatar_crop_save_button",loading:E,onClick:L,autoFocus:!0,"aria-label":S.t("Save")},S.t("Save")))))};AvatarCropPane.displayName="AvatarCropPane"},0xdac250:(e,t,a)=>{"use strict";a.d(t,{Z:()=>AvatarUploadPane});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x11a296110),i=a(0xb1ea448c),s=a(0x127218dbe),o=a(0x1ca293e13),c=a(0x2440854b3),d=a(0x2395e748b),m=a(0x20f6327e1),u=a(0x1b3ecb90f),p=a(0x20e80190e),_=a(0xb1a6818e),b=a.n(_);let f=new r.Ay("workflow_builder");function AvatarUploadPane({file:e,prevPane:t,nextPane:a,switchPane:r,onClose:_,setOnCropImagePane:h}){let{status:g,avatarUrl:x,imageId:w,error:y}=(0,m.V)(e),E=(0,l.useCallback)(()=>r(t),[t,r]);(0,l.useEffect)(()=>{g===m.A.SUCCESS&&w&&x&&(a===d.n.CROP_IMAGE&&h&&h(!0),r(a,{imageId:w,avatarUrl:x}))},[x,w,a,h,g,r]);let k=f.t("Uploading your photo\u2026"),S=l.createElement(i.A,{size:"jumbo"});if(g===m.A.ERROR){let{errorEmoji:e,errorText:t,errorTitle:a}=(({error:e})=>e===c.fw?{errorTitle:f.t("Dang"),errorEmoji:":worried:",errorText:f.t("That\u2019s a very nice photo, but it\u2019s a bit too big. Try one that\u2019s smaller than 2 MB.")}:e===c.DV?{errorTitle:f.t("Dang"),errorEmoji:":worried:",errorText:f.t("Profile photos must be GIFs, JPGs or PNGs.")}:e===c.dW?{errorTitle:f.t("Dang"),errorEmoji:":worried:",errorText:f.t("That\u2019s a very nice photo, but it\u2019s a bit too small. Try one that\u2019s larger than 128x128.")}:e===c.P1?{errorTitle:f.t("Dang"),errorEmoji:":worried:",errorText:f.t("That\u2019s a very nice photo, but it\u2019s a bit too big. Try one that\u2019s smaller than 2000x2000.")}:{errorTitle:f.t("Eek"),errorEmoji:":frowning:",errorText:f.t("Sorry! Something went wrong. Please try again.")})({error:y});k=a,S=l.createElement("div",{className:b().error_container},l.createElement(u.Ay,{emojiSize:u.lw.LARGE,forceDisplay:!0,text:e}),l.createElement("br",null),l.createElement("strong",{className:b().error_text,"data-qa":"avatar_upload_error_text"},t))}return l.createElement(l.Fragment,null,l.createElement(p.rQ,null,l.createElement(s.A,{"data-qa":"avatar_upload_back_button",onClick:E}),l.createElement(p.Rc,{"data-qa":"avatar_upload__title-bar",title:k})),l.createElement(p.$m,null,l.createElement(p.qf,{className:"center_content"},l.createElement(o.A,null,S))),l.createElement(p.jl,null,l.createElement(p.ox,null,l.createElement(p.s_,{type:"outline",autoFocus:!y,onClick:_,"aria-label":f.t("Cancel")},f.t("Cancel")),g===m.A.ERROR&&l.createElement(n.Ay,{"data-qa":"avatar_upload_retry_button",onClick:E},f.t("Try a Different Image")))))}AvatarUploadPane.displayName="AvatarUploadPane"},0x12bc54835:(e,t,a)=>{"use strict";a.d(t,{x:()=>o});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x6add6a0e),s=a.n(i);let o=l.forwardRef(({className:e=null,main:t=!1,children:a},r)=>t?l.createElement("div",{ref:r,className:n()(s().container,s().main,e)},a):l.createElement("div",{ref:r,className:n()(s().container,e)},a))},0x16e99b359:(e,t,a)=>{"use strict";a.d(t,{l:()=>Select});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x1cbdfeceb),s=a(0x12edaa96a),o=a(0x1e586fbba),c=a(0x1d1911997),d=a(0xe53aa0),m=a(0x1312f060e),u=a(0x93f78b39),p=a(0x1b3ecb90f),_=a(0x15a4ffb05),b=a(0x207fb9b92),f=a(0x77627b71),h=a.n(f);let Select=({className:e,options:t,value:a,id:r,placeholder:f,required:g=!1,errorText:x,isInvalid:w=!1,onChange:y,dataQa:E,...k})=>{let S=(0,l.useMemo)(()=>`${(0,s.A)()}-${t.length}`,[t]),v=(0,l.useMemo)(()=>{let e=null;return t.some(t=>!!(Array.isArray(t.options)&&(e=t.options.find(e=>e.value===a)))||(!!(0,d.X)(t)&&t.id===a||t.value===a)&&(e=t,!0)),e||null},[t,a]),A=(0,l.useCallback)((e={})=>(0,d.X)(e)?y(e.id,e):y(e.value,e),[y]),{onBlur:T,errorText:C}=(0,b.K)({errorMessage:x,isErrored:w}),N=(0,l.useCallback)(e=>(0,d.X)(e)?null:l.isValidElement(e.label)?e.label:l.createElement("div",{className:n()(h().plainTextSelectOptions,"p-block-kit-select_options")},l.createElement(_.A,{text:e.label,emojiSize:p.lw.MEDIUM})),[]),I=(0,l.useCallback)(e=>{let t=e.value?.[0]?.elements?.[0];if(!(0,m.B)(t)||!t.elements)return null;let a=e.value[0].type;return l.createElement("div",{className:"p-block-kit-select_options"},l.createElement(u.A,{type:a,elements:t.elements,disableHighlights:!1,inline:!0,clogLinkClick:i.A,noInlineLinks:!0,alwaysDisplayMentionsAsLinks:!0,disableJumboEmoji:!0}))},[]),M=(0,l.useMemo)(()=>(0,d.X)(t[0]),[t]);return l.createElement("div",{className:n()(h().container,e,{[h().invalid]:!!C})},l.createElement(c.Ay,{key:S,options:t,width:"100%",selectId:r,selectedOption:v,onOptionSelected:A,placeholderText:f,isRequired:g,onBlur:T,isInvalid:!!C,selectDataQa:E,renderSelectedOption:M?I:N,renderOption:M?I:N,...k}),!!C&&l.createElement(o.A,null,C))};Select.displayName="Select"},0x1d898b34c:(e,t,a)=>{"use strict";a.d(t,{v:()=>HermesWorkflowMetadataDialog});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x11a296110),i=a(0x1d2cd7755),s=a(0x126f22530),o=a(0x1e586fbba),c=a(0x1b7f0cd57),d=a(0xa3743afa),m=a(0x16cf1da63),u=a(0x16475a65c),p=a(0x72b537b5),_=a(0xe874a88a),b=a(0x205f4fb61),f=a(0x16ac9b089),h=a(0x2264e6ea3),g=a(0x1faa3f1ac),x=a(0x143f89715),w=a(0x253c586a2),y=a(0x7f5a02e8),E=a(0xe9c32bb),k=a(0x1d1a513a),S=a(0x16e99b359),v=a(0xf4030543),A=a(0x220757cb0),T=a(0x20570d71a),C=a(0x13c8b082e),N=a(0x23a4b0853),I=a(0x10d53599f),M=a(0x19dc73101),D=a(0x23198a843),P=a(0x238b287cf),O=a(0x1bb9b9e21),L=a(0xa1832ae4),R=a(0xb8504a42),F=a(0x3711e82d),W=a(0x16ed1b0dc),H=a(0x4f725d55),U=a(0x66c6b26d),B=a(0x20adb28cd),q=a(0x4e250925),z=a(0x226892387),V=a(0x1ee439e69),j=a(0x1b1df7714),$=a.n(j);let Y=new r.Ay("workflow_builder"),renderMemberOption=e=>l.createElement(I.A,{id:e.value}),PermissionsSettingsModalSection=({onPermissionsErrorChange:e,showMore:t=!1},a)=>{let r=(0,p.U)(),n=(0,P.A)(),s=(0,m.wA)(),o=(0,T.Y)(),c=(0,z.d4)(V.H7),d=(0,L.ZT)(c),I=(0,L.F1)(c),j=(0,R.kA)(c),G=(0,z.d4)((0,U.sx)(o,B.u6)),Q=(0,z.d4)((0,U.sx)(o,B.Ds)),K=(0,z.d4)((0,U.sx)(o,B.Sg)),Z=(0,z.d4)((0,U.sx)(o,B.Zx)),X=(0,z.d4)((0,U.sx)(o,B.uY)),[J,ee]=(0,l.useState)(t),et=Y.t("Permissions"),ea=(0,z.d4)(e=>(0,O.X)(e,X)),el=(0,z.d4)(e=>{let t=(0,V._J)(e,ea);if(t)return(0,L.F1)(t)}),er=(0,z.d4)((0,U.sx)(o,B.gT)),en=el||I,[ei,es]=(0,l.useState)(er),[eo,ec]=(0,l.useState)(Z),[ed,em]=(0,l.useState)(G||"everyone"),eu=(0,z.Z2)(e=>{let[t]=(0,B.e5)(e,eo);return t}),{isTeamValidSCWorkflowTarget:ep}=(0,k.u)(o),e_=(0,l.useMemo)(()=>eu.some(e=>!ep(e)),[ep,eu]),[eb,ef]=(0,l.useState)(Q?.slice()||[]),eh=(0,l.useMemo)(()=>eb.map(e=>({label:e,value:e})),[eb]),eg=Y.t("Everyone in {teamName}",{teamName:(0,f.Ay)(en)}),ex=Y.t("Workflow managers only"),ew=(0,l.useMemo)(()=>[{value:"everyone",label:eg},{value:"collaborators",label:ex}],[ex,eg]),ey=Y.t("No selection"),eE=(0,l.useMemo)(()=>{let e=ew.find(e=>e.value===ed);return e?e.label:ey},[ew,ey,ed]),ek=0===eb.length,eS=0===eo.length,ev=eo.length>v.y,eA=Y.t("You must provide at least 1 workflow manager"),eT=Y.t("You must select users, channels, or workspaces"),eC=Y.t("Workflow access is limited to a total of {entitiesLimit} users, channels, or workspaces. Remove {amountToRemove} to save.",{entitiesLimit:(0,b.ZV)(v.y),amountToRemove:(0,b.ZV)(eo.length-v.y)}),eN=(0,l.useMemo)(()=>{let e=[];return ek&&e.push({id:"empty_collaborators",message:eA}),e},[eA,ek]),eI=(0,l.useMemo)(()=>{let e=[];return ei===C.PW.named_entities&&eS&&e.push({id:"empty_entities_with_run_access",message:eT}),ev&&e.push({id:D.S.TooManyNamedEntities,message:eC}),e},[eT,ev,eS,ei,eC]),eM=(0,l.useCallback)(e=>{let t=e.map(({value:e})=>e);ef(t),ei===C.PW.named_entities&&ec([...new Set([...t,...eo])])},[eo,ei,ef]),eD=(0,l.useCallback)(e=>{("everyone"===e||"collaborators"===e)&&em(e)},[]),eP=(0,l.useCallback)(async()=>{let e=(0,u.A)(Q,eb),t=(0,u.A)(eb,Q);t.length>0&&await s((0,q.gP)({workflowId:o,collaborators:t})),e.length>0&&await s((0,q.i9)({workflowId:o,collaborators:e}))},[o,Q,s,eb]),eO=(0,l.useCallback)(({userIds:e,channelIds:t,teamIds:a,orgIds:l})=>{let{userIds:r=[],channelIds:n=[],teamIds:i=[],orgIds:s=[]}=K??{},o=(0,u.A)(e,r).length>0||(0,u.A)(t,n).length>0||(0,u.A)(a,i).length>0||(0,u.A)(l,s).length>0,c=(0,u.A)(r,e).length>0||(0,u.A)(n,t).length>0||(0,u.A)(i,a).length>0||(0,u.A)(s,l).length>0;return o||c},[K]),eL=(0,l.useCallback)(async()=>{let e=[],t=[],a=[],l=[];eo.forEach(r=>{(0,H.A)(r)&&e.push(r),(0,W.A)(r)&&t.push(r),(0,h.Ay)(r)&&a.push(r),(0,h.JV)(r)&&l.push(r)});let r=e.length>0?e:void 0,n=t.length>0?t:void 0,i=a.length>0?a:void 0,c=l.length>0?l:void 0,m=[];if(ei!==K?.permissionType||eO({userIds:e,channelIds:t,teamIds:a,orgIds:l})){let e=ei,t={};ei===C.PW.everyone&&(i||c)?(e=C.PW.named_entities,t={teamIds:j?i:[d].concat(i||[]),orgIds:j?[d].concat(c||[]):c}):ei===C.PW.named_entities&&(t={userIds:r,channelIds:n,teamIds:i,orgIds:c}),m.push(s((0,q.$N)({workflowId:o,permissionType:e,...t})))}return _.S.all(m)},[eO,d,s,j,eo,ei,K,o]),eR=(0,l.useCallback)(async()=>{if(ed!==G)return s((0,q.ZU)({workflowId:o,permissionType:ed}))},[G,s,ed,o]);(0,l.useEffect)(()=>{(0,N.Vb)({clogger:n,uiArgs:{step:F.UiStep.WORKFLOW_PERMISSIONS},wbArgs:{workflow_id:o,is_hermes:!0}})},[n,o]),(0,l.useEffect)(()=>{e&&e(e_||(0,x.A)(eN,r)||(0,x.A)(eI,r))},[eN,eI,e_,e,r]),(0,l.useImperativeHandle)(a,()=>({updateCollaborators:eP,updateTriggerRunPermissions:eL,updateCopyPermissions:eR}),[eP,eR,eL]);let eF=(0,l.useCallback)(()=>{ee(!0)},[]);return l.createElement("div",{className:"padding_top_50 padding_bottom_125"},l.createElement(E.Pd,{element:"h1",className:"margin_bottom_150",weight:"bold"},et),l.createElement(A.B,{currentTeamId:d,teamName:en,selectedRunAccessOption:ei,setRunAccessOption:es,selectedEntitiesWithRunAccess:eo,setSelectedEntitiesWithRunAccess:ec,entitiesWithRunAccessErrors:eI,selectedCollaborators:eb,selectedExternalEntities:eu,hasExternalEntititesDriftedFromSCPrefs:e_}),J?l.createElement(l.Fragment,null,l.createElement(i.A,{htmlFor:"copy-access-select",text:Y.t("Who can copy this workflow?")},l.createElement(S.l,{id:"copy-access-select",value:ed||"",options:ew,placeholder:eE,ariaLabel:Y.t("Default selection"),onChange:eD,required:!0,errorText:"","data-qa":"copy-access-select"})),l.createElement(i.A,{htmlFor:"collaborators-multi-select",text:Y.t("Workflow managers")},l.createElement(M.h,{width:"100%",className:"margin_bottom_50",selectDataQa:"collaborators-multi-select",selectId:"collaborators-multi-select",isInvalid:eN.length>0,errors:eN,renderOption:renderMemberOption,searcherOptions:(0,y.Zq)(w.Df,{externalWorkspaceToSearchOn:ea}),selectedOptions:eh,onSelectedItemsChange:eM,focusOnMount:!0}),l.createElement("span",{className:$().helpText},Y.t("Can edit, publish, and delete this workflow")))):l.createElement("div",null,l.createElement(g.A,{onClick:eF,"data-qa":"show-more-permissions-link"},Y.t("Show more permissions"))))};PermissionsSettingsModalSection.displayName="PermissionsSettingsModalSection";let G=(0,l.forwardRef)(PermissionsSettingsModalSection);var Q=a(0x1e813d5b2),K=a(0x1a5ac3a0c),Z=a(0x126af815a),X=a(0x937a43ca),J=a(0x1d1437423),ee=a(0x19178121a),et=a.n(ee);let ea=new r.Ay("workflow_builder"),HermesWorkflowMetadataDialog=({switchPane:e,workflowName:t,workflowId:a,workflowDescription:r,workflowIconUrl:m,setWorkflowDescription:u,setWorkflowName:p,hasSaveError:_,paneType:b,nameIsInvalid:f,selectedWorkflow:h,onPermissionsErrorChange:g,permissionSettingsHandlersRef:x})=>{let w=(0,l.useRef)(null),y=(0,l.useRef)(null),E=(0,z.d4)((0,U.sx)(a,B.RG)),k=h||E,S=(0,l.useRef)(null),v=(0,l.useMemo)(()=>k?.trigger?(0,K.eG)(k.trigger,k?.coachmarkData):void 0,[k]),A=v?.type,T=Z.zW===A,C=(0,l.useCallback)(()=>S?.current?.click(),[]),N=(0,l.useCallback)(t=>{let a=(t.target.files||[])[0];a&&e(b,{file:a})},[b,e]),I=(0,l.useMemo)(()=>(0,X.yA)(t),[t]),M=(0,l.useMemo)(()=>new Set((0,X.QM)(t)),[t]),D=(0,l.useMemo)(()=>(0,X.Zb)(t),[t]),P=(0,l.useMemo)(()=>(0,X.L8)(t),[t]),O=(0,l.useMemo)(()=>t===ea.t("Untitled Workflow"),[t]),L=(0,l.useMemo)(()=>r===ea.t("A brand new workflow"),[r]),R=(0,l.useMemo)(()=>I?ea.t("Whoops! That name is reserved."):M.size?ea.rt("Choose a name without these special characters: <b>{characters}</b> ",{characters:[...M].join(" ")}):D?ea.t("Workflow names can\u2019t support special characters (i.e. !#$%&)."):P?ea.t("Whoops! Workflow names cannot have emojis."):t.length>d.p?ea.t("You can\u2019t enter more than {maxLength} characters.",{maxLength:d.p}):ea.t("This field is required."),[M,D,I,P,t.length]),{onChange:F,errorText:W}=(0,J.x)({errorMessage:R,isErrored:f}),H=(0,l.useCallback)(e=>{p(e),F()},[F,p]),q=(0,l.useCallback)(()=>{w.current&&O&&w.current?.select()},[O]),V=(0,l.useCallback)(()=>{y.current&&L&&y.current?.select()},[L]);(0,l.useEffect)(()=>{H(t)},[]);let j=ea.t("Something short and descriptive"),$=ea.t("What is this workflow for?"),Y=(0,l.useMemo)(()=>{if(k)return{...k,workflow:{...k.workflow,title:t,description:r,icons:{image_192:m,image_96:m}}}},[k,t,r,m]);return l.createElement(l.Fragment,null,l.createElement("div",{className:et().workflow_metadata_section},l.createElement("div",{className:et().workflow_avatar_upload},l.createElement(c.R,{className:et().workflow_avatar_icon_improvement,iconSrcUrl:m,altText:t,size:"large"}),l.createElement("input",{className:et().file_input,type:"file",accept:"image/jpeg,image/gif,image/png",onChange:N,ref:S,"aria-hidden":"true",tabIndex:-1,hidden:!0}),l.createElement(n.Ay,{type:"outline",size:"small",onClick:C,className:et().choose_file_icon,"data-qa":"workflow-details-modal-icon-button","aria-label":ea.t("Upload workflow avatar image")},ea.t("Upload"))),l.createElement("div",{className:et().workflow_metadata_form},l.createElement(i.A,{className:et().workflow_name_form,text:ea.t("Name")},l.createElement(s.A,{id:"workflow-details-modal_name",type:"text",maxCharacterLimit:d.p,name:"name",value:t,onChange:H,placeholder:j,errorText:W,autoComplete:"off",focusOnMount:!0,inputRef:w,onFocus:q,className:"margin_bottom_50","data-qa":"workflow-details-modal-name__input",useInlineAlert:!0,hintId:"workflow_naming_hint"}),l.createElement("span",{className:et().workflow_naming_help_text,id:"workflow_naming_hint"},ea.t('Workflow names can\u2019t use punctuation marks and certain special characters, for example: ! ? @ # % + & $ * : " , / [ ]'))),l.createElement(i.A,{text:ea.t("Description")},l.createElement(s.A,{id:"workflow-details-modal_description",type:"text",maxCharacterLimit:d.p,minCharacterLimit:d.H,name:"description",value:r,onChange:u,placeholder:$,inputRef:y,onFocus:V,"data-qa":"workflow-details-modal-description__input",useInlineAlert:!0,isRequired:!0})))),g&&x&&l.createElement(G,{onPermissionsErrorChange:g,ref:x}),Y&&T&&l.createElement(Q.Q,{workflow:Y.workflow,trigger:Y.trigger,workflowName:t,workflowDescription:r}),_&&l.createElement(o.A,{"data-qa":"workflow-details-modal-description-error"},ea.t("There was an error updating your workflow.")))};HermesWorkflowMetadataDialog.displayName="HermesWorkflowMetadataDialog"},0xa3743afa:(e,t,a)=>{"use strict";a.d(t,{H:()=>l,p:()=>r});let l=1,r=80},0x2395e748b:(e,t,a)=>{"use strict";a.d(t,{n:()=>l});let l={WORKFLOW_DETAILS:"workflow_details",UPLOAD_IMAGE:"upload_image",CROP_IMAGE:"crop_image"}},0x3c5a1598:(e,t,a)=>{"use strict";a.d(t,{R:()=>F});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x120c268ad),i=a.n(n),s=a(0x20482ad21),o=a(0xf3c40abe),c=a(0x11a296110),d=a(0x4c96e5d9),m=a(0x1b7f0cd57),u=a(0xe9c32bb),p=a(0x24546e7f2),_=a(0x15ab42d61),b=a(0xdac250),f=a(0x2395e748b),h=a(0x1d898b34c),g=a(0xa3743afa),x=a(0x937a43ca),w=a(0x20e80190e),y=a(0x4e250925);let E=new s.Ay("workflow_builder"),WorkflowDetailsModalPane=({onClose:e,switchPane:t,workflowName:a,workflowId:n,workflowDescription:i,workflowIconUrl:s,setWorkflowDescription:o,setWorkflowName:d,updateWorkflowMetaDataCallback:m,selectedWorkflow:u})=>{let p=(0,r.wA)(),[_,b]=(0,l.useState)(!1),[k,S]=(0,l.useState)(!1),v=(0,x.nM)(g.p,a),A=(0,x.Qe)(g.p,i),T=v||k||A,C=(0,l.useCallback)(async()=>{try{S(!0),b(!1);let t=await p((0,y.QC)({name:a,description:i,iconUrl:s,selectedWorkflow:u,workflowId:n}));t&&m&&m(t),e()}catch{S(!1),b(!0)}},[p,a,i,s,u,n,m,e]);return l.createElement(l.Fragment,null,l.createElement(w.rQ,null,l.createElement(w.Rc,{title:E.t("Workflow Details")})),l.createElement(w.$m,null,l.createElement(w.qf,null,l.createElement(h.v,{switchPane:t,workflowName:a,workflowId:n,workflowDescription:i,workflowIconUrl:s,setWorkflowDescription:o,setWorkflowName:d,hasSaveError:_,paneType:f.n.UPLOAD_IMAGE,nameIsInvalid:v,selectedWorkflow:u}))),l.createElement(w.jl,null,l.createElement(w.ox,null,l.createElement(w.s_,{onClick:e,type:"outline","aria-label":E.t("Cancel")},E.t("Cancel")),l.createElement(c.lV,{type:"primary",onClick:C,disabled:T,loading:k,"data-qa":"first_publish-next__button","aria-label":E.t("Save")},E.t("Save")))))};WorkflowDetailsModalPane.displayName="WorkflowDetailsModalPane";var k=a(0x20570d71a),S=a(0x1a5ac3a0c),v=a(0x145d46a61),A=a(0x66c6b26d),T=a(0x20adb28cd),C=a(0x226892387),N=a(0x1fcbb004d),I=a(0x17f19ec0c),M=a.n(I);let D=new s.Ay("workflow_builder"),HermesWorkflowMetadataModal=({selectedWorkflow:e,updateWorkflowMetaDataCallback:t})=>{let a=(0,r.wA)(),n=(0,C.d4)(v.tQ),s=(0,k.Y)(),o=(0,C.d4)((0,A.sx)(s,T.RG)),c=e||o,d=(0,S.BQ)(c),m=c?(0,S.yL)(c):"",u=(0,S.DU)(c),[h,g]=(0,l.useState)(!1),[x,w]=(0,l.useState)((m||"").replace(/[()]/g,"")),[y,E]=(0,l.useState)((d||"").replace(/[()]/g,"")),[I,P]=(0,l.useState)(u||""),O=(0,l.useCallback)(()=>{a((0,N.O)()),g(!1)},[a]),L=D.t("Workflow Details"),R=D.t("Edit Avatar Upload"),F=D.t("Edit Avatar Crop"),W=(0,l.useMemo)(()=>({[f.n.WORKFLOW_DETAILS]:{render:e=>l.createElement(WorkflowDetailsModalPane,{onClose:O,workflowName:y,workflowId:s,workflowDescription:x,workflowIconUrl:I,setWorkflowDescription:w,setWorkflowName:E,updateWorkflowMetaDataCallback:t,selectedWorkflow:c,...e}),modalProps:{contentLabel:L}},[f.n.UPLOAD_IMAGE]:{render:e=>l.createElement(b.Z,{onClose:O,nextPane:f.n.CROP_IMAGE,prevPane:f.n.WORKFLOW_DETAILS,setOnCropImagePane:g,...e}),modalProps:{contentLabel:R}},[f.n.CROP_IMAGE]:{render:e=>l.createElement(_._,{workflowName:y,workflowDescription:m,onClose:O,nextPane:f.n.WORKFLOW_DETAILS,prevPane:f.n.WORKFLOW_DETAILS,showPreview:!1,setOnCropImagePane:g,setIconUrl:P,...e}),modalProps:{contentLabel:F}}}),[L,R,F,O,y,x,I,t,c,s,m]);return l.createElement(p.A,{centered:!n,closeModal:O,dataQa:"workflow_builder_metadata_edit_modal",defaultPane:f.n.WORKFLOW_DETAILS,overlayClassName:i()({[M().modalOverlay]:n}),panes:W,showCloseButton:!h})};HermesWorkflowMetadataModal.displayName="HermesWorkflowMetadataModal";var P=a(0x46dbff89),O=a(0x12cdb23b0),L=a.n(O);let R=new s.Ay("workflow_builder"),PrimitiveHermesWorkflowMetadata=({name:e,icon:t,description:a,badgeText:n,canEdit:s=!1,hasKeyboardFocus:o,onEditClick:p,isClientBuilder:_=!1})=>{let b=R.t("Edit workflow title, description, or avatar"),f=R.t("Edit details",{fallbackHash:"0a49b64a50b81012b504c1a11b676ee14f396601"}),h=(0,r.wA)(),g=(0,l.useCallback)(()=>{if(s){if(p)return void p();h((0,P.q)({element:l.createElement(HermesWorkflowMetadataModal,null)}))}},[s,p,h]);return s?l.createElement(d.Ay,{position:"right",tip:f},l.createElement(c.Nm,{className:i()(L().container,{[L().can_edit]:s,[L().isClientBuilder]:_}),onClick:g,autoFocus:o,"data-qa":"edit-workflow-metadata","aria-label":b},l.createElement(m.R,{size:_?"small":"medium",iconSrcUrl:t,altText:e,className:L().headerAvatar}),l.createElement("div",{className:L().nameContainer},l.createElement("div",{className:L().name},l.createElement(u.Pd,{element:"h1"},e),n&&l.createElement("span",{className:L().badge},n)),l.createElement(u.nB,{className:L().description},a)))):l.createElement("span",{className:i()(L().container,{[L().isClientBuilder]:_}),"data-qa":"no-edit-workflow-metadata",role:"heading","aria-level":1},l.createElement(m.R,{iconSrcUrl:t,altText:e,className:L().headerAvatar}),l.createElement("div",null,l.createElement("div",{className:L().name},l.createElement(u.Pd,{element:"h1"},e),n&&l.createElement("span",{className:L().badge},n)),l.createElement(u.nB,{className:L().description},a)))};PrimitiveHermesWorkflowMetadata.displayName="PrimitiveHermesWorkflowMetadata";let F=(0,o.A)(PrimitiveHermesWorkflowMetadata)},0x190ea1603:(e,t,a)=>{"use strict";a.d(t,{T:()=>OpenWFBInNewWindowButton});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x344bb842),s=a(0x4c96e5d9),o=a(0xd843ab47),c=a(0x145d46a61),d=a(0x24558b75f),m=a(0xdb0578c7),u=a(0x226892387),p=a(0x7230bced),_=a.n(p);let b=new n.Ay("workflow_builder"),f={name:"open-in-window"};function OpenWFBInNewWindowButton({source:e,route:t,size:a="medium",experimentViewHeaderButtonPolishGroupOn:n=!1}){let p=(0,r.wA)(),h=(0,u.d4)(c.b2),{isChildWindow:g}=(0,l.useContext)(o.A),x=b.t("Open in new window",{ns:"huddles"}),w=(0,l.useCallback)(()=>{p((0,m.A)({source:e,forceOpenInNewWindow:!0,route:t}))},[p,t,e]);return h&&(0,d.M2)()&&!g?l.createElement(s.Ay,{tip:x},l.createElement(i.A,{svgIconProps:f,onClick:w,"aria-label":x,size:a,className:"workflow-edit"===e&&n?_().viewHeaderActionButton:""})):null}OpenWFBInNewWindowButton.displayName="OpenWFBInNewWindowButton"},0xf4030543:(e,t,a)=>{"use strict";a.d(t,{y:()=>l});let l=100},0x220757cb0:(e,t,a)=>{"use strict";a.d(t,{B:()=>TriggerRunSettings});var l,r=a(0xbad225b5),n=a(0x120c268ad),i=a.n(n),s=a(0x16475a65c),o=a(0xf2e7528e),c=a(0x1d24ec95f),d=a(0x72b537b5),m=a(0x20b4dda68),u=a(0x20482ad21),p=a(0x16ac9b089),_=a(0x45bd075),b=a(0x1d2cd7755),f=a(0x143f89715),h=a(0x4c96e5d9),g=a(0x7f5a02e8),x=a(0x1d1a513a),w=a(0x16e99b359),y=a(0x124d99cb0),E=a(0x24430233d),k=a(0x6960d8b9),S=a(0x1ccef1c6f),v=a(0x226892387);let A=new u.Ay("workflow_builder"),ScheduledTriggerRunAccessHelpText=({className:e,trigger:t})=>{let a=(0,v.d4)(e=>(0,S.ty)(e,"time24")),{schedule:l}=t.config,n=(0,y.lP)(l.startTime,l.timezone),i=(0,k.Od)(n,{excludeYear:!0,uncapitalizedRelativeDay:!0}),s=n.format(a?"HH:mm":"h:mm A"),o=(0,E.o)(l);return r.createElement("span",{className:e},A.rt("This is a scheduled workflow. Next run {humanReadableDate} at {humanReadableTime}{humanReadableRepeat}.",{humanReadableDate:i,humanReadableTime:s,humanReadableRepeat:""===o?o:` ${o}`}))};ScheduledTriggerRunAccessHelpText.displayName="ScheduledTriggerRunAccessHelpText";var T=a(0x126af815a),C=a(0x13c8b082e),N=a(0x1f66b5878),I=a(0x1887ed0ea),M=a(0x1b1df7714),D=a.n(M);let P=new u.Ay("workflow_builder"),TriggerRunAccessHelpText=({workflowId:e,isAllowExternalOrgsChecked:t=!1,permissionType:a,trigger:l})=>{let n=(0,v.d4)(e=>(0,N.p$)(e,"hermes_triggers_trippable_by_slack_connected_teams")),i=(0,v.d4)(I.M7),{isTrippableByAnySlackConnectedTeamByPrefs:s}=(0,x.u)(e),o=l.type===T.LO,c=l.type===T.zW;return o?r.createElement(ScheduledTriggerRunAccessHelpText,{className:D().helpText,trigger:l}):a===C.PW.app_collaborators?r.createElement("span",{className:D().helpText},P.t("Only workflow managers can find and use this workflow",{fallbackHash:"45866bc2093eb04b2e05464a6d10af2a7d575c0d"})):a===C.PW.named_entities?r.createElement("span",{className:D().helpText},c?P.t("Only people in this list can find and use this workflow."):P.t("Only people in this list can find this workflow.")):(!i&&n||i&&s)&&a===C.PW.everyone&&t?r.createElement("span",{className:D().helpText},P.t("All new connected external orgs will need to be manually added.")):null};TriggerRunAccessHelpText.displayName="TriggerRunAccessHelpText";var O=a(0x2264e6ea3),L=a(0x15bd59d31),R=a(0x10d53599f),F=a(0x1de80d519),W=a(0x16ed1b0dc),H=a(0x4f725d55);let TriggerRunSettingsListEntity=({option:e})=>{let t=e.value,a=null;return(0,H.A)(t)?a=r.createElement(R.A,{id:t,"data-qa":"trigger-run-settings-list-entity-member"}):(0,W.A)(t)?a=r.createElement(L.A,{channelId:t,"data-qa":"trigger-run-settings-list-entity-channel"}):((0,O.Ay)(t)||(0,O.JV)(t))&&(a=r.createElement(F.e,{id:t,"data-qa":"trigger-run-settings-list-entity-team"})),a};TriggerRunSettingsListEntity.displayName="TriggerRunSettingsListEntity";var U=a(0x20570d71a),B=a(0x1a5ac3a0c),q=a(0x19dc73101),z=a(0x12cc25ec2),V=a(0x23198a843),j=a(0xf09fa16e),$=a(0x9b971e7e),Y=a(0x66c6b26d),G=a(0x20adb28cd),Q=a(0x358bddfc),K=a(0x14149c126),Z=a(0x1cbba0fb),X=a(0x8b08ad98),J=a.n(X);let ee=new u.Ay("workflow_builder");var et=((l=et||{}).IS_WORKFLOW_RESTRICTED="is_workflow_restricted",l.IS_EXTERNAL_TEAM_INVALID="is_external_team_invalid",l.GENERIC_DRIFT_ERROR="is_invalid_existing_external_target",l);let TriggerRunSettings=({currentTeamId:e,teamName:t,selectedRunAccessOption:a,setRunAccessOption:l,selectedEntitiesWithRunAccess:n,setSelectedEntitiesWithRunAccess:u,entitiesWithRunAccessErrors:y,selectedCollaborators:E,selectedExternalEntities:k,hasExternalEntititesDriftedFromSCPrefs:S,overrideTrigger:A,overrideWorkflowConnectionsPrefs:M,overrideWorkflowRetrictions:D,overridePermissions:P})=>{let O=(0,d.U)(),L=(0,j.A)(),R=(0,U.Y)(),F=(0,v.d4)(e=>(0,Z.yz)(e,"available")),W=(0,v.d4)((0,Y.sx)(R,G.RG)),H=(0,v.d4)(I.M7),X=(0,v.d4)(e=>"on"===(0,K._Z)(e,"wfb_acl_translation")),et=(0,v.d4)(e=>M||(0,G.NN)(e,R)),ea=(0,r.useMemo)(()=>W?.trigger?(0,B.eG)(W.trigger,W.coachmarkData):void 0,[W]),el=A??ea,er=(0,v.d4)(e=>(0,N.p$)(e,"hermes_triggers_trippable_by_slack_connected_teams")),{isTrippableByAnySlackConnectedTeamByPrefs:en,isTeamValidSCWorkflowTarget:ei,workflowRestrictedStatus:es}=(0,x.u)(R,M,D),eo=(0,v.d4)(e=>D?D.is_restricted:(0,G.lW)(e,R)),ec=(0,v.d4)($.Kc),ed=(0,v.d4)(e=>(0,G.kS)(e,R,k,P)),[em,eu]=(0,r.useState)(k.length>0),ep=k.length>0||en&&a!==C.PW.app_collaborators,e_=ee.t("Everyone internal in {teamName}",{teamName:(0,p.Ay)(t)}),eb=X?ee.t("Workflow managers, plus specific people, channels, and workspaces"):"Workflow managers, plus specific people, channels, and workspaces",ef=ee.t("Workflow managers only"),eh=(0,r.useMemo)(()=>[{label:e_,value:C.PW.everyone},{label:eb,value:C.PW.named_entities},{label:ef,value:C.PW.app_collaborators}],[ef,e_,eb]),eg=ee.t("No selection"),ex=(0,r.useMemo)(()=>{let e=eh.find(e=>e.value===a);return e?e.label:eg},[eh,a,eg]),ew=(0,r.useCallback)(e=>{e!==a&&(e===C.PW.named_entities&&u([...E,...k]),e===C.PW.everyone&&u(em?F.slice(0,99):[]),e===C.PW.app_collaborators&&(u([]),eu(!1))),l(e)},[F,em,E,a,k,l,u]),ey=(0,r.useCallback)(e=>{let t=e.map(({value:e})=>e);u(e=>{let a=e.filter(e=>!k.includes(e)),l=(0,s.A)(t,a),r=(0,s.A)(a,t);return(0,o.A)(e,a,l).filter(e=>!r.includes(e))})},[k,u]),eE=(0,r.useCallback)(e=>{let t=e.map(({value:e})=>e);u(e=>{let a=e.filter(e=>k.includes(e)),l=(0,s.A)(t,a),r=(0,s.A)(a,t);return(0,o.A)(e,a,l).filter(e=>!r.includes(e))})},[k,u]),ek=(0,r.useCallback)(t=>{t.target.checked||u(t=>t.filter(t=>!(a===C.PW.everyone&&t===e||k.includes(t)))),eu(e=>!e)},[a,u,e,k]),eS=(0,r.useCallback)(e=>r.createElement(TriggerRunSettingsListEntity,{option:e}),[]),[ev,eA]=(0,r.useMemo)(()=>(0,c.A)(y,e=>!em||e.id!==V.S.TooManyNamedEntities),[y,em]),eT=(0,r.useMemo)(()=>(0,f.A)(ev,O)||y.some(({id:e})=>e===V.S.TooManyNamedEntities),[y,ev,O]),eC=(0,r.useMemo)(()=>{if(a!==C.PW.named_entities)return null;let e=null;e=!H&&er||H&&en?(0,g.Zq)(g.Dm):(0,g.Zq)(g.aQ);let t=n.filter(e=>!k.includes(e)).map(e=>({label:e,value:e}));return r.createElement(q.h,{width:"100%",isInvalid:eT,errors:ev,renderOption:eS,searcherOptions:e,selectedOptions:t,onSelectedItemsChange:ey,selectDataQa:"run-trigger-permissions-internal-entities-multi-select",selectId:"run-trigger-permissions-internal-entities-multi-select",className:"margin_bottom_50"})},[a,H,er,en,n,eT,ev,eS,ey,k]),eN=ee.t("Your workflow includes third-party steps or restricted Slack built-ins, so it cannot be shared with external teams."),eI=(0,r.useMemo)(()=>(eo&&!ed&&eA.push({id:"is_workflow_restricted",message:eN}),eA.length>0?eA:[]),[eA,eo,ed,eN]),eM=(0,r.useMemo)(()=>(0,f.A)(eI,O)||y.some(({id:e})=>e===V.S.TooManyNamedEntities),[y,eI,O]),eD=(0,r.useCallback)(({id:e})=>(!eo||!!H)&&(!et||ei(e)),[H,ei,eo,et]),eP=(0,r.useMemo)(()=>{if(!ep||!em)return null;let e=(0,g.Zq)(g.TE,{filter:eD}),a=k.map(e=>{let t=!ei(e);return{label:e,value:e,isTeamError:t}}),l=[];return H?S&&(l=[{id:"is_invalid_existing_external_target",message:ee.t("Some organizations are not allowed to use this workflow.")}]):l=eI.concat(S?{id:"is_external_team_invalid",message:ee.t("Some organizations don\u2019t have permissions to use workflows created by {teamName}",{teamName:t})}:[]),r.createElement(q.h,{width:"100%",renderOption:eS,searcherOptions:e,selectedOptions:a,onSelectedItemsChange:eE,selectDataQa:"run-trigger-permissions-external-teams-multi-select",selectId:"run-trigger-permissions-external-teams-multi-select",className:"margin_bottom_50",errors:l,isInvalid:!H&&eM||S})},[ep,em,eD,k,S,eS,eE,eM,ei,H,t,eI]),eO=(0,r.useMemo)(()=>{if(!ep)return null;let e=ee.t("Also include connected, external organizations to find and run"),t=!1,a=null;H&&(es===Q.U.FULL_RESTRICTED&&(a=ee.t("External organizations are not allowed to use this workflow."),t=!0),es===Q.U.RESTRICTED_BY_ONLY_CONNECTORS&&(et?.allowed_teams_with_3p_connectors?.length??0)===0&&et?.hermes_triggers_trippable_by_slack_connected_teams_mcp!==z.HF.SAFE_AND_3P&&(a=ee.t("External organizations are not allowed to use this workflow because it contains third party steps."),t=!0));let l=(ec===m.uh||ec===m.kp)&&ed,n=!H&&eo&&!em&&0===k.length&&!l,s=r.createElement(b.A,{className:i()({[J().disabledCheckboxLabel]:H&&t}),text:e,subtext:a,type:"inline",cursor:"pointer","data-qa":"allow-external-orgs-checkbox-label",isDisabled:!H&&n||t},r.createElement(_.A,{id:"allow-external-orgs",name:"allow-external-orgs",value:String(em),checked:em,onChange:ek,"data-qa":"allow-external-orgs-checkbox","aria-disabled":!H&&n||t}));return!H&&n?r.createElement(h.Ay,{"data-qa":"allow-external-orgs-checkbox-tooltip",tip:eN},s):s},[ep,H,ec,ed,eo,em,k.length,ek,eN,es,et?.allowed_teams_with_3p_connectors?.length,et?.hermes_triggers_trippable_by_slack_connected_teams_mcp]);if((0,r.useEffect)(()=>{k.length>0&&L.current&&eu(!0)},[L,k.length]),!el)return null;let eL=ee.t("Who can find and use this workflow?",{fallbackHash:"7d5e45c9df7cc48c632e106be22861700e67214b"}),eR=ee.t("Who can find this workflow?",{fallbackHash:"c49daccad9eba5c019308fe7556b8494fcb19f7a"});return r.createElement("div",{className:"margin_bottom_150"},r.createElement(b.A,{htmlFor:"run-trigger-permissions-select",text:el.type===T.zW?eL:eR},r.createElement(w.l,{id:"run-trigger-permissions-select",value:a,options:eh,placeholder:ex,ariaLabel:ee.t("Default selection"),onChange:ew,required:!0,errorText:"",className:"margin_bottom_50"})),eC,eO,eP,eT||eM?null:r.createElement(TriggerRunAccessHelpText,{workflowId:R,isAllowExternalOrgsChecked:em,permissionType:a,trigger:el}))};TriggerRunSettings.displayName="TriggerRunSettings"},0x1e813d5b2:(e,t,a)=>{"use strict";a.d(t,{Q:()=>WorkflowPreview});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x1d2cd7755),i=a(0x12cef2078),s=a(0xe9c32bb),o=a(0x126af815a),c=a(0x239cd8d69),d=a(0x1dc84ebc7),m=a(0x21e6a881a),u=a(0xa25cde92),p=a(0xe38b5635),_=a(0x33f2430),b=a.n(_);let f=new r.Ay("workflow_builder"),h={[o.LO]:o.Oy,[o.bX]:o.UE};function mapHermesTriggerTypeToShared(e){let t=e&&h[e];return t||e}let WorkflowPreview=({workflow:e,trigger:t,workflowName:a,workflowDescription:r,shouldAllowAutomatedTriggerPreview:_=!1})=>{let h=t?.type,g=o.zW===h,x=(0,d.j)({trigger:{...t,type:mapHermesTriggerTypeToShared(h)},workflow:{...e,steps:e.steps}});a&&(x.title=a),r&&(x.description=r);let w=x?.description,y=e?.icons?.image_192,E=f.t("This is how the workflow will appear in Slack messages and canvases");return l.createElement(l.Fragment,null,e&&x&&l.createElement(l.Fragment,null,g||_?l.createElement("div",{className:b().workflow_preview},l.createElement(n.A,{text:f.t("Preview"),htmlFor:"",className:b().preview_subtitle,"data-qa":"workflow-details-modal-preview"},l.createElement(s.nB,null,E),g?l.createElement(u.j,{shortcutInfo:x,showActions:!1,showByline:!1,isWorkflowBuilderPreview:!0,iconUrl:y}):l.createElement(i.X,null,l.createElement(p.A,{className:"p-workflow_card",elevation:2,size:"medium"},l.createElement(m.A,{shortcutInfo:x,iconUrl:y}),l.createElement("div",{className:"p-workflow_card__body"},w&&l.createElement("div",{className:"p-workflow_card__body__description"},w),l.createElement(c.x,{owningTeamId:x.owningTeamId,className:"margin_top_75"})))))):l.createElement("div",{"data-qa":"workflow-preview-non-link",className:b().non_link_trigger})))};WorkflowPreview.displayName="WorkflowPreview"},0x6713bca9:(e,t,a)=>{"use strict";a.d(t,{J:()=>SegmentIcon});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x344bb842),s=a(0x2501a2cee),o=a(0x4c96e5d9),c=a(0x12cef2078),d=a(0x1f495452e),m=a.n(d);let SegmentIcon=({icon:e,isFocusedOrHovering:t})=>{if(e&&"object"==typeof e&&"onClick"in e&&void 0!==e?.onClick){let{label:a,onClick:r,svgIconProps:s,svgIconPropsOnHover:d}=e,u=n()(m().outline_container,m().with_background,{[m().show_outline]:t}),p=d&&t?d:s,_={"aria-controls":e["aria-controls"],"aria-expanded":e["aria-expanded"]};return l.createElement(c.X,{preventDefault:!0,stopPropagation:!1},l.createElement("div",{className:u},l.createElement(o.Ay,{tip:a,delay:o.PK},l.createElement(i.A,{svgIconProps:p,"aria-label":a,onClick:r,className:m().icon_button,ref:"ref"in e?e.ref:void 0,..._}))))}return(0,l.isValidElement)(e)?e:l.createElement("div",{className:m().container,"data-qa":"segment-icon"},l.createElement(s.Ah,{name:e,size:"20"}))};SegmentIcon.displayName="SegmentIcon"},0x243685e41:(e,t,a)=>{"use strict";a.d(t,{_:()=>useTemplateEditing,d:()=>useCleanupTempWorkflow});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x2286acf6c),i=a(0x20482ad21),s=a(0x6e87d4ec),o=a(0xcaea2334),c=a(0x17c7b6bbb),d=a(0x124d99cb0),m=a(0x1a5ac3a0c),u=a(0xd2ed875e),p=a(0xc8f333a2),_=a(0x1a5f9a4c8),b=a(0x145d46a61),f=a(0x20adb28cd),h=a(0x4e250925),g=a(0x226892387),x=a(0x16ffed5ab);let w=new i.Ay("workflow_builder");function useTemplateEditing({triggerId:e,workflowId:t,templateId:a,hermesWorkflow:i,isTriggerAvailable:o}){let c=useCleanupTempWorkflow({triggerId:e,workflowId:t}),d=useIsEditingDisabled(i,o),u=i.trigger,[_,f]=(0,l.useState)(!1),[y,E]=(0,l.useState)(u?.date_updated||0),k=(0,g.d4)(b.b2),S=(0,r.wA)();(0,l.useEffect)(()=>(a&&!k&&window.addEventListener("beforeunload",c),()=>{k&&c(),window.removeEventListener("beforeunload",c)}),[a,S,c,k]);let v=(0,l.useCallback)(async()=>{if(a&&t)try{await S((0,h.tZ)({workflowId:t,published:!0})),await S((0,p.M)({templateId:a,workflowId:t,reason:"workflow-builder:save-to-template"})),await S((0,h.tZ)({workflowId:t,published:!1}))}catch{S((0,x.M)({element:l.createElement(s.A,{duration:6e3},l.createElement("span",null,w.t("There was an error updating your template.")))}))}},[S,a,t]),A=(0,l.useMemo)(()=>(0,n.A)(e=>{let t=(0,m.j5)(i),a=u?.date_updated||0,l=0!==t||a!==y;e.value&&l&&(f(!0),E(a),v().finally(()=>f(!1)))},1e3),[i,v,u?.date_updated,y]);return(0,l.useEffect)(()=>{let e={value:!d};return A(e),()=>{e.value=!1}},[d,A,u]),{isSaving:_,isEditingDisabled:d||_}}function useIsEditingDisabled(e,t){let a=(0,m.DY)(e),l=(0,m.a6)(e),r=e.trigger,n=!!r&&(0,c.uS)(r),i=(0,g.d4)(o.I),s=(0,g.d4)(e=>(0,b.eF)(e)&&(0,f.jF)(e,a)),u=(0,g.d4)(t=>(0,f.v3)(t,e)),p=l||!n;return n&&!l&&(p=!(0,d.Sm)(r.schedule.start_time)),!i||!(0,m.Nb)(e)||!p||u||!t||s}function useCleanupTempWorkflow({triggerId:e,workflowId:t}){let a=(0,r.wA)();return(0,l.useCallback)(async()=>{e&&await a((0,_.I)({triggerId:e,reason:"workflow-builder:template-editing-cleanup"})),t&&await a((0,u.a)({workflowId:t,reason:"workflow-builder:template-editing-cleanup"}))},[a,e,t])}useTemplateEditing.displayName="useTemplateEditing"},0x8d9b2838:(e,t,a)=>{"use strict";a.d(t,{v:()=>useEditTemplateModal});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x24546e7f2),s=a(0x15ab42d61),o=a(0xdac250),c=a(0x3c838d6a),d=a(0xd013226d),m=a(0x5b0d97fd),u=a(0xa263fbfd),p=a(0x1a5ac3a0c),_=a(0x145d46a61),b=a(0x235bbf477),f=a(0x226892387),h=a(0x1fcbb004d),g=a(0x16ffed5ab);let x=new n.Ay("workflow_builder"),TemplateEditModal=()=>{let e=(0,u.X)(),t=(0,f.d4)(_.dm),a=(0,f.d4)(_.kY),n=(0,r.wA)(),b=(0,l.useCallback)(()=>n((0,h.O)()),[n]),[g,w]=(0,l.useState)(""),[y,E]=(0,l.useState)(""),[k,S]=(0,l.useState)(""),[v,A]=(0,l.useState)(!1),[T,C]=(0,l.useState)(""),N=(0,l.useMemo)(()=>({[m.C7.Details]:{render:({switchPane:e})=>l.createElement(d.R,{templateName:g,setTemplateName:w,description:y,setDescription:E,iconUrl:k,switchPane:e,madLib:T,setMadLib:C,modalType:"edit"}),modalProps:{contentLabel:x.t("Finish Up Template")}},[m.C7.BasicDetails]:{render:({switchPane:e})=>l.createElement(c.R,{templateName:g,setTemplateName:w,description:y,setDescription:E,iconUrl:k,switchPane:e,modalType:"edit"}),modalProps:{contentLabel:x.t("Edit details")}},[m.C7.UploadImg]:{render:({switchPane:e,file:t})=>l.createElement(o.Z,{onClose:b,nextPane:m.C7.CropImg,prevPane:a?m.C7.BasicDetails:m.C7.Details,setOnCropImagePane:A,switchPane:e,file:t}),modalProps:{contentLabel:x.t("Edit Avatar Upload")}},[m.C7.CropImg]:{render:({switchPane:e,imageId:t,avatarUrl:r})=>l.createElement(s._,{workflowName:g,workflowDescription:y,onClose:b,nextPane:a?m.C7.BasicDetails:m.C7.Details,prevPane:a?m.C7.BasicDetails:m.C7.Details,showPreview:!1,setOnCropImagePane:A,setIconUrl:S,avatarUrl:r||"",imageId:t||"",switchPane:e}),modalProps:{contentLabel:x.t("Edit Avatar Upload")}},[m.C7.Confirmation]:{render:()=>l.createElement(TemplateEditConfirmation,{onClose:b}),modalProps:{contentLabel:x.t("Template Edit Confirmation")}}}),[g,y,k,T,b,a]);return((0,l.useEffect)(()=>{e&&(w(e.workflow.title),E(e.workflow.description),C(e.madLibSentence||""),e.workflow.icons?.image_192&&S((0,p.DU)(e.workflow)))},[e]),t&&e)?l.createElement(i.A,{closeModal:b,defaultPane:a?m.C7.BasicDetails:m.C7.Details,panes:N,dataQa:"template-edit-modal",showCloseButton:!v}):null};function TemplateEditConfirmation({onClose:e}){let t=(0,r.wA)(),a=x.t("Template Updated");return(0,l.useEffect)(()=>{t((0,g.M)({element:l.createElement(b.V,{message:a})})),e()},[t,e,a]),null}TemplateEditModal.displayName="TemplateEditModal",TemplateEditConfirmation.displayName="TemplateEditConfirmation";var w=a(0x46dbff89);function useEditTemplateModal(){let e=(0,r.wA)(),t=(0,u.X)();return{openEditModal:(0,l.useCallback)(()=>{let a=l.createElement(u.Z.Provider,{value:t},l.createElement(TemplateEditModal,null));e((0,w.q)({isStackable:!0,element:a}))},[e,t])}}useEditTemplateModal.displayName="useEditTemplateModal"},0x2d26ca33:(e,t,a)=>{"use strict";a.d(t,{K:()=>useTemplateFetch});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0xe874a88a),i=a(0x1a5ac3a0c),s=a(0x14b92995e),o=a(0xf5bbd10a),c=a(0x145d46a61),d=a(0x16e94c2bd),m=a(0x24fc5dd2c),u=a(0x226892387);function useTemplateFetch(e){let t=(0,u.d4)(c.dm),a=(0,r.wA)(),p=(0,o.A)(),[_,b]=(0,l.useState)(),[f,h]=(0,l.useState)(!1),[g,x]=(0,l.useState)(!0),[w,y]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{t&&g&&(async()=>{if(!e)return n.S.reject(Error("No templateId"));try{return y(!1),h(!0),await a((0,s.l)({templateId:e,reason:"load-template-get-as-decorated-workflow"}))}catch(t){return p.error(`Something went wrong when trying to fetch a workflow with templateId: ${e}`,t),n.S.reject(t)}finally{h(!1)}})().then(e=>{let t=(0,d.l_)(e.workflow),a={...e.trigger,type:(0,m.k)(e.trigger.type)},l=(0,i.Ln)(t);b({...e,workflow:t,trigger:a,segments:l})}).catch(()=>{y(!0)}).finally(()=>{x(!1)})},[a,g,p,e,t]),_&&_.workflow&&_.trigger&&_.segments)?{templateId:e||"",failedToFetch:w,dateUpdated:_?.date_updated,workflow:_?.workflow,trigger:_?.trigger,availableData:_?.available_data,expressionData:_?.expression_data??{},segments:_?.segments,isFetchingTemplate:f,categories:_?.categories||[],madLibSentence:_?.madlibs_config?.sentence,templateState:_?.state,collaboratorIds:_?.collaborator_ids||[],refetchTemplate:()=>x(!0)}:null}},0x18bdc312b:(e,t,a)=>{"use strict";a.d(t,{f:()=>useValidateTemplateName});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0xe874a88a),i=a(0x22a29f141),s=a(0x1dfdeb1c8),o=a(0x1ec68d6a3),c=a(0xe747dd27);let d=(0,s.A)("workflows.templates.validate generated fetcher",(e,t,a)=>new n.S((l,r)=>{let{abortSignal:n,reason:s,...d}=a,m=(0,c.VA)(d);e((0,i.apiCall)({method:"workflows.templates.validate",args:m,abortSignal:n,reason:s})).then(e=>{l(e)}).catch(e=>{(0,o.default)({getState:t}).error(`API call to workflows.templates.validate
						with reason ${s} failed, initiated by generated fetcher`),r(e)})}));function useValidateTemplateName(){let e=(0,r.wA)();return{isTemplateNameValid:(0,l.useCallback)(async t=>{try{return await e(d({name:t,reason:"validate-template-name"})),!0}catch{return!1}},[e])}}d.meta={name:"workflowsTemplatesValidateFetcher",key:"createFetcherWorkflowsTemplatesValidateFetcher",description:"workflows.templates.validate generated fetcher"}},0x9c51305d:(e,t,a)=>{"use strict";a.r(t),a.d(t,{TemplateEdit:()=>TemplateEdit});var l,r=a(0xbad225b5),n=a(0x20482ad21),i=a(0x2b7f0bcc),s=a(0x1faa3f1ac),o=a(0x12bc54835),c=a(0x16cf1da63),d=a(0xe874a88a),m=a(0x22a29f141),u=a(0x1dfdeb1c8),p=a(0x1ec68d6a3),_=a(0xe747dd27);let b=(0,u.A)("templates.admins.list generated fetcher",(e,t,a)=>new d.S((l,r)=>{let{abortSignal:n,reason:i,...s}=a,o=(0,_.VA)(s);e((0,m.apiCall)({method:"templates.admins.list",args:o,abortSignal:n,reason:i})).then(e=>{l(e)}).catch(e=>{(0,p.default)({getState:t}).error(`API call to templates.admins.list
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));b.meta={name:"templatesAdminsListFetcher",key:"createFetcherTemplatesAdminsListFetcher",description:"templates.admins.list generated fetcher"};var f=a(0x145d46a61),h=a(0x226892387),g=a(0x19c76d181),x=((l=x||{}).NOT_STARTED="not_started",l.FETCHING="fetching",l.SUCCESS="success",l.ERROR="error",l);function useTemplateAdminsFetch(){let e=(0,c.wA)(),t=(0,h.d4)(f.dm),a=(0,h.d4)(g.WR),[l,n]=(0,r.useState)([]),[i,s]=(0,r.useState)("not_started");return(0,r.useEffect)(()=>{let fetch=async()=>{try{s("fetching");let{admins:t}=await e(b({templateType:"workflow",reason:"template-creation-tool"}));s("success"),n(t)}catch{s("error")}};t&&fetch()},[e,t]),{isTemplateAdmin:"success"===i&&l.includes(a)}}var w=a(0x2d26ca33),y=a(0x2501a2cee),E=a(0x1a1567045),k=a.n(E);let S=new n.Ay("workflow_builder");function TemplateDeleted(){return(0,h.d4)(f.dm)?r.createElement("div",{className:k().templateDeletedContainer},r.createElement("div",{className:k().templateDeletedIcon},r.createElement(y.Ah,{name:"trash",size:"inherit"})),r.createElement("div",{className:k().templateDeleteText},S.rt("This template was deleted."))):null}TemplateDeleted.displayName="TemplateDeleted";var v=a(0x3c5a1598),A=a(0x8d9b2838),T=a(0x16d41362a),C=a(0x38c77fce),N=a(0x1a5ac3a0c);let I=new n.Ay("workflow_builder");function TemplateEditHeader({workflow:e}){let{openEditModal:t}=(0,A.v)(),a=(0,r.useMemo)(()=>(0,N.BQ)(e),[e]),l=(0,r.useMemo)(()=>(0,N.DU)(e),[e]),n=(0,r.useMemo)(()=>(0,N.yL)(e),[e]),i=(0,C.y)(),s=I.t("TEMPLATE",{fallbackHash:"3ec1ae061c27325c7ecb543adf91235e22cbc9ed",fallbackHashNs:"files"});return r.createElement("div",{className:"template_edit_header"},r.createElement("div",{className:"template_edit_name_status"},r.createElement(v.R,{name:a,icon:l,description:n,badgeText:s,canEdit:!i,onEditClick:t})),r.createElement(T.G,null))}TemplateEditHeader.displayName="TemplateEditHeader";var M=a(0x120c268ad),D=a.n(M),P=a(0xc5f25803),O=a(0x11a296110),L=a(0x1e4ad58a2),R=a(0x1ee57b3a0),F=a(0x1fa67866c),W=a(0xe9c32bb),H=a(0x210b99e76),U=a(0x6713bca9),B=a(0x126f22530),q=a(0x344bb842),z=a(0x4c96e5d9),V=a(0x23515fd5),j=a(0xa263fbfd);let $=new n.Ay("workflow_builder");function TemplateEditTriggerCoachmark({trigger:e,editOnStart:t,onCancelClick:a,onDeleteClick:l}){let n=(0,c.wA)(),i=(0,j.X)(),s=(0,r.useCallback)(async({coachmarkText:e})=>{i&&(await n((0,V.lL)({templateId:i.templateId,coachmarkText:e})),i.refetchTemplate?.())},[n,i]),o=(0,r.useCallback)(()=>{s({coachmarkText:""}),l()},[s,l]);return r.createElement(TemplateCoachmark,{id:"trigger",originalCoachmark:e.coachmark||"",onUpdate:s,onCancelClick:a,editOnStart:t,onDeleteTemplate:o})}function TemplateEditCoachmark({segment:e,editOnStart:t,onCancelClick:a,onDeleteClick:l}){let n=(0,c.wA)(),i=(0,j.X)(),s=(0,r.useCallback)(async({coachmarkText:t})=>{i&&(await n((0,V.JR)({templateId:i.templateId,coachmarkText:t,workflow:i.workflow,stepId:e.id})),i.refetchTemplate?.())},[n,e.id,i]),o=(0,r.useCallback)(()=>{s({coachmarkText:""}),l()},[s,l]);return r.createElement(TemplateCoachmark,{id:e.id,originalCoachmark:e.coachmarkText||"",editOnStart:t,onUpdate:s,onCancelClick:a,onDeleteTemplate:o})}function TemplateCoachmark({id:e,originalCoachmark:t,onUpdate:a,editOnStart:l,onCancelClick:n,onDeleteTemplate:i}){let s=(0,h.d4)(f.dm),[o,c]=(0,r.useState)(l),[d,m]=(0,r.useState)(t||""),u=!!d.trim().length,[p,_]=(0,r.useState)(!1),b=(0,C.y)(),g=(0,r.useCallback)(e=>{m(e)},[]),x=(0,r.useCallback)(()=>{c(!0)},[]),w=(0,r.useCallback)(()=>{m(t||""),c(!1),_(!1),n()},[t,n]),onUpdateClick=async()=>{_(!1);try{await a({coachmarkText:d}),c(!1)}catch{_(!0)}};if((0,r.useEffect)(()=>{b&&o&&w()},[o,b,w]),!s)return null;if(o&&!b)return r.createElement("div",{"data-qa":"coachmark-wrapper",className:"template-edit_coachmark"},r.createElement("div",{className:D()("template-edit_coachmark-title",{"template-edit_coachmark-title-error":p})},r.createElement(B.A,{className:"template-edit_coachmark-input",id:`coachmark_${e}`,type:"text",name:"name",value:d,onChange:g,errorText:p?$.t("There was an error updating your template."):void 0,"aria-label":$.t("Workflow instructions",{fallbackHash:"ae6084c38eabe6b5bb974d6644555bf3a0e4c360"}),placeholder:$.t("Add instructions to help others"),autoComplete:"off",useInlineAlert:!0,size:"small"})),r.createElement("div",{className:"template-edit_coachmark-btns"},r.createElement(O.Ay,{"aria-label":$.t("Submit Coachmark"),size:"small",onClick:onUpdateClick},$.t("Save")),r.createElement(O.Ay,{"aria-label":$.t("Cancel"),onClick:w,type:"outline",size:"small"},$.t("Cancel"))));let E=$.t("Instructions for builder:"),k=u?t:$.t("If you\u2019d like, add instructions to help others use this template.");return r.createElement("div",{"data-qa":"coachmark-wrapper",className:"template-edit_coachmark"},r.createElement("div",{className:"template-edit_coachmark-title"},r.createElement(z.Ay,{tip:$.t("Tips are to help people using your template"),position:"left"},r.createElement(y.Ah,{name:"emoji-objects",inline:!0,size:"20"})),r.createElement("div",null,r.createElement("span",{className:"template-edit_tip"},E)," ",k)),!b&&r.createElement("div",{className:"template-edit_coachmark-btns"},r.createElement(q.A,{onClick:x,"aria-label":$.t("Edit"),size:"small"},r.createElement(y.Ah,{name:"edit",inline:!0,size:"20"})),r.createElement(q.A,{"data-qa":"delete-coachmark",onClick:i,"aria-label":$.t("Delete"),size:"small"},r.createElement(y.Ah,{name:"trash",inline:!0,size:"20"}))))}TemplateEditTriggerCoachmark.displayName="TemplateEditTriggerCoachmark",TemplateEditCoachmark.displayName="TemplateEditCoachmark",TemplateCoachmark.displayName="TemplateCoachmark";var Y=a(0x162e18dce),G=a(0x20a2a54fa),Q=a(0x22ae7a8bf),K=a(0x1bffa495d),Z=a(0x1c27a9e4a),X=a(0xee12becf),J=a(0x252b4df6e),ee=a(0x171a52b74),et=a(0xbf22577d),ea=a(0x20d4168fd),el=a(0x75b1e64d),er=a(0x1d9a37519),en=a(0x16af7d0de),ei=a(0x1e9a6d1d);let es=new n.Ay("workflow_builder"),TemplateEditStepPreview=({workflow:e,availableData:t,trigger:a,step:l,enableCoachmarkEditing:n,expressionData:i,renderNestedTemplateEditSteps:s})=>{let o=(0,h.d4)(f.dm),c=(0,Q.S)(t,a,e),d=l.function?.id===en.Ez.case_step?(0,ea.N1)(l):(0,J.lq)(l,l?.coachmark),m=(0,G.sM)(c,d.id),u=(0,C.y)(),p=(0,r.useMemo)(()=>l.function?.id===en.Ez.case_step?r.createElement(el.B,{segment:d,templateExpressionData:i}):(0,X.S)(d),[i,d,l.function?.id]),_=(0,Y.E)(d),[b,g]=(0,r.useState)(!!d.coachmarkText||n),x=(0,r.useMemo)(()=>l.function?.id===en.Ez.case_step?"case":l.function?.id===en.Ez.switch_step?"switch":"function",[l.function?.id]),w=(0,r.useCallback)(()=>{g(!0)},[]),y=(0,r.useCallback)(()=>{g(!!d.coachmarkText)},[d.coachmarkText]),E=(0,r.useCallback)(()=>{g(!1)},[]),k=(0,r.useMemo)(()=>{if("slackFunction"in d.config){if(_?.app_id)return r.createElement(er.z,{appId:_?.app_id,size:24});let{slackFunction:e}=d.config;if(e?.type===ei.A.BuiltIn||e?.type===ei.A.Utility)return(0,H.m)(e?.callback_id);if(e?.app_id)return r.createElement(er.z,{appId:e.app_id,size:24})}let e=(0,Z.E)(d);return(0,K.pA)({type:d?.type,subtype:e})},[d,_?.app_id]),S=(0,r.useMemo)(()=>(0,ee.GS)(d)?(0,et.n)("template",d,m,{staticWorkflow:e}):null,[d,m,e]);if(!o)return null;let v=`template-edit_divider ${x}`;return r.createElement("div",{"data-qa":"template-step",className:"template-edit_root"},r.createElement("div",{className:v},r.createElement("div",{className:"template-edit_dot"}),r.createElement("div",{className:"template-edit_spacer"})),b&&r.createElement(TemplateEditCoachmark,{segment:d,editOnStart:n,onCancelClick:y,onDeleteClick:E}),r.createElement("div",{className:D()({"template-edit_coachmark-step-wrapper":b})},r.createElement(L.A,{className:"template-edit_card-container"},r.createElement(R.A,{className:D()("template-edit_card-header",{"template-edit_header-no-border-bottom":!S})},r.createElement("div",{className:"template-edit_header-info"},r.createElement("div",{className:"template-edit__header-title"},r.createElement(U.J,{icon:k}),r.createElement("div",{className:"template-edit_header-text"},r.createElement(W.nB,{element:"h2",weight:"bold"},p))),!b&&!u&&r.createElement(O.Nm,{className:"template-edit__add-coachmark",onClick:w,"data-qa":"add-instructions"},es.t("Add Instructions")))),S&&r.createElement(F.A,{className:"template-edit_card-section"},S)),!!(l.steps&&s)&&r.createElement("div",{className:"template-edit-nested-step-list"},s?.({parentStepId:l.id,workflow:e,availableData:t,trigger:a,enableCoachmarkEditing:n,expressionData:i}))))};TemplateEditStepPreview.displayName="TemplateEditStepPreview";let eo=new n.Ay("workflow_builder"),TemplateEditTriggerPreview=({trigger:e,enableCoachmarkEditing:t})=>{let a=(0,h.d4)(f.dm),l=(0,N.eG)(e),n=(0,Z.E)(l),i=(0,K.pA)({type:l.type,subtype:n}),s=(0,X.S)(l),[o,c]=(0,r.useState)(!!e.coachmark||t),d=(0,C.y)(),m=(0,r.useCallback)(()=>{c(!0)},[]),u=(0,r.useCallback)(()=>{c(!!e.coachmark)},[e.coachmark]),p=(0,r.useCallback)(()=>{c(!1)},[]);return a?r.createElement(r.Fragment,null,o&&r.createElement(TemplateEditTriggerCoachmark,{trigger:e,editOnStart:t,onCancelClick:u,onDeleteClick:p}),r.createElement("div",{className:D()({"template-edit_coachmark-step-wrapper":o})},r.createElement(L.A,{className:"template-edit_card-container","data-qa":"trigger-preview"},r.createElement("div",{className:"template-edit_card-header"},r.createElement("div",{className:"template-edit_header-info"},r.createElement("div",{className:"template-edit__header-title"},i&&r.createElement(U.J,{icon:i}),r.createElement("div",{className:"template-edit_header-text"},r.createElement(W.nB,{element:"h2",weight:"bold",className:"template-edit__header-title-body"},s))),!o&&!d&&r.createElement(O.Nm,{className:"template-edit__add-coachmark",onClick:m},eo.t("Add Instructions"))))))):null};function TemplateEditSteps({trigger:e,workflow:t,availableData:a,enableCoachmarkEditing:l,parentStepId:n,expressionData:i}){let s=(0,C.y)(),o=n?(0,P.a)(t).find(e=>e.id===n)?.steps??[]:t.steps,c=(0,r.useCallback)(e=>r.createElement(TemplateEditSteps,e),[]);return r.createElement("div",{className:D()("template-edit_card-section",{"template-edit_card-section--disabled":s})},!n&&r.createElement(TemplateEditTriggerPreview,{trigger:e,enableCoachmarkEditing:l}),o.map((n,s)=>r.createElement(TemplateEditStepPreview,{key:`${n.function?.id}_${s+1}`,workflow:t,trigger:e,availableData:a,step:n,enableCoachmarkEditing:l,renderNestedTemplateEditSteps:c,expressionData:i})))}TemplateEditTriggerPreview.displayName="TemplateEditTriggerPreview",TemplateEditSteps.displayName="TemplateEditSteps";var ec=a(0x1959e5e36),ed=a(0x5b0d97fd),em=a(0xad14d02e),eu=a(0x1e367a230),ep=a(0x1ee439e69);let e_=new n.Ay("workflow_builder");function TemplateEdit({workflowTemplateId:e}){let t=(0,h.d4)(f.dm),a=(0,h.d4)(f.kY),l=(0,h.d4)(f.mh),n=(0,h.d4)(ep.H7),c=(0,eu.PW)(n.id),[d,m]=(0,r.useState)(l),[u,p]=(0,r.useState)(!1),_=(0,w.K)(e),{isTemplateAdmin:b}=useTemplateAdminsFetch(),g=(0,r.useMemo)(()=>null===_?null:{..._,markTemplateAsDeleted:()=>p(!0)},[_]),x=(0,r.useMemo)(()=>!!_?.templateState&&(0,ed.BE)({templateState:_.templateState,isTemplateAdmin:b,isTemplateOpsWorkspace:c,experimentTemplateCreationDiscoverabilityGroupOn:a}),[a,b,c,_?.templateState]);return _?.failedToFetch?r.createElement("div",{className:"template-edit-error-container"},r.createElement(i.Ay,{level:i.A_.error,type:i.QE.boxed,align:i.AO.left,className:"template-edit-error-msg"},t?e_.rt("We\u2019re having trouble loading this template. It may have been deleted, or you may have been removed as a manager. Contact another manager, or <a>check the Slack service</a> to make sure it\u2019s not a problem on our end",null,({text:e,tag:t})=>"a"===t?r.createElement(s.A,{href:"https://slack-status.com/"},e):null):"")):t&&g&&g?.workflow&&g?.segments&&g?.trigger?r.createElement(j.Z.Provider,{value:g},r.createElement(C.g.Provider,{value:x},r.createElement("div",{"data-qa":"template-edit-container",className:"base_template_edit"},u?r.createElement(TemplateDeleted,null):r.createElement(o.x,null,r.createElement(TemplateEditHeader,{workflow:g.workflow,templateState:g.templateState}),l&&r.createElement(ec.P,{templateId:e,enableCoachmarkEditing:d,onEnableCoachmarkEditing:m}),r.createElement(TemplateEditSteps,{availableData:g.availableData,trigger:g.trigger,workflow:g.workflow,enableCoachmarkEditing:d,expressionData:g.expressionData}))),r.createElement(em.A,null))):null}TemplateEdit.displayName="TemplateEdit"},0xcbde109e:(e,t,a)=>{"use strict";a.d(t,{i:()=>MadLibsModal});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x11a296110),s=a(0x1d2cd7755),o=a(0x126f22530),c=a(0x145d46a61),d=a(0x20e80190e),m=a(0x226892387),u=a(0x1fcbb004d);let p=new n.Ay("workflow_builder");function MadLibsModal({templateTitle:e,onGenerate:t}){let a=(0,m.d4)(c.dm),n=(0,r.wA)(),[_,b]=(0,l.useState)(e),f=(0,l.useCallback)(()=>n((0,u.O)()),[n]),h=(0,l.useCallback)(()=>{t(_),f()},[t,f,_]);return a?l.createElement(d.dW,{contentLabel:p.t("Generate Madlibs"),closeModal:f},l.createElement(d.rQ,null,l.createElement(d.Rc,{title:p.t("Generate Madlibs")})),l.createElement(d.$m,null,l.createElement(d.qf,null,l.createElement(s.A,{text:p.rt("<b>Goal:</b> <i>Briefly explain what this workflow achieves</i>")},l.createElement(o.A,{id:"madlibs-goal",type:"text",name:"name",value:_,onChange:b,placeholder:"",autoComplete:"off",focusOnMount:!0,useInlineAlert:!0})))),l.createElement(d.jl,null,l.createElement(d.ox,null,l.createElement(i.Ay,{type:"outline",onClick:f},p.t("Cancel")),l.createElement(i.lV,{onClick:h,"aria-label":p.t("Generate")},p.t("Generate"))))):null}MadLibsModal.displayName="MadLibsModal"},0x3c838d6a:(e,t,a)=>{"use strict";a.d(t,{R:()=>TemplateBasicDetailsPane});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x120c268ad),i=a.n(n),s=a(0x2286acf6c),o=a(0x20482ad21),c=a(0x11a296110),d=a(0x1d2cd7755),m=a(0x126f22530),u=a(0x5299a396),p=a(0x1e586fbba),_=a(0x1b7f0cd57),b=a(0xa3743afa),f=a(0x18bdc312b),h=a(0x23515fd5),g=a(0x5b0d97fd),x=a(0xa263fbfd),w=a(0x937a43ca),y=a(0x145d46a61),E=a(0x20e80190e),k=a(0x1dae1e14d),S=a(0xf3c231c),v=a(0x226892387),A=a(0x1fcbb004d),T=a(0x254059bfb),C=a.n(T);let N=new o.Ay("workflow_builder");function TemplateBasicDetailsPane({switchPane:e,templateName:t,setTemplateName:a,description:n,setDescription:o,iconUrl:T,modalType:I="publish",publishStepNumber:M,totalNumberOfPublishSteps:D}){let P=(0,x.X)(),{isTemplateNameValid:O}=(0,f.f)(),L=(0,r.wA)(),[R,F]=(0,l.useState)(!1),W=(0,v.d4)(y.dm),H="publish"===I,U=(0,l.useCallback)(()=>L((0,A.O)()),[L]),B=(0,l.useRef)(null),q=(0,l.useCallback)(()=>B?.current?.click(),[]),z=(0,l.useCallback)(t=>{let a=(t.target.files||[])[0];a&&e(g.C7.UploadImg,{file:a})},[e]),[V,j]=(0,l.useState)(!1),$=(0,l.useMemo)(()=>!!(0,k.A)(t),[t]),Y=(0,l.useMemo)(()=>!!(0,S.A)(t,b.p),[t]),G=(0,l.useMemo)(()=>(0,w.Zb)(t),[t]),Q=(0,l.useMemo)(()=>(0,w.yA)(t),[t]),K=(0,l.useMemo)(()=>(0,w.L8)(t),[t]),Z=(0,l.useMemo)(()=>Q?N.t("Whoops! That name is reserved."):G?W?N.t("Template names can\u2019t support special characters (i.e. !#$%&)."):"Template names can\u2019t support special characters (i.e. !#$%&).":K?W?N.t("Whoops! Template names cannot have emojis."):"Whoops! Template names cannot have emojis.":V?N.t("This template already exists, choose a different name."):"",[W,G,Q,K,V]),X=(0,l.useMemo)(()=>!!(0,k.A)(n),[n]),J=(0,l.useMemo)(()=>!!(0,S.A)(n,b.p),[n]),ee=(0,l.useMemo)(()=>(0,s.A)(e=>{O(e).then(e=>{e||j(!0)})},600),[O]),et=(0,l.useCallback)(async e=>{j(!1),a(e);let t=e.trim();t.length&&t!==P?.workflow.title&&ee(t)},[a,P?.workflow.title,ee]),ea=(0,l.useCallback)(async()=>{if(H)return void e(g.C7.AdvancedDetails);if(P){F(!1);try{await L((0,h.J7)({...P,description:n,templateName:t,iconUrl:T,prevTemplateState:P.templateState})),P.refetchTemplate?.(),e(g.C7.Confirmation)}catch{F(!0)}}},[n,L,T,H,e,P,t]),el=(0,l.useMemo)(()=>!!Z||$||Y||X||J,[Z,$,Y,X,J]);return W?l.createElement(l.Fragment,null,l.createElement(E.rQ,null,l.createElement(E.Rc,{id:"story__title-bar",title:H?N.t("Publish Template"):N.t("Edit details")})),l.createElement(E.$m,null,l.createElement(E.qf,null,l.createElement(d.A,{text:N.t("Template Name")},l.createElement(m.A,{id:"template-details-name",type:"text",maxCharacterLimit:b.p,minCharacterLimit:b.H,name:"name",value:t,onChange:et,placeholder:N.t("Something short and descriptive"),errorText:Z,autoComplete:"off",focusOnMount:!0,"data-qa":"workflow-details-modal-name__input",useInlineAlert:!0,isRequired:!0})),l.createElement(d.A,{text:N.t("Description")},l.createElement(u.A,{id:"workflow-details-modal_description",type:"text",maxCharacterLimit:b.p,minCharacterLimit:b.H,name:"description",value:n,onChange:o,placeholder:N.t("What is this template for?"),"data-qa":"workflow-details-modal-description__input",useInlineAlert:!0,isRequired:!0})),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(d.A,{text:N.t("Image")},l.createElement("input",{className:C().file_input,type:"file",accept:"image/jpeg,image/gif,image/png",onChange:z,ref:B,"aria-hidden":"true",tabIndex:-1,hidden:!0})),l.createElement(c.Ay,{type:"outline",size:"small",onClick:q,className:C().choose_file_icon,"data-qa":"workflow-details-modal-icon-button"},N.t("Choose Image"))),l.createElement(_.R,{className:C().workflow_avatar_icon,iconSrcUrl:T,altText:t,size:"xl"}))),R&&l.createElement(E.qf,null,l.createElement(p.A,{"data-qa":"workflow-details-modal-description-error"},N.t("There was an error updating your template.")))),l.createElement(E.jl,{className:C().modalFooter},H&&l.createElement("div",null,N.rt("Step {currentStepNumber} of {totalNumberOfSteps}",{currentStepNumber:M,totalNumberOfSteps:D})),l.createElement(E.ox,null,l.createElement(c.Ay,{type:"outline",onClick:U},N.t("Cancel")),l.createElement(c.Ay,{disabled:el,onClick:ea,className:i()(C().primaryCtaButton,{[C().disabled]:el,"template-edit-publish-button":H})},H?N.t("Next"):N.t("Save"))))):null}TemplateBasicDetailsPane.displayName="TemplateBasicDetailsPane"},0xd367bf0f:(e,t,a)=>{"use strict";a.d(t,{S:()=>mapCategoriesToOptions,p:()=>TemplateDetailsCategories});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0xa7ec93c2),i=a(0x5b0d97fd),s=a(0x145d46a61),o=a(0x226892387);let c=new r.Ay("workflow_builder");function TemplateDetailsCategories({selectedOptions:e,onSelect:t}){let a=mapCategoriesToOptions();return(0,o.d4)(s.dm)?l.createElement(n.Ay,{className:"template-edit-categories",options:a,selectId:"workflow-details-categories",size:"medium",width:"400",placeholderText:c.t("Choose a category\u2026"),selectedOptions:e,onSelectedItemsChange:t,expandOnFocus:!0}):null}function mapCategoriesToOptions(e=(0,i.N4)()){return e.map(e=>({label:e,value:e}))}TemplateDetailsCategories.displayName="TemplateDetailsCategories"},0x184ab8957:(e,t,a)=>{"use strict";a.d(t,{c:()=>TemplateDetailsDiscoverabilitySetting});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x1d2cd7755),i=a(0x139c79d16),s=a(0xa5dbe09b),o=a(0x1e367a230),c=a(0x145d46a61),d=a(0xa1832ae4),m=a(0x226892387),u=a(0x1ee439e69);let p=new r.Ay("workflow_builder");function TemplateDetailsDiscoverabilitySetting({templateState:e,setTemplateState:t}){let a=(0,l.useRef)(e),r=(0,m.d4)(c.kY),_=(0,m.d4)(u.H7),b=(0,d.F1)(_),f=(0,o.PW)(_.id),h=(0,l.useCallback)(e=>()=>{"publish_requested"===e&&f?t("published"):t(e)},[t,f]),g=r?p.t("Submit to have template reviewed and published to {teamName}",{teamName:b}):`Submit to have template reviewed and published to ${b}`;return f&&(g=r?p.t("Submit to have template published to {teamName}",{teamName:b}):`Submit to have template published to ${b}`),l.createElement(s.A,{legendText:r?p.t("Who can find and use this template",{fallbackHash:"323f0a57655a9c49ec8d3084642340e9f0eab788"}):"Who can find and use this template",isDisabled:"publish_requested"===a.current||"published"===a.current},l.createElement(n.A,{text:r?p.t("Template managers only"):"Template managers only",subtext:r?p.t("Save as private to test with collaborators before sharing widely"):"Save as private to test with collaborators before sharing widely",htmlFor:"template-details-discoverability-managers",type:"inline"},l.createElement(i.A,{id:"template-details-discoverability-managers",name:"template-details-discoverability",checked:"draft"===e,onChange:h("draft")})),l.createElement(n.A,{text:r?p.t("Everyone internal in {teamName}",{teamName:b}):`Everyone internal in ${b}`,subtext:g,htmlFor:"template-details-discoverability-internal",type:"inline"},l.createElement(i.A,{id:"template-details-discoverability-internal",name:"template-details-discoverability",checked:"publish_requested"===e||"published"===e,onChange:h("publish_requested")})))}TemplateDetailsDiscoverabilitySetting.displayName="TemplateDetailsDiscoverabilitySetting"},0xd013226d:(e,t,a)=>{"use strict";a.d(t,{R:()=>TemplateDetailsPane});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x120c268ad),i=a.n(n),s=a(0x2286acf6c),o=a(0x72b537b5),c=a(0x20482ad21),d=a(0x11a296110),m=a(0xb1ea448c),u=a(0x1d2cd7755),p=a(0x126f22530),_=a(0x5299a396),b=a(0x344bb842),f=a(0x1e586fbba),h=a(0x143f89715),g=a(0x1b7f0cd57),x=a(0x253c586a2),w=a(0x7f5a02e8),y=a(0xa3743afa),E=a(0x18bdc312b),k=a(0xcbde109e),S=a(0xd367bf0f),v=a(0x184ab8957),A=a(0x23515fd5),T=a(0x5b0d97fd),C=a(0xa263fbfd),N=a(0x10d53599f),I=a(0x19dc73101),M=a(0x1e367a230),D=a(0xe1644a69),P=a(0x247e6596),O=a(0x1f26a5878),L=a(0x2120d7f64),R=a(0x145d46a61),F=a(0x20e80190e),W=a(0x226892387),H=a(0x19c76d181),U=a(0x14149c126),B=a(0x1fcbb004d),q=a(0x46dbff89),z=a(0x1ee439e69),V=a(0x254059bfb),j=a.n(V);let $=new c.Ay("workflow_builder"),renderMemberOption=e=>l.createElement(N.A,{id:e.value});function TemplateDetailsPane({switchPane:e,templateName:t,setTemplateName:a,madLib:n,setMadLib:c,description:N,setDescription:V,iconUrl:Y,modalType:G="publish"}){let Q=(0,o.U)(),K=(0,C.X)(),[Z,X]=(0,l.useState)(K?.templateState),{isTemplateNameValid:J}=(0,E.f)(),ee=(0,r.wA)(),[et,ea]=(0,l.useState)(!1),[el,er]=(0,l.useState)(!1),[en,ei]=(0,l.useState)(""),[es,eo]=(0,l.useState)(!1),ec=(0,W.d4)(R.dm),ed=(0,W.d4)(e=>"on"===(0,U._Z)(e,"workflow_templates_collaborators")),em=(0,W.d4)(R.kY),eu=(0,W.d4)(H.WR),ep=(0,W.d4)(z.H7),{speedBumpState:e_,closeSpeedBump:eb,openSpeedBump:ef}=(0,L.v)(),[eh,eg]=(0,l.useState)((0,S.S)(K?.categories)),ex=(0,l.useCallback)(()=>ee((0,B.O)()),[ee]),ew=(0,l.useRef)(null),ey=(0,l.useCallback)(()=>ew?.current?.click(),[]),eE=(0,l.useCallback)(t=>{let a=(t.target.files||[])[0];a&&e(T.C7.UploadImg,{file:a})},[e]),[ek,eS]=(0,l.useState)(K?.collaboratorIds||[]),ev=0===ek.length,eA=ed?$.t("You must provide at least 1 template manager"):"You must provide at least 1 template manager",eT=(0,l.useMemo)(()=>{let e=[];return ev&&e.push({id:"empty_collaborators",message:eA}),e},[eA,ev]),eC=(0,l.useMemo)(()=>(0,s.A)(e=>{J(e).then(e=>{e||ei(ec?$.t("This template already exists, choose a different name"):"")})},600),[J,ec]),eN=(0,l.useCallback)(e=>{ei("");let t=e.trim();a(e),t.length&&t!==K?.workflow.title&&eC(t)},[a,eC,K]),eI=(0,l.useMemo)(()=>{let e=(K?.collaboratorIds||[]).some(e=>e===eu),t=!ek.some(e=>e===eu);return e&&t},[eu,ek,K?.collaboratorIds]),eM=(0,l.useCallback)(async()=>{try{if(!K)return void er(!0);ea(!0),er(!1);let a=eh.map(e=>e.value),l="publish"===G?"published":void 0;em&&Z&&(l=Z),await ee((0,A.J7)({workflow:K.workflow,trigger:K.trigger,templateId:K.templateId,description:N,templateName:t,prevTemplateState:K.templateState,iconUrl:Y,categories:a,madLib:n,newTemplateState:l})),await ee((0,A.A1)({templateId:K.templateId,collaboratorIds:K.collaboratorIds||[],updatedCollaboratorIds:ek})),K.refetchTemplate?.(),ea(!1),e(T.C7.Confirmation)}catch{er(!0),ea(!1)}},[K,eh,G,em,Z,ee,N,t,Y,n,e,ek]),eD=(0,l.useCallback)(()=>{eI&&ed?ef({heading:$.t("Remove yourself as a template manager?"),message:$.t("Removing yourself as a template manager means you\u2019ll immediately lose access to edit this template. To become a template manager of this template again, a current manager will need to add you."),onCancel:eb,onContinue:eM}):eM()},[eI,ef,eb,eM,ed]),eP=(0,l.useMemo)(()=>ek.map(e=>({label:e,value:e})),[ek]),eO=(0,l.useCallback)(e=>{eS(e.map(({value:e})=>e))},[eS]),eL=(0,l.useCallback)(async e=>{eo(!0);try{let t=await ee((0,P.A)({templateId:K?.templateId||"",reason:"template-edit:generate-madlibs"})),{result:a}=await ee((0,O.W)({workflowDescription:t.workflow_description,triggerDescription:t.trigger_description,goal:e,reason:"template-edit:generate-mablibs"}));c(a)}catch{er(!0)}finally{eo(!1)}},[ee,K,c]),eR=(0,l.useCallback)(()=>{ee((0,q.q)({isStackable:!0,element:l.createElement(k.i,{templateTitle:K?.workflow.title||"",onGenerate:eL})}))},[ee,eL,K?.workflow.title]),eF=(0,l.useMemo)(()=>{if(em)switch(Z){case"draft":return $.t("Publish");case"publish_requested":case"published":return $.t("Submit");default:return $.t("Save")}return"publish"===G?$.t("Publish Template"):$.t("Save")},[G,Z,em]),eW=(0,l.useMemo)(()=>!!en.length||(0,h.A)(eT,Q)&&ed,[eT,en,ed,Q]);if(!ec)return null;let eH=$.t("Something short and descriptive"),eU=$.t("What is this template for?"),eB=(0,M.PW)(ep.id);return l.createElement(l.Fragment,null,l.createElement(F.rQ,null,l.createElement(F.Rc,{id:"story__title-bar",title:"publish"===G?$.t("Finish Up Template"):$.t("Edit details")})),l.createElement(F.$m,null,l.createElement(F.qf,null,l.createElement(u.A,{text:$.t("Template Name")},l.createElement(p.A,{id:"template-details-name",type:"text",maxCharacterLimit:y.p,name:"name",value:t,onChange:eN,placeholder:eH,errorText:en,autoComplete:"off",focusOnMount:!0,"data-qa":"workflow-details-modal-name__input",useInlineAlert:!0})),l.createElement(u.A,{text:$.t("Description")},l.createElement(_.A,{id:"workflow-details-modal_description",type:"text",maxCharacterLimit:y.p,minCharacterLimit:y.H,name:"description",value:N,onChange:V,placeholder:eU,"data-qa":"workflow-details-modal-description__input",useInlineAlert:!0,isRequired:!0})),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(u.A,{text:$.t("Image")},l.createElement("input",{className:j().file_input,type:"file",accept:"image/jpeg,image/gif,image/png",onChange:eE,ref:ew,"aria-hidden":"true",tabIndex:-1,hidden:!0})),l.createElement(d.Ay,{type:"outline",size:"small",onClick:ey,className:j().choose_file_icon,"data-qa":"workflow-details-modal-icon-button"},$.t("Choose Image"))),l.createElement(g.R,{className:j().workflow_avatar_icon,iconSrcUrl:Y,altText:t,size:"xl"}))),l.createElement("hr",null),l.createElement(F.qf,null,l.createElement(u.A,{text:$.t("Category Tags"),className:j().category_section},l.createElement(S.p,{selectedOptions:eh,onSelect:eg})),ed&&l.createElement(u.A,{text:ed?$.t("Template Managers"):"Template Managers"},l.createElement(I.h,{width:"100%",className:"margin_bottom_50",selectDataQa:"collaborators-multi-select",selectId:"collaborators-multi-select",isInvalid:eT.length>0,errors:eT,renderOption:renderMemberOption,searcherOptions:(0,w.Zq)(x.Df,{}),selectedOptions:eP,onSelectedItemsChange:eO,focusOnMount:!0}),l.createElement("span",{className:j().helpText},ed?$.t("Can edit, publish, and delete this template"):"Can edit, publish, and delete this template"))),l.createElement("hr",null),em&&l.createElement(F.qf,null,l.createElement(v.c,{templateState:Z,setTemplateState:X})),eB&&l.createElement(F.qf,null,l.createElement("div",{className:j().madlibs_label},l.createElement(u.A,{text:$.t("Madlib")}),es?l.createElement(m.A,{size:"small",className:j().madlibs_ai_loading}):l.createElement(b.A,{"aria-label":$.t("Generate Madlibs"),className:j().madlibs_ai_btn,onClick:eR},l.createElement(D.o,{type:"workflow",size:"16"}))),l.createElement(_.A,{id:"template-details-madlib",type:"text",name:"madlib",value:n,onChange:c})),(em||eB)&&l.createElement("hr",null),el&&l.createElement(l.Fragment,null,l.createElement(F.qf,null,l.createElement(f.A,{"data-qa":"workflow-details-modal-description-error"},$.t("There was an error updating your template."))),l.createElement("hr",null))),e_.isVisible?l.createElement(F.ty,{description:e_.message,...e_,continueButtonType:"primary",continueButtonLabel:$.t("Save")}):l.createElement(F.jl,null,l.createElement(F.ox,null,l.createElement(d.Ay,{type:"outline",onClick:ex},$.t("Cancel")),l.createElement(d.lV,{disabled:eW,loading:et,onClick:eD,className:i()({"template-edit-publish-button":"publish"===G}),"aria-label":eF},eF))))}TemplateDetailsPane.displayName="TemplateDetailsPane"},0x16d41362a:(e,t,a)=>{"use strict";a.d(t,{G:()=>TemplateEditActions});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x20482ad21),i=a(0x11a296110),s=a(0x344bb842),o=a(0x99233ecb),c=a(0x1e4b6e4e6),d=a(0x190ea1603),m=a(0x24546e7f2),u=a(0x15ab42d61),p=a(0xdac250),_=a(0x1faa3f1ac),b=a(0x2501a2cee),f=a(0x191e9e7f6),h=a(0xa263fbfd),g=a(0x145d46a61),x=a(0x20e80190e),w=a(0x226892387),y=a(0x1ee439e69),E=a(0x15f87e66b),k=a.n(E);let S=new n.Ay("workflow_builder");function PublishTemplateConfirmation({onClose:e}){let t=(0,h.X)(),a=(0,w.d4)(g.dm),r=(0,w.d4)(y.H7),n=r?.id;return a&&t?l.createElement(l.Fragment,null,l.createElement(x.rQ,null,l.createElement(x.Rc,{title:S.t("Your template is published!")})),l.createElement(x.$m,null,l.createElement(x.qf,null,l.createElement(f.pL,null),l.createElement("div",{"data-qa":"template-preview-non-link",className:k().non_link_trigger}))),l.createElement(x.jl,null,l.createElement(x.ox,{className:k().footer_buttons},l.createElement(_.A,{href:`slack://workflow-template?team=${n}&id=${t.templateId}`,className:k().workflowsHelpLink},l.createElement(b.Ah,{name:"info",inline:!0,size:"20"}),S.t("View in Slack Automations")),l.createElement(x.s_,{type:"primary",onClick:e,className:k().done_button,"data-qa":"first-publish-modal-confirmation-close__button","aria-label":S.t("Done")},S.t("Done"))))):null}PublishTemplateConfirmation.displayName="PublishTemplateConfirmation";var v=a(0x120c268ad),A=a.n(v),T=a(0x72b537b5),C=a(0x6affae29),N=a(0x1d2cd7755),I=a(0x1e586fbba),M=a(0x127218dbe),D=a(0x143f89715),P=a(0xd367bf0f),O=a(0x253c586a2),L=a(0x7f5a02e8),R=a(0x10d53599f),F=a(0x19dc73101),W=a(0x14149c126);let H=new n.Ay("workflow_builder"),renderMemberOption=e=>l.createElement(R.A,{id:e.value});function TemplateDetailsCollaborators({selectedCollaborators:e,setSelectedCollaborators:t,collaboratorInputErrors:a,setCollaboratorInputErrors:r}){let n=(0,w.d4)(e=>"on"===(0,W._Z)(e,"workflow_templates_collaborators"));(0,l.useEffect)(()=>{let t=[];0===e.length&&t.push({id:"empty_collaborators",message:n?H.t("You must provide at least 1 template manager"):"You must provide at least 1 template manager"}),r(t)},[n,e,r]);let i=(0,l.useMemo)(()=>[{id:"help-text",message:n?H.t("Can edit, publish, and delete this template"):"Can edit, publish, and delete this template"}],[n]),s=(0,l.useMemo)(()=>e.map(e=>({label:e,value:e})),[e]),o=(0,l.useCallback)(e=>{t(e.map(({value:e})=>e))},[t]);return l.createElement(F.h,{width:"100%",className:"margin_bottom_50",selectDataQa:"collaborators-multi-select",selectId:"collaborators-multi-select",isInvalid:!!a.length,errors:a,renderOption:renderMemberOption,searcherOptions:(0,L.Zq)(O.Df,{}),selectedOptions:s,onSelectedItemsChange:o,hints:a.length?void 0:i})}TemplateDetailsCollaborators.displayName="TemplateDetailsCollaborators";var U=a(0x184ab8957),B=a(0xb1ea448c),q=a(0x5299a396),z=a(0xcbde109e),V=a(0xe1644a69),j=a(0x247e6596),$=a(0x1f26a5878),Y=a(0x46dbff89),G=a(0x254059bfb),Q=a.n(G);let K=new n.Ay("workflow_builder");function TemplateDetailsMadlibs({templateData:e,madLib:t,setMadLib:a,setHasSaveError:n}){let i=(0,r.wA)(),[o,c]=(0,l.useState)(!1),d=(0,l.useCallback)(async t=>{c(!0);try{let l=await i((0,j.A)({templateId:e.templateId||"",reason:"template-edit:generate-madlibs"})),{result:r}=await i((0,$.W)({workflowDescription:l.workflow_description,triggerDescription:l.trigger_description,goal:t,reason:"template-edit:generate-mablibs"}));a(r)}catch{n(!0)}finally{c(!1)}},[i,e.templateId,a,n]),m=(0,l.useCallback)(()=>{i((0,Y.q)({isStackable:!0,element:l.createElement(z.i,{templateTitle:e?.workflow.title||"",onGenerate:d})}))},[i,d,e?.workflow.title]);return l.createElement(l.Fragment,null,l.createElement("div",{className:Q().madlibs_label},l.createElement(N.A,{text:K.t("Madlib")}),o?l.createElement(B.A,{size:"small",className:Q().madlibs_ai_loading}):l.createElement(s.A,{"aria-label":K.t("Generate Madlibs"),className:Q().madlibs_ai_btn,onClick:m},l.createElement(V.o,{type:"workflow",size:"16"}))),l.createElement(q.A,{id:"template-details-madlib",type:"text",name:"madlib",value:t,onChange:a}))}TemplateDetailsMadlibs.displayName="TemplateDetailsMadlibs";var Z=a(0x23515fd5),X=a(0x5b0d97fd),J=a(0x1e367a230),ee=a(0x2120d7f64),et=a(0x19c76d181),ea=a(0x1fcbb004d);let el=new n.Ay("workflow_builder");function TemplateAdvancedDetailsPane({switchPane:e,templateName:t,madLib:a,setMadLib:n,description:s,iconUrl:o,modalType:c="publish",prevPane:d,publishStepNumber:m,totalNumberOfPublishSteps:u}){let p=(0,T.U)(),_=(0,r.wA)(),b=(0,h.X)(),[f,E]=(0,l.useState)(b?.templateState),[k,S]=(0,l.useState)(!1),[v,O]=(0,l.useState)(!1),[L,R]=(0,l.useState)(b?.collaboratorIds||[]),[F,H]=(0,l.useState)([]),[B,q]=(0,l.useState)((0,P.S)(b?.categories)),z=(0,w.d4)(g.dm),V=(0,w.d4)(e=>"on"===(0,W._Z)(e,"workflow_templates_collaborators")),j=(0,w.d4)(g.kY),$=(0,w.d4)(et.WR),Y=(0,w.d4)(y.H7),G=(0,J.PW)(Y.id),{speedBumpState:K,closeSpeedBump:er,openSpeedBump:en}=(0,ee.v)(),ei=(0,l.useCallback)(()=>_((0,ea.O)()),[_]),es=(0,l.useMemo)(()=>{let e=(b?.collaboratorIds||[]).some(e=>e===$),t=!L.some(e=>e===$);return e&&t},[$,L,b?.collaboratorIds]),eo=(0,l.useCallback)(async()=>{try{if(!b)return void O(!0);S(!0),O(!1);let l=B.map(e=>e.value);await _((0,Z.J7)({workflow:b.workflow,trigger:b.trigger,templateId:b.templateId,description:s,templateName:t,prevTemplateState:b.templateState,iconUrl:o,categories:l,madLib:a,newTemplateState:f})),await _((0,Z.A1)({templateId:b.templateId,collaboratorIds:b.collaboratorIds||[],updatedCollaboratorIds:L})),b.refetchTemplate?.(),e(X.C7.Confirmation,{templateState:f})}catch{O(!0),S(!1)}},[b,B,f,_,s,t,o,a,e,L]),ec=(0,l.useCallback)(()=>{es&&V?en({heading:el.t("Remove yourself as a template manager?"),message:el.t("Removing yourself as a template manager means you\u2019ll immediately lose access to edit this template. To become a template manager of this template again, a current manager will need to add you."),onCancel:er,onContinue:eo}):eo()},[es,en,er,eo,V]),ed=(0,l.useCallback)(()=>{d&&e(d)},[d,e]),em="publish"===c,eu=(0,l.useMemo)(()=>{if(!f)return"";switch(f){case"draft":case"staging":case"featured":return el.t("Save");case"publish_requested":return el.t("Submit");case"published":return el.t("Publish");default:return(0,C.Kh)(f)}},[f]),ep=(0,l.useMemo)(()=>(0,D.A)(F,p),[F,p]);if(!z)return null;let e_=G&&b;return l.createElement(l.Fragment,null,l.createElement(x.rQ,null,l.createElement(x.Rc,{id:"story__title-bar",title:em?el.t("Publish Template"):el.t("Settings")})),l.createElement(x.$m,null,l.createElement(x.qf,null,G&&l.createElement(N.A,{text:el.t("Category Tags"),className:Q().category_section},l.createElement(P.p,{selectedOptions:B,onSelect:q})),V&&l.createElement(N.A,{text:V?el.t("Template Managers"):"Template Managers"},l.createElement(TemplateDetailsCollaborators,{selectedCollaborators:L,setSelectedCollaborators:R,collaboratorInputErrors:F,setCollaboratorInputErrors:H}))),j&&l.createElement(x.qf,null,l.createElement(U.c,{templateState:f,setTemplateState:E})),e_&&l.createElement(x.qf,null,l.createElement(TemplateDetailsMadlibs,{templateData:b,madLib:a,setMadLib:n,setHasSaveError:O})),v&&l.createElement(x.qf,null,l.createElement(I.A,{"data-qa":"workflow-details-modal-description-error"},el.t("There was an error updating your template.")))),K.isVisible?l.createElement(x.ty,{description:K.message,...K,continueButtonType:"primary",continueButtonLabel:el.t("Save")}):l.createElement(x.jl,{className:Q().modalFooter},em&&l.createElement("div",null,el.rt("Step {currentStepNumber} of {totalNumberOfSteps}",{currentStepNumber:m,totalNumberOfSteps:u})),l.createElement(x.ox,null,d&&l.createElement(M.A,{onClick:ed}),l.createElement(i.Ay,{type:"outline",onClick:ei},el.t("Cancel")),l.createElement(i.lV,{disabled:ep,loading:k,onClick:ec,className:A()(Q().primaryCtaButton,{[Q().disabled]:ep}),"aria-label":eu},eu))))}TemplateAdvancedDetailsPane.displayName="TemplateAdvancedDetailsPane";var er=a(0x3c838d6a),en=a(0x14fad6485);let ei=a.p+"draft-confirmation-illustration-efb1e91.svg";var es=a(0xdceaf1fc);let eo=new n.Ay("workflow_builder");function TemplateConfirmationPane({templateState:e,templateId:t}){let a=(0,w.d4)(g.dm),r=(0,w.d4)(g.kY),n=(0,w.d4)(y.H7),{windowRef:i}=(0,en.ox)(),s=r?eo.t("Your template has been saved!"):"",o=r?eo.t("Template managers can keep tweaking and testing the template until you are ready to submit it to everyone in the workspace."):"",c=r?eo.t("Your template has been submitted!"):"",d=r?eo.t("Your template is in review. You will be notified soon once its status changes."):"",m=eo.t("Your template is published!"),{title:u,body:p,imgSrc:h}=(0,l.useMemo)(()=>{if(!e)return{};switch(e){case"draft":return{title:s,body:o,imgSrc:ei};case"publish_requested":return{title:c,body:d,imgSrc:es};case"published":return{title:m,body:l.createElement(l.Fragment,null,l.createElement(f.pL,{window:i.deref()}),l.createElement("div",{"data-qa":"template-preview-non-link",className:k().genericIllustration}))};case"staging":case"featured":return{title:s,body:l.createElement(l.Fragment,null,l.createElement(f.pL,{window:i.deref()}),l.createElement("div",{"data-qa":"template-preview-non-link",className:k().genericIllustration}))};default:return(0,C.Kh)(e)}},[o,s,d,c,m,e,i]);return a?l.createElement(l.Fragment,null,l.createElement(x.$m,null,h&&l.createElement(x.hR,{src:h,alt:"template_confirmation_illustration"}),l.createElement(x.Rc,{title:u}),l.createElement(x.qf,null,p)),l.createElement(x.jl,null,l.createElement(_.A,{href:`slack://workflow-template?team=${n.id}&id=${t}`,className:k().viewLink},l.createElement(b.Ah,{name:"new-window",inline:!0,size:"20"}),eo.t("View in Slack Automations")),l.createElement(x.ox,null,l.createElement(x.s_,{type:"primary",className:k().doneButton,"data-qa":"first-publish-modal-confirmation-close__button","aria-label":eo.t("Done")},eo.t("Done"))))):null}TemplateConfirmationPane.displayName="TemplateConfirmationPane";var ec=a(0xd013226d),ed=a(0x1a5ac3a0c);let em=new n.Ay("workflow_builder"),eu=[X.C7.BasicDetails,X.C7.AdvancedDetails],getPublishStepNumber=e=>eu.findIndex(t=>t===e)+1,PublishTemplateModal=()=>{let e=(0,h.X)(),t=(0,w.d4)(g.dm),a=(0,w.d4)(g.kY),n=(0,r.wA)(),i=(0,l.useCallback)(()=>n((0,ea.O)()),[n]),[s,o]=(0,l.useState)(""),[c,d]=(0,l.useState)(""),[_,b]=(0,l.useState)(""),[f,x]=(0,l.useState)(!1),[y,E]=(0,l.useState)(""),k=(0,l.useMemo)(()=>({[X.C7.Details]:{render:({switchPane:e})=>l.createElement(ec.R,{templateName:s,setTemplateName:o,description:c,setDescription:d,iconUrl:_,switchPane:e,madLib:y,setMadLib:E}),modalProps:{contentLabel:em.t("Finish Up Template")}},[X.C7.BasicDetails]:{render:({switchPane:e})=>l.createElement(er.R,{templateName:s,setTemplateName:o,description:c,setDescription:d,iconUrl:_,switchPane:e,publishStepNumber:getPublishStepNumber(X.C7.BasicDetails),totalNumberOfPublishSteps:eu.length}),modalProps:{contentLabel:em.t("Finish Up Template")}},[X.C7.AdvancedDetails]:{render:({switchPane:e})=>l.createElement(TemplateAdvancedDetailsPane,{templateName:s,description:c,iconUrl:_,switchPane:e,madLib:y,setMadLib:E,prevPane:X.C7.BasicDetails,publishStepNumber:getPublishStepNumber(X.C7.AdvancedDetails),totalNumberOfPublishSteps:eu.length}),modalProps:{contentLabel:em.t("Finish Up Template")}},[X.C7.UploadImg]:{render:({switchPane:e,file:t})=>l.createElement(p.Z,{onClose:i,nextPane:X.C7.CropImg,prevPane:a?X.C7.BasicDetails:X.C7.Details,setOnCropImagePane:x,switchPane:e,file:t}),modalProps:{contentLabel:em.t("Edit Avatar Upload")}},[X.C7.CropImg]:{render:({switchPane:e,imageId:t,avatarUrl:r})=>l.createElement(u._,{workflowName:s,workflowDescription:c,onClose:i,nextPane:a?X.C7.BasicDetails:X.C7.Details,prevPane:a?X.C7.BasicDetails:X.C7.Details,showPreview:!1,setOnCropImagePane:x,setIconUrl:b,avatarUrl:r||"",imageId:t||"",switchPane:e}),modalProps:{contentLabel:em.t("Edit Avatar Upload")}},[X.C7.Confirmation]:{render:({templateState:t})=>a?l.createElement(TemplateConfirmationPane,{templateState:t,templateId:e?.templateId||""}):l.createElement(PublishTemplateConfirmation,{onClose:i}),modalProps:{contentLabel:em.t("Template Publish Confirmation")}}}),[s,c,_,y,i,a,e?.templateId]);return((0,l.useEffect)(()=>{e&&(o(e.workflow.title),d(e.workflow.description),E(e.madLibSentence||""),e.workflow.icons?.image_192&&b((0,ed.DU)(e.workflow)))},[e]),t&&e)?l.createElement(m.A,{closeModal:i,defaultPane:a?X.C7.BasicDetails:X.C7.Details,panes:k,dataQa:"publish-template-modal",showCloseButton:!f}):null};PublishTemplateModal.displayName="PublishTemplateModal";var ep=a(0x8c8bafa3),e_=a(0x133aaa7da),eb=a(0x235bbf477),ef=a(0x16ffed5ab);let eh=new n.Ay("workflow_builder"),TemplateSettingsModal=()=>{let e=(0,h.X)(),t=(0,w.d4)(g.dm),a=(0,r.wA)(),n=(0,l.useCallback)(()=>a((0,ea.O)()),[a]),[i,s]=(0,l.useState)(""),[o,c]=(0,l.useState)(""),[d,u]=(0,l.useState)(""),[p,_]=(0,l.useState)(""),b=(0,l.useMemo)(()=>({[X.C7.AdvancedDetails]:{render:({switchPane:e})=>l.createElement(TemplateAdvancedDetailsPane,{templateName:i,description:o,iconUrl:d,switchPane:e,madLib:p,setMadLib:_,modalType:"settings"}),modalProps:{contentLabel:eh.t("Settings")}},[X.C7.Confirmation]:{render:({templateState:t})=>l.createElement(TemplateEditConfirmation,{templateId:e?.templateId||"",templateState:t,onClose:n}),modalProps:{contentLabel:eh.t("Template Edit Confirmation")}}}),[i,o,d,p,e?.templateId,n]);return((0,l.useEffect)(()=>{e&&(s(e.workflow.title),c(e.workflow.description),_(e.madLibSentence||""),e.workflow.icons?.image_192&&u((0,ed.DU)(e.workflow)))},[e]),t&&e)?l.createElement(m.A,{closeModal:n,defaultPane:X.C7.AdvancedDetails,panes:b,dataQa:"template-settings-modal"}):null};function TemplateEditConfirmation({templateId:e,templateState:t,onClose:a}){let n=(0,r.wA)();if("draft"===t){let e=eh.t("Template Updated");return n((0,ef.M)({element:l.createElement(eb.V,{message:e})})),a(),null}return l.createElement(TemplateConfirmationPane,{templateId:e,templateState:t})}function useTemplateSettingsModal(){let e=(0,r.wA)(),t=(0,h.X)();return{openSettingsModal:(0,l.useCallback)(()=>{let a=l.createElement(h.Z.Provider,{value:t},l.createElement(TemplateSettingsModal,null));e((0,Y.q)({isStackable:!0,element:a}))},[e,t])}}TemplateSettingsModal.displayName="TemplateSettingsModal",TemplateEditConfirmation.displayName="TemplateEditConfirmation",useTemplateSettingsModal.displayName="useTemplateSettingsModal";var eg=a(0x3965535c);let ex=new n.Ay("workflow_builder"),TemplateDeleteModal=()=>{let[e,t]=(0,l.useState)(!1),[a,n]=(0,l.useState)(!1),s=(0,h.X)(),o=(0,w.d4)(g.dm),c=(0,r.wA)(),d=(0,l.useCallback)(()=>c((0,ea.O)()),[c]),m=(0,l.useCallback)(async()=>{if(s&&s.templateId){n(!0),t(!1);try{await c((0,eg.W)({templateId:s.templateId,reason:"template-edit/delete-template"})),s.markTemplateAsDeleted?.(),d()}catch(e){t(!0)}}},[c,s,d]);if(!o)return null;let u=ex.t("Permanently delete this template?");return l.createElement(x.dW,{contentLabel:u,closeModal:d,dataQa:"template-delete-modal"},l.createElement(x.rQ,null,l.createElement(x.Rc,{id:"story__title-bar",title:u})),l.createElement(x.$m,null,l.createElement(x.qf,null,ex.t("When you delete this template, it will be removed form your templates list and you won\u2019t be able to access it again."),e&&l.createElement(I.A,null,ex.t("There was an error deleting your template.")))),l.createElement(x.jl,null,l.createElement(x.ox,null,l.createElement(i.Ay,{type:"outline",onClick:d},ex.t("Cancel")),l.createElement(i.lV,{loading:a,type:"danger",onClick:m,"aria-label":ex.t("Delete")},ex.t("Delete")))))};function useDeleteTemplateModal(){let e=(0,r.wA)(),t=(0,h.X)();return{openDeleteModal:(0,l.useCallback)(()=>{let a=l.createElement(h.Z.Provider,{value:t},l.createElement(TemplateDeleteModal,null));e((0,Y.q)({isStackable:!0,element:a}))},[e,t])}}TemplateDeleteModal.displayName="TemplateDeleteModal",useDeleteTemplateModal.displayName="useDeleteTemplateModal";var ew=a(0x8d9b2838);function useSubmitForTranslations(){let e=(0,r.wA)();return{submitForTranslations:(0,l.useCallback)(({templateId:t,toastMessage:a,refetchTemplate:r})=>async()=>{await e((0,Z.Ab)({templateId:t,newTemplateStatus:"ready_for_localization"})),e((0,ef.M)({element:l.createElement(eb.V,{message:a})})),r?.()},[e])}}function useUnpublishTemplate(){let e=(0,r.wA)();return{unpublishTemplate:(0,l.useCallback)(({templateId:t,toastMessage:a,refetchTemplate:r})=>async()=>{await e((0,Z.Ab)({templateId:t,newTemplateStatus:"draft"})),e((0,ef.M)({element:l.createElement(eb.V,{message:a})})),r?.()},[e])}}useSubmitForTranslations.displayName="useSubmitForTranslations",useUnpublishTemplate.displayName="useUnpublishTemplate";var ey=a(0x38c77fce),eE=a(0x1ed767a16);let ek=new n.Ay("workflow_builder");function TemplateEditActionsMenu({templateData:e,teamId:t}){let a=(0,w.d4)(g.kY),{openEditModal:r}=(0,ew.v)(),{openSettingsModal:n}=useTemplateSettingsModal(),{openDeleteModal:i}=useDeleteTemplateModal(),{unpublishTemplate:s}=useUnpublishTemplate(),{submitForTranslations:c}=useSubmitForTranslations(),d=(0,ey.y)(),m=(0,l.useCallback)(()=>{(0,eE.tD)()&&(0,eE.x3)(e.templateId)},[e.templateId]),u=("published"===e.templateState||"featured"===e.templateState)&&(0,J.PW)(t),p=[{label:ek.t("View in Slack Automations"),datQa:"view-automations-menu-item",href:`slack://workflow-template?team=${t}&id=${e.templateId}`,showLinkIndicatorIcon:!1,show:!0},{type:e_.A.separator,show:!0},{label:ek.t("Settings"),dataQa:"settings-menu-item",click:a?n:r,show:!d},{label:ek.t("Copy template ID",{fallbackHash:"95fab9b37025563f196f402d0adb6f65aef7e166",fallbackHashNs:"slack-docs"}),dataQa:"copy-template-id-menu-item",click:m,show:!0},{type:e_.A.separator,show:!0},{label:ek.t("Unpublish template"),dataQa:"unpublish-menu-item",click:s({templateId:e.templateId,toastMessage:ek.t("Template Updated",{fallbackHash:"465f80917dfb282b7d9979b284e153a70fbbd187"}),refetchTemplate:e.refetchTemplate}),show:!1},{label:ek.t("Delete"),dataQa:"delete-menu-item",danger:!0,click:i,show:!0},{type:e_.A.separator,show:!0},{label:ek.t("Help center"),dataQa:"help-menu-item",href:`https://${(0,ep.qF)()}/help/articles/360035692513?utm_source=slack&utm_medium=prod&utm_campaign=hc`,show:!0},{label:ek.t("Send feedback"),dataQa:"feedback-menu-item",href:`https://${(0,ep.qF)()}/help/requests/new`,show:!0},{type:e_.A.separator,show:u},{label:ek.t("Submit to be featured in Slack"),dataQa:"submit-featured-menu-item",click:c({templateId:e.templateId,toastMessage:ek.t("Template Updated",{fallbackHash:"465f80917dfb282b7d9979b284e153a70fbbd187"}),refetchTemplate:e.refetchTemplate}),icon:l.createElement(b.Ah,{name:"slack-logo-color",size:"18"}),show:u}].filter(e=>e.show);return l.createElement(o.a,{template:p})}TemplateEditActionsMenu.displayName="TemplateEditActionsMenu";var eS=a(0x4c96e5d9),ev=a(0xa1832ae4);let eA=new n.Ay("workflow_builder");function TemplateEditBadge({templateState:e}){let t=(0,w.d4)(e=>(0,ev.F1)((0,y.H7)(e)));if(!(0,w.d4)(g.dm))return null;switch(e){case"draft":case"publish_requested":case"published":return null;case"staging":return l.createElement(eS.Ay,{tip:eA.rt("Template available in {teamName} gallery in multiple languages",{teamName:t})},l.createElement("div",{className:"template_edit_status_badge"},eA.t("Staging")));case"featured":return l.createElement(eS.Ay,{tip:eA.t("Template available in Slack\u2019s gallery in multiple languages")},l.createElement("div",{className:"template_edit_status_badge"},eA.t("Featured")));default:return(0,C.Kh)(e)}}TemplateEditBadge.displayName="TemplateEditBadge";var eT=a(0xe9c32bb),eC=a(0x6960d8b9);let eN=new n.Ay("workflow_builder");function TemplateEditStatusText({dateUpdated:e,templateState:t,teamName:a}){let r=(0,w.d4)(g.dm),n=(0,w.d4)(g.kY),i=n?eN.t("Private to Template Managers"):"Private to Template Managers",s=n?eN.t("In review for {workspaceName}",{workspaceName:a}):`In review for ${a}`,o=n?eN.t("Published to {workspaceName}",{workspaceName:a}):`Published to ${a}`,c=(0,l.useMemo)(()=>{if(!r)return null;if(n)switch(t){case"draft":return i;case"publish_requested":return s;case"published":return o;default:return null}return"draft"===t?eN.t("Never Published"):e?eN.rt("Published {date}",{date:(0,eC.Yq)(e,"{ago}")}):eN.t("Published")},[r,n,t,e,i,s,o]);return l.createElement(eT.HL,{className:"template-edit__status"},c)}TemplateEditStatusText.displayName="TemplateEditStatusText";var eI=a(0x136b41a52);let eM=new n.Ay("workflow_builder"),eD={name:"ellipsis-horizontal-filled"};function TemplateEditActions({isEditingDisabled:e,isSavingChanges:t}){let a=(0,r.wA)(),n=(0,h.X)(),m=(0,w.d4)(y.H7),u=m?.id,p=(0,w.d4)(g.dm),_=(0,w.d4)(g.kY),b=(0,w.d4)(eI.S),f=(0,w.d4)(eI.z),x=(0,ey.y)(),E=(0,l.useCallback)(()=>n&&u?l.createElement(TemplateEditActionsMenu,{templateData:n,teamId:u}):null,[n,u]),k=(0,l.useCallback)(()=>{let e=l.createElement(h.Z.Provider,{value:n},l.createElement(PublishTemplateModal,null));a((0,Y.q)({isStackable:!0,element:e}))},[a,n]),S=n?.templateState!=="draft"&&b&&f,v=(0,l.useMemo)(()=>_?eM.t("Publish"):S?eM.t("Template Published"):eM.t("Finish Up Template"),[_,S]),A=(0,l.useMemo)(()=>({routeTo:c.E9.V2_TEMPLATES,subPath:c.Ax.EDITOR,templateId:n?.templateId||""}),[n]);if(!p||!n)return null;let T=e||(_?x:S);return l.createElement("div",{className:"template-edit-actions"},l.createElement(TemplateEditBadge,{templateState:n.templateState}),l.createElement(TemplateEditStatusText,{templateState:n.templateState,dateUpdated:n.dateUpdated,teamName:(0,ev.F1)(m)}),l.createElement(i.lV,{pillarClassName:"template-edit-publish-button",id:"templateButtonId",onClick:k,"aria-label":v,disabled:T,"data-qa":"publish-btn",loading:t},v),l.createElement(d.T,{source:"template-edit",route:A}),l.createElement(o.cQ,{renderMenu:E,position:"bottom-right",offsetX:0},l.createElement(s.A,{"data-qa":"template-actions-btn","aria-label":eM.t("Template Actions"),svgIconProps:eD})))}TemplateEditActions.displayName="TemplateEditActions"},0x1959e5e36:(e,t,a)=>{"use strict";a.d(t,{P:()=>TemplateEditSwitch});var l=a(0xbad225b5),r=a(0x16cf1da63),n=a(0x120c268ad),i=a.n(n),s=a(0x62a17882),o=a(0x20482ad21),c=a(0x102edf836),d=a(0x11a296110),m=a(0xb1ea448c),u=a(0x13953efe6),p=a(0x2501a2cee),_=a(0x1e4b6e4e6),b=a(0x243685e41),f=a(0x3989021c),h=a(0x11571542c),g=a(0x1ae5d492),x=a(0x1f2fa5a0f),w=a(0x145d46a61),y=a(0x3711e82d),E=a(0xdb0578c7),k=a(0x226892387),S=a(0x5b1935a6);let v=a.p+"light_bulb-e04002b.png",A=new o.Ay("workflow_builder"),T={clogImpression:!0,elementName:"template_edit_swtich_coachmark",elementType:y.ElementType.COACHMARK,eventId:y.EventId.DETAILS_MODAL,uiStep:y.UiStep.CHANNEL_DETAILS_NEW_PERMISSIONS_COACHMARK},TemplateEditSwitch=({templateId:e,workflow:t,enableCoachmarkEditing:a,onEnableCoachmarkEditing:n})=>{let o=(0,r.wA)(),u=(0,b.d)({triggerId:t?.trigger?.id,workflowId:t?.workflow.id}),f=(0,k.d4)(w.mh),y=(0,k.d4)(w.b2),[S,v]=(0,l.useState)(!1),T=(0,l.useCallback)(async t=>{if(!e)return;v(!0);let{workflow_id:a}=await o((0,h.k)({templateId:e,payload:{allResources:!0},reason:"template-edit-actions-menu:edit-template"}));if(v(!1),n(!1),y){let l=(0,s.cX)()?t.metaKey:t.ctrlKey;return o((0,E.A)({source:"template-steps-editor",route:{routeTo:_.E9.EDIT_WORKFLOW,workflowId:a,templateId:e},forceOpenInNewWindow:"button"in t&&1===t.button||"button"in t&&0===t.button&&l}))}(0,g._U)(x.Bs,{workflowId:a,workflowTemplateId:e})},[e,o,n,y]),C=(0,l.useCallback)(()=>{n(!0),u()},[n,u]),N=f?A.t("Edit Template"):"Edit Template",I=A.t("Add Instructions");return l.createElement("div",{className:"template-edit__switch"},l.createElement(TemplateSwitchCoachmark,null,l.createElement(d.Ay,{type:c.QE.outline,size:c.F0.small,onClick:T,"aria-label":N,className:i()("template-edit__switch-button",{"template-edit__switch-button--active":a})},S?l.createElement(m.A,{color:"white",size:"medium",className:"template-edit__switch-button__spinner"}):l.createElement(l.Fragment,null,l.createElement(p.Ah,{name:"edit"}),N))),l.createElement(d.Ay,{type:c.QE.outline,size:c.F0.small,onClick:C,"aria-label":I,className:i()("template-edit__switch-button",{"template-edit__switch-button--active":!a})},l.createElement(p.Ah,{name:"add-comment"}),I))};function TemplateSwitchCoachmark({children:e}){let t=(0,k.d4)(w.mh),{closeCoachmark:a,renderCoachmark:r}=(0,f.A)(S.ze.HERMES_WORKFLOWS_TEMPLATES_AWARENESS_BANNER,S.xu.WORKFLOW_BUILDER_COACHMARKS),n=(0,l.useCallback)(()=>a(),[a]),i=(0,l.useMemo)(()=>l.createElement("div",{className:"p-user_created_template_coachmark__hero"},l.createElement("img",{src:v,alt:t?A.t("Guide for converting canvas to template"):"",className:"p-user_created_template_coachmark__hero__image"})),[t]);return l.createElement(u.Ay,{coachmarkElement:r({autoClogProps:T,width:403,arrowPosition:10,hero:i,title:t?A.t("Customize Your Template"):"Customize Your Template",ariaLabel:t?A.t("Customize Your Template"):"Customize Your Template",bodyText:t?A.t("You can now add, edit, or remove template steps. When your steps are all set, switch views to add instructions to help others use your template."):"",hideCloseButton:!1,closeCoachmark:n}),orientation:"bottom"},e)}TemplateEditSwitch.displayName="TemplateEditSwitch",TemplateSwitchCoachmark.displayName="TemplateSwitchCoachmark"},0x23515fd5:(e,t,a)=>{"use strict";a.d(t,{JR:()=>x,Ab:()=>h,lL:()=>g,J7:()=>w,A1:()=>y});var l=a(0x250ebc75c),r=a(0x5b0d97fd),n=a(0xe874a88a),i=a(0x22a29f141),s=a(0x1dfdeb1c8),o=a(0x1ec68d6a3),c=a(0xe747dd27);let d=(0,s.A)("workflows.templates.collaborators.add generated fetcher",(e,t,a)=>new n.S((l,r)=>{let{abortSignal:n,reason:s,...d}=a,m=(0,c.VA)(d);e((0,i.apiCall)({method:"workflows.templates.collaborators.add",args:m,abortSignal:n,reason:s})).then(e=>{l(e)}).catch(e=>{(0,o.default)({getState:t}).error(`API call to workflows.templates.collaborators.add
						with reason ${s} failed, initiated by generated fetcher`),r(e)})}));d.meta={name:"workflowsTemplatesCollaboratorsAddFetcher",key:"createFetcherWorkflowsTemplatesCollaboratorsAddFetcher",description:"workflows.templates.collaborators.add generated fetcher"};let m=(0,s.A)("workflows.templates.collaborators.remove generated fetcher",(e,t,a)=>new n.S((l,r)=>{let{abortSignal:n,reason:s,...d}=a,m=(0,c.VA)(d);e((0,i.apiCall)({method:"workflows.templates.collaborators.remove",args:m,abortSignal:n,reason:s})).then(e=>{l(e)}).catch(e=>{(0,o.default)({getState:t}).error(`API call to workflows.templates.collaborators.remove
						with reason ${s} failed, initiated by generated fetcher`),r(e)})}));m.meta={name:"workflowsTemplatesCollaboratorsRemoveFetcher",key:"createFetcherWorkflowsTemplatesCollaboratorsRemoveFetcher",description:"workflows.templates.collaborators.remove generated fetcher"};var u=a(0x1fa75c0ee),p=a(0xc8f333a2),_=a(0xaf5a1707),b=a(0x11c82607b);let f="WORKFLOW-EDITOR",h=(0,b.Ay)("Updates the workflow template status",async(e,t,{templateId:a,newTemplateStatus:l})=>e((0,u.T)({templateId:a,status:l,reason:"template-edit-update-status"})));h.meta={name:"updateTemplateStatus",key:"createThunkUpdateTemplateStatus",description:"Updates the workflow template status"};let g=(0,b.Ay)("Updates a trigger coachmark on a template",async(e,t,{templateId:a,coachmarkText:l})=>{await e((0,p.M)({templateId:a,triggerConfiguration:{coachmark:l},reason:"template-edit-coachmark-update"}))});g.meta={name:"updateTriggerCoachmark",key:"createThunkUpdateTriggerCoachmark",description:"Updates a trigger coachmark on a template"};let x=(0,b.Ay)("Updates a coachmark on a template",async(e,t,{templateId:a,coachmarkText:r,workflow:n,stepId:i})=>{let s=(0,l.c)(n.steps,e=>({coachmark:i===e.id?r:e.coachmark??"",steps:e?.steps}));await e((0,p.M)({templateId:a,stepsConfiguration:s,reason:"template-edit-coachmark-update"}))});x.meta={name:"updateCoachmark",key:"createThunkUpdateCoachmark",description:"Updates a coachmark on a template"};let w=(0,b.Ay)("Updates the workflow template data and status",async(e,t,{workflow:a,trigger:l,templateName:r,description:n,templateId:i,prevTemplateState:s,newTemplateState:c,iconUrl:d,categories:m,madLib:u})=>{let _=(0,o.default)({getState:t,label:f}),b={coachmark:l.coachmark},g=a.steps.map(e=>({coachmark:e.coachmark||""})),x=0===m.length?void 0:m,w=u&&u.trim().length?{sentence:u}:void 0;try{let t=await e((0,p.M)({templateId:i,name:r,description:n,stepsConfiguration:g,triggerConfiguration:b,icon:d,categories:x,madlibsConfig:w,reason:"template-edit-update"}));if(c&&s!==c)return await e(h({templateId:i,newTemplateStatus:c}));return t}catch(e){throw _.error(Error(`Unable to update the template ${i}: ${e}`)),e}});w.meta={name:"updateWorkflowTemplate",key:"createThunkUpdateWorkflowTemplate",description:"Updates the workflow template data and status"};let y=(0,b.Ay)("Finds users that have been added / removed as collaborators and updates the template",async(e,t,{templateId:a,collaboratorIds:l,updatedCollaboratorIds:n})=>{let i=(0,o.default)({getState:t,label:f}),{toBeAdded:s,toBeRemoved:c}=(0,r.Zf)(l,n);try{(0,_.E)(s)&&await e(d({templateId:a,collaboratorIds:s,reason:"add_template_collaborators"})),(0,_.E)(c)&&await e(m({templateId:a,collaboratorIds:c,reason:"remove_template_collaborators"}))}catch(e){throw i.error(Error(`Unable to update template collaborators ${a}: ${e}`)),e}});y.meta={name:"updateWorkflowTemplateCollaborators",key:"createThunkUpdateWorkflowTemplateCollaborators",description:"Finds users that have been added / removed as collaborators and updates the template"}},0x5b0d97fd:(e,t,a)=>{"use strict";a.d(t,{BE:()=>isWorkflowTemplateViewOnly,C7:()=>n,N4:()=>getTemplateCategories,Zf:()=>diffCollaborators});var l,r=a(0x6affae29),n=((l={}).Details="details",l.BasicDetails="basicDetails",l.AdvancedDetails="advancedDetails",l.UploadImg="uploadImg",l.CropImg="cropImg",l.Confirmation="confirmation",l);let getTemplateCategories=()=>["default","express","advanced","channel_suggestion","express_next","default_next"];function diffCollaborators(e,t){return{toBeAdded:t.filter(t=>!e.includes(t)),toBeRemoved:e.filter(e=>!t.includes(e))}}function isWorkflowTemplateViewOnly({templateState:e,isTemplateAdmin:t,isTemplateOpsWorkspace:a,experimentTemplateCreationDiscoverabilityGroupOn:l}){if(!l)return!1;switch(e){case"draft":return!1;case"publish_requested":case"published":return!t&&!a;case"staging":case"featured":return!a;default:return(0,r.Kh)(e)}}},0x38c77fce:(e,t,a)=>{"use strict";a.d(t,{g:()=>r,y:()=>useWorkflowTemplateViewOnly});var l=a(0xbad225b5);let r=(0,l.createContext)(!1),useWorkflowTemplateViewOnly=()=>(0,l.useContext)(r)},0x24de3d958:(e,t,a)=>{"use strict";a.d(t,{K:()=>useAvatarCropState});var l=a(0xbad225b5),r=a(0x2440854b3),n=a(0x8ed4913f),i=a(0x44240292);let useAvatarCropState=(e,t)=>{let[a,s]=(0,l.useState)({}),o=(0,l.useMemo)(()=>({width:a?.width,height:a?.height,src:e}),[e,a?.height,a?.width]),c=(0,l.useMemo)(()=>(({crop:e,imageWidth:t,imageHeight:a})=>{let{displayWidth:l,displayHeight:i}=(0,n.A)({width:t,height:a,maxSize:r.Vt}),s=Math.max(1,a/i),o=Math.max(1,t/l),c=e.x*o;return{fullCropX:c,fullCropY:e.y*s,fullCropSize:e.width*o}})({crop:t,imageWidth:a.width||0,imageHeight:a.height||0}),[t,a.height,a.width]);return(0,l.useEffect)(()=>{(0,i.A)(e).then(({width:e,height:t})=>s({width:e,height:t}))},[e]),{cropData:c,imageData:o}}},0x20f6327e1:(e,t,a)=>{"use strict";a.d(t,{A:()=>d,V:()=>useAvatarUploadState});var l,r=a(0xbad225b5),n=a(0x16cf1da63),i=a(0x2440854b3),s=a(0xe874a88a),o=a(0x44240292);function validateImage(e,t){return new s.S((a,l)=>{if(!i.i_.includes(e.type))return void l(Error(i.DV));if(e.size>i.w3)return void l(Error(i.fw));let r=new window.FileReader;r.onload=e=>{let n=e?.target?.result;r.onload=null,(0,o.A)(n).then(({width:e,height:r})=>{e>i.g_||r>i.g_?l(Error(i.P1)):e<t||r<t?l(Error(i.dW)):a({dataUrl:n})}).catch(e=>l(e))},r.readAsDataURL(e)})}var c=a(0x1ed79bf71),d=((l={}).UPLOADING="uploading",l.ERROR="error",l.SUCCESS="success",l);let useAvatarUploadState=e=>{let t=(0,n.wA)(),[a,l]=(0,r.useState)({status:"uploading",avatarUrl:null,imageId:null,error:null});return(0,r.useEffect)(()=>{e&&(l({status:"uploading"}),validateImage(e,i.Yh).then(()=>t((0,c.W8)({file:e}))).then(({url:e,id:t})=>l({status:"success",imageId:t,avatarUrl:e})).catch(e=>l({status:"error",error:e.message})))},[e,t]),a}},0x13cd04b48:(e,t,a)=>{"use strict";a.d(t,{DJ:()=>getLabelFromExpressionData,Ox:()=>useExpressionData,SD:()=>buildExpressionDataSourceMap,w:()=>getVarNameFromExpressionReference});var l=a(0x20482ad21),r=a(0x20570d71a),n=a(0x66c6b26d),i=a(0x20adb28cd),s=a(0x226892387);let o=new l.Ay("workflow_builder"),{BUTTON:c,DROPDOWN:d,EMOJI:m}={BUTTON:"button",DROPDOWN:"dropdown",EMOJI:"emoji"};function useExpressionData(){let e=(0,r.Y)(),t=(0,s.d4)((0,n.sx)(e,i.RG));return t?.expressionData}let getLabelFromExpressionData=({expressionDataObject:e,returnOnlyVariableText:t,isUnsupportedRichTextDropdownType:a})=>{let{type:l,content:r}=e;if(!r)return"";let n="";if(l===c&&"string"!=typeof r){let e=r.text.text??"";n=o.t("User clicked button: {buttonName}",{buttonName:e}),t&&(n=e)}if(l===d&&"string"!=typeof r)if(a)n=o.t("Update your Form step dropdown options to use them here.");else{let e=r.title;n=o.t("User picked option: {dropdownOptionTitle}",{dropdownOptionTitle:e})}if(l===m){let e=`:${r}:`;n=o.t("User reacted with: {emojiName}",{emojiName:e}),t&&(n=e)}return n},buildExpressionDataSourceMap=e=>{if(!e)return;let t={};for(let a of Object.values(e)){let{sourceStep:e}=a;if(!e)continue;let l=t[e]||[];l.push(a),t[e]=l}return t},getVarNameFromExpressionReference=e=>{let t=".fields.";if(!e||-1===e.indexOf(t))return"";let a=e.indexOf(t)+t.length,l=e.slice(a),r=l.indexOf(".");return l.slice(0,r)}},0x162e18dce:(e,t,a)=>{"use strict";a.d(t,{E:()=>useSegmentWrappedFunctionDetails});var l=a(0x1bffa495d),r=a(0x226892387);let useSegmentWrappedFunctionDetails=e=>(0,r.d4)(t=>(0,l.MZ)(t,e))},0x235bbf477:(e,t,a)=>{"use strict";a.d(t,{V:()=>BuilderToast});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x1faa3f1ac),i=a(0xbb0c5132);let s=new r.Ay("workflow_builder"),BuilderToast=({message:e,undo:t,...a})=>l.createElement(i.Ay,a,e,t&&l.createElement(l.Fragment,null,"\xa0",l.createElement(n.A,{onClick:t},s.t("Undo"))))},0x135b7b386:(e,t,a)=>{"use strict";a.d(t,{EG:()=>n,Id:()=>o,Nn:()=>c,YE:()=>r,wo:()=>i,y:()=>s});var l=a(0x18dac2b8e);let r="A014GBNBJ59",n="A04MG80N5CY",i=(0,l.Cu)()?r:n,s=(0,l.Cu)()?"A0150E985M0":"A05P4475DFY",o=(0,l.Cu)()?"A014LHD2ATV":"A050C90PUF5",c=(0,l.Cu)()?"A0154SFF675":"A05UG04QC4X"},0x1ed79bf71:(e,t,a)=>{"use strict";a.d(t,{MS:()=>d,W8:()=>o,Zq:()=>c,z_:()=>s});var l=a(0x292cc606),r=a(0x21f32a55),n=a(0xcf658893),i=a(0x11c82607b);let s=(0,i.Ay)("Crop Workflow Avatar",(e,t,{id:a,x:r,y:n,width:i})=>e((0,l.s)({reason:"workflows_crop_workflow_avatar",avatar:a,cropbox:`${Math.round(r)},${Math.round(n)},${Math.round(i)}`})));s.meta={name:"cropWorkflowAvatar",key:"createThunkCropWorkflowAvatar",description:"Crop Workflow Avatar"};let o=(0,i.Ay)("Upload Workflow Avatar",(e,t,{file:a})=>e((0,r.Z)({reason:"workflows_upload_workflow_avatar",image:a})));o.meta={name:"uploadWorkflowAvatar",key:"createThunkUploadWorkflowAvatar",description:"Upload Workflow Avatar"};let c=(0,n.Ay)("Sets the teamId to use for missions.workflows requests");c.meta={name:"setWorkflowsPageMetadataTeamId",key:"createActionSetWorkflowsPageMetadataTeamId",description:"Sets the teamId to use for missions.workflows requests"};let d=(0,n.Ay)("Sets the teamId to use for admin missions requests");d.meta={name:"setTeamWorkflowsPageMetadataTeamId",key:"createActionSetTeamWorkflowsPageMetadataTeamId",description:"Sets the teamId to use for admin missions requests"}},0x1bffa495d:(e,t,a)=>{"use strict";a.d(t,{pA:()=>getSegmentIcon,Kb:()=>N,mV:()=>C,MZ:()=>M});var l=a(0x20482ad21),r=a(0x14149c126);let n=new l.Ay("workflow_builder"),i={getTitle:e=>"on"===(0,r._Z)(e,"wfb_repeaters_lookups")?n.t("Repeat a step"):"",getDescription:e=>"on"===(0,r._Z)(e,"wfb_repeaters_lookups")?n.t("Repeats steps for each item in a collection"):"",getIsEnabled:()=>!1,getIcon:()=>"refresh"};var s=a(0xaaa6bbd0);let o={getTitle:()=>"",getDescription:()=>"",getIsEnabled:()=>!1,getAppName:()=>"",getFunctionType:()=>""};a(0x171a52b74);let c=new l.Ay("workflow_builder"),d={getTitle:()=>c.t("Add a branch",{fallbackHash:"61cc55aa0453184734c3fa0b621eda6fa874bd83"}),getDescription:()=>"",getIsEnabled:()=>!1,getIcon:()=>"branch"};var m=a(0x36e8c71e),u=a(0xbad225b5),p=a(0x210501b8f);let _=new l.Ay("workflow_builder"),b={getTitle:()=>_.t("Customize how to start the workflow",{fallbackHash:"5695013e040ce5cadf7d7deb2e87ac2471bb0650"}),getDescription:()=>"Third party event trigger",getIsEnabled:()=>!1,getIcon:()=>u.createElement("img",{alt:_.t("Salesforce Icon",{ns:"data_sources"}),className:"c-icon",src:p})},f=new l.Ay("workflow_builder"),h={getTitle:()=>f.t("On a schedule"),getDescription:()=>"Template trigger description",getIsEnabled:()=>!1,getIcon:()=>"clock"},g=new l.Ay("workflow_builder"),x={getTitle:()=>g.t("From a webhook"),getDescription:()=>"Hermes webhook trigger",getIsEnabled:()=>!1,getIcon:()=>"webhook"},w=new l.Ay("workflow_builder"),y={getTitle:()=>w.t("Choose how to start the workflow"),getDescription:()=>"Service trigger",getIsEnabled:()=>!0,getIcon:()=>"code"},E=new l.Ay("workflow_builder"),k={getTitle:()=>E.t("From a link in Slack"),getDescription:()=>"Someone clicks a shortcut",getIsEnabled:()=>!1,getIcon:()=>"link"};var S=a(0x2385f51a9),v=a(0x126af815a),A=a(0x1cf0d97e1),T=a(0x3b8174d2);function getSegmentInfo(e){switch(e){case v.SJ:return b;case v.bX:return x;case v.LO:return h;case v.kr:return S.f;case v.zW:return k;case v.YV:return y;case m.SLACK_FUNCTION:return o;case m.SWITCH:return d;case m.LOOP:return i;default:return null}}let C=(0,A.Ay)((e,t)=>{let{type:a}=t;return!getSegmentInfo(a)});C.meta={name:"getSegmentTypeIsUnknown",key:"createSelectorGetSegmentTypeIsUnknown",description:(e,t)=>{let{type:a}=t;return!getSegmentInfo(a)}};let N=(0,A.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getTitle?.(e,t.subtype)});N.meta={name:"getSegmentTitle",key:"createSelectorGetSegmentTitle",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getTitle?.(e,t.subtype)}},(0,A.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getDescription?.(e,t.subtype)??null}).meta={name:"getSegmentDescription",key:"createSelectorGetSegmentDescription",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getDescription?.(e,t.subtype)??null}},(0,A.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getAppName?.(e,t.subtype)??null}).meta={name:"getSegmentAppName",key:"createSelectorGetSegmentAppName",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getAppName?.(e,t.subtype)??null}};let getSegmentIcon=(e,t)=>{let a=getSegmentInfo(e.type);return a&&a.getIcon?"event"===e.type?a.getIcon(e.subtype,t):a.getIcon(e.type,t):null},I=(0,A.Ay)((e,t,a)=>{let l=getSegmentInfo(t.type);return l?.getIsEnabled?.(e,t.subtype,a)??!1});I.meta={name:"getSegmentIsEnabled",key:"createSelectorGetSegmentIsEnabled",description:(e,t,a)=>{let l=getSegmentInfo(t.type);return l?.getIsEnabled?.(e,t.subtype,a)??!1}},(0,A.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getIsAdvanced?.(e,t.subtype)??!1}).meta={name:"getSegmentIsAdvanced",key:"createSelectorGetSegmentIsAdvanced",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getIsAdvanced?.(e,t.subtype)??!1}},(0,A.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getFunctionType?.(e,t.subtype)||""}).meta={name:"getSegmentFunctionCallbackId",key:"createSelectorGetSegmentFunctionCallbackId",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getFunctionType?.(e,t.subtype)||""}},(0,A.Ay)(e=>Object.values(m).reduce((t,a)=>I(e,{type:a})?[...t,a]:t,[])).meta={name:"selectEnabledStepTypes",key:"createSelectorSelectEnabledStepTypes",description:e=>Object.values(m).reduce((t,a)=>I(e,{type:a})?[...t,a]:t,[])};let M=(0,A.Ay)((e,t)=>{let a=(0,s.Pv)(t)&&(0,s.lK)(t);return a?t.config.wrappedSlackFunction??(0,T.hj)(e,a):void 0});M.meta={name:"selectWrappedFunctionDetails",key:"createSelectorSelectWrappedFunctionDetails",description:(e,t)=>{let a=(0,s.Pv)(t)&&(0,s.lK)(t);return a?t.config.wrappedSlackFunction??(0,T.hj)(e,a):void 0}}},0x1c27a9e4a:(e,t,a)=>{"use strict";a.d(t,{E:()=>getSegmentSubtype});var l=a(0x252b4df6e),r=a(0x36e8c71e),n=a(0x112dbb8f3),i=a(0x126af815a);let getSegmentSubtype=e=>{switch(e?.type){case r.SLACK_FUNCTION:return(0,l.g$)(e);case i.kr:return(0,n.vd)(e);default:return}}},0xee12becf:(e,t,a)=>{"use strict";a.d(t,{S:()=>getSegmentSummary});var l=a(0xbad225b5),r=a(0x20482ad21),n=a(0x1b3ecb90f),i=a(0x15a4ffb05),s=a(0x226892387),o=a(0x14149c126);let c=new r.Ay("workflow_builder"),LoopSummary=()=>{let e=(0,s.d4)(e=>"on"===(0,o._Z)(e,"wfb_repeaters_lookups"));return l.createElement("span",null,l.createElement(i.A,{text:e?c.t("Loop Function"):"Loop Function",emojiSize:n.lw.SMALL}))};LoopSummary.displayName="LoopSummary";var d=a(0xbe0b63ff),m=a(0x162e18dce),u=a(0x252b4df6e);let p=new r.Ay("workflow_builder");function DelaySummary({segment:e}){let t,a=(0,u.Iw)(e),r=a.minutes_to_delay?.value;if(r){let e=parseInt(r,10);if(e%1440==0){let a=e/1440;t=p.rt("Delay: {delayDisplay} {delayNumber, plural, =1 {day} other {days}}",{delayDisplay:String(a),delayNumber:a})}else if(e%60==0){let a=e/60;t=p.rt("Delay: {delayDisplay} {delayNumber, plural, =1 {hour} other {hours}}",{delayDisplay:String(a),delayNumber:a})}else t=p.rt("Delay: {delayDisplay} {delayNumber, plural, =1 {minute} other {minutes}}",{delayDisplay:r,delayNumber:e})}return l.createElement("span",null,r?t:"")}DelaySummary.displayName="DelaySummary";var _=a(0x15fb82076),b=a(0x2501a2cee),f=a(0x1c09d8c36),h=a(0x1795d8821),g=a(0xc4548bcd),x=a(0x159917868),w=a.n(x);let y=new r.Ay("workflow_builder");function GoogleSheetsSummary({segment:e}){let t=(0,u.Dl)(e),a=(0,u.Dp)(e),r=(0,u.Iw)(e),n=r.spreadsheet_id.value,i=`${f.BF}/${n}`,s=r.spreadsheet_id.label,o=(0,l.useCallback)(e=>{e.stopPropagation(),(0,g.A)(i)},[i]);if(!i||!s||"string"!=typeof n)return l.createElement("span",null,t?.title);let c=s[n],getSummaryLabel=()=>{switch(a){case h.Zk.AddSpreadsheetRow:return y.t("Add to");case h.Zk.SelectSpreadsheetRow:return y.t("Select from");case h.Zk.UpdateSpreadsheetRow:return y.t("Update");case h.Zk.DeleteSpreadsheetRow:return y.t("Delete from");default:return l.createElement("span",null,t?.title)}};return getSummaryLabel.displayName="getSummaryLabel",l.createElement("span",null,l.createElement("span",{className:w().title},getSummaryLabel()),l.createElement(_.A,{onClick:o},l.createElement("span",null,c),l.createElement("span",{className:w().icon},l.createElement(b.Ah,{name:"new-window",inline:!0,size:"20"}))))}GoogleSheetsSummary.displayName="GoogleSheetsSummary";var E=a(0x1e74dc307),k=a(0x668181b3),S=a(0x2772625d),v=a(0x20a2a54fa),A=a(0x247cf31a2),T=a(0xf4097f62),C=a(0x2dcb2e34),N=a.n(C);let I=new r.Ay("workflow_builder"),DynamicItemLabel=({label:e,variableSvgIcon:t})=>l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,size:"inherit",...t})," ",e??I.t("Missing Data")),getUserLabel=(e,t,a)=>{if(e.length>1)return I.t("{qty} people",{qty:e.length,fallbackHash:"b37554f695b15005fd23907b9488e0a8ad4bca5f"});let r=e[0];return(0,S.cn)(r)?l.createElement(DynamicItemLabel,{label:(0,k.x)(t.list,r)?.label,variableSvgIcon:a}):I.rt("@{user}",{user:l.createElement(T.A,{id:r,truncate:!0}),fallbackHash:"457d64a8b6c031bbf97653abb1689cab35c6261c"})};getUserLabel.displayName="getUserLabel";let getChannelLabel=(e,t,a)=>{if(e.length>1)return I.t("{qty} channels",{qty:e.length,fallbackHash:"18e03e2a37ba37df713f9665ef752fb8b40fc1e8"});let r=e[0];return(0,S.cn)(r)?l.createElement(DynamicItemLabel,{label:(0,k.x)(t.list,r)?.label,variableSvgIcon:a}):l.createElement(E.A,{channelId:r},l.createElement(A.A,{channelId:r,truncate:!0}))};function InviteToChannelSummary({segment:e}){let t=(0,u.Iw)(e),a=(0,v.EM)(e),r={name:"css"};if(!t.user_ids?.value||!t.channel_ids?.value)return l.createElement("span",null,I.rt("Invite to channel",{fallbackHash:"9a409d1a0f27bcc7944c5c19495e584fb26964d3",fallbackHashNs:"huddles"}));let n=[t.channel_ids?.value].flat(),i=getUserLabel([t.user_ids?.value].flat(),a,r),s=getChannelLabel(n,a,r);return l.createElement("span",null,I.rt("Invite {userLabel} to {channelLabel}",{userLabel:i,channelLabel:s,fallbackHash:"9a409d1a0f27bcc7944c5c19495e584fb26964d3",fallbackHashNs:"huddles"}))}getChannelLabel.displayName="getChannelLabel",InviteToChannelSummary.displayName="InviteToChannelSummary";let M=new r.Ay("workflow_builder");function SendEphemeralMessageSummary({segment:e}){let t=(0,u.Iw)(e),a=(0,v.EM)(e),r=t.channel_id?.value,n=t.user_id?.value,i=(0,u.Dl)(e),s={name:"css"};if("string"==typeof r&&"string"==typeof n){let e=(0,S.cn)(r),t=(0,S.cn)(n),i=e?(0,k.x)(a.list,r):null,o=t?(0,k.x)(a.list,n):null,c=i&&!i.isTombstone?i.label:M.t("Missing Data"),d=o&&!o.isTombstone?o.label:M.t("Missing Data"),m=t?l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,size:"inherit",...s})," ",d):l.createElement(T.A,{id:n}),u=e?l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,size:"inherit",...s})," ",c):l.createElement(E.A,{channelId:r},l.createElement(A.A,{channelId:r}));return l.createElement("span",null,M.rt('Send an "only visible to you" message to {user} in {channel}',{user:m,channel:u,fallbackHash:"2826a04933908bf2bc4143809f09f387840708b8"}))}return l.createElement("span",null,i?.title)}SendEphemeralMessageSummary.displayName="SendEphemeralMessageSummary";var D=a(0x16cf1da63),P=a(0x11a296110),O=a(0x125de1ee5),L=a(0x1e5781b84),R=a(0xcaee4748),F=a(0x238ee6f5d),W=a(0x154933c60),H=a(0xd6a16321),U=a(0xd843ab47),B=a(0x145d46a61),q=a(0x1ec68d6a3),z=a(0x21bfacd01),V=a(0x217553e42);let j=new r.Ay("workflow_builder");function SendMessageSummary({segment:e,hasErrors:t}){let a=(0,u.Iw)(e),r=(0,v.EM)(e),n=a.channel_id?.value,i=a.user_id?.value,o=(0,u.Dl)(e),c=(0,s.d4)(e=>(0,V.Pu)(e,i)),d=(0,s.d4)(z.V),m=(0,s.d4)(B.b2),{isChildWindow:p}=(0,l.useContext)(U.A),_=!d&&m&&!p,f=(0,D.wA)(),h=(0,l.useCallback)((e,t)=>{_&&(e.stopPropagation(),e.preventDefault(),f((0,O.p)({navProps:(0,H.pr)(t)})))},[f,_]),g=(0,l.useCallback)(async e=>{if(c)return void h(e,c.id);try{let t=await f((0,W.jP)({memberIds:[i],reason:"workflow_builder_send_message_summary"}));t?.channel?.id&&h(e,t.channel.id)}catch(e){(0,q.default)({label:"WORKFLOW-BUILDER"}).error("Failed to open DM in send message summary",e)}},[c,h,f,i]),x={name:"css"};if(n){if((0,S.cn)(n)){let e=(0,k.x)(r.list,n),t=e&&!e.isTombstone?e.label:j.t("Missing Data");return e&&t?l.createElement("span",null,j.rt("Send a message to <span>{dynamic_channel_label}</span>",{dynamic_channel_label:t},({text:e})=>l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,size:"inherit",...x})," ",e))):l.createElement("span",null,j.t("Sends a message to a channel"))}return l.createElement("span",null,j.rt("Send a message to {channel}",{channel:l.createElement(E.A,{openInClient:h,channelId:n},l.createElement(A.A,{channelId:n}),_?l.createElement("span",{className:N().splitViewIcon},l.createElement(b.Ah,{inline:!0,size:"inherit",name:"move-to-split-view"})):null)}))}if(i){if((0,S.cn)(i)){let e=(0,k.x)(r.list,i),t=e&&!e.isTombstone?e.label:j.t("Missing Data");return e&&t?l.createElement("span",null,j.rt("Send a message to <span>{dynamic_user_label}</span>",{dynamic_user_label:t},({text:e})=>l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,size:"inherit",...x})," ",e))):l.createElement("span",null,j.t("Sends a message to a user"))}return _?l.createElement("span",null,j.rt("Send a message to {user}",{user:l.createElement(P.Nm,{className:"c-member_slug--link",onClick:g},l.createElement(R.A,{noLinking:!0,id:i}),l.createElement("span",{className:N().splitViewIcon},l.createElement(b.Ah,{inline:!0,size:"inherit",name:"move-to-split-view"})))})):l.createElement("span",null,j.rt("Send a message to @{user}",{user:l.createElement(L.A,{id:i})}))}return t?l.createElement("span",null,j.rt("Send a message to {error}",{error:l.createElement(F.A,{type:"unknown"})})):l.createElement("span",null,o?.title)}SendMessageSummary.displayName="SendMessageSummary";let $=new r.Ay("workflow_builder"),SendToSalesHomeSummary=({segment:e,hasErrors:t=!1,isUserRequired:a=!1})=>{let r=(0,u.Iw)(e),n=(0,v.EM)(e),i=r.user_id?.value,s=r.notify_managers?.value,o=(0,u.Dl)(e),c={name:"css"};if("string"==typeof i){if((0,S.cn)(i)){let e=(0,k.x)(n.list,i),t=e&&!e.isTombstone?e.label:$.t("Missing Data");return e&&t?"string"==typeof s&&"true"===s.toLowerCase()||!0===s?l.createElement("span",null,$.rt("Send a notification to <span>{dynamic_user_label}</span> and their Managers or Leaders",{dynamic_user_label:t},({text:e})=>l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,...c})," ",e))):l.createElement("span",null,$.rt("Send a notification to <span>{dynamic_user_label}</span>",{dynamic_user_label:t},({text:e})=>l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,...c})," ",e))):l.createElement("span",null,$.t("Sends a notification to a user"))}return l.createElement("span",null,$.rt("Send a notification to @{user}",{user:l.createElement(L.A,{id:i})}))}return t&&a?l.createElement("span",null,$.rt("Send a notification to {error}",{error:l.createElement(F.A,{type:"unknown"})})):l.createElement("span",null,o?.title)};SendToSalesHomeSummary.displayName="SendToSalesHomeSummary";let Y=new r.Ay("workflow_builder"),ChannelLabel=({channelId:e,variables:t})=>{if(!e)return null;if((0,S.cn)(e)){let a=(0,k.x)(t,e),r=a?.label;return l.createElement("span",{className:N().variable_container},l.createElement(b.Ah,{inline:!0,name:"css",size:"inherit"})," ",r)}return l.createElement(E.A,{channelId:e},l.createElement(A.A,{channelId:e,truncate:!0}))};function SummarizeChannelSummary({segment:e}){let t=(0,u.Iw)(e),a=(0,v.EM)(e),r=t.channel_ids?.value,n=t.days?.value,i=Array.isArray(r)?r[0]:r;return Array.isArray(r)&&r.length>1?l.createElement("span",null,Y.rt("Summarize channels",{fallbackHash:"1b8962f14007d162f0dc43de8d265d059787b34a",fallbackHashNs:"assistant"})):"string"!=typeof i||"string"!=typeof n&&"number"!=typeof n||"string"==typeof n&&(0,S.cn)(n)?l.createElement("span",null,Y.rt("Summarize channel")):l.createElement("span",null,Y.rt("Summarize the last {dayCount} {dayCount, plural, =1 {day} other {days}} of {channelLabel}",{channelLabel:l.createElement(ChannelLabel,{channelId:i,variables:a.list}),dayCount:Number(n)}))}ChannelLabel.displayName="ChannelLabel",SummarizeChannelSummary.displayName="SummarizeChannelSummary";var G=a(0x339b339c),Q=a(0x135b7b386);let SlackFunctionSummary=({segment:e,hasErrors:t})=>{let a=(0,m.E)(e),r=(0,u.Dp)(e),n=a??(0,u.Dl)(e),i=(0,u.Zy)(e);if(a&&(0,d.GU)(a))return l.createElement(G.A,{size:"large"});if(i===Q.wo)return GoogleSheetsSummary({segment:e});if(r!==h.oW.SendMessage&&r!==h.oW.SendToMySalesHome&&r!==h.oW.SendToSalesHome&&r!==h.oW.SendToMySalesforceApp&&r!==h.oW.SendToSalesforceApp&&r!==h.oW.SendSummaryToMySalesHome&&r!==h.oW.SendSummaryToSalesHome&&r!==h.oW.SendEphemeralMessage&&r!==h.oW.SendDm&&r!==h.oW.ReplyInThread&&r!==h.oW.InviteUserToChannel&&r!==h.oW.Delay&&r!==h.oW.SummarizeChannel)return l.createElement("span",null,n?.title);switch(r){case h.oW.SendDm:case h.oW.SendMessage:case h.oW.ReplyInThread:return l.createElement(SendMessageSummary,{segment:e,hasErrors:t});case h.oW.SendEphemeralMessage:return l.createElement(SendEphemeralMessageSummary,{segment:e});case h.oW.Delay:return l.createElement(DelaySummary,{segment:e});case h.oW.InviteUserToChannel:return l.createElement(InviteToChannelSummary,{segment:e});case h.oW.SummarizeChannel:return l.createElement(SummarizeChannelSummary,{segment:e});case h.oW.SendToMySalesHome:case h.oW.SendToMySalesforceApp:return l.createElement(SendToSalesHomeSummary,{segment:e,hasErrors:t});case h.oW.SendToSalesHome:case h.oW.SendToSalesforceApp:return l.createElement(SendToSalesHomeSummary,{segment:e,hasErrors:t,isUserRequired:!0});default:return l.createElement("span",null,n?.title)}};SlackFunctionSummary.displayName="SlackFunctionSummary";var K=a(0x75b1e64d),Z=a(0x36e8c71e),X=a(0xdfa9cb32),J=a(0x17178b190),ee=a(0x56e1c8ae);let et=new r.Ay("workflow_builder"),ExternalTriggerSummary=({trigger:e})=>{if((0,ee.kp)(e.config)||(0,ee.EP)(e.config)||(0,ee.S)(e.config)){let{startTime:t,frequency:a}=e.config,r={startTime:t,frequency:{type:a.type,onDays:a.on_days,repeatsEvery:a.repeats_every},timezone:J.GI};return l.createElement("span",{className:"name"},(0,X.M)(r))}return(0,ee.SZ)(e.config)?l.createElement("span",{className:"name"},et.t("Starts when a Salesforce channel is created",{fallbackHash:"16195f4e05b6d8dbd288fb741705a87c3e6e3682",fallbackHashNs:"hermes_shortcuts"})):l.createElement("span",{className:"name"},et.t("Starts with a Salesforce event"))};ExternalTriggerSummary.displayName="ExternalTriggerSummary";var ea=a(0x1ccef1c6f);let HermesScheduledTriggerSummary=({trigger:e})=>{let t=(0,s.d4)(e=>(0,ea.ty)(e,"time24")),{schedule:a}=e.config;return l.createElement("span",null,(0,X.M)(a,{do24hrTime:t}))};HermesScheduledTriggerSummary.displayName="HermesScheduledTriggerSummary";let el=new r.Ay("workflow_builder"),HermesWebhookTriggerSummary=()=>l.createElement("span",null,el.t("Starts with a webhook"));HermesWebhookTriggerSummary.displayName="HermesWebhookTriggerSummary";let ServiceTriggerSummary=({trigger:e})=>l.createElement("span",null,e.config.summary);ServiceTriggerSummary.displayName="ServiceTriggerSummary";var er=a(0x1f48c8a62),en=a.n(er);let ei=new r.Ay("workflow_builder"),ShortcutSummary=()=>l.createElement("div",{className:en().shortcut_summary_header},ei.t("Starts from a link in Slack"));ShortcutSummary.displayName="ShortcutSummary";var es=a(0x61c95b1b),eo=a(0x112dbb8f3);let ec=new r.Ay("workflow_builder"),ChannelCreatedSummary=({trigger:e})=>{let t=(0,s.d4)(B.EA),a=(0,eo.kv)(e.config.event);return a?l.createElement(l.Fragment,null,t?ec.rt('Starts when a channel containing "{channelSubstring}" is created',{channelSubstring:a}):`Starts when a channel containing "${a}" is created`):l.createElement(l.Fragment,null,t?ec.t("Starts when a channel is created"):"Starts when a channel is created")};var ed=a(0x408bdeff),em=a(0x3796a18c),eu=a(0x37ad6380),ep=a.n(eu);let e_=new r.Ay("workflow_builder"),ListRecordCreatedSummary=({trigger:e})=>{let t=(0,eo.I2)(e);return t?l.createElement("span",{className:ep().inline__title},e_.rt("Starts when an item is created in {list}",{list:l.createElement(ed.A,{id:t,detailType:em.s.NONE,className:ep().inline__file_entity}),fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"})):l.createElement(l.Fragment,null,e_.t("Starts when a list item is created",{fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"}))};ListRecordCreatedSummary.displayName="ListRecordCreatedSummary";let eb=new r.Ay("workflow_builder"),ListRecordUpdatedSummary=({trigger:e})=>{let t=(0,eo.I2)(e);return t?l.createElement("span",{className:ep().inline__title},eb.rt("Starts when an item is updated in {list}",{list:l.createElement(ed.A,{id:t,detailType:em.s.NONE,className:ep().inline__file_entity}),fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"})):l.createElement(l.Fragment,null,eb.t("Starts when a list item is updated",{fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"}))};ListRecordUpdatedSummary.displayName="ListRecordUpdatedSummary";var ef=a(0x22f6c772a),eh=a(0x51e1a82c);let eg=new r.Ay("workflow_builder"),MessagePostedSummary=({trigger:e})=>{let{channelIds:t,filter:a}=e.config.event,r=(0,s.d4)(B.Lh);return a&&t?l.createElement("span",null,(0,eh.H)({channelIds:t,filter:a,inClient:r,messagePostedSummaryContext:ef.Q.EDITOR})):eg.t("Starts when a message is posted with keywords")};MessagePostedSummary.displayName="MessagePostedSummary";var ex=a(0x1e864b930),ew=a(0x9b971e7e),ey=a(0x1266f1359),eE=a(0x1e4ae349d);let ek=new r.Ay("workflow_builder"),ReactionAddedSummary=({trigger:e})=>{let t=(0,eo.zP)(e.config.event),a=(0,eo.Jp)(e),r=(0,s.d4)(e=>(0,ea.ty)(e,"preferred_skin_tone")),i=(0,s.d4)(ew.ZT),o=(0,ey.$D)(i),c=(0,l.useCallback)(e=>(0,eE.Fm)(o,{text:e,teamId:i??""})&&"1"!==r?`${e}::skin-tone-${r}`:e,[r,o,i]);return t.length&&a.length?l.createElement(l.Fragment,null,ek.rt("Starts when someone reacts with {emoji} in {channel}",{emoji:(0,ex.A)(t.map(e=>{let t=c(e);return l.createElement(n.Ay,{key:`emoji-${t}`,text:t,emojiSize:"small"})}),{conj:"or",keyPrefix:"emoji"}),channel:(0,ex.A)(a.map(e=>l.createElement(E.A,{channelId:e,key:`channel-${e}`},l.createElement(A.A,{channelId:e}))),{conj:"or",keyPrefix:"channel"})})):l.createElement(l.Fragment,null,ek.t("Starts when an emoji reaction is used"))};ReactionAddedSummary.displayName="ReactionAddedSummary";let eS=new r.Ay("workflow_builder"),UserJoinedChannelSummary=({trigger:e})=>{let t=(0,eo.Jp)(e);return t.length?l.createElement(l.Fragment,null,eS.rt("Starts when a person joins {channel}",{channel:(0,ex.A)(t.map(e=>l.createElement(E.A,{channelId:e,key:`channel-${e}`},l.createElement(A.A,{channelId:e}))),{conj:"or",keyPrefix:"channel"})})):l.createElement(l.Fragment,null,eS.t("Starts when a person joins a channel"))};UserJoinedChannelSummary.displayName="UserJoinedChannelSummary";let SlackEventTriggerSummary=({trigger:e})=>{let t=(0,eo.IM)(e);switch((0,eo.vd)(e)){case es.$.ReactionAdded:return l.createElement(ReactionAddedSummary,{trigger:e});case es.$.UserJoinedChannel:return l.createElement(UserJoinedChannelSummary,{trigger:e});case es.$.ListRecordCreated:return l.createElement(ListRecordCreatedSummary,{trigger:e});case es.$.ListRecordUpdated:return l.createElement(ListRecordUpdatedSummary,{trigger:e});case es.$.ChannelCreated:return l.createElement(ChannelCreatedSummary,{trigger:e});case es.$.MessagePosted:return l.createElement(MessagePostedSummary,{trigger:e});default:return l.createElement("span",null,t)}};SlackEventTriggerSummary.displayName="SlackEventTriggerSummary";var ev=a(0x126af815a);function getSegmentSummary(e,t){switch(e?.type){case ev.SJ:return l.createElement(ExternalTriggerSummary,{trigger:e});case ev.kr:return l.createElement(SlackEventTriggerSummary,{trigger:e});case ev.zW:return l.createElement(ShortcutSummary,null);case ev.bX:return l.createElement(HermesWebhookTriggerSummary,null);case ev.LO:return l.createElement(HermesScheduledTriggerSummary,{trigger:e});case ev.YV:return l.createElement(ServiceTriggerSummary,{trigger:e});case Z.SLACK_FUNCTION:return l.createElement(SlackFunctionSummary,{segment:e,hasErrors:t});case Z.SWITCH:return l.createElement(K.B,{segment:e});case Z.LOOP:return l.createElement(LoopSummary,null);default:return null}}getSegmentSummary.displayName="getSegmentSummary"},0xc3116e8:(e,t,a)=>{"use strict";a.d(t,{Ji:()=>modifyObjectVariables,Km:()=>convertVariablesToPrimaryObjectFields,Xw:()=>doesTriggerConfigAllowExtraColumnInput,ZT:()=>convertParametersV2ToPrimaryObjectFields,dg:()=>stripObjectFromPrimaryObjectFieldLabel});var l=a(0x56e1c8ae);let r=/^([^>]*?)\s>\s([^>]*?)$/,n=/^([0-9]+?)_([0-9]+?)$/;function notEmpty(e){return null!=e}let convertVariablesToPrimaryObjectFields=e=>e.list.flatMap(e=>e.objectProperties?e.objectProperties.flatMap(e=>{let t;return t=`${e.name}`.match(n),t?.length===3?{id:+t[2],schemaObjectId:+t[1],label:e.label,type:e.type}:null}).filter(notEmpty):[]),convertParametersV2ToPrimaryObjectFields=e=>Object.values(e).flatMap(e=>e?Object.values(e.properties??[]).map(e=>{let t;return t=`${e.name}`.match(n),t?.length===3?{id:+t[2],schemaObjectId:+t[1],label:e.title??"No Label Found",type:e.type}:null}).filter(notEmpty)??[]:[])??[],stripObjectFromPrimaryObjectFieldLabel=e=>{let t=`${e}`.match(r);return t?.length===3?t[2]:e},i=/^[0-9]+?_[0-9]+?$/,s=/^[0-9]+?_[0-9]+?_[0-9]+?_[0-9]+?$/,modifyMatchingObjectPropertyVariables=(e,t)=>a=>{let l=a.objectProperties?.flatMap(a=>{if(a.isHidden&&e.some(e=>e.test(a.name))){let e=t(a);return e?[e]:[]}return a});return l?{...a,objectProperties:l}:a},modifyObjectVariables=(e,t)=>{let a=e.groups.map(e=>{let a=e.data.map(modifyMatchingObjectPropertyVariables([i,s],t));return{...e,data:a}});return{list:e.list.map(modifyMatchingObjectPropertyVariables([i,s],t)),groups:a}},doesTriggerConfigAllowExtraColumnInput=e=>(0,l.EP)(e.config)},0x1d67ca27f:(e,t,a)=>{"use strict";a.d(t,{Wt:()=>processExternalTriggerSegmentVariablesForStep,_V:()=>sortChildRecipientsForUI,g9:()=>o,r3:()=>modifyChildObjectVariables});var l=a(0x20482ad21),r=a(0x2172ff7ff);let n=/[0-9]+?_([0-9]+?)_([0-9]+?)_([0-9]+?)_([0-9]+?)_child$/,i=/[0-9]+?_([0-9]+?)_([0-9]+?_){3}child_multi$/,s=/[0-9]+?_([0-9]+?)_([0-9]+?_){5}child_multi$/,o=/Ft[A-Z0-9]*?__[0-9]+?_([0-9]+?)_([0-9]+?)_([0-9]+?)_([0-9]+?)_child/,c=new l.Ay("workflow_builder"),modifyChildObjectPropertyVariables=e=>t=>{let a=t.objectProperties?.flatMap(t=>{if(t.isHidden&&n.test(t.name)){let a=e(t);return a?[a]:[]}if(i.test(t.name)||s.test(t.name)){let e=c.t("{selectedDataLabel} (multiple)",{selectedDataLabel:t.label}).replaceAll("&gt;",">");return[{...t,label:e}]}return t});return a?{...t,objectProperties:a}:t},modifyChildObjectVariables=(e,t)=>{let a=e.groups.map(e=>{let a=e.data.map(modifyChildObjectPropertyVariables(t));return{...e,data:a}});return{list:e.list.map(modifyChildObjectPropertyVariables(t)),groups:a}},processExternalTriggerSegmentVariablesForStep=(e,t,a=!1)=>{let l=`${e?.value}`.match(o);return l?a?modifyChildObjectVariables(t,e=>{let t=e.name.match(n);return l[1]===t?.[1]&&l[3]===t?.[3]?{...e,isHidden:!1}:null}):modifyChildObjectVariables(t,e=>{let t=e.name.match(n);return l[1]===t?.[1]&&l[3]===t?.[3]?e:null}):modifyChildObjectVariables(t,e=>null)},labelPrefix=e=>{let t=e.label.indexOf(" >");return t>0?e.label.substring(0,t):e.label},sortByFirstPropLabel=(e,t)=>{let a=e.objectProperties&&e.objectProperties[0]?labelPrefix(e.objectProperties[0]):e.label,l=t.objectProperties&&t.objectProperties[0]?labelPrefix(t.objectProperties[0]):t.label;return(0,r.Ay)(a,l)},sortChildRecipientsForUI=e=>{let buildResult=t=>{let a={...e.groups[0]};a.data=t;let l=e.groups.slice(1);return l.unshift(a),{list:e.list,groups:l}};if(e.groups[0]){let t=e.groups[0].data,a=t.findIndex(e=>!e.name.includes("_")&&"metadata"!==e.name);if(a>=0){let e=t[a],l=t.slice(0,a).concat(t.slice(a+1));return l.sort(sortByFirstPropLabel).unshift(e),buildResult(l)}let l=[...t];return l.sort(sortByFirstPropLabel),buildResult(l)}return e}},0xead28e26:(e,t,a)=>{"use strict";a.d(t,{P:()=>SendSummaryToSalesHomeInputPreview});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x1f355b555),s=a(0x20482ad21),o=a(0x1d2cd7755),c=a(0x12cef2078),d=a(0xe9c32bb),m=a(0x23b93d6d0),u=a(0x1a5ac3a0c),p=a(0xc3116e8),_=a(0x6c06317c),b=a(0x56e1c8ae),f=a(0x126af815a),h=a(0x66c6b26d),g=a(0x20adb28cd),x=a(0x226892387),w=a(0x38c797fc),y=a.n(w);let E=new s.Ay("workflow_builder"),SendSummaryToSalesHomeInputPreview=({configuredParameters:e,isStepPreview:t,workflowId:a})=>{let r=((e,t)=>{let a;if(!t)return null;let l=(0,u.DU)(t),r=(0,u.BQ)(t),n=(0,u.eR)(t);if(n?.type!==f.SJ||(0,b.Fe)(n.config)||(0,b.SZ)(n.config))return null;let s=(0,_.h)(e),o=(0,i.Ay)(n.config.startTime),c=o.subtract(o.utcOffset(),"minute").unix().toString(),d=e?.notification_display_table_header?.value,m="string"==typeof d&&d?d:n.config.notificationHeader,h=t.trigger?.available_data,g=h?(0,p.ZT)(h):[],x=e?.notification_display_table_extra_column_field_id?.value,w=x?g.find(e=>e.id===x):null,y=w?{payload_field:`${w.id}`,name:(0,p.dg)(w.label),type:w.type,label:w.label}:null,E=y?[...n.config.columns,y]:n.config.columns;return{payload:{workflow:{title:r,icon_url:l,subtitle:m},generic_records:(a={},E.forEach(e=>{a[e.payload_field]={record_field_identifier:e.payload_field,record_field_label:e.label||e.name,record_field_rendered_value:""}}),[{object_identifier:"Object1",record_identifier:"Record1",record_link:"https://example.com/record1",record_name:"",record_fields:a},{object_identifier:"Object2",record_identifier:"Record2",record_link:"https://example.com/record2",record_name:"",record_fields:a}]),notification_type:"scheduled"},notification_type:"scheduled",created_ts:c,is_unread:!0,icon_url:l,body:s,is_acn:!1,notification_display_columns:E}})(e,(0,x.d4)((0,h.sx)(a,g.RG)));if(!r)return null;let s=E.t("This is how your notification will appear in Sales Home"),w=l.createElement(c.X,{noPointerEvents:!0},l.createElement(m.Z,{notification:r,hasFocus:!0,isFirst:!0,isWorkflowPreview:!0,isStepPreview:t}));return l.createElement("div",{className:n()({[y().input_preview]:t})},t?l.createElement(o.A,{text:E.t("Preview")},l.createElement(d.nB,null,s),w):w)};SendSummaryToSalesHomeInputPreview.displayName="SendSummaryToSalesHomeInputPreview"},0xbf22577d:(e,t,a)=>{"use strict";a.d(t,{n:()=>getSlackFunctionStepPreview});var l=a(0xbad225b5),r=a(0x93d35cfe),n=a(0x12cef2078),i=a(0x16bebefd8),s=a(0x96aa1794),o=a(0x1a5ac3a0c),c=a(0x68e1de73),d=a(0xd0fb5338);let SlackFunctionFormStepPreview=({segment:e})=>l.createElement(c.B,{dialogTitle:(0,d.F$)(e),questions:(0,d.yS)(e),showTitle:!0});SlackFunctionFormStepPreview.displayName="SlackFunctionFormStepPreview";var m=a(0x1d67ca27f),u=a(0xead28e26),p=a(0x252b4df6e),_=a(0x6c06317c),b=a(0x1795d8821);let BuiltInMessageStepPreview=({segment:e,data:t,previewOptions:a={}})=>{let{staticWorkflow:c,isPinned:d,isEditor:u}=a,f=(0,p.Iw)(e),h=(0,p.Dp)(e),g=(0,l.useMemo)(()=>h!==b.oW.SendToSalesHome&&h!==b.oW.SendToSalesforceApp?t.list:(0,m.Wt)(f.user_id,t).list,[h,f.user_id,t]),x=(0,s.j)(),w=c||x,y=(0,o.BQ)(w),E=(0,o.DU)(w),k=(0,i.Sp)(w)?"":(0,o.DY)(w),S=(0,_.h)(f);return l.createElement(n.X,{noPointerEvents:!0,isInert:!0},l.createElement(r.Y,{blocks:S,dataList:g,isThread:b.oW.ReplyInThread===h,isPinned:d,workflowName:y,workflowIcon:E,workflowId:k,isEditor:u}))};BuiltInMessageStepPreview.displayName="BuiltInMessageStepPreview";let getSlackFunctionStepPreview=(e,t,a,r)=>{let n=(0,p.Dp)(t),i=(0,p.Iw)(t);switch(n){case b.oW.ReplyInThread:case b.oW.SendDm:case b.oW.SendMessage:case b.oW.SendToMySalesHome:case b.oW.SendToSalesHome:case b.oW.SendToMySalesforceApp:case b.oW.SendToSalesforceApp:case b.oW.SendToRecordChannel:case b.oW.SendEphemeralMessage:return l.createElement(BuiltInMessageStepPreview,{segment:t,data:a,previewOptions:r});case b.oW.OpenForm:return l.createElement(SlackFunctionFormStepPreview,{segment:t});case b.oW.SendSummaryToMySalesHome:case b.oW.SendSummaryToSalesHome:return l.createElement(u.P,{workflowId:e,configuredParameters:i});default:return null}};getSlackFunctionStepPreview.displayName="getSlackFunctionStepPreview"},0x6c06317c:(e,t,a)=>{"use strict";a.d(t,{h:()=>getPreviewBlocks});var l=a(0x21f3c49e8),r=a(0x1db69cda);let n=new(a(0x20482ad21)).Ay("workflow_builder"),getPreviewBlocks=e=>{let t=e.message?.value,a=(0,l.A)(t)?[{type:"rich_text",elements:[{type:"rich_text_section",elements:[{type:"text",text:n.t("Hello!")}]}]}]:(0,r.A)(t),i=e.interactive_blocks?.value,s=i?.find(e=>"actions"===e.type);if(s){let e={...s};e.block_id="workflow-builder-preview-actionblock",e.elements=e.elements.map(e=>"workflow_button"===e.type?{...e,action_id:"test",workflow:{trigger:{url:"https://example.com",customizable_input_parameters:[]}}}:{...e}),a.push(e)}return a}},0x21c792378:(e,t,a)=>{"use strict";a.d(t,{Bl:()=>getOperatorLabel,Qq:()=>buildVarNameToPrependLabelMap,ie:()=>buildTargetSelectOptions,tB:()=>getOperatorsForVariableType,yw:()=>valueOrValueArrayIsEligible});var l=a(0x20482ad21),r=a(0x13cd04b48),n=a(0x210eb9aa7),i=a(0x1795d8821),s=a(0x2a3fb7ec);let o=new l.Ay("workflow_builder"),c=[i.TE.SlackTypesDate,i.TE.SlackTypesTimestamp];function variableIsEligible(e,t){return!!e.isAvailable&&[i.TE.Array,i.TE.Boolean,i.TE.Integer,i.TE.Number,i.TE.String,i.TE.SlackTypesCanvasId,i.TE.SlackTypesChannelId,i.TE.SlackTypesDate,i.TE.SlackTypesLimitedRichText,i.TE.SlackTypesListId,i.TE.SlackTypesMessageContext,i.TE.SlackTypesRichText,i.TE.SlackTypesTimestamp,i.TE.SlackTypesUserId,i.TE.SlackTypesUsergroupId,...t?[i.TE.SlackTypesCanvasTemplateId,i.TE.SlackTypesTeamId]:[]].includes(e.type)}function valueOrValueArrayIsEligible(e){return Array.isArray(e)?e.every(valueIsEligible):valueIsEligible(e)}function valueIsEligible(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"object"==typeof e&&!!e&&!Array.isArray(e)&&"type"in e&&"rich_text"===e.type||null==e}function getOperatorLabel(e,t){switch(e){case n.UT:return o.t("equals");case n.vz:if((0,s.X)(c,t))return o.t("is after");return o.t("is greater than");case n.iH:if((0,s.X)(c,t))return o.t("is before");return o.t("is less than");case n.k1:if((0,s.X)(c,t))return o.t("is on or after");return o.t("is greater than or equal to");case n.V_:if((0,s.X)(c,t))return o.t("is on or before");return o.t("is less than or equal to");case n.sz:case n.Lr:return o.t("contains");case n.Hh:case n.m:return o.t("does not contain");case n.mh:return o.t("is not equal to");case n.zG:return o.t("is empty");case n.tC:return o.t("is not empty");case n.io:return o.t("contains all of");case n.$:return o.t("contains any of");case n.Rh:return o.t("contains only");case n.aQ:return o.t("does not contain any of");default:return""}}let getOperatorsForVariableType=(e,t)=>{if(e){if(e===i.TE.Array&&t===i.TE.SlackTypesFileId)return n.bK;let a=n.fG[e];if(a)return a}return[]},buildVarNameToPrependLabelMap=e=>{let t={};for(let a of e)t[a.name]=a.prependLabel||"";return t},buildTargetSelectOptions=({stepData:e,expressionData:t,experimentWfbConditionalBranchingNewTypesGroupOn:a})=>{let l=(0,r.SD)(t),n=[],s=e.groups.reduce((e,t)=>{let s,{id:o,data:c,label:d,stepIndex:m}=t,u=(s=(e,t)=>{if(!t.isHidden&&variableIsEligible(t,a)&&e.push({label:t.label,value:t.id,key:`${t.id}`,extras:{data:t}}),t.type===i.TE.Object&&t.objectProperties){let a=t.objectProperties.reduce(s,[]);e.push(...a)}return e},c.reduce(s,[])),p=l&&l[o],_=m?`${m}. ${d}`:d;if(p){let e=((e,t,a)=>{let l=[],n="";for(let s of e){let{id:e,reference:o}=s;if(!e||!o)continue;let c=(0,r.w)(o);n!==c&&l.push({label:t[c],value:"",isDisabled:!0,nonInteractive:!0}),n=c;let d=o.replace(/\.\d+?\.block_id}}$/,"}}"),m=a.find(e=>e.id===d)?.type===i.TE.SlackTypesRichText,u=(0,r.DJ)({expressionDataObject:s,isUnsupportedRichTextDropdownType:m});l.push({label:u,value:e,key:e,extras:{data:{...s,label:u}},isDisabled:m})}return l})(p,buildVarNameToPrependLabelMap(c),c);n.push({label:_,value:"",nonInteractive:!0,isDisabled:!0}),n.push(...e)}return 0!==u.length&&e.push({label:_,options:u,value:o}),e},[]);return[...0!==n.length?[{label:o.t("Recommended"),value:"",options:n}]:[],...s]}},0x75b1e64d:(e,t,a)=>{"use strict";a.d(t,{B:()=>SwitchSummary});var l=a(0xbad225b5),r=a(0x120c268ad),n=a.n(r),i=a(0x5359476e),s=a(0x1cbdfeceb),o=a(0x20482ad21),c=a(0x1fd3f6e20),d=a(0x1fdec3e16),m=a(0x222a04717),u=a(0x1312f060e),p=a(0x668181b3),_=a(0x2772625d),b=a(0x96aa1794),f=a(0x13cd04b48),h=a(0x20a2a54fa),g=a(0x1a5ac3a0c),x=a(0x21c792378),w=a(0x20d4168fd),y=a(0x154dd8295),E=a(0x247cf31a2),k=a(0x1346d4ed0),S=a(0xf4097f62),v=a(0x213c0555e),A=a(0x93f78b39),T=a(0x1b3ecb90f),C=a(0x15a4ffb05),N=a(0x42654967),I=a(0x1795d8821),M=a(0x6960d8b9),D=a(0x254e93e7),P=a.n(D);let O=new o.Ay("workflow_builder"),SwitchSummary=({segment:e,templateExpressionData:t})=>{let{list:a}=(0,h.EM)(e),r=(0,f.Ox)()??t,i=(0,b.j)(),s=(0,l.useMemo)(()=>i?.workflow.steps??[],[i]),o=(0,y.Yc)(e),u=(0,w.C9)(e),_=(0,w.At)(e),E=(0,g.W0)(e.id,i),k=u?.target?(0,p.x)(a,u.target):void 0,S=r&&u?.target&&r[u.target],v=!k&&!S,A=(0,l.useMemo)(()=>{let e,t=O.t("Missing Data"),r="";u?.target&&(k&&(t=k?.label,e=k.type),S)&&(r=(0,x.Qq)(a)[(0,f.w)(S?.reference)],t=(0,f.DJ)({expressionDataObject:S}),e=S.type);let n=l.createElement("span",{className:v?P().missing_data:""},l.createElement(m._,{type:e}),t&&l.createElement(C.A,{text:t})),i=l.createElement("span",null,r);return r?O.rt("{targetLabelElement} from {referenceLabelElement}",{targetLabelElement:n,referenceLabelElement:i}):n},[u?.target,S,v,a,k]),N=(0,l.useMemo)(()=>u?.operator?l.createElement("span",null,(0,x.Bl)(u.operator,k?.type)):"",[u?.operator,k?.type]),I=(0,l.useMemo)(()=>deriveValueToDisplay(u,a,k)??"",[u,a,k]),M=(0,l.useMemo)(()=>{let t=(0,g.B5)(e.id,s),a=convertBranchColorToTagStyle((0,w.K1)(e),E);return l.createElement("div",null,l.createElement("div",{className:P().branch_header},l.createElement(c.v,{style:a,isMicro:!0},l.createElement(d.A,{lines:1,withTooltip:!0},!!t&&l.createElement("span",{className:"margin_right_25"},O.t("Branch {index}.",{index:t,fallbackHash:"234c28ea605029faff767aa5c00d652776a209f4"})),l.createElement(C.A,{text:_,emojiSize:T.lw.SMALL}))),u?l.createElement("span",{className:n()(P().branch_expression,P().statement_container)},O.rt("If {target} {operator} {value}",{target:A,operator:N,value:I})):O.t("FALLBACK")))},[_,u,E,N,e,A,I,s]);return o?l.createElement("span",null,l.createElement(C.A,{text:O.t("Branch workflow"),emojiSize:T.lw.SMALL}),l.createElement("span",{className:P().switch_caption},O.t("(first matching branch will run)",{fallbackHash:"0d35d89f29fe5c2d2c521a719e4ac92002831468"}))):M};function convertBranchColorToTagStyle(e,t){if(!e||"gray"===e)return t?void 0:c.u.Gray;switch(e){case"gray":default:return c.u.Gray;case"tomato":case"paprika":return c.u.Flamingo;case"sunflower":return c.u.Honeycomb;case"jade":return c.u.Jade;case"indigo":return c.u.Indigo;case"lagoon":return c.u.Lagoon}}function deriveValueToDisplay(e,t,a){return e?.value?Array.isArray(e?.value)?l.createElement(l.Fragment,null,(0,i.A)(e?.value,(e,t,a)=>a.length-1!==t?[e,O.t(", ")]:e).map((l,r)=>deriveSingleValueToDisplay(l,e?.label,t,a,r)??"")):l.createElement(l.Fragment,null,deriveSingleValueToDisplay(e?.value,e?.label,t,a)??""):null}function deriveSingleValueToDisplay(e,t,a,r,n){if(!e)return null;let i=void 0!==n,o=r?.type===I.TE.SlackTypesLimitedRichText||r?.type===I.TE.SlackTypesRichText,c=i&&!o?r?.items?.type:r?.type,d=n??0;if("string"==typeof e&&(0,_.cn)(e)){let t=(0,p.x)(a,e),r=t?.label??O.t("Missing Data");return l.createElement("span",{key:`${d}-${t?.id??"missing-data"}`},l.createElement(m._,{type:c})," ",r)}if(!(i&&n%2==1)){if(r&&c===I.TE.SlackTypesChannelId&&"string"==typeof e)return l.createElement(E.A,{channelId:e,key:`${d}-${e}`});if(r&&c===I.TE.SlackTypesUserId&&"string"==typeof e)return l.createElement(S.A,{id:e,key:`${d}-${e}`});if(r&&c===I.TE.SlackTypesUsergroupId&&"string"==typeof e)return l.createElement("span",{className:P().inline,key:`${d}-${e}`},l.createElement(v.A,{id:e}));if(r&&c===I.TE.SlackTypesTimestamp&&"string"==typeof e)return l.createElement("span",{className:P().inline,key:`${d}-${e}`},(0,M.Yq)(e,"{date_pretty}"),(0,M.Yq)(e," {time}"));if(r&&c===I.TE.SlackTypesDate&&"string"==typeof e)return l.createElement("span",{className:P().inline,key:`${d}-${e}`},(0,M.Yq)((0,N.cU)(e),"{date_pretty}"));if(r&&(c===I.TE.SlackTypesCanvasId||c===I.TE.SlackTypesListId)&&"string"==typeof e)return l.createElement("span",{className:P().inline,key:`${d}-${e}`},l.createElement(k.A,{id:e,shouldShowHighlight:!1,shouldShowDetailText:!1}));if(r&&(c===I.TE.SlackTypesLimitedRichText||c===I.TE.SlackTypesRichText)&&"object"==typeof e){let t=e?.elements?.[0];if(!(0,u.B)(t)||!t.elements)return null;let a=e.type;return l.createElement("div",{className:"p-block-kit-select_options",key:`${a}-${d}`},l.createElement(A.A,{type:a,elements:t.elements,disableHighlights:!1,inline:!0,clogLinkClick:s.A,noInlineLinks:!0,alwaysDisplayMentionsAsLinks:!0,disableJumboEmoji:!0}))}}let b="";return b="string"==typeof e?l.createElement(C.A,{key:`${d}-${e}`,text:e}):"object"==typeof e?"":"boolean"==typeof e?e?O.t("Yes"):O.t("No"):e,t??b}SwitchSummary.displayName="SwitchSummary",deriveSingleValueToDisplay.displayName="deriveSingleValueToDisplay"},0x85512121:(e,t,a)=>{"use strict";e.exports=a.p+"workflows_192-0e70beb.png"},0xbf61ff25:(e,t,a)=>{"use strict";e.exports=a.p+"reminder-02bb3e2.svg"},0xdceaf1fc:(e,t,a)=>{"use strict";e.exports=a.p+"submission-confirmation-illustration-d849d18.svg"}}]);
//# sourceMappingURL=https://slack.com/source-maps/bv1-13/gantry-v2-async-workflow-builder-template-edit.03ad1f24768b4084c08d.min.js.mapØA
—Eoúô