From de253a985fa128a21733ae0638b49cdc2a75d038 Mon Sep 17 00:00:00 2001 From: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:33:20 -0400 Subject: [PATCH 1/5] adsct Stock control supervisors From 5f411ed593463c62690ac2ae27f6d5cc9d9c1dbb Mon Sep 17 00:00:00 2001 From: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:34:14 -0400 Subject: [PATCH 2/5] index.js.download Stock control supervisors From d86233bc565283c910598a81318a09d2fa57c05d Mon Sep 17 00:00:00 2001 From: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:35:50 -0400 Subject: [PATCH 3/5] 3074-50725deb36de2bde.js.download Stock control supervisors --- 3074-50725deb36de2bde.js.download | 408 ++++++++++++++++++++++++++++++ 1 file changed, 408 insertions(+) create mode 100644 3074-50725deb36de2bde.js.download diff --git a/3074-50725deb36de2bde.js.download b/3074-50725deb36de2bde.js.download new file mode 100644 index 0000000000..5ca4e877a1 --- /dev/null +++ b/3074-50725deb36de2bde.js.download @@ -0,0 +1,408 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3074],{21357:function(e,t,o){"use strict";o.d(t,{H:function(){return d}});var n=o(2784),r=o(28165),a=o(39479),i=o(77293),s=o(3e3),l=o(70776),u=o(87593);const c=(0,a.B)("AvatarGroup",{root:r.iv` + ${s.ZT.base}; + display: flex; + align-items: center; + user-select: none; + width: max-content; + + &[data-size='40'] > * { + margin-right: -10px; + } + &[data-size='25'] > * { + margin-right: -5px; + } + &[data-size='18'] > * { + margin-right: -3px; + } + &[data-size] > *:last-of-type { + margin-right: 0; + } + `,count:r.iv` + --AvatarGroup__count-text-indent: 0px; + position: relative; + display: flex; + align-items: center; + text-align: center; + color: ${l.w.neutral800}; + font-weight: 700; + line-height: 1; + + [data-size='25'] & { + font-size: 14px; + } + &::before { + content: '+'; + text-indent: var(--AvatarGroup__count-text-indent); + } + + [data-size='40'] & { + --AvatarGroup__count-text-indent: -3px; + background-color: ${l.w.neutral300}; + border: 1px solid #fff; + border-radius: 100px; + font-size: 16px; + padding: 0 10px; + height: 40px; + min-width: 40px; + border-width: 2px; + } + + [data-size='25'] & { + --AvatarGroup__count-text-indent: -2px; + font-size: 14px; + height: 25px; + min-width: 25px; + padding: 0 4px 0 11px; + } + + [data-size='18'] & { + --AvatarGroup__count-text-indent: -1px; + font-size: 12px; + height: 18px; + min-width: 18px; + padding: 0 4px 0 7px; + } + `}),d=({children:e,size:t,max:o=3})=>{const r=n.Children.toArray(e).filter(Boolean),a=r.slice(0,o),s=r.length-a.length,l=40!==t?(0,i.U)("div",{css:c.count},Math.min(s,999)," others"):(0,i.U)(u.p,{content:`Plus ${s} others`,position:"southeast"},(()=>(0,i.U)("div",{"aria-label":`Plus ${s} others`,css:c.count},Math.min(s,999))));return(0,i.U)("div",{css:c.root,"data-size":t},a,s>0&&l)}},12687:function(e,t,o){"use strict";o.d(t,{O:function(){return s}});var n=o(2784),r=o(87593),a=o(41273),i=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r{var{position:t}=e,o=i(e,["position"]);const[s="",...l]=o.name.split(/\s+/),u=l.pop()||"",c=`${s} ${u?`${u.slice(0,1)}.`:""}`.trim();return n.createElement(r.p,{content:c,position:t},(({childProps:e})=>n.createElement(a.q,Object.assign({},e,o,{isBlock:!0}))))}},47553:function(e,t,o){"use strict";o.d(t,{M:function(){return p},w:function(){return h}});var n=o(28165),r=o(2784),a=o(39479),i=o(77293),s=o(38137),l=o(3e3),u=o(70776);const c=(0,s.F)("AvatarsWithText",["textDisplay","textFontSizeLight","textLineHeightLight","textFontSizeHeavy","textLineHeightHeavy"]),d=(0,a.B)("AvatarsWithText",{root:e=>n.iv` + ${c.textDisplay}: inline-block; + ${c.textFontSizeLight}: 12px; + ${c.textLineHeightLight}: 15px; + ${c.textFontSizeHeavy}: 12px; + ${c.textLineHeightHeavy}: 15px; + + display: grid; + grid-template-columns: auto 1fr; + gap: ${e?"0px":"5px"}; + align-items: center; + + &[data-multiline] { + ${c.textDisplay}: block; + } + + &[data-size='18'] { + ${c.textFontSizeLight}: ${l.ZT.smallPrint3.fontSize}; + ${c.textLineHeightLight}: ${l.ZT.smallPrint3.lineHeight}; + ${c.textFontSizeHeavy}: ${l.ZT.smallPrint3Bold.fontSize}; + ${c.textLineHeightHeavy}: ${l.ZT.smallPrint3Bold.lineHeight}; + } + &[data-size='18'] > *:last-of-type { + top: -1px; + } + + &[data-size='25']:not([data-multiline]), + &[data-size='40']:not([data-multiline]) { + ${c.textFontSizeLight}: ${l.ZT.smallPrint1.fontSize}; + ${c.textLineHeightLight}: ${l.ZT.smallPrint1.lineHeight}; + ${c.textFontSizeHeavy}: ${l.ZT.smallPrint1Bold.fontSize}; + ${c.textLineHeightHeavy}: ${l.ZT.smallPrint1Bold.lineHeight}; + } + + &[data-size='25'][data-multiline] { + align-items: start; + ${c.textFontSizeLight}: ${l.ZT.smallPrint1.fontSize}; + ${c.textLineHeightLight}: 17px; + ${c.textFontSizeHeavy}: ${l.ZT.smallPrint1Bold.fontSize}; + ${c.textLineHeightHeavy}: ${l.ZT.smallPrint1Bold.lineHeight}; + } + + &[data-size='40'][data-multiline] { + ${c.textFontSizeLight}: ${l.ZT.smallPrint1.fontSize}; + ${c.textLineHeightLight}: ${l.ZT.smallPrint1.lineHeight}; + ${c.textFontSizeHeavy}: ${l.ZT.paragraph3Bold.fontSize}; + ${c.textLineHeightHeavy}: ${l.ZT.paragraph3Bold.lineHeight}; + } + &[data-size='40'] { + gap: ${e?"0px":"10px"}; + } + `,avatars:n.iv` + display: block; + `,content:n.iv` + display: block; + position: relative; + line-height: max( + var(${c.textLineHeightLight}), + var(${c.textLineHeightHeavy}) + ); + `,text:n.iv` + display: var(${c.textDisplay}); + &[data-kind='light'] { + color: ${u.w.neutral700}; + font-weight: 400; + font-size: calc(1px * var(${c.textFontSizeLight})); + line-height: var(${c.textLineHeightLight}); + } + &[data-kind='heavy'] { + color: ${u.w.neutral800}; + font-weight: 700; + font-size: calc(1px * var(${c.textFontSizeHeavy})); + line-height: var(${c.textLineHeightHeavy}); + } + `}),p=e=>(0,i.U)("span",{"aria-label":e.ariaLabel,css:d.text,"data-kind":e.kind,role:"text"},e.children),h=e=>{var t,o;const n=r.Children.toArray(e.avatars),a=((0,r.isValidElement)(n[0])?null===(o=null===(t=n[0].props)||void 0===t?void 0:t.children)||void 0===o?void 0:o.length:0)>3&&40!==e.size;return(0,i.U)("div",{"aria-label":e.ariaLabel,css:d.root(a),"data-multiline":e.multiline?"":void 0,"data-size":e.size},(0,i.U)("div",{css:d.avatars},e.avatars),(0,i.U)("div",{css:d.content},e.children))}},31738:function(e,t,o){"use strict";o.d(t,{K:function(){return d}});var n=o(28165),r=o(39479),a=o(52676),i=o(77293),s=o(61854),l=o(70776),u=o(98628);const c=(0,r.B)("BooleanInput",{root:()=>[(0,n.iv)({position:"relative",display:"inline-block"})],inner:e=>[(0,n.iv)({display:"block",position:"relative",zIndex:1,border:`2px solid ${l.w.neutral600}`,backgroundColor:"transparent",cursor:"pointer",transition:`all ${u.f.transitionDuration} ease-in-out`}),"checkbox"===e.type&&[(0,a.Q)("checkbox",(0,n.iv)({width:18,height:18,borderRadius:3,color:l.w.neutral100})),e.checked&&(0,a.Q)("checked",(0,n.iv)({backgroundColor:l.w.blue,borderColor:"transparent"})),e.isErrored&&(0,a.Q)("errored",(0,n.iv)({backgroundColor:e.checked?l.w.error:"transparent",borderColor:l.w.error})),e.disabled&&(0,a.Q)("disabled",(0,n.iv)({backgroundColor:e.checked?l.w.neutral500:"transparent",borderColor:l.w.neutral500,cursor:"not-allowed"}))],"radio"===e.type&&[(0,a.Q)("radio",(0,n.iv)({color:"transparent",width:20,height:20,borderRadius:20})),e.checked&&(0,a.Q)("checked",(0,n.iv)({borderColor:l.w.blue,color:l.w.blue})),e.isErrored&&(0,a.Q)("errored",(0,n.iv)({borderColor:l.w.error,color:l.w.error})),e.disabled&&(0,a.Q)("disabled",(0,n.iv)({borderColor:l.w.neutral500,color:l.w.neutral500,cursor:"not-allowed"}))]],layer:(0,n.iv)({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:-2,left:-2,width:"calc(100% + 4px)",height:"calc(100% + 4px)"})}),d=({type:e,ariaLabel:t,checked:o=!1,disabled:n,id:r,isErrored:a,isRequired:l,name:u,onChange:d=(()=>{}),tabIndex:p=0,value:h})=>{const f={type:e,ariaLabel:t,checked:o,disabled:n,id:r,isErrored:a,isRequired:l,name:u,onChange:d,tabIndex:p,value:h};return(0,i.U)("span",{css:c.root()},(0,i.U)("span",{css:c.inner(f)},(0,i.U)("input",{"aria-label":t,checked:o,css:c.layer,disabled:n,id:r,name:u,onChange:d,required:l,tabIndex:p,type:e,value:h}),o&&(0,i.U)("span",{css:c.layer},(0,i.U)(s.J,{isBlock:!0,name:{checkbox:"formCheck",radio:"formRadioDot"}[e],size:18}))))}},44055:function(e,t,o){"use strict";o.d(t,{D:function(){return I}});var n=o(2784),r=o(28165),a=o(44051),i=o.n(a),s=o(37168),l=o(70776),u=o(91604),c=o(20110),d=o(39479),p=o(52676),h=o(77293),f=o(36897);const y=e=>(0,h.U)(f.Y,Object.assign({},e,{size:"small"})),v=(0,d.B)("ButtonNav",{list:e=>[e.align&&(0,p.Q)(`${e.align}-aligned`,{justifyContent:`${e.align}`}),{display:"flex",flexFlow:"wrap",gap:10},!1===e.wrap&&{"@media screen and (min-width: 1024px)":{display:"grid",gridTemplateColumns:`repeat(${e.items.length}, minmax(auto, min-content))`,justifyContent:"center"}},e.perRow&&(0,p.Q)(`${e.perRow}-perRow`,{"@media screen and (min-width: 1024px)":{gridTemplateColumns:`repeat(${Math.min(e.items.length,e.perRow)}, 1fr)`}}),e.isButtonFullWidth&&(0,p.Q)("isButtonFullWidth",{"@media screen and (min-width: 1024px)":{display:"grid",gridTemplateColumns:`repeat(${e.perRow?Math.min(e.items.length,e.perRow):e.items.length}, 1fr)`}})],item:e=>[{display:"block"},e&&(0,p.Q)("isButtonFullWidth",{flex:"0 0 100%","@media screen and (min-width: 768px)":{flex:"1"}})]}),m=({align:e,ariaLabel:t,isButtonFullWidth:o,items:n,perRow:r,selectedItemKey:a,onChooseItem:i=(()=>{}),wrap:s=!1})=>{const l={align:e,ariaLabel:t,isButtonFullWidth:o,items:n,onChooseItem:i,perRow:r,selectedItemKey:a,wrap:s},u=n.map((e=>{const t=e.key===a;return(0,h.U)("li",{css:v.item(o),key:e.key},(0,h.U)(y,{ariaLabel:t?`${e.text}, selected`:e.text,color:"button-nav",hasShadow:!1,href:e.href,iconBefore:e.iconBefore,isFullWidth:o,isSelected:t,onClick:t=>i(e,t)},e.text))}));return(0,h.U)("nav",{"aria-label":t},(0,h.U)("ul",{css:v.list(l)},u))};var b=o(15504),g=o(98628),k=o(61854),w=o(13030),D=o(68516),x=o(87593);function P(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e{const o=e.find((e=>O(e.value.from,t.from)&&O(e.value.to,t.to))),r=function(e){const t=O(e.from,e.to),o=e.from?(0,h.U)(D.ou,{date:e.from,format:"MM/DD/YY",ignoreProfileTimezone:!0}):null,r=!t&&e.to?(0,h.U)(D.ou,{date:e.to,format:"MM/DD/YY",ignoreProfileTimezone:!0}):null;return(0,h.U)(n.Fragment,null,o,Boolean(o)&&Boolean(r)&&" \u2013 ",r)}(t);return(0,h.U)("div",{css:M.wrapper},(0,h.U)(x.p,{content:o?r:null},(({childProps:e})=>(0,h.U)("span",{"aria-describedby":e.ariaDescribedBy,css:M.root},o?o.text:r))))},N=(0,d.B)("DateRangePickerInput",{root:e=>r.iv` + cursor: ${e.isDisabled?"default":"pointer"}; + `,button:r.iv` + display: flex; + align-items: center; + min-width: 0; + `,clearSelectionButton:r.iv` + align-items: center; + cursor: pointer; + display: flex; + height: 100%; + justify-content: center; + width: 100%; + + &:hover, + &:focus { + color: ${l.w.neutral700}; + transition: ${g.f.transitionValue}; + } + `,placeholder:r.iv` + color: ${l.w.neutral600}; + display: block; + overflow: hidden; + white-space: nowrap; + `}),T=({clearSelection:e})=>(0,h.U)("button",{type:"button",css:N.clearSelectionButton,onClick:e,title:"Clear Selection"},(0,h.U)(k.J,{canAcceptPointerEvents:!1,name:"x",size:20})),E=e=>{const{value:t,clearSelection:o}=e,{from:n,to:r}=t,a=Boolean(n||r),i=a&&!e.isDisabled;return(0,h.U)("div",{css:N.root(e)},(0,h.U)(w.I,{id:e.id,isDisabled:e.isDisabled,isErrored:e.isErrored,renderIconAfter:({isFocused:e,isHovered:t})=>i&&(0,h.U)(T,{clearSelection:o,isFocused:e,isHovered:t}),renderIconBefore:({iconSize:e})=>(0,h.U)(k.J,{name:"actionCalendar",size:e})},(t=>(0,h.U)("button",{"aria-controls":t["aria-controls"],"aria-expanded":e.isOpen?"true":"false","aria-haspopup":"true","aria-invalid":t["aria-invalid"],"aria-label":t["aria-label"],css:[t.css,N.button],disabled:t.disabled,id:t.id,onClick:e.onClick,onKeyDown:t.onKeyDown,type:"button"},a?(0,h.U)(C,{options:e.options,value:e.value}):(0,h.U)("span",{css:N.placeholder},e.placeholder)))))};var _=o(66830);const B={root:r.iv` + display: flex; + justify-content: space-between; + position: absolute; + width: 100%; + `},j=({onNextClick:e,onPreviousClick:t})=>(0,h.U)("div",{css:B.root},(0,h.U)(_.h,{icon:"arrowSmallLeft",label:"Previous Month",onClick:()=>t(),shouldCorrectTooltipPosition:!1,tooltipPosition:"southwest",color:"icon-secondary"}),(0,h.U)(_.h,{icon:"arrowSmallRight",label:"Next Month",onClick:()=>e(),shouldCorrectTooltipPosition:!1,tooltipPosition:"southeast",color:"icon-secondary"}));var S=o(3e3);function U({children:e,size:t}){return n.createElement(r.ms,null,(({css:o})=>e({classNames:{body:o` + display: table-row-group; + `,caption:o` + color: ${l.w.neutral800}; + margin: 0 0 1em 0; + text-align: center; + ${S.ZT.paragraph3Bold} + `,container:o` + display: flex; + justify-content: center; + position: relative; + user-select: none; + + &:after, + &:before { + border: solid transparent; + bottom: 100%; + content: ' '; + display: block; + height: 0; + left: 10%; + pointer-events: none; + position: absolute; + width: 0; + } + + &:after { + border-bottom-color: ${l.w.neutral800}; + border-color: rgba(136, 183, 213, 0); + border-width: 8px; + margin-left: -8px; + } + + &:before { + border-bottom-color: ${l.w.neutral800}; + border-color: rgba(194, 225, 245, 0); + border-width: 8px; + margin-left: -8px; + } + + abbr { + ${S.ZT.smallPrint3Semibold} + text-decoration: none; + } + + div[role='columnheader'] > abbr { + font-size: 14px; + font-weight: 700; + line-height: 20px; + text-transform: uppercase; + } + `,day:o` + border: none; + cursor: pointer; + display: table-cell; + padding: 0.8rem 0.7rem; + text-align: center; + vertical-align: middle; + ${S.ZT.paragraph3} + + &:hover { + background-color: ${l.w.neutral200}; + border-radius: 10px; + } + `,interactionDisabled:o` + .DayPicker-Day { + cursor: default; + } + `,month:o` + border-collapse: collapse; + border-spacing: 0; + padding: 2.5em 1em 1em 0em; + user-select: none; + ${"small"!==t?`\n &:last-of-type {\n border-left: 1px solid ${l.w.neutral300};\n padding: 2.5em 0em 1em 1em;\n }\n `:""} + ${"small"===t&&"padding: 2.5em 0em 1em 0em;"} + `,months:o` + display: flex; + `,navBar:"",navButtonNext:"",navButtonPrev:"",navButtonInteractionDisabled:"",footer:"",todayButton:"",week:o` + display: table-row; + `,weekNumber:"",weekday:o` + display: table-cell; + font-size: 0.875em; + padding: 0.8rem 0.7rem; + text-align: center; + ${S.ZT.smallPrint3Bold} + `,weekdays:o` + display: table-header-group; + + > div { + display: table-row; + } + `,weekdaysRow:"",wrapper:o` + display: flex; + position: relative; + `,outside:o` + color: ${l.w.neutral500}; + cursor: default; + `,selected:o` + background-color: ${l.w.blue10}; + color: ${l.w.blue}; + font-weight: 600; + `,today:o` + color: ${l.w.neutral800}; + font-weight: 700; + `,disabled:o` + background-color: ${l.w.neutral200}; + color: ${l.w.neutral600}; + cursor: not-allowed; + outline: none; + `},modifiersStyles:{from:{borderBottomLeftRadius:10,borderTopLeftRadius:10},to:{borderBottomRightRadius:10,borderTopRightRadius:10}}})))}const F=(0,d.B)("DateRangePicker",{root:r.iv` + position: relative; + `,menu:e=>[r.iv` + display: grid; + gap: 20px; + padding: 20px; + `,"large"===e.size&&r.iv` + grid-template-columns: auto 1fr; + `],options:e=>["large"===e.size&&r.iv` + border-right: 1px solid ${l.w.neutral300}; + padding-right: 20px; + min-width: 195px; + `],doneButton:r.iv` + display: flex; + justify-content: flex-end; + grid-column: 1 / -1; + `,modalBackdrop:r.iv` + background: rgba(0, 0, 0, 0.8); + position: fixed; + z-index: ${u.C.modalOverlay}; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: flex; + align-items: center; + justify-content: center; + `,modal:e=>[r.iv` + background: ${l.w.neutral100}; + border-radius: 10px; + overflow: auto; + width: 100%; + max-width: 344px; + max-height: 100vh; + `,"small"===e&&(0,r.iv)({maxWidth:"344px"}),"medium"===e&&(0,r.iv)({maxWidth:"670px"})]}),$={},I=({ariaLabel:e,menuAriaLabel:t,onChange:o,value:r=$,placeholder:a,disabledDates:l,id:u,isDisabled:d,isErrored:p,closeText:f="Done",options:y=[],menuAlign:v="left",size:g="medium",variant:k})=>{const w={ariaLabel:e,menuAriaLabel:t,onChange:o,value:r,placeholder:a,disabledDates:l,id:u,isDisabled:d,isErrored:p,closeText:f,options:y,menuAlign:v,size:g};let D=k;D||(D="small"===g?"modal":"dropdown");const[x,M]=(0,n.useState)(null),[C,N]=(0,n.useState)(!1),[T,_]=(0,n.useState)(w.value||$),{from:B,to:S}=T,I="small"===w.size?w.size:"medium",L="small"===w.size;(0,n.useEffect)((()=>{w.value!==T&&_(w.value)}),[w.value]);const z=()=>{var e,t;setTimeout((()=>{N(!1)}),0),O(B,null===(e=w.value)||void 0===e?void 0:e.from)&&O(S,null===(t=w.value)||void 0===t?void 0:t.to)||w.onChange(T)},W=(e,t,o)=>{if(t[o.disabled])return;const n=function(e,t,o){return t?o&&O(t,o)&&O(e,t)?{from:void 0,to:void 0}:o&&O(t,o)?P(e,t)?{from:e,to:t}:{from:t,to:e}:!o&&P(e,t)?{from:e,to:t}:o?{from:e,to:e}:{from:t,to:e}:{from:e,to:e}}(e,B,S);_(n),null!==x&&M(null)},[H]=(0,s.O)({onClickOutside:z}),R=C&&(0,h.U)("div",{"aria-label":w.menuAriaLabel,css:F.menu(w)},w.options.length>0&&(0,h.U)("div",{css:F.options(w)},(0,h.U)(m,{ariaLabel:"Predefined date ranges",isButtonFullWidth:!0,items:w.options,onChooseItem:(e,t)=>{t.preventDefault(),M(e),_(e.value)},perRow:"medium"===w.size?void 0:1,selectedItemKey:null===x||void 0===x?void 0:x.key})),(0,h.U)(U,{size:I},(({classNames:e,modifiersStyles:t})=>(0,h.U)(i(),{classNames:e,disabledDays:w.disabledDates,fixedWeeks:!0,initialMonth:B,modifiers:T,modifiersStyles:t,navbarElement:j,numberOfMonths:L?1:2,onDayClick:(t,o)=>W(t,o,e),selectedDays:[B,T]}))),(0,h.U)("div",{css:F.doneButton},(0,h.U)(c.z,{isFullWidth:"small"===w.size,onClick:z},w.closeText)));return(0,h.U)("div",{css:F.root},(0,h.U)(E,Object.assign({},w,{clearSelection:()=>{_($),w.onChange($)},isOpen:C,onClick:()=>{w.isDisabled||C||N(!0)},options:w.options,value:T})),C&&("modal"===D?(0,h.U)("div",{css:F.modalBackdrop},(0,h.U)("div",{css:F.modal(I),ref:H},R)):(0,h.U)(b.f,{align:w.menuAlign,borderRadius:10,intersectHeight:460,onClickOutside:z},R)))}},17688:function(e,t,o){"use strict";o.d(t,{g:function(){return y}});var n=o(2784),r=o(28165),a=o(39479),i=o(77293),s=o(61854),l=o(61446),u=o(3e3),c=o(70776),d=o(60196),p=o(61814);const h=(0,a.B)("Field",{root:r.iv` + display: grid; + grid-gap: 5px; + `,helpTextWrapper:r.iv` + ${u.ZT.smallPrint1} + `,helpText:r.iv` + display: grid; + grid-template-columns: 1fr auto; + grid-gap: 10px; + align-items: start; + color: ${c.w.neutral700}; + `,helpTextInner:r.iv` + padding-top: 1px; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + // Without this truncation won't properly occur. + * { + display: inline; + margin: 0; + } + `,helpTextToggle:r.iv` + cursor: pointer; + text-decoration: underline; + text-transform: lowercase; + // Prevent help text toggle size from changing. + width: 33px; + &:hover, + &:focus { + outline: 1px solid ${c.w.blue}; + outline-offset: 1px; + color: ${c.w.blue}; + } + `,error:r.iv` + display: inline; + color: ${c.w.error400}; + `}),f=({children:e,helpTextLineClamp:t})=>{const[o,r]=(0,n.useState)(!1),[a,s]=(0,d.I)(),l=a&&(0,i.U)("button",{"aria-hidden":"true",css:h.helpTextToggle,onClick:()=>r(!o),type:"button"},o?"Less":"More"),u={WebkitLineClamp:o?void 0:t};return(0,i.U)("div",{css:h.helpText},(0,i.U)("div",{css:h.helpTextInner,ref:e=>s(e),style:u},(0,i.U)("div",null,e)),l)},y=({label:e,renderInput:t,error:o,inputId:r,isDisabled:a,isRequired:u,helpTextLineClamp:c=1,renderHelpText:d,renderLabel:y,requiredText:v})=>{const[m]=(0,n.useState)(r||(0,p.E)("Field-")),b=`${m}-description`,g=d&&d();return(0,i.U)("div",{css:h.root},(0,i.U)("div",null,y?y({htmlFor:m,isDisabled:a,isErrored:!!o,isRequired:u,label:e,requiredText:v}):(0,i.U)(l.l,{alignItems:"start",htmlFor:m,isDisabled:a,isErrored:!!o,isRequired:u,requiredText:v,size:"small"},o&&(0,i.U)(s.J,{color:"error400",isBlock:!0,name:"formXCircle",size:18}),(0,i.U)("span",null,e))),(0,i.U)("div",null,t({ariaDescribedBy:g||o?b:void 0,id:m,isDisabled:!!a,isErrored:!!o,isRequired:!!u})),(0,i.U)("div",{"aria-live":o?"polite":"off",css:h.helpTextWrapper,id:b},(g||o)&&(0,i.U)(f,{helpTextLineClamp:c},o&&(0,i.U)("div",{css:h.error},o," "),g)))}},61446:function(e,t,o){"use strict";o.d(t,{l:function(){return d}});var n=o(28165),r=o(39479),a=o(77293),i=o(70776),s=o(3e3);const l=(0,r.B)("FormLabelRequiredText",{root:Object.assign(Object.assign({},s.ZT.smallPrint1),{color:i.w.neutral700,textTransform:"lowercase","&::before":{content:'"("'},"&::after":{content:'")"'},'&[data-state="disabled"]':{color:i.w.neutral500}})}),u=({children:e="Required",isDisabled:t=!1})=>(0,a.U)("span",{"aria-hidden":"true",css:l.root,"data-state":t?"disabled":void 0},e),c=(0,r.B)("FormLabel",{root:n.iv` + display: grid; + justify-content: start; + grid-gap: 5px; + grid-auto-flow: column; + grid-auto-columns: auto; + cursor: pointer; + color: ${i.w.neutral700}; + + &[data-align-items='center'] { + align-items: center; + } + + &[data-align-items='start'] { + align-items: start; + } + + &[data-justify-content='start'] { + justify-content: start; + } + + &[data-justify-content='stretch'] { + justify-content: stretch; + } + + &[data-state~='selected'] { + color: ${i.w.blue}; + } + + &[data-state~='errored'] { + color: ${i.w.error400}; + } + + &[data-state~='disabled'] { + cursor: not-allowed; + } + + &[data-state~='disabled'] { + color: ${i.w.neutral500}; + } + + &[data-size='small'] { + ${s.ZT.smallPrint1Semibold}; + } + + &[data-size='medium'] { + ${s.ZT.paragraph3Medium}; + } + + &[data-size='medium'][data-state='selected'] { + ${s.ZT.paragraph3Semibold} + } + `}),d=({children:e,alignItems:t="center",htmlFor:o,isDisabled:n,isErrored:r,isRequired:i,isSelected:s,justifyContent:l="start",requiredText:d,size:p="medium"})=>(0,a.U)("label",{css:c.root,"data-align-items":t,"data-justify-content":l,"data-size":p,"data-state":[s&&"selected",r&&"errored",n&&"disabled"].filter(Boolean).join(" ")||void 0,htmlFor:o},i&&"*",e,i?d?(0,a.U)(u,{isDisabled:n},d):(0,a.U)(u,{isDisabled:n}):null)},56119:function(e,t,o){"use strict";o.d(t,{r:function(){return s}});var n=o(28165),r=o(39479),a=o(77293);const i=(0,r.B)("Grid",{root:e=>{return(0,n.iv)({display:"grid",alignItems:e.alignItems,gap:e.gap,gridTemplateColumns:(t=e.columns,"number"===typeof t?`repeat(${e.columns}, 1fr)`:e.columns)});var t}}),s=e=>(0,a.U)("div",{css:i.root(e)},e.children)},74897:function(e,t,o){"use strict";o.d(t,{x:function(){return f}});var n=o(77293),r=o(20110),a=o(36897),i=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r{const t={ariaLabel:e.ariaLabel,href:e.href,onClick:e.onClick,size:"small"},o=e.isOnDarkBackground?l:r.z;return e.children?(0,n.U)(o,Object.assign({},t,{color:"secondary",iconBefore:"arrowBigLeft"}),e.children):e.isOnDarkBackground?(0,n.U)(h,Object.assign({},t,{color:"icon-secondary",icon:"arrowBigLeft",label:e.tooltipText,tooltipPosition:"east"})):(0,n.U)(u.h,Object.assign({},t,{color:"icon-alt",icon:"arrowBigLeft",label:e.tooltipText,tooltipPosition:"east"}))}},44051:function(e,t,o){var n;"undefined"!=typeof self&&self,e.exports=(n=o(2784),function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(e,t){e.exports=n},function(e,t,o){"use strict";function n(e){return new Date(e.getTime())}function r(e){return e instanceof Date&&!isNaN(e.valueOf())}function a(e,t){var o=n(e);return o.setMonth(e.getMonth()+t),o}function i(e,t){return!(!e||!t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function s(e,t){return!(!e||!t)&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function l(e,t){return n(e).setHours(0,0,0,0)n(t).setHours(0,0,0,0)}function c(e){var t=new Date;return t.setHours(0,0,0,0),l(e,t)}function d(e){var t=new Date((new Date).getTime()+864e5);return t.setHours(0,0,0,0),e>=t}function p(e,t,o){var r=n(e);return r.setHours(0,0,0,0),u(r,t)&&l(r,o)||u(r,o)&&l(r,t)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:null,to:null},o=t.from,n=t.to;return o?o&&n&&i(o,n)&&i(e,o)?(o=null,n=null):n&&l(e,o)?o=e:n&&i(e,n)?(o=e,n=e):l(n=e,o)&&(n=o,o=e):o=e,{from:o,to:n}}function f(e,t){var o=t.from,n=t.to;return o&&i(e,o)||n&&i(e,n)||o&&n&&p(e,o,n)}function y(e){var t=n(e);return t.setHours(0,0,0),t.setDate(t.getDate()+4-(t.getDay()||7)),Math.ceil(((t-new Date(t.getFullYear(),0,1))/864e5+1)/7)}Object.defineProperty(t,"__esModule",{value:!0}),t.clone=n,t.isDate=r,t.addMonths=a,t.isSameDay=i,t.isSameMonth=s,t.isDayBefore=l,t.isDayAfter=u,t.isPastDay=c,t.isFutureDay=d,t.isDayBetween=p,t.addDayToRange=h,t.isDayInRange=f,t.getWeekNumber=y,t.default={addDayToRange:h,addMonths:a,clone:n,getWeekNumber:y,isDate:r,isDayAfter:u,isDayBefore:l,isDayBetween:p,isDayInRange:f,isFutureDay:d,isPastDay:c,isSameDay:i,isSameMonth:s}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LEFT=37,t.UP=38,t.RIGHT=39,t.DOWN=40,t.ENTER=13,t.SPACE=32,t.ESC=27,t.TAB=9},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={container:"DayPicker",wrapper:"DayPicker-wrapper",interactionDisabled:"DayPicker--interactionDisabled",months:"DayPicker-Months",month:"DayPicker-Month",navBar:"DayPicker-NavBar",navButtonPrev:"DayPicker-NavButton DayPicker-NavButton--prev",navButtonNext:"DayPicker-NavButton DayPicker-NavButton--next",navButtonInteractionDisabled:"DayPicker-NavButton--interactionDisabled",caption:"DayPicker-Caption",weekdays:"DayPicker-Weekdays",weekdaysRow:"DayPicker-WeekdaysRow",weekday:"DayPicker-Weekday",body:"DayPicker-Body",week:"DayPicker-Week",weekNumber:"DayPicker-WeekNumber",day:"DayPicker-Day",footer:"DayPicker-Footer",todayButton:"DayPicker-TodayButton",today:"today",selected:"selected",disabled:"disabled",outside:"outside"}},function(e,t,o){"use strict";function n(e){e.preventDefault(),e.stopPropagation()}function r(e){return new Date(e.getFullYear(),e.getMonth(),1,12)}function a(e){var t=r(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t.getDate()}function i(e){var t=y({},e.modifiers);return e.selectedDays&&(t[e.classNames.selected]=e.selectedDays),e.disabledDays&&(t[e.classNames.disabled]=e.disabledDays),t}function s(e){var t=e.firstDayOfWeek,o=e.locale,n=void 0===o?"en":o,r=e.localeUtils,a=void 0===r?{}:r;return isNaN(t)?a.getFirstDayOfWeek?a.getFirstDayOfWeek(n):0:t}function l(e){return!!(e&&e.from&&e.to)}function u(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}function c(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,m.getFirstDayOfWeek)(),o=arguments[2],n=a(e),r=[],i=[],s=[],l=1;l<=n;l+=1)r.push(new Date(e.getFullYear(),e.getMonth(),l,12));r.forEach((function(e){i.length>0&&e.getDay()===t&&(s.push(i),i=[]),i.push(e),r.indexOf(e)===r.length-1&&s.push(i)}));for(var u=s[0],c=7-u.length;c>0;c-=1){var d=(0,v.clone)(u[0]);d.setDate(u[0].getDate()-1),u.unshift(d)}for(var p=s[s.length-1],h=p.length;h<7;h+=1){var f=(0,v.clone)(p[p.length-1]);f.setDate(p[p.length-1].getDate()+1),p.push(f)}if(o&&s.length<6)for(var y=void 0,b=s.length;b<6;b+=1){for(var g=(y=s[s.length-1])[y.length-1],k=[],w=0;w<7;w+=1){var D=(0,v.clone)(g);D.setDate(g.getDate()+w+1),k.push(D)}s.push(k)}return s}function d(e){var t=(0,v.clone)(e);return t.setDate(1),t.setHours(12,0,0,0),t}function p(e,t){var o=void 0;o=t===b.default?t.day+"--"+t.outside:""+t.outside;var n="."+t.day.replace(/ /g,".")+":not(."+o.replace(/ /g,".")+")";return e.querySelectorAll(n)}function h(e){return Array.prototype.slice.call(e,0)}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var y=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(o,r){var a=t[r];return n(e,a)&&o.push(r),o}),[])}Object.defineProperty(t,"__esModule",{value:!0}),t.dayMatchesModifier=n,t.getModifiersForDay=r;var a=o(1),i=o(4);t.default={dayMatchesModifier:n,getModifiersForDay:r}},function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ModifiersUtils=t.LocaleUtils=t.DateUtils=t.DayPicker=void 0;var u=Object.assign||function(e){for(var t=1;t1&&e.fromMonth){var o=m.startOfMonth(e.fromMonth),n=m.getMonthsDiff(o,t);t=b.addMonths(o,Math.floor(n/e.numberOfMonths)*e.numberOfMonths)}else e.toMonth&&e.numberOfMonths>1&&m.getMonthsDiff(t,e.toMonth)<=0&&(t=b.addMonths(m.startOfMonth(e.toMonth),1-this.props.numberOfMonths));return t}},{key:"getNextNavigableMonth",value:function(){return b.addMonths(this.state.currentMonth,this.props.numberOfMonths)}},{key:"getPreviousNavigableMonth",value:function(){return b.addMonths(this.state.currentMonth,-1)}},{key:"allowPreviousMonth",value:function(){var e=b.addMonths(this.state.currentMonth,-1);return this.allowMonth(e)}},{key:"allowNextMonth",value:function(){var e=b.addMonths(this.state.currentMonth,this.props.numberOfMonths);return this.allowMonth(e)}},{key:"allowMonth",value:function(e){var t=this.props,o=t.fromMonth,n=t.toMonth;return!(!t.canChangeMonth||o&&m.getMonthsDiff(o,e)<0||n&&m.getMonthsDiff(n,e)>0)}},{key:"allowYearChange",value:function(){return this.props.canChangeMonth}},{key:"showMonth",value:function(e,t){var o=this;this.allowMonth(e)&&this.setState({currentMonth:m.startOfMonth(e)},(function(){t&&t(),o.props.onMonthChange&&o.props.onMonthChange(o.state.currentMonth)}))}},{key:"showNextYear",value:function(){if(this.allowYearChange()){var e=b.addMonths(this.state.currentMonth,12);this.showMonth(e)}}},{key:"showPreviousYear",value:function(){if(this.allowYearChange()){var e=b.addMonths(this.state.currentMonth,-12);this.showMonth(e)}}},{key:"focus",value:function(){this.wrapper.focus()}},{key:"focusFirstDayOfMonth",value:function(){m.getDayNodes(this.dayPicker,this.props.classNames)[0].focus()}},{key:"focusLastDayOfMonth",value:function(){var e=m.getDayNodes(this.dayPicker,this.props.classNames);e[e.length-1].focus()}},{key:"focusPreviousDay",value:function(e){var t=this,o=m.getDayNodes(this.dayPicker,this.props.classNames),n=m.nodeListToArray(o).indexOf(e);-1!==n&&(0===n?this.showPreviousMonth((function(){return t.focusLastDayOfMonth()})):o[n-1].focus())}},{key:"focusNextDay",value:function(e){var t=this,o=m.getDayNodes(this.dayPicker,this.props.classNames),n=m.nodeListToArray(o).indexOf(e);-1!==n&&(n===o.length-1?this.showNextMonth((function(){return t.focusFirstDayOfMonth()})):o[n+1].focus())}},{key:"focusNextWeek",value:function(e){var t=this,o=m.getDayNodes(this.dayPicker,this.props.classNames),n=m.nodeListToArray(o).indexOf(e);n>o.length-8?this.showNextMonth((function(){var e=7-(o.length-n);m.getDayNodes(t.dayPicker,t.props.classNames)[e].focus()})):o[n+7].focus()}},{key:"focusPreviousWeek",value:function(e){var t=this,o=m.getDayNodes(this.dayPicker,this.props.classNames),n=m.nodeListToArray(o).indexOf(e);n<=6?this.showPreviousMonth((function(){var e=m.getDayNodes(t.dayPicker,t.props.classNames);e[e.length-7+n].focus()})):o[n-7].focus()}},{key:"handleOutsideDayClick",value:function(e){var t=this.state.currentMonth,o=this.props.numberOfMonths,n=m.getMonthsDiff(t,e);n>0&&n>=o?this.showNextMonth():n<0&&this.showPreviousMonth()}},{key:"renderNavbar",value:function(){var e=this.props,t=e.labels,o=e.locale,n=e.localeUtils,r=e.canChangeMonth,i=e.navbarElement,s=a(e,["labels","locale","localeUtils","canChangeMonth","navbarElement"]);if(!r)return null;var l={month:this.state.currentMonth,classNames:this.props.classNames,className:this.props.classNames.navBar,nextMonth:this.getNextNavigableMonth(),previousMonth:this.getPreviousNavigableMonth(),showPreviousButton:this.allowPreviousMonth(),showNextButton:this.allowNextMonth(),onNextClick:this.showNextMonth,onPreviousClick:this.showPreviousMonth,dir:s.dir,labels:t,locale:o,localeUtils:n};return p.default.isValidElement(i)?p.default.cloneElement(i,l):p.default.createElement(i,l)}},{key:"renderMonths",value:function(){for(var e=[],t=m.getFirstDayOfWeekFromProps(this.props),o=0;o-1,ariaSelected:r.indexOf(n.props.classNames.selected)>-1,onClick:n.props.onDayClick,onFocus:n.props.onDayFocus,onKeyDown:n.props.onDayKeyDown,onMouseEnter:n.props.onDayMouseEnter,onMouseLeave:n.props.onDayMouseLeave,onMouseDown:n.props.onDayMouseDown,onMouseUp:n.props.onDayMouseUp,onTouchEnd:n.props.onDayTouchEnd,onTouchStart:n.props.onDayTouchStart},n.props.renderDay(e,l))},i(n,o)}return s(t,e),l(t,[{key:"render",value:function(){var e=this,t=this.props,o=t.classNames,n=t.month,r=t.months,a=t.fixedWeeks,i=t.captionElement,s=t.weekdayElement,l=t.locale,u=t.localeUtils,p=t.weekdaysLong,f=t.weekdaysShort,m=t.firstDayOfWeek,b=t.onCaptionClick,g=t.showWeekNumbers,k=t.showWeekDays,w=t.onWeekClick,D={date:n,classNames:o,months:r,localeUtils:u,locale:l,onClick:b?function(e){return b(n,e)}:void 0},x=c.default.isValidElement(i)?c.default.cloneElement(i,D):c.default.createElement(i,D),P=y.getWeekArray(n,m,a);return c.default.createElement("div",{className:o.month,role:"grid"},x,k&&c.default.createElement(d.default,{classNames:o,weekdaysShort:f,weekdaysLong:p,firstDayOfWeek:m,showWeekNumbers:g,locale:l,localeUtils:u,weekdayElement:s}),c.default.createElement("div",{className:o.body,role:"rowgroup"},P.map((function(t){var r=void 0;return g&&(r=v.getWeekNumber(t[6])),c.default.createElement("div",{key:t[0].getTime(),className:o.week,role:"row"},g&&c.default.createElement("div",{className:o.weekNumber,tabIndex:w?0:-1,role:"gridcell",onClick:w?function(e){return w(r,t,e)}:void 0,onKeyUp:w?function(e){return e.keyCode===h.ENTER&&w(r,t,e)}:void 0},e.props.renderWeek(r,t,n)),t.map(e.renderDay))}))))}}]),t}(u.Component);t.default=m},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function u(e){var t=(e.input,e.selectedDay,e.month,e.children),o=e.classNames,n=l(e,["input","selectedDay","month","children","classNames"]);return f.default.createElement("div",h({className:o.overlayWrapper},n),f.default.createElement("div",{className:o.overlay},t))}function c(e){return(0,v.isDate)(e)?e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate():""}function d(e){if("string"==typeof e){var t=e.split("-");if(3===t.length){var o=parseInt(t[0],10),n=parseInt(t[1],10)-1,r=parseInt(t[2],10);if(!(isNaN(o)||String(o).length>4||isNaN(n)||isNaN(r)||r<=0||r>31||n<0||n>=12))return new Date(o,n,r,12,0,0,0)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.HIDE_TIMEOUT=void 0;var p=function(){function e(e,t){for(var o=0;o0&&this.setState(t)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.clickTimeout),clearTimeout(this.hideTimeout),clearTimeout(this.inputFocusTimeout),clearTimeout(this.inputBlurTimeout),clearTimeout(this.overlayBlurTimeout)}},{key:"getInitialMonthFromProps",value:function(e){var t=e.dayPickerProps,o=e.format,n=void 0;return e.value&&(n=(0,v.isDate)(e.value)?e.value:e.parseDate(e.value,o,t.locale)),t.initialMonth||t.month||n||new Date}},{key:"getInitialStateFromProps",value:function(e){var t=e.dayPickerProps,o=e.formatDate,n=e.format,r=e.typedValue,a=e.value;return e.value&&(0,v.isDate)(e.value)&&(a=o(e.value,n,t.locale)),{value:a,typedValue:r,month:this.getInitialMonthFromProps(e),selectedDays:t.selectedDays}}},{key:"getInput",value:function(){return this.input}},{key:"getDayPicker",value:function(){return this.daypicker}},{key:"updateState",value:function(e,t,o){var n=this,a=this.props,i=a.dayPickerProps,s=a.onDayChange;this.setState({month:e,value:t,typedValue:""},(function(){if(o&&o(),s){var t=h({disabled:i.disabledDays,selected:i.selectedDays},i.modifiers),a=(0,m.getModifiersForDay)(e,t).reduce((function(e,t){return h({},e,r({},t,!0))}),{});s(e,a,n)}}))}},{key:"showDayPicker",value:function(){var e=this,t=this.props,o=t.parseDate,n=t.format,r=t.dayPickerProps,a=this.state,i=a.value;if(!a.showOverlay){var s=i?o(i,n,r.locale):this.getInitialMonthFromProps(this.props);this.setState((function(e){return{showOverlay:!0,month:s||e.month}}),(function(){e.props.onDayPickerShow&&e.props.onDayPickerShow()}))}}},{key:"hideDayPicker",value:function(){var e=this;!1!==this.state.showOverlay&&this.setState({showOverlay:!1},(function(){e.props.onDayPickerHide&&e.props.onDayPickerHide()}))}},{key:"hideAfterDayClick",value:function(){var e=this;this.props.hideOnDayClick&&(this.hideTimeout=setTimeout((function(){e.overlayHasFocus=!1,e.hideDayPicker()}),g))}},{key:"handleInputClick",value:function(e){this.showDayPicker(),this.props.inputProps.onClick&&(e.persist(),this.props.inputProps.onClick(e))}},{key:"handleInputFocus",value:function(e){var t=this;this.showDayPicker(),this.inputFocusTimeout=setTimeout((function(){t.overlayHasFocus=!1}),2),this.props.inputProps.onFocus&&(e.persist(),this.props.inputProps.onFocus(e))}},{key:"handleInputBlur",value:function(e){var t=this;this.inputBlurTimeout=setTimeout((function(){t.overlayHasFocus||t.hideDayPicker()}),1),this.props.inputProps.onBlur&&(e.persist(),this.props.inputProps.onBlur(e))}},{key:"handleOverlayFocus",value:function(e){e.preventDefault(),this.overlayHasFocus=!0,this.props.keepFocus&&this.input&&"function"==typeof this.input.focus&&this.input.focus()}},{key:"handleOverlayBlur",value:function(){var e=this;this.overlayBlurTimeout=setTimeout((function(){e.overlayHasFocus=!1}),3)}},{key:"handleInputChange",value:function(e){var t=this.props,o=t.dayPickerProps,n=t.format,r=t.inputProps,a=t.onDayChange,i=t.parseDate;r.onChange&&(e.persist(),r.onChange(e));var s=e.target.value;if(""===s.trim())return this.setState({value:s,typedValue:""}),void(a&&a(void 0,{},this));var l=i(s,n,o.locale);if(!l)return this.setState({value:s,typedValue:s}),void(a&&a(void 0,{},this));this.updateState(l,s)}},{key:"handleInputKeyDown",value:function(e){e.keyCode===b.TAB?this.hideDayPicker():this.showDayPicker(),this.props.inputProps.onKeyDown&&(e.persist(),this.props.inputProps.onKeyDown(e))}},{key:"handleInputKeyUp",value:function(e){e.keyCode===b.ESC?this.hideDayPicker():this.showDayPicker(),this.props.inputProps.onKeyUp&&(e.persist(),this.props.inputProps.onKeyUp(e))}},{key:"handleMonthChange",value:function(e){var t=this;this.setState({month:e},(function(){t.props.dayPickerProps&&t.props.dayPickerProps.onMonthChange&&t.props.dayPickerProps.onMonthChange(e)}))}},{key:"handleDayClick",value:function(e,t,o){var n=this,r=this.props,a=r.clickUnselectsDay,i=r.dayPickerProps,s=r.onDayChange,l=r.formatDate,u=r.format;if(i.onDayClick&&i.onDayClick(e,t,o),!(t.disabled||i&&i.classNames&&t[i.classNames.disabled])){if(t.selected&&a){var c=this.state.selectedDays;if(Array.isArray(c)){var d=(c=c.slice(0)).indexOf(e);c.splice(d,1)}else c&&(c=null);return this.setState({value:"",typedValue:"",selectedDays:c},this.hideAfterDayClick),void(s&&s(void 0,t,this))}var p=l(e,u,i.locale);this.setState({value:p,typedValue:"",month:e},(function(){s&&s(e,t,n),n.hideAfterDayClick()}))}}},{key:"renderOverlay",value:function(){var e=this,t=this.props,o=t.classNames,n=t.dayPickerProps,r=t.parseDate,a=t.formatDate,i=t.format,s=this.state,l=s.selectedDays,u=s.value,c=void 0;if(!l&&u){var d=r(u,i,n.locale);d&&(c=d)}else l&&(c=l);var p=void 0;n.todayButton&&(p=function(){return e.updateState(new Date,a(new Date,i,n.locale),e.hideAfterDayClick)});var v=this.props.overlayComponent;return f.default.createElement(v,{classNames:o,month:this.state.month,selectedDay:c,input:this.input,tabIndex:0,onFocus:this.handleOverlayFocus,onBlur:this.handleOverlayBlur},f.default.createElement(y.default,h({ref:function(t){return e.daypicker=t},onTodayButtonClick:p},n,{month:this.state.month,selectedDays:c,onDayClick:this.handleDayClick,onMonthChange:this.handleMonthChange})))}},{key:"render",value:function(){var e=this,t=this.props.component,o=this.props.inputProps;return f.default.createElement("div",{className:this.props.classNames.container,style:this.props.style},f.default.createElement(t,h({ref:function(t){return e.input=t},placeholder:this.props.placeholder},o,{value:this.state.value||this.state.typedValue,onChange:this.handleInputChange,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,onKeyUp:this.handleInputKeyUp,onClick:o.disabled?void 0:this.handleInputClick})),this.state.showOverlay&&this.renderOverlay())}}]),t}(f.default.Component);k.defaultProps={dayPickerProps:{},value:"",typedValue:"",placeholder:"YYYY-M-D",format:"L",formatDate:c,parseDate:d,showOverlay:!1,hideOnDayClick:!0,clickUnselectsDay:!1,keepFocus:!0,component:"input",inputProps:{},overlayComponent:u,classNames:{container:"DayPickerInput",overlayWrapper:"DayPickerInput-OverlayWrapper",overlay:"DayPickerInput-Overlay"}},t.default=k}]).default)},94149:function(e,t,o){"use strict";function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}function r(e,t){return n(e,t)}function a(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function i(e,t,o){return i=a()?Reflect.construct:function(e,t,o){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return o&&r(a,o.prototype),a},i.apply(null,arguments)}function s(e,t,o){return i.apply(null,arguments)}o.d(t,{Z:function(){return s}})},58013:function(e,t,o){"use strict";function n(){return n=Object.assign||function(e){for(var t=1;t Date: Mon, 8 Apr 2024 08:37:41 -0400 Subject: [PATCH 4/5] 9329-6ff54d2035653a4b.js.download Stock control supervisors --- 9329-6ff54d2035653a4b.js.download | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 9329-6ff54d2035653a4b.js.download diff --git a/9329-6ff54d2035653a4b.js.download b/9329-6ff54d2035653a4b.js.download new file mode 100644 index 0000000000..ceb6397b84 --- /dev/null +++ b/9329-6ff54d2035653a4b.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9329],{15466:function(n,e,t){t.d(e,{Z:function(){return p}});var i=t(40794),r=t(86692),o=t(92228),a=t(60138);function u(){var n=(0,o.Z)(["\n fragment AppConnection on AppConnection {\n banner\n canConnect\n id\n slug\n selectedApi\n title\n images {\n url128X128\n url64X64\n url32X32\n url16X16\n }\n hasStaleAuth\n }\n"]);return u=function(){return n},n}var c=(0,a.Ps)(u());function s(){var n=(0,o.Z)(["\n fragment App on App {\n categories {\n id\n name\n }\n canConnect\n currentImplementationId\n currentImplementationMeta {\n authType\n hasUpfrontFields\n id\n }\n description\n id\n image\n name\n primaryColor\n slug\n }\n"]);return s=function(){return n},n}var l=(0,a.Ps)(s());function d(){var n=(0,o.Z)(["\n ","\n ","\n\n query GetApp(\n $selectedApis: [String!]\n $serviceSlug: String!\n $isPrivate: Boolean!\n ) {\n appBySlug(slug: $serviceSlug) @skip(if: $isPrivate) {\n ...App\n }\n appConnections(\n isPrivate: $isPrivate\n limit: 1\n selectedApis: $selectedApis\n ) @include(if: $isPrivate) {\n edges {\n ...AppConnection\n }\n }\n }\n"]);return d=function(){return n},n}var f=(0,a.Ps)(d(),c,l),v=t(2784),p=function(n){var e=n.selectedApi,t=n.serviceSlug,o=(0,i.a)(f,{skip:!e&&!t,variables:{isPrivate:!!e,selectedApis:e?[e]:null,serviceSlug:t||""}}),a=o.data,u=o.error,c=o.loading,s=(0,v.useMemo)((function(){var n,e;return(null===a||void 0===a?void 0:a.appBySlug)||(null===a||void 0===a||null===(n=a.appConnections)||void 0===n||null===(e=n.edges)||void 0===e?void 0:e[0])}),[a]);return{app:s,error:(0,r.e$)(u),isLoading:c}}},94641:function(n,e,t){t.d(e,{c8:function(){return h},s3:function(){return v},ek:function(){return p}});var i=t(92228),r=t(60138);function o(){var n=(0,i.Z)(["\n fragment PrimaryAuth on Authentication {\n created\n description\n destinationSelectedApi\n id\n identifier\n isPrivate\n isShared\n isStale\n permissions {\n delete\n edit\n reconnect\n share\n test\n transfer\n }\n selectedApi\n sharedWithAll\n title\n }\n"]);return o=function(){return n},n}function a(){var n=(0,i.Z)(["\n fragment SecondaryAuth on Authentication {\n destinationSelectedApiImages {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n id\n owner {\n email\n id\n imageUrl\n name\n }\n selectedApiImages {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n sharedWith {\n ... on ShareTeam {\n description\n id\n imageUrl\n memberCount\n name\n type\n }\n ... on ShareMember {\n description\n email\n id\n imageUrl\n name\n type\n }\n }\n zapCount\n }\n"]);return a=function(){return n},n}function u(){var n=(0,i.Z)(["\n ","\n ","\n fragment Auth on Authentication {\n ...PrimaryAuth\n ...SecondaryAuth\n }\n"]);return u=function(){return n},n}var c=(0,r.Ps)(o()),s=(0,r.Ps)(a());(0,r.Ps)(u(),c,s);function l(){var n=(0,i.Z)(["\n ","\n\n query GetPrimaryAppAuthentications(\n $offset: Int\n $limit: Int\n $serviceSlug: String\n $selectedApi: String\n ) {\n authentications(\n offset: $offset\n limit: $limit\n serviceSlug: $serviceSlug\n selectedApi: $selectedApi\n ) {\n edges {\n ...PrimaryAuth\n }\n pageInfo {\n offset\n hasNextPage\n }\n totalCount\n }\n }\n"]);return l=function(){return n},n}function d(){var n=(0,i.Z)(["\n ","\n\n query GetSecondaryAppAuthentications(\n $offset: Int\n $limit: Int\n $serviceSlug: String\n $selectedApi: String\n ) {\n authentications(\n offset: $offset\n limit: $limit\n serviceSlug: $serviceSlug\n selectedApi: $selectedApi\n ) {\n edges {\n ...SecondaryAuth\n }\n pageInfo {\n offset\n hasNextPage\n }\n totalCount\n }\n }\n"]);return d=function(){return n},n}function f(){var n=(0,i.Z)(["\n ","\n ","\n\n query GetAppAuthentications(\n $offset: Int\n $limit: Int\n $serviceSlug: String\n $selectedApi: String\n ) {\n authentications(\n offset: $offset\n limit: $limit\n serviceSlug: $serviceSlug\n selectedApi: $selectedApi\n ) {\n edges {\n ...PrimaryAuth\n ...SecondaryAuth\n }\n pageInfo {\n hasNextPage\n }\n totalCount\n }\n }\n"]);return f=function(){return n},n}var v=(0,r.Ps)(l(),c),p=(0,r.Ps)(d(),s),h=(0,r.Ps)(f(),c,s)},60390:function(n,e,t){t.d(e,{Z:function(){return g}});var i=t(70865),r=t(66383),o=t(40794),a=t(2784),u=t(35591),c=t(86692),s=t(47842),l=t(96670),d=t(50930),f=function(n,e){return!n||e.id===n||(e.destinationAuths||[]).some((function(e){return e.id===n}))},v=function(n){var e=n.selectedApi,t=n.identifier;return"".concat(e,":").concat(t||"")},p=function(n,e,t){var r=(0,a.useMemo)((function(){var e=n.reduce((function(n,e){return e.destinationSelectedApi||n.add(v({selectedApi:e.selectedApi,identifier:e.identifier||null})),n}),new Set);return n.reduce((function(n,t){if(t.destinationSelectedApi){var r=v({selectedApi:t.selectedApi,identifier:t.identifier||null});if(e.has(r))return(0,l.Z)((0,i.Z)({},n),(0,s.Z)({},r,(0,d.Z)(n[r]||[]).concat([t])))}return n}),{})}),[n]),o=(0,a.useMemo)((function(){return n.filter((function(n){return!n.destinationSelectedApi||!r[v({selectedApi:n.selectedApi,identifier:n.identifier||null})]})).map((function(n){var e=v({selectedApi:n.selectedApi,identifier:n.identifier||null});return(0,l.Z)((0,i.Z)({},n),{destinationAuths:r[e]||[]})})).sort((function(n,e){return((null===n||void 0===n?void 0:n.title)||"").localeCompare((null===e||void 0===e?void 0:e.title)||"")}))}),[n,r]);return(0,a.useMemo)((function(){var n=[],i=[],r=[],a=!0,u=!1,c=void 0;try{for(var s,l=o[Symbol.iterator]();!(a=(s=l.next()).done);a=!0){var d,v,p=s.value;if(f(e,p))(null===p||void 0===p||null===(d=p.owner)||void 0===d?void 0:d.id)===t?n.push(p):(null===p||void 0===p||null===(v=p.sharedWith)||void 0===v?void 0:v.length)>0?i.push(p):r.push(p)}}catch(h){u=!0,c=h}finally{try{a||null==l.return||l.return()}finally{if(u)throw c}}return[n,i,r,o]}),[o,e,t])},h=t(94641),g=function(n){var e,t,s,l=n||{},d=l.id,f=l.limit,v=l.serviceSlug,g=l.userId,m=l.selectedApi,A=l.skip,S=(0,i.Z)({},f?{limit:f}:{},m?{selectedApi:m}:{},v?{serviceSlug:v}:{}),y=(0,o.a)(h.s3,{variables:S,skip:A,onError:function(n){(0,u.Z)("PrimaryAppAuth",n)}}),I=y.error,P=y.loading,w=y.refetch,$=y.fetchMore,Z=(0,o.a)(h.ek,{variables:S,skip:A,onError:function(n){(0,u.Z)("SecondaryAppAuth",n)}}).fetchMore,_=(0,o.a)(h.c8,{fetchPolicy:"cache-only",returnPartialData:!0,variables:S}).data,C=(null===_||void 0===_||null===(e=_.authentications)||void 0===e?void 0:e.totalCount)||0,b=!!(null===_||void 0===_||null===(t=_.authentications)||void 0===t||null===(s=t.pageInfo)||void 0===s?void 0:s.hasNextPage),k=(0,a.useMemo)((function(){var n;return(null===_||void 0===_||null===(n=_.authentications)||void 0===n?void 0:n.edges)||[]}),[_]),E=(0,r.Z)(p(k,d,g),4),U=E[0],F=E[1],M=E[2],X=E[3];return{allAuthentications:k,connectionsError:(0,c.e$)(I),hasConnections:(null===X||void 0===X?void 0:X.length)>0,hasNextPage:b,isConnectionsLoading:P,myAuthentications:U,onLoadMore:function(){$({variables:{offset:k.length}}),Z({variables:{offset:k.length}})},privateAuthentications:M,refetch:w,sharedAuthentications:F,totalConnectionCount:C}}},50293:function(n,e,t){t.d(e,{Z:function(){return y}});var i=t(98788),r=t(5163),o=t(2784),a=t(38716),u=t(47842),c=t(96459),s=t(9197),l=t(59251),d=function(){return new Promise((function(n,e){var t,i=window.location.origin,r=function(n){return window.open(n,"_blank","height=700,width=980,scrollbars=yes")}((t="/window-splash/",(0,l.v)("csrftoken")?t:(0,c.Sr)("/csrf/fix/",{next:t})));if(r){var o=function(e){e.origin===i&&"ready"===e.data&&(window.removeEventListener("message",o),n(r))};window.addEventListener("message",o,!1)}else e(new Error("Popup was blocked."))}))},f="_zapier_auth_id",v="authenticationSuccess",p="AUTH_FAILED_CONN",h=function(n,e){var t=new Error(e);return t.code=n,t},g=function(n){return(0,s.uz)(function(n){var e,t=n.serviceKey,i=n.accountId,r=n.isShared,o=n.authId,a=n.authIdentifier,s=n.destinationServiceKey,l=n.isForSignup;return(0,c.Sr)("/engine/auth/start/".concat(t,"/"),(e={},(0,u.Z)(e,"_zapier_account_id",i),(0,u.Z)(e,"_zapier_is_shared",r),(0,u.Z)(e,f,o),(0,u.Z)(e,"_zapier_expected_identifier",a),(0,u.Z)(e,"_zapier_destination_selected_api",s),(0,u.Z)(e,"for_signup",l),e),!0)}(n)).then((function(n){return n.url}))},m=function(n,e){return new Promise((function(t,i){var r,o=window.location.origin,a=!1,u=function(n){n.origin===o&&n.data.type===v&&(r=n.data.authId,a=!0)};window.addEventListener("message",u);var c=function(){n.closed?setTimeout((function(){window.removeEventListener("message",u),a&&(null!=r||e)||i(h(p,"Failed to connect account.")),t(r)}),0):setTimeout(c,1e3)};c()}))},A=function(){var n=(0,i.Z)((function(n){var e,t,i,o,a,s,l,v,p,A,S,y,I,P,w,$,Z,_,C;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return e=n.accountId,t=n.hasUpfrontFields,i=n.isShared,o=n.isOauth,a=n.serviceKey,s=n.authId,l=n.authIdentifier,v=n.destinationServiceKey,p=n.onError,A=void 0===p?function(){}:p,S=n.onTrack,y=void 0===S?function(){return Promise.resolve()}:S,I=n.isForSignup,P={accountId:e,isShared:i,serviceKey:a,authId:s,authIdentifier:l,destinationServiceKey:v,isForSignup:I},[4,d()];case 1:return w=r.sent(),[4,g(P)];case 2:$=r.sent(),Z=function(n,e,t,i){var r;return!t||i?(0,c.Sr)(n,(r={},(0,u.Z)(r,"isShared",e.isShared),(0,u.Z)(r,f,e.authId),r),!0):n}($,P,o,t),y("auth: redirect to first leg",{accountId:e,authId:s,isForSignup:I,isOauth:o,parameterizedUrl:Z,serviceKey:a});try{w.location=Z}catch(b){throw A(b),h("AUTH_POPUP_FAILURE","Could not change the popup location.")}r.label=3;case 3:return r.trys.push([3,5,,6]),[4,m(w,o)];case 4:return _=r.sent(),y("auth: connection success",{accountId:e,authId:s,conn:_,isForSignup:I,isOauth:o,parameterizedUrl:Z,serviceKey:a}),[2,_];case 5:throw C=r.sent(),y("auth: could not get connection",{accountId:e,authId:s,error:C.message,isForSignup:I,isOauth:o,parameterizedUrl:Z,serviceKey:a}),C;case 6:return[2]}}))}));return function(e){return n.apply(this,arguments)}}(),S=t(53736),y=function(){var n=(0,a.X8)(),e=(0,S.l)().createNotification,t=(0,o.useCallback)(function(){var t=(0,i.Z)((function(t,i){var o,a,u,c,s;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!(null===t||void 0===t?void 0:t.canConnect))throw new Error("".concat(null===t||void 0===t?void 0:t.name," does not require connections"));return[4,A({accountId:n,authId:null===i||void 0===i?void 0:i.id,authIdentifier:(null===i||void 0===i?void 0:i.identifier)||void 0,destinationServiceKey:(null===i||void 0===i?void 0:i.destinationSelectedApi)||void 0,hasUpfrontFields:Boolean(null===t||void 0===t||null===(o=t.currentImplementationMeta)||void 0===o?void 0:o.hasUpfrontFields),isOauth:"oauth"===(null===(a=t.currentImplementationMeta)||void 0===a?void 0:a.authType),isShared:(null===i||void 0===i?void 0:i.isShared)||void 0,serviceKey:(null===(u=t.currentImplementationMeta)||void 0===u?void 0:u.id)||t.selectedApi||void 0})];case 1:return c=r.sent(),[2,{app:t,connection:i,id:c}];case 2:return(null===(s=r.sent())||void 0===s?void 0:s.code)!==p&&e({message:s.toString(),type:"error"}),[3,3];case 3:return[2,{app:t,connection:i}]}}))}));return function(n,e){return t.apply(this,arguments)}}(),[n,e]);return t}},57037:function(n,e,t){var i=t(2784);e.Z=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,t=(0,i.useState)(n),r=t[0],o=t[1];return(0,i.useEffect)((function(){var t=setTimeout((function(){o(n)}),e);return function(){clearTimeout(t)}}),[e,n]),r}}}]); +//# sourceMappingURL=9329-6ff54d2035653a4b.js.map \ No newline at end of file From 13d831a5f1bc083c5fafeb27845066424a076ca0 Mon Sep 17 00:00:00 2001 From: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:39:16 -0400 Subject: [PATCH 5/5] 9346-39f2bba9f43e1d73.js.download Stock control supervisors --- 9346-39f2bba9f43e1d73.js.download | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 9346-39f2bba9f43e1d73.js.download diff --git a/9346-39f2bba9f43e1d73.js.download b/9346-39f2bba9f43e1d73.js.download new file mode 100644 index 0000000000..75f56ca21e --- /dev/null +++ b/9346-39f2bba9f43e1d73.js.download @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9346],{82116:function(e,n,t){var i=t(52903),r=t(28165),a=function(e){var n,t=e.items.map((function(n,t){return(0,i.tZ)("li",{"data-testid":e.testId,children:e.itemRenderer(n,t)},e.getKey(n,t))}));return(0,i.tZ)("ul",{css:(n=e.gap,(0,r.iv)("list-style-type:none;display:flex;flex-direction:column;gap:",n,"px;li > a{text-decoration:none !important;}","List.tsx--rootStyle")),id:e.id,children:t})};a.defaultProps={getKey:function(e,n){return n},gap:10},n.Z=a},42722:function(e,n,t){t.d(n,{Z:function(){return I}});var i=t(70865),r=t(96670),a=t(92228),o=t(52903),l=t(28165),s=t(39097),c=t.n(s),u=t(70776),d=t(98628),p=t(10391),h=t(70398),v=t(76635),m=t(29620),f=t.n(m),g=function(e){return Array.isArray(e)?e:[e]};function Z(){var e=(0,a.Z)(["\n display: block;\n text-decoration: none !important;\n background-color: ",";\n border: "," solid\n ",";\n border-radius: 5px;\n padding: 15px;\n transition: ",";\n &:hover,\n &:focus {\n background-color: ",";\n border: 1px solid ",";\n box-shadow: ",";\n outline: 0;\n }\n "]);return Z=function(){return e},e}function b(){var e=(0,a.Z)(["\n padding: 15px 20px;\n "]);return b=function(){return e},e}var y={blue:{base:{backgroundColor:u.w.acidWash,border:u.w.blue},hover:{backgroundColor:u.w.neutral100,border:u.w.blue}},gray:{base:{backgroundColor:u.w.neutral100,border:u.w.neutral300},hover:{backgroundColor:u.w.neutral100,border:u.w.neutral300}},red:{base:{backgroundColor:u.w.neutral100,border:u.w.error400},hover:{backgroundColor:u.w.neutral100,border:u.w.error400}},white:{base:{backgroundColor:u.w.neutral100,border:u.w.blue},hover:{backgroundColor:u.w.neutral100,border:u.w.blue}}},x=function(e){return(0,h.uq)({mobile:(0,l.iv)(Z(),y[e.color].base.backgroundColor,"red"===e.color?"2px":"1px",y[e.color].base.border,d.f.transitionValue,y[e.color].hover.backgroundColor,y[e.color].hover.border,p.f.elevation5),tablet:(0,l.iv)(b())})},A=(0,l.iv)("cursor:pointer;","ListItem.tsx--clickableStyle"),C=function(e){var n,t,a=!e.href&&e.onClick?{onClick:e.onClick,onKeyDown:(n=["enter","space"],t=function(n){e.onClick&&e.onClick(n)},function(e){var i=g(n);(0,v.some)(i,(function(n){return e.keyCode===Number(f()(n))}))&&t(e)}),role:"button",tabIndex:0}:{};return e.href?(0,o.tZ)(c(),(0,r.Z)((0,i.Z)({href:e.href,target:e.target,legacyBehavior:!1},a),{children:(0,o.tZ)("span",{css:x(e),children:e.children})})):(0,o.tZ)("div",(0,r.Z)((0,i.Z)({css:[x(e),e.onClick&&A]},a),{children:e.children}))};C.defaultProps={color:"gray"};var I=C},15879:function(e,n,t){t.d(n,{Z:function(){return C}});var i=t(92228),r=t(52903),a=t(19928),o=t.n(a),l=t(28165),s=t(47043),c=t(55414),u=t(76635),d=["","k","M","B","T",""],p=function(e){if(!e||e<1&&e>-1)return(0,u.isNumber)(e)?e.toString():null;var n=Math.floor(Math.log(Math.abs(e))/Math.log(1e3)),t=d[Math.min(n,d.length)],i=String(Math.abs(e)/Math.pow(1e3,n)).substring(0,3),r=i.endsWith(".")?i.slice(0,-1):i;return"".concat(e<0?"-":"").concat(r).concat(t)},h=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!e)return 0;var t=Math.floor(Math.log10(Math.abs(e))),i=t-n,r=e/Math.pow(10,i),a=Math[e<0?"floor":"ceil"](r);return parseFloat((a*Math.pow(10,i)).toPrecision(12))},v=function(e){var n=e.children,t=e.infinityLabel,i=void 0===t?"Infinity":t,a=e.isAbbreviated,o=void 0!==a&&a,l=e.isFriendly,s=void 0!==l&&l,c=e.isNegativeOneInfinity,d=void 0!==c&&c,v=e.maxDecimals,m=void 0===v?2:v,f=e.minDecimals,g=void 0===f?0:f,Z=e.nanLabel,b=void 0===Z?"NaN":Z,y=n;return(0,u.isNaN)(y)||!(0,u.isNumber)(y)?(0,r.tZ)("span",{children:b}):!(0,u.isFinite)(y)||d&&-1===y?(0,r.tZ)("span",{children:i}):(s&&(y=h(y)),y=o?p(y):y.toLocaleString(void 0,{maximumFractionDigits:m,minimumFractionDigits:g}),(0,r.tZ)("span",{title:o?n.toLocaleString():void 0,children:y}))},m=t(70398),f=t(49187);function g(){var e=(0,i.Z)(["\n align-items: center;\n display: grid;\n grid-gap: 5px;\n grid-template-columns: auto 1fr;\n "]);return g=function(){return e},e}function Z(){var e=(0,i.Z)(["\n grid-gap: 0px;\n grid-template-columns: 1fr;\n text-align: center;\n "]);return Z=function(){return e},e}function b(){var e=(0,i.Z)(["\n height: 20px;\n overflow: hidden;\n "]);return b=function(){return e},e}function y(){var e=(0,i.Z)(["\n height: 40px;\n "]);return y=function(){return e},e}var x=(0,m.uq)({mobile:(0,l.iv)(g()),desktop:(0,l.iv)(Z())}),A=(0,m.uq)({mobile:(0,l.iv)(b()),desktop:(0,l.iv)(y())}),C=function(e){var n=e.isLoading,t=e.label,i=e.count;return n?(0,r.tZ)("div",{css:A,children:(0,r.tZ)(s.q,{height:"100%",width:"100%"})}):(0,r.BX)("div",{css:[x,(0,f.f)(e.label.toLowerCase())],children:[(0,r.tZ)(c.x,{type:"paragraph3Bold",children:(0,r.tZ)(v,{children:i||0})}),(0,r.tZ)(c.x,{tag:"div",type:"smallPrint1",children:o()(t,i)})]})}},95207:function(e,n,t){t.d(n,{Z:function(){return Xt}});var i=t(52903),r=t(28165),a=t(5632),o=t(20271),l=t(60943),s=t(55414),c=t(76128),u=t(56119),d=t(66415),p=t(47043),h=t(2784),v=t(53939),m=t(87416),f=t(82116),g=t(70865),Z=t(8736),b=function(e,n){return(0,Z.emit)((0,g.Z)({},e||{}),n)},y=t(98788),x=t(96670),A=t(66383),C=t(5163),I=t(3842),S=t(33379),w=t(53736),k=t(50293),T=t(15466),D=t(94641),B=t(92228),M=t(60138);function L(){var e=(0,B.Z)(["\n query GetAuth($id: ID!) {\n authentication(id: $id) {\n id\n isStale\n }\n }\n"]);return L=function(){return e},e}function z(){var e=(0,B.Z)(["\n mutation DeleteAuthentication($id: ID!) {\n deleteAuthentication(id: $id)\n }\n"]);return z=function(){return e},e}function P(){var e=(0,B.Z)(["\n fragment TestAuth on TestAuthResponse {\n id\n errors\n success\n }\n"]);return P=function(){return e},e}function X(){var e=(0,B.Z)(["\n ","\n mutation TestAuth($id: ID!) {\n testAuth(id: $id) {\n ...TestAuth\n }\n }\n"]);return X=function(){return e},e}function $(){var e=(0,B.Z)(["\n mutation UpdateAuthTitle($id: ID!, $title: String!) {\n updateAuthTitle(id: $id, title: $title) {\n id\n title\n }\n }\n"]);return $=function(){return e},e}var R=(0,M.Ps)(L()),E=(0,M.Ps)(z()),F=(0,M.Ps)(P()),_=(0,M.Ps)(X(),F),q=(0,M.Ps)($()),O=function(e){return Array.isArray(e)&&e.length>0};function H(e){if(!e)return"";var n=function(e){var n=e.graphQLErrors;if(O(n)){var t,i,r,a=n[0],o=null===a||void 0===a||null===(t=a.extensions)||void 0===t?void 0:t.response,l=null===o||void 0===o||null===(i=o.body)||void 0===i?void 0:i.errors;if(O(l))return l[0]||"";var s=null===o||void 0===o||null===(r=o.body)||void 0===r?void 0:r.detail,c=null===o||void 0===o?void 0:o.status,u=null===o||void 0===o?void 0:o.statusText;return c&&u?"".concat(c,": ").concat(u).concat(s?" - ".concat(s):""):a.message||""}return""}(e)||function(e){var n,t=null===(n=e.networkError)||void 0===n?void 0:n.message;return t?"Network error: ".concat(t):""}(e)||e.toString()||"";return(null===n||void 0===n?void 0:n.message)||n}var W,N,Y,U,j=function(e){var n=e.cache,t=e.query,i=e.updater,r=e.variables;try{var a=n.readQuery({query:t,variables:r});if(!a)return;var o=i(a);n.writeQuery({data:o,query:t,variables:r})}catch(l){console.warn(l)}},K=function(e){var n=e.connection,t=e.serviceSlug,i=e.selectedApi,r=(0,w.l)().createNotification,a=(0,k.Z)(),o=(0,T.Z)({selectedApi:i,serviceSlug:t||""}).app,l=(0,A.Z)((0,I.t)(R),1)[0],s=(0,A.Z)((0,S.D)(E,{onCompleted:function(){r({message:"Successfuly deleted connection.",type:"success"})},onError:function(e){r({message:"Error deleting connection. ".concat(H(e)),type:"error"})},update:function(e,n){j({cache:e,query:D.c8,updater:function(e){var t;return{authentications:(0,x.Z)((0,g.Z)({},e.authentications),{edges:null===(t=e.authentications)||void 0===t?void 0:t.edges.filter((function(e){var t;return e.id!==(null===(t=n.data)||void 0===t?void 0:t.deleteAuthentication)})),totalCount:e.authentications.totalCount-1})}},variables:(0,g.Z)({},t?{serviceSlug:t}:{},i?{selectedApi:i}:{})})}}),1),c=s[0],u=(0,A.Z)((0,S.D)(_,{variables:{id:n.id},onError:function(){r({message:"Error testing connection.",type:"error"})}}),2),d=u[0],p=u[1],v=p.data,m=p.loading,f=(0,A.Z)((0,S.D)(q,{onError:function(){r({message:"Error updating name. Please try again.",type:"error"})}}),1)[0],Z=(0,h.useState)(0)[1],b=(0,h.useMemo)((function(){return null===v||void 0===v?void 0:v.testAuth}),[v]),B=(0,h.useRef)(b);(0,h.useEffect)((function(){b!==B.current&&(B.current=b,Z((function(e){return e+1})),(null===b||void 0===b?void 0:b.success)&&setTimeout((function(){B.current=void 0,Z((function(e){return e+1}))}),5e3))}),[b]);var M=(0,h.useCallback)((function(){c({variables:{id:null===n||void 0===n?void 0:n.id}})}),[c,n.id]),L=(0,h.useCallback)((0,y.Z)((function(){var e,t;return(0,C.__generator)(this,(function(i){switch(i.label){case 0:return[4,a(o,n)];case 1:return e=i.sent(),(null===(t=e.connection)||void 0===t?void 0:t.id)&&l({variables:{id:n.id}}),[2]}}))})),[a,l,n,o]);return{isTesting:m,onDeleteAuth:M,onReconnectAuth:L,onTestAuth:d,onUpdateAuthTitle:(0,h.useCallback)((function(e){f({optimisticResponse:{updateAuthTitle:{__typename:"Authentication",id:n.id,title:e}},variables:{id:n.id,title:e}})}),[f,n.id]),testAuthResult:B.current}},V=t(56675);function G(){var e=(0,B.Z)(["\n fragment PrimaryAuth on Authentication {\n created\n description\n destinationSelectedApi\n id\n identifier\n isPrivate\n isShared\n isStale\n permissions {\n delete\n edit\n reconnect\n share\n test\n transfer\n }\n selectedApi\n sharedWithAll\n title\n }\n"]);return G=function(){return e},e}function J(){var e=(0,B.Z)(["\n fragment SecondaryAuth on Authentication {\n destinationSelectedApiImages {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n id\n owner {\n email\n id\n imageUrl\n name\n }\n selectedApiImages {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n sharedWith {\n ... on ShareTeam {\n description\n id\n imageUrl\n memberCount\n name\n type\n }\n ... on ShareMember {\n description\n email\n id\n imageUrl\n name\n type\n }\n }\n zapCount\n }\n"]);return J=function(){return e},e}function Q(){var e=(0,B.Z)(["\n ","\n ","\n fragment Auth on Authentication {\n ...PrimaryAuth\n ...SecondaryAuth\n }\n"]);return Q=function(){return e},e}!function(e){e.admin="admin",e.member="member",e.owner="owner",e.super_admin="super_admin"}(W||(W={})),function(e){e.member="member",e.team="team"}(N||(N={})),function(e){e.asc="asc",e.desc="desc"}(Y||(Y={})),function(e){e.transfer="transfer",e.workflow="workflow"}(U||(U={}));var ee=(0,M.Ps)(G()),ne=(0,M.Ps)(J()),te=(0,M.Ps)(Q(),ee,ne);function ie(){var e=(0,B.Z)(["\n ","\n\n mutation CreateAuthMembership($id: ID!, $memberId: ID!) {\n createAuthMembership(id: $id, memberId: $memberId) {\n ...Auth\n }\n }\n"]);return ie=function(){return e},e}function re(){var e=(0,B.Z)(["\n ","\n\n mutation DeleteAuthMembership($id: ID!, $memberId: ID!) {\n deleteAuthMembership(id: $id, memberId: $memberId) {\n ...Auth\n }\n }\n"]);return re=function(){return e},e}function ae(){var e=(0,B.Z)(["\n ","\n\n mutation CreateAuthTeamship($id: ID!, $teamId: ID!) {\n createAuthTeamship(id: $id, teamId: $teamId) {\n ...Auth\n }\n }\n"]);return ae=function(){return e},e}function oe(){var e=(0,B.Z)(["\n ","\n\n mutation DeleteAuthTeamship($id: ID!, $teamId: ID!) {\n deleteAuthTeamship(id: $id, teamId: $teamId) {\n ...Auth\n }\n }\n"]);return oe=function(){return e},e}function le(){var e=(0,B.Z)(["\n mutation SetAuthIsShared($id: ID!, $isShared: Boolean!) {\n setAuthIsShared(id: $id, isShared: $isShared) {\n id\n isShared\n }\n }\n"]);return le=function(){return e},e}function se(){var e=(0,B.Z)(["\n mutation transferAuth($id: ID!, $customuserId: ID!) {\n transferAuth(id: $id, customuserId: $customuserId) {\n id\n customuserId\n }\n }\n"]);return se=function(){return e},e}var ce=(0,M.Ps)(ie(),te),ue=(0,M.Ps)(re(),te),de=(0,M.Ps)(ae(),te),pe=(0,M.Ps)(oe(),te),he=(0,M.Ps)(le()),ve=(0,M.Ps)(se()),me=function(e,n,t,i,r){var a=n.id,o=n.isShared,l=(0,w.l)().createNotification,s=(0,V.x)(),c=(0,A.Z)((0,S.D)(ce),1)[0],u=(0,A.Z)((0,S.D)(ue),1)[0],d=(0,A.Z)((0,S.D)(de),1)[0],p=(0,A.Z)((0,S.D)(pe),1)[0],v=(0,A.Z)((0,S.D)(he),1)[0],m=(0,A.Z)((0,S.D)(ve,{onCompleted:function(){l({message:"Connection ownership successfully changed",type:"success"}),t()},onError:function(){l({message:"Connection ownership successfully changed",type:"success"}),t()}}),1)[0],f=(0,h.useCallback)((function(e,t,i){t===N.member?i?c({variables:{id:a,memberId:e}}):u({optimisticResponse:{deleteAuthMembership:(0,x.Z)((0,g.Z)({},n),{sharedWith:n.sharedWith.filter((function(n){return n.id!==e}))})},variables:{id:a,memberId:e}}):i?d({variables:{id:a,teamId:e}}):p({optimisticResponse:{deleteAuthTeamship:(0,x.Z)((0,g.Z)({},n),{sharedWith:n.sharedWith.filter((function(n){return n.id!==e}))})},variables:{id:a,teamId:e}})}),[n,a,c,d,u,p]);return{onToggleAll:(0,h.useCallback)((function(e){e?d({optimisticResponse:{createAuthTeamship:(0,x.Z)((0,g.Z)({},n),{sharedWithAll:!0})},variables:{id:a,teamId:"all"}}):p({optimisticResponse:{deleteAuthTeamship:(0,x.Z)((0,g.Z)({},n),{sharedWithAll:!1})},variables:{id:a,teamId:"all"}})}),[n,d,a,p]),onToggleIsShared:(0,h.useCallback)((function(){v({optimisticResponse:{__typename:"Authentication",id:a,isShared:!o},variables:{id:a,isShared:!o}})}),[a,o,v]),onToggleShare:f,onTransferAuth:(0,h.useCallback)((function(n){(0,y.Z)((function(){return(0,C.__generator)(this,(function(t){switch(t.label){case 0:return[4,m({optimisticResponse:{transferAuth:{__typename:"Authentication",customuserId:n,id:a}},variables:{customuserId:n,id:a}})];case 1:return t.sent(),s.query({fetchPolicy:"network-only",query:D.c8,variables:{accountId:e,selectedApi:r,serviceSlug:i}}),[2]}}))}))()}),[e,s,a,r,i,m])}},fe=t(3e3),ge=t(70776),Ze=t(32945),be=t(64476),ye=t(12687),xe=t(47553),Ae=t(73223),Ce=t(25277),Ie=t(42722),Se=t(15879),we=t(70398),ke=function(e){return Array.isArray(e)&&e.length>0},Te=t(49187),De=t(71937),Be=t(25155),Me=t(19928),Le=t.n(Me),ze=function(e,n){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Math.abs((0,Be.differenceInWeeks)(e,n));if(i>0&&i<4){var r=Math.abs((0,Be.differenceInDays)(e,n))%7,a=r<4?i:i+1,o=(0,Be.isAfter)(n,e),l=t&&o?"in ":"",s=t&&!o?" ago":"";return"".concat(l).concat(a," ").concat(Le()("week",a)).concat(s)}return(0,Be.distanceInWordsStrict)(e,n,{addSuffix:t})},Pe=(0,h.createContext)({}),Xe=function(){try{return(new Intl.DateTimeFormat).resolvedOptions().timeZone}catch(e){return null}},$e=t(82067),Re=function(e){return"number"===typeof e&&e<1e10&&(e*=1e3),new Date(e)},Ee={default:"MMMM DD, YYYY",short:"MMM DD, YYYY",exhaustive:"YYYY-MM-DD HH:mm:ss",iso:"YYYY-MM-DDTHH:mm:ssZ"},Fe=function(e,n,t){var i=Re(e);if("iso"===n)return i.toISOString();try{return(0,$e.default)(i,Ee[n]||n,t?{timezone:t}:void 0)}catch(r){try{return i.toLocaleDateString("en-US",t?{timeZone:t}:void 0)}catch(a){return Fe(e,n)}}},_e=Fe,qe=function(e){var n=e.date,t=e.formatter,r=void 0===t?ze:t,a=e.hasSuffix,o=(0,h.useContext)(Pe).timezone||Xe()||"UTC",l=_e(n,"iso",o);return(0,i.tZ)("time",{dateTime:l,title:l,children:r(Date.now(),n,!1!==a)})},Oe=(0,r.iv)("border-top:1px solid ",ge.w.neutral300,";display:grid;grid-gap:20px;margin-top:20px;padding-top:20px;","DownstreamConnections.tsx--rootStyle"),He=(0,r.iv)("display:grid;grid-gap:20px;","DownstreamConnections.tsx--listStyle"),We=function(e){return(0,i.BX)("div",{css:Oe,children:[(0,i.tZ)(s.x,{type:"smallPrint1Bold",children:"Gmail Approved Data Destinations"}),(0,i.tZ)("ul",{css:He,children:(e.connection.destinationAuths||[]).map((function(n){return(0,i.tZ)("li",{children:(0,i.tZ)(Bt,{accountId:e.accountId,connection:n,isDownstream:!0,isPersonal:e.isPersonal,isTeam:e.hasTeams,isAdmin:e.isAdmin})},n.id)}))})]})},Ne=t(76635),Ye=t(22211),Ue=t(87593),je=t(20110),Ke=t(61854),Ve=t(26215);var Ge=/\[([^[]+)\]\(([^)]+)\)/g;var Je=(0,r.iv)("min-width:200px;","TestErrorMessage.tsx--rootStyle");var Qe=function(e){var n=function(e){for(var n,t,r,a,o,l=e.trim(),s=0,c=[];null!==(n=Ge.exec(l));)0===s&&c.push(l.slice(0,n.index)),c.push((r=n[1],a=n[2],(0,i.tZ)(Ve.r,{href:a,children:r}))),t=n,s++;return c.length>0?(c.push(l.slice((null===t||void 0===t?void 0:t.index)+(null===t||void 0===t||null===(o=t[0])||void 0===o?void 0:o.length))),c):[l]}(e);return(0,i.tZ)("div",{css:Je,children:n})},en=t(28952),nn=t(66266),tn=t(61446),rn=t(96963),an=t(59712),on=t(90446),ln=t(41273),sn=t(66830),cn=t(15504),un=t(74936),dn=t(75725),pn=t(29476),hn=t(16181),vn=(0,r.iv)("display:grid;","ShareMember.tsx--descCss"),mn=(0,r.iv)("padding:10px;","ShareMember.tsx--menuCss"),fn=(0,r.iv)(fe.ZT.paragraph3Bold," color:",ge.w.neutral800,";text-transform:none;","ShareMember.tsx--nameCss"),gn=(0,r.iv)("align-items:center;cursor:initial;display:grid;grid-gap:10px;grid-template-columns:40px 1fr auto;min-width:min(80vw,600px);","ShareMember.tsx--rootStyle"),Zn=(0,r.iv)("grid-template-columns:40px 1fr auto 40px;","ShareMember.tsx--rootWithMenu");var bn=function(e){var n=(0,hn.gn)().isAdmin,t=(0,h.useState)(!1),r=t[0],a=t[1],o=(0,h.useState)(!1),l=o[0],c=o[1];return(0,i.BX)("div",{css:[gn,!e.isOwner&&Zn],children:[(0,i.tZ)(ln.q,{name:e.name,size:40,url:e.imageUrl}),(0,i.BX)("div",{css:vn,children:[(0,i.tZ)("span",{css:fn,children:e.name}),(0,i.tZ)(s.x,{type:"smallPrint3",children:e.description})]}),(0,i.tZ)(s.x,{type:"smallPrint3",children:e.isOwner?"Owner":"Has access"}),!e.isOwner&&(e.canTransfer||e.canTransfer)&&(0,i.BX)("div",{css:{position:"relative"},children:[(0,i.tZ)(sn.h,{icon:"navMoreHoriz",onClick:function(){return a(!0)}}),r&&(0,i.tZ)(cn.f,{align:"right",intersectHeight:140,minWidth:"170px",onClickOutside:function(){return a(!1)},children:(0,i.BX)("div",{css:mn,children:[(0,i.BX)(un.v,{ariaLabel:"Zap actions",children:[e.canEdit&&(0,i.tZ)(dn.s,{onClick:e.onRemove,children:"Remove"},"remove"),e.canTransfer&&(0,i.tZ)("div",{onMouseEnter:function(){return c(!0)},onMouseLeave:function(){return c(!1)},children:(0,i.tZ)(dn.s,{onClick:e.onTransfer,children:"Make Owner"},"transfer")})]}),l&&!n&&(0,i.tZ)(pn.u,{allowMultiline:!0,position:"northeast",children:"You will lose access to this connection when you transfer ownership."})]})})]})]})},yn=t(25914),xn=t(57037);function An(){var e=(0,B.Z)(["\n query ShareSearch($accountId: Int!, $search: String, $excludeTeams: Boolean) {\n searchShare(\n accountId: $accountId\n search: $search\n excludeTeams: $excludeTeams\n ) {\n description\n id\n imageUrl\n name\n type\n }\n }\n"]);return An=function(){return e},e}var Cn=(0,M.Ps)(An()),In=function(e){var n=e.accountId,t=e.excludeTeams,i=void 0!==t&&t,r=(0,A.Z)((0,I.t)(Cn),2),a=r[0],o=r[1],l=o.data,s=o.loading;return{error:o.error,isLoading:s,onSearch:function(e){e&&n&&a({variables:{accountId:n,excludeTeams:i,search:e}})},searchResults:(null===l||void 0===l?void 0:l.searchShare)||[]}};var Sn=function(e){var n=(0,h.useState)(0),t=n[0],r=n[1],a=(0,h.useState)(""),o=a[0],l=a[1],s=(0,xn.Z)(o,300),c=In({accountId:e.accountId,excludeTeams:e.excludeTeams}),u=c.isLoading,d=c.onSearch,p=c.searchResults,v=e.memberExclusions?p.filter((function(n){var t;return"member"!==n.type||!(null===(t=e.memberExclusions)||void 0===t?void 0:t.includes(n.id))})):p;return(0,h.useEffect)((function(){e.onInputValueChange&&e.onInputValueChange(s),d(s)}),[s]),(0,i.tZ)(yn.Z,{ariaLabel:"Member ".concat(e.excludeTeams?"":"and team ","search"),autoComplete:"off",filterItems:function(e,n){return n},getKeyForItem:function(e){return e.id},getLabelForItem:function(e){return"".concat(e.name," - ").concat(e.description)},initialSelectedItem:e.value,inputId:e.inputId,isBusy:u,isDisabled:e.isDisabled,isErrored:e.isErrored,items:u?[]:v,keepInputValueOnBlur:e.keepValueOnBlur,labelId:e.labelId,menuAriaLabel:"list of members".concat(e.excludeTeams?"":"or teams"),onChange:function(n){e.onChange(n),e.value||r(t+1)},onInputValueChange:function(e){return l(e)},placeholder:e.placeholder||"Enter email".concat(e.excludeTeams?" or name":", name, or team name"),renderIcon:function(e){return e?(0,i.tZ)(ln.q,{ariaHidden:!0,name:e.name,size:25,url:e.imageUrl}):null},size:e.size},t)},wn=t(38716),kn=(0,r.iv)("display:grid;grid-gap:1px;","AuthSharing.tsx--detailsCss"),Tn=(0,r.iv)("align-items:center;display:grid;grid-auto-flow:column;justify-content:space-between;","AuthSharing.tsx--footerCss"),Dn=(0,r.iv)("align-items:center;display:grid;grid-gap:10px;grid-template-columns:40px 1fr;","AuthSharing.tsx--headerCss"),Bn=(0,r.iv)("display:grid;grid-gap:10px;","AuthSharing.tsx--membersCss"),Mn=(0,r.iv)("display:grid;grid-gap:22px;padding:10px;","AuthSharing.tsx--rootCss");function Ln(e){var n,t,i;return e.sharedWithAll?"Shared with everyone":0===(null===(n=e.sharedWith)||void 0===n?void 0:n.length)?"Share":"Shared with ".concat((null===(t=e.sharedWith)||void 0===t?void 0:t.length)||0," ").concat(Le()("member",(null===(i=e.sharedWith)||void 0===i?void 0:i.length)||0))}var zn=function(e){var n,t,r,o,l,c,u=e.accountId,d=e.auth,p=e.onClose;(0,an.jj)("open AuthSharing modal"),u=(0,wn.X8)();var v=(0,h.useCallback)((function(){(0,on.Z)({account_id:u,event_action:"click",interaction_name:"share_connection_button",option_selected:"Share",system_name:"reporting",interaction_raw_text:"Share"},Ae.rw)}),[u]),m=(0,a.useRouter)().query,g=m.selectedApi?m.selectedApi:"",Z=m.serviceSlug?m.serviceSlug:"",b=me(u,d,p,Z,g),y=b.onToggleAll,x=b.onToggleShare,A=b.onTransferAuth;v();var C=(d.sharedWith||[]).filter((function(e){return"all"!==e.id}));return(0,i.tZ)(en.u,{onClosed:p,children:(0,i.tZ)(nn.hz,{children:(0,i.BX)("div",{css:Mn,children:[(0,i.BX)("div",{css:Dn,children:[(0,i.tZ)(be.A,{alt:d.title,serviceName:d.selectedApi,size:40,src:(null===d||void 0===d||null===(n=d.selectedApiImages)||void 0===n?void 0:n.url128X128)||Ae.hn}),(0,i.BX)("div",{css:kn,children:[(0,i.tZ)(s.x,{type:"paragraph3Bold",children:d.title}),(0,i.tZ)(s.x,{type:"smallPrint3",children:Ln(d)})]})]}),!d.sharedWithAll&&d.permissions.share&&(0,i.tZ)(Sn,{accountId:Number(u),excludeTeams:!1,keepValueOnBlur:!1,memberExclusions:[null===(t=d.owner)||void 0===t?void 0:t.id],onChange:function(e){e&&x(e.id,e.type,!0)},placeholder:"Share with members and teams",value:null}),(0,i.BX)("div",{css:Bn,children:[(0,i.tZ)(bn,{canEdit:!1,canTransfer:!1,description:(null===(r=d.owner)||void 0===r?void 0:r.email)||null,imageUrl:(null===(o=d.owner)||void 0===o?void 0:o.imageUrl)||null,isOwner:!0,name:(null===(l=d.owner)||void 0===l?void 0:l.name)||"Owner"},null===(c=d.owner)||void 0===c?void 0:c.id),!d.sharedWithAll&&C.length>0&&(0,i.tZ)(f.Z,{gap:10,itemRenderer:function(e){return(0,i.tZ)(bn,{canEdit:d.permissions.share,canTransfer:d.permissions.transfer,description:e.description,imageUrl:e.imageUrl,name:e.name,onRemove:function(){return x(e.id,e.type,!1)},onTransfer:function(){return A(e.id)}})},items:C})]}),(0,i.BX)("div",{css:Tn,children:[(0,i.BX)(tn.l,{isDisabled:!d.permissions.share,children:[(0,i.tZ)(rn.X,{checked:d.sharedWithAll,disabled:!d.permissions.share,name:"sharedWithAll",onChange:function(e){y(e.currentTarget.checked)},value:"sharedWithAll"}),"Share with everyone"]}),(0,i.tZ)(je.z,{onClick:p,children:"Done"})]})]})})})};var Pn=function(e){var n,t,r,a,o=e.connection,l=e.accountId,s=(0,h.useState)(!1),c=s[0],u=s[1],d=(0,h.useCallback)((function(){return u((function(e){return!e}))}),[]),p=(null===(n=o.sharedWith)||void 0===n?void 0:n.length)>0,v=(r=o.sharedWithAll,a=(null===(t=o.sharedWith)||void 0===t?void 0:t.length)||0,r?"Everyone":0===a?"Share":"".concat(a," ").concat(Le()("member",a)));return(0,i.BX)("div",{onClick:function(e){return e.stopPropagation()},children:[(0,i.tZ)(je.z,{color:"secondary",iconBefore:p?"personGroup":"actionLock",onClick:function(e){e.stopPropagation(),d()},size:"small",children:v}),c&&(0,i.tZ)(zn,{accountId:l,auth:o,onClose:d})]})},Xn=(0,r.iv)("align-items:center;display:grid;grid-auto-flow:column;grid-gap:7px;justify-content:flex-start;","useSharingOrTesting.tsx--messageStyle"),$n=function(e){var n,t,r,a,o=e.accountId,l=e.connection,c=e.hasTeams,u=e.onReconnectAuth,d=e.testAuthLoading,p=e.testAuthResult;return d?(0,i.BX)("div",{css:Xn,children:[(0,i.tZ)(Ye.$,{size:"small"}),(0,i.tZ)(s.x,{color:"neutral700",fontWeight:700,type:"smallPrint1",children:"Testing"})]}):!(null===p||void 0===p?void 0:p.success)&&ke(null===p||void 0===p?void 0:p.errors)?l.permissions.reconnect?(0,i.tZ)(Ue.p,{allowMultilineTooltip:!0,content:Qe(null===p||void 0===p||null===(n=p.errors)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.title),isTooltipInteractive:!0,children:function(e){var n=e.childProps;return(0,i.tZ)(je.z,(0,x.Z)((0,g.Z)({},n),{color:"danger",onClick:u,size:"small",children:"Reconnect app"}))}}):(0,i.tZ)(Ue.p,{allowMultilineTooltip:!0,content:Qe(null===p||void 0===p||null===(r=p.errors)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.title),isTooltipInteractive:!0,children:function(e){var n=e.childProps;return(0,i.BX)("div",(0,x.Z)((0,g.Z)({},n),{css:Xn,children:[(0,i.tZ)(Ke.J,{color:"error400",name:"alertInfo",size:16}),(0,i.tZ)(s.x,{color:"error400",type:"paragraph3Semibold",children:"Reconnect needed"})]}))}}):l.isStale?l.permissions.reconnect?(0,i.tZ)(je.z,{color:"danger",onClick:u,size:"small",children:"Reconnect app"}):(0,i.BX)("div",{css:Xn,children:[(0,i.tZ)(Ke.J,{color:"error400",name:"alertInfo",size:16}),(0,i.tZ)(s.x,{color:"error400",type:"paragraph3Semibold",children:"Reconnect needed"})]}):(null===p||void 0===p?void 0:p.success)?(0,i.BX)("div",{css:Xn,children:[(0,i.tZ)(Ke.J,{color:"success500",name:"formCheckCircle",size:16}),(0,i.tZ)(s.x,{color:"success500",type:"paragraph3Semibold",children:"Test successful"})]}):l.permissions.share&&c&&!(0,Ne.isUndefined)(l.sharedWith)?(0,i.tZ)(Pn,{accountId:o,connection:l}):null},Rn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0,i=!!n,r=i?"private/":"";return"".concat(Ae.Xu,"/").concat(r).concat(e||n,"/zaps?authId=").concat(t)},En=function(e){var n=e.connection,t=e.hasTeams,i=e.isDownstream,r=e.onClickChangeOwnership,a=e.onClickDelete,o=e.onClickRename,l=e.onReconnectAuth,s=e.onTestAuth,c=e.selectedApi,u=e.serviceSlug;return(0,h.useMemo)((function(){return[n.permissions.transfer&&t?{avroEvent:"change_ownership",onClick:r,text:"Change ownership",icon:"arrowConnect"}:void 0,n.permissions.edit?{avroEvent:"edit_connection_name",onClick:o,text:"Edit connection name",icon:"actionEdit"}:void 0,n.permissions.reconnect?{avroEvent:"reconnect",onClick:l,text:"Reconnect",icon:"actionAutoRenew"}:void 0,!i&&n.permissions.test?{avroEvent:"test_connection",onClick:s,text:"Test connection",icon:"actionCheckConnection"}:void 0,n.zapCount>0?{avroEvent:"view_zaps",href:Rn(u,c,n.id),text:"View Zaps",icon:"miscEye"}:void 0,n.permissions.delete?{avroEvent:"delete",onClick:a,text:"Delete",warningHighlight:!0,icon:"actionTrash"}:void 0].filter((function(e){return(0,Ne.isObject)(e)&&(!!e.href||!!e.onClick)}))}),[n,t,i,r,a,o,l,s,c,u])},Fn=(0,r.iv)("button:hover,button:focus{background-color:",ge.w.error100," !important;color:",ge.w.error400," !important;}","ConnectionListItemDropdownItem.tsx--warningItemStyle"),_n=(0,r.iv)("display:flex;gap:10px;","ConnectionListItemDropdownItem.tsx--itemContent"),qn=function(e){var n=e.avroEvent,t=e.icon,r=e.href,a=e.onClick,o=e.text,l=e.warningHighlight,c=(0,wn.X8)(),u=(0,h.useCallback)((function(){b({account_id:c,event_action:"click",interaction_name:"connection_kebab_interaction",option_selected:n,system_name:"reporting",interaction_raw_text:o},Ae.rw)}),[c,n,o]);return(0,i.tZ)("span",{css:!!l&&Fn,children:(0,i.tZ)(dn.s,{href:r,onClick:function(){a&&a(),n&&u()},role:"menuitem",children:(0,i.BX)("span",{css:_n,"data-testid":"connection-list-item-dropdown-item-".concat(o),children:[(0,i.tZ)(Ke.J,{name:t,size:24}),(0,i.tZ)(s.x,{color:"inherit",type:"paragraph3Medium",children:o})]})})})},On=(0,r.iv)("grid-area:options;position:relative;button{border:0 none transparent !important;}","ConnectionListItemDropdown.tsx--menuButtonStyle"),Hn=(0,r.iv)("padding:10px;","ConnectionListItemDropdown.tsx--menuStyle"),Wn=function(e){var n=e.connection,t=e.hasTeams,r=e.isDownstream,a=e.isMenuOpen,o=e.onClickChangeOwnership,l=e.onClickDelete,s=e.onClickRename,c=e.onHandleMenuState,u=e.onReconnectAuth,d=e.onTestAuth,p=e.selectedApi,v=e.serviceSlug,m=En({connection:n,hasTeams:t,isDownstream:r,onClickChangeOwnership:o,onClickDelete:l,onClickRename:s,onReconnectAuth:u,onTestAuth:d,selectedApi:p,serviceSlug:v});return(0,i.BX)("div",{css:On,"data-testid":"ConnectionListItem-menu-button-".concat(n.id),children:[(0,i.tZ)(sn.h,{ariaControls:"".concat(n.id,"-zap-actions-menu"),ariaExpanded:a,ariaHaspopup:!0,ariaLabel:"Connection List Item Menu Button",color:"icon-secondary",icon:"navMoreHoriz",onClick:c}),(0,i.tZ)(h.Fragment,{children:a&&(0,i.tZ)(cn.f,{align:"right",intersectHeight:180,minWidth:"190px",onClickOutside:c,children:(0,i.tZ)("div",{css:Hn,children:(0,i.tZ)(un.v,{ariaLabel:"Zap actions menu",id:"".concat(n.id,"-zap-actions-menu"),role:"menu",children:m.map((function(e){var t=e.avroEvent,r=e.href,a=e.icon,o=e.onClick,l=e.text,s=e.warningHighlight;return(0,i.tZ)(qn,{avroEvent:t,href:r,icon:a,onClick:o,text:l,warningHighlight:s},"".concat(n.id,"-").concat(l))}))})})})})]})};function Nn(){var e=(0,B.Z)(['\n grid-template-areas: "name zaps avatar options";\n grid-template-columns: 1fr 80px 110px 40px;\n grid-template-rows: 1fr;\n ']);return Nn=function(){return e},e}function Yn(){var e=(0,B.Z)(['\n align-items: center;\n display: grid;\n grid-gap: 10px;\n grid-template-areas: ". . options" "name name name" "zaps zaps .";\n grid-template-columns: 1fr 125px 40px;\n grid-template-rows: 1fr 1fr 1fr;\n ']);return Yn=function(){return e},e}function Un(){var e=(0,B.Z)(['\n grid-template-areas: "name zaps avatar options";\n grid-template-columns: 1fr 60px 120px 40px;\n ']);return Un=function(){return e},e}function jn(){var e=(0,B.Z)(['\n grid-template-areas: "avatar avatar . options" "name name name name" "zaps zaps . .";\n grid-template-columns: 40px 1fr 125px 40px;\n ']);return jn=function(){return e},e}function Kn(){var e=(0,B.Z)(['\n grid-template-areas: "name sharing zaps avatar options";\n grid-template-columns: 1fr 160px 60px 120px 40px;\n ']);return Kn=function(){return e},e}function Vn(){var e=(0,B.Z)(['\n grid-template-areas: "avatar avatar . options" "name name name name" "zaps . sharing sharing";\n grid-template-columns: 40px 1fr 125px 40px;\n ']);return Vn=function(){return e},e}function Gn(){var e=(0,B.Z)(['\n grid-template-areas: "apps name options";\n grid-template-columns: 81px 1fr 40px;\n grid-template-rows: 1fr;\n ']);return Gn=function(){return e},e}function Jn(){var e=(0,B.Z)(['\n grid-template-areas: "apps . . options" "name name name name";\n grid-template-columns: 81px 1fr 125px 40px;\n grid-template-rows: 1fr 1fr;\n ']);return Jn=function(){return e},e}function Qn(){var e=(0,B.Z)(['\n grid-template-areas: "apps name sharing options";\n grid-template-columns: 81px 1fr 160px 40px;\n ']);return Qn=function(){return e},e}function et(){var e=(0,B.Z)(['\n grid-template-areas: "apps . . options" "name name name name" ". . sharing sharing";\n grid-template-columns: 81px 1fr 125px 40px;\n ']);return et=function(){return e},e}var nt=(0,we.uq)({tablet:(0,r.iv)(Nn()),mobile:(0,r.iv)(Yn())}),tt=(0,we.uq)({tablet:(0,r.iv)(Un()),mobile:(0,r.iv)(jn())}),it=(0,we.uq)({tablet:(0,r.iv)(Kn()),mobile:(0,r.iv)(Vn())}),rt=(0,we.uq)({tablet:(0,r.iv)(Gn()),mobile:(0,r.iv)(Jn())}),at=(0,we.uq)({tablet:(0,r.iv)(Qn()),mobile:(0,r.iv)(et())}),ot=(0,r.iv)("display:flex;flex-direction:column;","ConnectionListItem.tsx--nameSectionStyle"),lt=(0,r.iv)(fe.ZT.paragraph1ShortBold," align-items:center;color:",ge.w.neutral800,";display:grid;font-weight:700;grid-auto-flow:column;grid-gap:5px;justify-content:flex-start;","ConnectionListItem.tsx--titleStyle"),st=(0,r.iv)("display:flex;justify-content:center;","ConnectionListItem.tsx--sharingStyle"),ct=function(e){var n=e.connection,t=e.hasTeams,r=e.isDownstream,a=e.isHighlighted,o=e.isMenuOpen,l=e.onClickChangeOwnership,c=e.onClickDelete,u=e.onClickRename,d=e.onHandleMenuState,p=e.onReconnectAuth,v=e.onTestAuth,m=e.selectedApi,f=e.serviceSlug,Z=e.testAuthResult,b=$n(e),y=n.isStale||!(null===Z||void 0===Z?void 0:Z.success)&&ke(null===Z||void 0===Z?void 0:Z.errors);return(0,i.tZ)(Ie.Z,{color:a?"blue":y?"red":"gray",children:(0,i.BX)("div",{"data-testid":"ConnectionListItem-root-".concat(n.id),id:n.id,children:[(0,i.BX)("div",{css:[nt,t&&!b&&tt,b&&it,r&&rt,r&&b&&at],children:[r&&(0,i.tZ)("div",{css:(0,Te.f)("apps"),children:(0,i.tZ)(Ze.r,{maxServices:2,renderServiceIcon:function(e){var n;return(0,i.tZ)(be.A,{serviceName:e.selectedApi,size:40,src:(null===e||void 0===e||null===(n=e.selectedApiImages)||void 0===n?void 0:n.url128X128)||Ae.hn})},services:[n,{selectedApi:n.destinationSelectedApi,selectedApiImages:n.destinationSelectedApiImages}]})}),(0,i.BX)("div",{css:[(0,Te.f)("name"),ot],"data-testid":"ConnectionListItem-attributes",children:[(0,i.tZ)("span",{css:lt,children:n.title}),(0,i.BX)(s.x,{type:"smallPrint1",children:[!r&&n.description&&"".concat(n.description," - "),"added ",(0,i.tZ)(qe,{date:n.created})]})]}),Boolean(b)&&(0,i.tZ)("div",{css:[(0,Te.f)("sharing"),st],children:b}),!r&&(0,i.tZ)("div",{css:(0,Te.f)("zaps"),children:(0,i.tZ)(Se.Z,{count:n.zapCount,label:"Zap"})}),!r&&t&&!!n.owner&&(0,i.tZ)("div",{css:(0,Te.f)("avatar"),children:(0,i.tZ)(Ce.Z,{avatarsCount:1,size:25,avatarsNodes:[(0,i.tZ)(ye.O,{name:n.owner.name||"",url:n.owner.imageUrl||""},n.owner.name)],children:n.owner.name&&(0,i.BX)(h.Fragment,{children:[(0,i.tZ)(xe.M,{kind:"light",children:"by"})," ",(0,i.tZ)(xe.M,{kind:"heavy",children:(0,De.G)(n.owner.name)})]})})}),(0,i.tZ)(Wn,{connection:n,hasTeams:t,isDownstream:r,isMenuOpen:o,onClickChangeOwnership:l,onClickDelete:c,onClickRename:u,onHandleMenuState:d,onReconnectAuth:p,onTestAuth:v,selectedApi:m,serviceSlug:f})]}),(n.destinationAuths||[]).length>0&&(0,i.tZ)(We,(0,x.Z)((0,g.Z)({},e),{onHandleMenuState:d}))]})})},ut=t(17688),dt=(0,r.iv)("display:grid;grid-gap:40px;min-width:min(688px,50vw);","ChangeAuthModal.tsx--rootStyle"),pt=(0,r.iv)("align-items:center;display:grid;grid-gap:5px;grid-template-columns:20px 1fr;","ChangeAuthModal.tsx--subStyle"),ht=(0,r.iv)("display:grid;grid-gap:10px;","ChangeAuthModal.tsx--titleStyle"),vt=function(e){var n=(0,h.useState)(),t=n[0],r=n[1],a=(0,h.useState)(),o=a[0],l=a[1];return(0,i.BX)("form",{css:dt,onSubmit:function(n){return n.preventDefault(),n.stopPropagation(),t?e.onAccept(t.id):l("Owner is required"),!1},children:[(0,i.BX)("div",{css:ht,children:[(0,i.tZ)(s.x,{type:"sectionHeader3",children:"Change Ownership"}),!e.isAdmin&&(0,i.BX)("span",{css:pt,children:[(0,i.tZ)(Ke.J,{name:"alertInfo",size:20}),(0,i.tZ)(s.x,{type:"smallPrint3",children:"You will lose access to this connection when you change ownership."})]})]}),(0,i.tZ)(ut.g,{error:o,isRequired:!0,label:"Choose a new owner",renderInput:function(n){return(0,i.tZ)(Sn,(0,x.Z)((0,g.Z)({},n),{accountId:e.accountId||-1,excludeTeams:!0,onChange:r,value:t}))}}),(0,i.tZ)(je.z,{disabled:!t,type:"submit",children:"Change ownership"})]})},mt=function(e){return(0,i.tZ)(en.u,{onClosed:e.onCancel,children:(0,i.tZ)(nn.hz,{children:(0,i.tZ)(vt,(0,g.Z)({},e))})})},ft=t(42126),gt=t(80327),Zt=(0,r.iv)("display:grid;grid-gap:40px;","RenameAuthModal.tsx--rootStyle"),bt="Edit connection name";function yt(e){var n=(0,h.useState)(e.title),t=n[0],r=n[1],a=(0,h.useState)(),o=a[0],l=a[1],c=(0,A.Z)((0,gt.Z)(),1)[0];return(0,i.BX)("form",{css:Zt,onSubmit:function(n){return n.preventDefault(),n.stopPropagation(),t?e.onAccept(t):l("Title is required"),!1},"data-testid":"RenameAuthModal-root",children:[(0,i.tZ)(s.x,{type:"sectionHeader3",children:bt}),(0,i.tZ)(ut.g,{error:o,isRequired:!0,label:"Name",renderInput:function(e){return(0,i.tZ)(ft.o,(0,x.Z)((0,g.Z)({},e),{ref:c,onChange:function(e){return r(e.currentTarget.value)},value:t}))}}),(0,i.tZ)(je.z,{disabled:!t,type:"submit",children:"OK"})]})}var xt=function(e){return(0,i.tZ)(en.u,{onClosed:e.onCancel,ariaLabel:bt,children:(0,i.tZ)(nn.hz,{children:(0,i.tZ)(yt,(0,g.Z)({},e))})})},At=(0,r.iv)("display:flex;flex-flow:row nowrap;gap:10px;> *{flex:1 1 auto !important;}","DeleteAuthModal.tsx--buttonStyle"),Ct=(0,r.iv)("display:grid;grid-gap:40px;","DeleteAuthModal.tsx--rootCss"),It=function(e){var n=e.onAccept,t=e.title,r=e.onCancel;return(0,i.BX)("form",{onSubmit:function(e){e.preventDefault(),e.stopPropagation(),n()},css:[Ct],"data-testid":"DeleteAuthModal-root",children:[(0,i.tZ)(s.x,{type:"sectionHeader3",children:t}),(0,i.tZ)(s.x,{type:"paragraph1Short",children:"Are you sure you want to delete this connection?"}),(0,i.BX)("div",{css:At,children:[(0,i.tZ)(je.z,{color:"secondary",onClick:r,children:"Cancel"}),(0,i.tZ)(je.z,{type:"submit",children:"Delete"})]})]})},St=function(e){return(0,i.tZ)(en.u,{onClosed:e.onCancel,ariaLabel:"Delete ".concat(e.title," connection"),children:(0,i.tZ)(nn.hz,{children:(0,i.tZ)(It,(0,g.Z)({},e))})})},wt="delete",kt="none",Tt="rename",Dt="change_ownership",Bt=function(e){var n=e.accountId,t=e.connection,r=e.isHighlighted,o=void 0!==r&&r,l=e.isTeam,s=e.isAdmin,c=e.isDownstream,u=void 0!==c&&c,d=e.isPersonal,p=void 0!==d&&d,v=e.testAuthsLoading,m=void 0!==v&&v,f=e.testAuthsResult,g=(0,h.useState)(kt),Z=g[0],y=g[1],x=(0,h.useState)(!1),A=x[0],C=x[1],I=(0,h.useState)(o),S=I[0],w=I[1],k=(0,a.useRouter)().query,T=k.serviceSlug,D=k.selectedApi,B=!!D,M=(0,h.useRef)(null);(0,h.useEffect)((function(){o&&(!function(e){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=0,i=e?e.offsetHeight:0;e;)t+=e.offsetTop,e=e.offsetParent;window.scrollTo(0,n?t+i:t)}(M.current),setTimeout((function(){return w(!1)}),2e3))}),[]);var L=me(n,t,(function(){}),T,D).onTransferAuth,z=K({connection:t,isPrivate:B,selectedApi:D,serviceSlug:T||""}),P=z.isTesting,X=z.onDeleteAuth,$=z.onReconnectAuth,R=z.onTestAuth,E=z.onUpdateAuthTitle,F=z.testAuthResult,_=(0,h.useCallback)((function(){y(kt),C(!1)}),[C,y]),q=(0,h.useCallback)((function(){b({account_id:n,event_action:A?"close":"open",interaction_name:"connection_kebab_interaction",option_selected:"",system_name:"reporting"},Ae.rw)}),[A,n]),O=(0,h.useCallback)((function(e){null===e||void 0===e||e.stopPropagation(),Z===kt&&(q(),C((function(e){return!e})))}),[Z,C,q]),H=(0,h.useCallback)((function(e){null===e||void 0===e||e.stopPropagation(),R(),_(),q()}),[R,q,_]),W=(0,h.useCallback)((function(e){null===e||void 0===e||e.stopPropagation(),$(),_(),q()}),[$,_,q]),N=(0,h.useCallback)((function(e){E(e),_()}),[E,_]),Y=(0,h.useCallback)((function(e){L(e),_()}),[L,_]),U=(0,h.useCallback)((function(){X(),_()}),[X,_]),j=(0,h.useCallback)((function(){y(Tt),C(!1),q()}),[q]),V=(0,h.useCallback)((function(){y(Dt),C(!1),q()}),[q]),G=(0,h.useCallback)((function(){y(wt),C(!1),q()}),[q]);return(0,i.BX)("div",{"data-testid":"Connection",id:"connection-".concat(t.id),ref:M,children:[(0,i.tZ)(ct,{accountId:n,connection:t,hasTeams:l,isAdmin:s,isHighlighted:S,isMenuOpen:A,isPersonal:p,isDownstream:u,onClickChangeOwnership:V,onClickDelete:G,onClickRename:j,onHandleMenuState:O,onReconnectAuth:W,onTestAuth:H,selectedApi:D,serviceSlug:T,testAuthLoading:P||m,testAuthResult:F||f},t.id),Z===Tt&&(0,i.tZ)(xt,{onAccept:N,onCancel:_,title:t.title}),Z===wt&&(0,i.tZ)(St,{onAccept:U,onCancel:_,title:t.title}),Z===Dt&&(0,i.tZ)(mt,{accountId:n,isAdmin:s,onAccept:Y,onCancel:_})]})},Mt=(0,r.iv)("display:grid;grid-gap:10px;","ConnectionsSection.tsx--rootStyle"),Lt=(0,r.iv)("display:flex;place-items:center;","ConnectionsSection.tsx--header"),zt=function(e){var n=e.connections,t=e.highlightedId,r=e.isAdminSection,a=void 0!==r&&r,o=e.isPersonal,l=void 0!==o&&o,c=e.testAuthsLoading,u=e.testAuthsResults,d=e.title,p=(0,hn.gn)(),g=p.accountId,Z=p.isTeam,b=p.isAdmin,y=(0,h.useCallback)((function(e){return null===u||void 0===u?void 0:u.find((function(n){return n.id===e}))}),[u]);return(0,i.BX)("section",{css:Mt,"data-testid":"ConnectionsSection",children:[(0,i.BX)("div",{css:Lt,children:[(0,i.tZ)(s.x,{type:"subHeader3Medium",children:d}),(0,i.BX)(h.Fragment,{children:[(0,i.tZ)(v.L,{width:5}),(0,i.tZ)(m.C,{children:String(null===n||void 0===n?void 0:n.length)})]}),(0,i.tZ)(v.L,{width:5}),a&&(0,i.tZ)(m.C,{children:"Admin"})]}),(0,i.tZ)(f.Z,{gap:10,id:"",itemRenderer:function(e){var n=e.id===t||(e.destinationAuths||[]).some((function(e){return e.id===t})),r=y(e.id);return(0,i.tZ)(Bt,{accountId:g,connection:e,isAdmin:b,isHighlighted:n,isPersonal:l,isTeam:Z,testAuthsLoading:c,testAuthsResult:r})},items:n})]})},Pt=(0,r.iv)("display:grid;grid-gap:30px;padding:20px;","AppConnections.tsx--rootStyle"),Xt=function(e){var n=e.connectionsError,t=e.hasConnections,r=e.hasNextPage,h=e.isConnectionsLoading,v=e.myAuthentications,m=e.onLoadMore,f=e.privateAuthentications,g=e.sharedAuthentications,Z=e.testAuthsLoading,b=e.testAuthsResults,y=(0,hn.gn)().isAdmin,x=(0,a.useRouter)().query;return!h&&n?(0,i.tZ)("div",{css:Pt,children:(0,i.tZ)(o.b,{type:"error",children:n})}):(0,i.BX)("div",{css:Pt,children:[v.length>0&&(0,i.tZ)(zt,{connections:v,highlightedId:x.hl,isPersonal:!0,testAuthsLoading:Z,testAuthsResults:b,title:"My connections"}),g.length>0&&(0,i.tZ)(zt,{connections:g,highlightedId:x.hl,testAuthsLoading:Z,testAuthsResults:b,title:"Shared connections"}),f.length>0&&y&&(0,i.tZ)(zt,{connections:f,highlightedId:x.hl,isAdminSection:!0,testAuthsLoading:Z,testAuthsResults:b,title:"Private connections"}),r&&(0,i.tZ)(l.W,{isLoading:h,onClick:m,children:"Load More"}),!t&&!h&&(0,i.tZ)(s.x,{color:"neutral700",margin:"20px",type:"paragraph1Short",children:"You do not have any connections."}),h&&(0,i.tZ)(c.g,{children:(0,i.BX)(u.r,{gap:10,children:[(0,i.tZ)(d.N,{lines:1,size:"heading",width:"30%"}),Array.from({length:5}).map((function(e,n){return(0,i.tZ)(p.q,{height:79,width:"100%"},n)}))]})})]})}},39555:function(e,n,t){t.d(n,{Z:function(){return ue}});var i=t(52903),r=t(53939),a=t(87416),o=t(74897),l=t(53583),s=t(28165),c=t(2784),u=t(5632),d=t(98788),p=t(92228),h=t(5163),v=t(64476),m=t(55414),f=t(26215),g=t(61854),Z=t(20110),b=t(66830),y=t(70398),x=t(53736),A=t(16181),C=t(50293),I=t(90446),S=t(73223),w=t(60390),k=t(38716);function T(){var e=(0,p.Z)(['\n grid-template-columns: 1fr auto auto;\n grid-template-areas: "serviceTitle testButton button";\n grid-template-rows: 1fr;\n ']);return T=function(){return e},e}function D(){var e=(0,p.Z)(['\n align-items: center;\n display: grid;\n grid-gap: 15px;\n grid-template-columns: 1fr;\n grid-template-rows: auto auto auto;\n grid-template-areas: "serviceTitle" "testButton" "button";\n ']);return D=function(){return e},e}function B(){var e=(0,p.Z)(["\n display: grid;\n "]);return B=function(){return e},e}function M(){var e=(0,p.Z)(["\n display: block;\n "]);return M=function(){return e},e}var L=(0,y.uq)({tablet:(0,s.iv)(T()),mobile:(0,s.iv)(D())}),z=(0,s.iv)('align-items:center;display:grid;grid-gap:30px;grid-template-areas:"icon name";grid-template-columns:60px 1fr;',"AppDetailHeader.tsx--serviceTitle");function P(e){return(0,s.iv)("grid-area:",e,";","AppDetailHeader.tsx--serviceTitle")}var X=(0,s.iv)("align-items:center;background-color:transparent;border-radius:10px;display:flex;grid-area:icon;height:60px;justify-content:center;width:60px;","AppDetailHeader.tsx--iconStyle"),$=(0,s.iv)("display:grid;grid-area:name;","AppDetailHeader.tsx--infoStyle"),R=(0,s.iv)("align-items:center;display:grid;grid-auto-flow:column;grid-gap:10px;justify-content:flex-start;","AppDetailHeader.tsx--titleStyle"),E=(0,y.uq)({mobile:(0,s.iv)(B()),tablet:(0,s.iv)(M())}),F=function(e){var n,t,r,a=e.app,o=e.displayTestAuths,l=e.handleTestAuths,s=e.isPrivate,p=e.slug,T=e.testAuthsLoading,D=(0,x.l)().createNotification,B=(0,A.gn)().userId,M=(0,C.Z)(),F=(0,u.useRouter)(),_=F.query.serviceSlug,q=F.query.selectedApi,O=(0,k.X8)(),H=(0,c.useCallback)((function(){(0,I.Z)({account_id:O,event_action:"click",interaction_name:"add_connection_button",option_selected:"add connection",system_name:"reporting",interaction_raw_text:"Add Connection"},S.rw)}),[O]),W=(0,w.Z)({id:(null===(n=F.query)||void 0===n||null===(t=n.id)||void 0===t?void 0:t.includes("all"))?null:F.query.id,serviceSlug:_,userId:B,selectedApi:q}).refetch,N=null===a||void 0===a?void 0:a.canConnect,Y=(0,c.useMemo)((function(){return(null===a||void 0===a?void 0:a.name)||(null===a||void 0===a?void 0:a.title)}),[a]),U=(0,c.useCallback)((0,d.Z)((function(){var e;return(0,h.__generator)(this,(function(n){switch(n.label){case 0:return a?(H(),[4,M(a)]):[3,2];case 1:(e=n.sent().id)&&(W(),F.push("".concat(S.Xu,"/").concat(a.slug,"?hl=").concat(e)),D({message:"New connection added",type:"info"})),n.label=2;case 2:return[2]}}))})),[M,D,W,F,a]),j=function(){l()},K=Object.prototype.hasOwnProperty.call(a,"image")?(null===a||void 0===a?void 0:a.image)||S.hn:(null===a||void 0===a||null===(r=a.images)||void 0===r?void 0:r.url128X128)||S.hn,V=Object.prototype.hasOwnProperty.call(a,"categories")&&(null===a||void 0===a?void 0:a.categories)||[];return(0,i.BX)("div",{css:L,children:[(0,i.tZ)("div",{css:P("serviceTitle"),children:(0,i.BX)("div",{css:z,children:[(0,i.tZ)("div",{css:X,children:(0,i.tZ)(v.A,{serviceName:Y,size:60,src:K})}),(0,i.BX)("div",{css:$,children:[(0,i.BX)("div",{css:R,children:[(0,i.tZ)(m.x,{tag:"h1",type:"sectionHeader1Medium",children:Y}),!s&&(0,i.tZ)("div",{children:(0,i.tZ)(f.r,{ariaLabel:"View app info link",href:"/apps/".concat(p),rel:"noreferrer",style:{display:"flex"},target:"_blank",children:(0,i.tZ)(g.J,{name:"arrowOffsite",ariaLabel:"View app info",size:24})})})]}),(null===V||void 0===V?void 0:V.length)>0&&(0,i.tZ)(m.x,{color:"neutral700",type:"smallPrint1",children:V[0].name})]})]})}),N&&(0,i.BX)(c.Fragment,{children:[o&&(0,i.BX)("div",{css:P("testButton"),children:[(0,i.tZ)("div",{css:y.CD,children:(0,i.tZ)(Z.z,{color:"secondary",disabled:T,isFullWidth:!0,onClick:j,size:"small",children:T?"Testing...":"Test Connections"})}),(0,i.tZ)("div",{css:y.pI,children:(0,i.tZ)(b.h,{disabled:T,icon:"actionCheckConnection",label:T?"Testing...":"Test Connections",onClick:j})})]}),(0,i.tZ)("div",{css:P("button"),children:(0,i.tZ)("div",{css:E,children:(0,i.tZ)(Z.z,{color:"primary",iconBefore:"formAdd",onClick:U,size:"small",children:"Add connection"})})})]})]})},_=t(56357),q=t(15466),O=t(66383),H=t(33379),W=t(60138);function N(){var e=(0,p.Z)(["\n mutation TestAuths(\n $accountId: Int!\n $serviceSlug: String\n $selectedApi: String\n ) {\n testAuths(\n accountId: $accountId\n serviceSlug: $serviceSlug\n selectedApi: $selectedApi\n ) {\n id\n success\n errors\n }\n }\n"]);return N=function(){return e},e}var Y=(0,W.Ps)(N()),U=function(e){var n=e.accountId,t=e.serviceSlug,i=e.selectedApi,r=(0,O.Z)((0,H.D)(Y,{variables:{accountId:n,selectedApi:i,serviceSlug:t}}),2),a=r[0],o=r[1],l=o.loading,s=o.data,u=(0,c.useMemo)((function(){return(null===s||void 0===s?void 0:s.testAuths)||[]}),[s]),d=(0,c.useState)(0)[1],p=(0,c.useRef)(u);return(0,c.useEffect)((function(){u!==p.current&&(p.current=u,d((function(e){return e+1})),(null===u||void 0===u?void 0:u.some((function(e){return e.success})))&&setTimeout((function(){p.current=(null===u||void 0===u?void 0:u.filter((function(e){return!e.success})))||[],d((function(e){return e+1}))}),5e3))}),[u]),{handleTestAuths:a,isLoading:l,results:p.current}},j=t(47842),K=t(70865),V=t(96670),G=t(40794),J=t(92642);function Q(){var e=(0,p.Z)(["\n fragment LegacyZap on LegacyZap {\n accountId\n id\n isShared\n isTrashed\n kind\n title\n isEnabled\n folderId\n owner {\n email\n id\n imageUrl\n name\n }\n sourceUrl\n steps {\n app {\n actions {\n bulkReads {\n key\n }\n }\n images {\n url32X32\n url128X128\n }\n name\n id\n }\n id\n }\n updatedAt\n }\n"]);return Q=function(){return e},e}var ee,ne=(0,W.Ps)(Q());function te(){var e=(0,p.Z)(["\n ","\n\n query LegacyAppZaps(\n $activityEnd: String\n $activityStart: String\n $authIds: [ID!]\n $folderId: Int\n $limit: Int\n $offset: Int\n $orderBy: ZapOrderByInput\n $search: String\n $selectedApis: [String!]\n $slug: String\n $state: String\n ) {\n legacyZaps(\n activityEnd: $activityEnd\n activityStart: $activityStart\n authIds: $authIds\n folderId: $folderId\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n search: $search\n selectedApis: $selectedApis\n slug: $slug\n state: $state\n ) {\n totalCount\n pageInfo {\n hasNextPage\n }\n edges {\n ...LegacyZap\n }\n }\n }\n"]);return te=function(){return e},e}!function(e){e.asc="asc",e.desc="desc"}(ee||(ee={}));var ie=(0,W.Ps)(te(),ne),re=t(86692),ae=function(e){if(e)return e.split(",").reduce((function(e,n){var t=n.startsWith("-")?"desc":"asc";return(0,V.Z)((0,K.Z)({},e),(0,j.Z)({},n.replace("-",""),t))}),{})},oe=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.activity,i=n.appId,r=n.authId,a=n.page,o=void 0===a?0:a,l=n.serviceSlug,s=n.sorting,u=n.selectedApi,d=n.state,p=[u,i].filter(Boolean),h=(0,V.Z)((0,K.Z)({},(null===t||void 0===t?void 0:t.to)?{activityEnd:t.to}:{},(null===t||void 0===t?void 0:t.from)?{activityStart:t.from}:{},r?{authIds:[r]}:{},s?{orderBy:ae(s)}:{},(null===p||void 0===p?void 0:p.length)?{selectedApis:p}:{},d?{state:d}:{}),{slug:l,limit:S.wt,offset:o*S.wt}),v=(0,G.a)(ie,{fetchPolicy:"cache-and-network",onError:function(e){var n="Error fetching LegacyZaps: ".concat((0,re.e$)(e));J.uT(n,{extra:{err:JSON.stringify(e)}})},variables:h}),m=v.data,f=v.loading,g=v.error,Z=(0,c.useMemo)((function(){var e;return(null===m||void 0===m||null===(e=m.legacyZaps)||void 0===e?void 0:e.edges)||[]}),[m]),b=(0,c.useMemo)((function(){return Z.map((function(e){return e.id}))}),[Z]);return{error:g,isLegacyLoading:f,legacyZapIds:b,legacyZaps:Z,totalCount:(null===m||void 0===m||null===(e=m.legacyZaps)||void 0===e?void 0:e.totalCount)||0}},le=(0,s.iv)("display:grid;grid-gap:20px;margin:0px auto;max-width:1120px;padding:20px;","AppDetails.tsx--rootStyle"),se=(0,s.iv)("max-width:120px;","AppDetails.tsx--backStyle"),ce=(0,s.iv)("display:flex;align-items:center;","AppDetails.tsx--countBadgeStyle"),ue=function(e){var n=e.serviceSlug,t=e.selectedApi,s=e.children,d=(0,A.gn)(),p=d.accountId,h=d.userId,v=(0,u.useRouter)(),m=v.query,f=v.asPath,g=(0,q.Z)({serviceSlug:n,selectedApi:t}).app,Z=m.appId?m.appId:"",b=m.authId?m.authId:"",y=m.zapSort?m.zapSort:void 0,x=parseInt(m.page)||0,C=m.status?m.status:void 0,I=(0,_.H7)(m),k=(0,w.Z)({serviceSlug:n,userId:h,selectedApi:t}),T=k.connectionsError,D=k.hasConnections,B=k.hasNextPage,M=k.isConnectionsLoading,L=k.myAuthentications,z=k.onLoadMore,P=k.privateAuthentications,X=k.sharedAuthentications,$=k.totalConnectionCount,R=U({accountId:p,selectedApi:t,serviceSlug:n}),E=R.handleTestAuths,O=R.isLoading,H=R.results,W=oe({activity:I,appId:Z,authId:b,page:x,selectedApi:t,serviceSlug:n,sorting:y,state:C}),N=W.error,Y=W.isLegacyLoading,j=W.legacyZapIds,K=W.legacyZaps,V=W.totalCount,G=(0,c.cloneElement)(s,{connectionsError:T,hasConnections:D,hasNextPage:B,isConnectionsLoading:M,isZapsLoading:Y,legacyZapIds:j,myAuthentications:L,onLoadMore:z,privateAuthentications:P,sharedAuthentications:X,testAuthsLoading:O,testAuthsResults:H,totalConnectionCount:$,totalZapCount:V,zaps:K,zapsError:N}),J=!!t,Q=J?"private/":"",ee="".concat(S.Xu,"/").concat(Q).concat(n||t),ne="".concat(ee,"/zaps"),te=[{href:ee,text:(0,i.BX)("div",{css:ce,children:["Connections",(0,i.tZ)(r.L,{width:5}),(0,i.tZ)(a.C,{color:"info-bold",children:M?"-":String($)})]})},{href:ne,text:(0,i.BX)("div",{css:ce,children:["Zaps",(0,i.tZ)(r.L,{width:5}),(0,i.tZ)(a.C,{color:"info-bold",children:Y?"-":String(V)})]})}];return(0,i.BX)("div",{css:le,children:[(0,i.tZ)("div",{css:se,children:(0,i.tZ)(o.x,{href:S.Xu,children:"My apps"})}),(0,i.tZ)(F,{app:g,displayTestAuths:$>1,handleTestAuths:E,isPrivate:J,slug:n,testAuthsLoading:O}),(0,i.tZ)(l.m,{items:te,selectedItemHref:f.split("?")[0],size:"large"}),(0,i.tZ)("div",{children:G})]})}},19782:function(e,n,t){t.d(n,{Z:function(){return an}});var i=t(92228),r=t(52903),a=t(2784),o=t(28165),l=t(5632),s=t(20271),c=t(55414),u=t(20110),d=t(76128),p=t(47043),h=t(90982),v=t(96459),m=t(70398),f=t(82116),g=t(68516),Z=t(32945),b=t(64476),y=t(29416),x=t(53939),A=t(12687),C=t(47553),I=t(49187),S=t(71937),w=t(42722),k=t(15879),T=t(73223),D=t(25277);function B(){var e=(0,i.Z)(['\n grid-template-areas: "serviceIcons info taskCount";\n grid-template-columns: 140px 1fr 120px;\n grid-template-rows: 1fr;\n ']);return B=function(){return e},e}function M(){var e=(0,i.Z)(['\n align-items: center;\n display: grid;\n grid-gap: 10px;\n grid-template-areas:\n "serviceIcons taskCount"\n "info info";\n grid-template-columns: 1fr 80px;\n grid-template-rows: auto 1fr;\n ']);return M=function(){return e},e}function L(){var e=(0,i.Z)(['\n grid-template-areas: "serviceIcons info taskCount avatar";\n grid-template-columns: 140px 1fr 120px 120px;\n ']);return L=function(){return e},e}function z(){var e=(0,i.Z)(['\n grid-template-areas:\n "serviceIcons serviceIcons taskCount"\n "info info info"\n "avatar avatar avatar";\n grid-template-columns: 1fr 80px auto;\n ']);return z=function(){return e},e}function P(){var e=(0,i.Z)(["\n padding-bottom: 0;\n "]);return P=function(){return e},e}function X(){var e=(0,i.Z)(["\n display: flex;\n align-items: center;\n padding-bottom: 5px;\n "]);return X=function(){return e},e}var $=(0,m.uq)({tablet:(0,o.iv)(B()),mobile:(0,o.iv)(M())}),R=(0,m.uq)({tablet:(0,o.iv)(L()),mobile:(0,o.iv)(z())}),E=(0,m.uq)({tablet:(0,o.iv)(P()),mobile:(0,o.iv)(X())}),F=(0,o.iv)("justify-content:end;","ZapListItem.tsx--taskCountStyle"),_=function(e){var n,t=e.zap,i=e.hasTeams,o=e.zapStat,l=e.isZapStatsLoading,s=t.title,u=t.id,d=t.steps,p=t.owner,h=t.updatedAt;return(0,r.tZ)(w.Z,{href:"/app/zap/".concat(u),children:(0,r.BX)("div",{css:[$,i&&R],children:[(0,r.tZ)("div",{css:(0,I.f)("serviceIcons"),children:(0,r.tZ)(Z.r,{size:40,maxServices:3,renderServiceIcon:function(e){var n,t,i=null===e||void 0===e||null===(n=e.app)||void 0===n?void 0:n.images;return(0,r.tZ)(b.A,{serviceName:null===e||void 0===e||null===(t=e.app)||void 0===t?void 0:t.id,size:40,src:(null===i||void 0===i?void 0:i.url128X128)||(null===i||void 0===i?void 0:i.url32X32)||T.hn})},services:d})}),(0,r.BX)("div",{css:(0,I.f)("info"),"data-testid":"ZapListItem-details-root",children:[(0,r.tZ)(c.x,{type:"paragraph1ShortBold",children:s||T.MK}),(0,r.BX)("div",{css:E,children:[(0,r.tZ)(y.S,{color:t.isEnabled?"info":"gray",size:"small",children:t.isEnabled?"ON":"OFF"}),(0,r.tZ)(x.L,{width:5}),(0,r.tZ)(c.x,{color:"neutral700",type:"smallPrint1",children:"Last changed"}),(0,r.tZ)(x.L,{width:5}),(0,r.tZ)(c.x,{type:"smallPrint1Semibold",children:(0,r.tZ)(g.ou,{date:h,format:"MMM DD, YYYY hh:mm a"})})]})]}),(0,r.tZ)("div",{css:[(0,I.f)("taskCount"),F],children:(0,r.tZ)(k.Z,{count:null===o||void 0===o||null===(n=o.tasks)||void 0===n?void 0:n.billable,isLoading:l,label:"Tasks"})}),i&&(0,r.tZ)("div",{css:(0,I.f)("avatar"),children:(0,r.tZ)(D.Z,{avatarsCount:1,size:25,avatarsNodes:[(0,r.tZ)(A.O,{name:p.name||"",url:p.imageUrl||""},p.name)],children:p.name&&(0,r.BX)(a.Fragment,{children:[(0,r.tZ)(C.M,{kind:"light",children:"by"})," ",(0,r.tZ)(C.M,{kind:"heavy",children:(0,S.G)(p.name)})]})})})]})})},q=t(58013),O=t(70865),H=t(96670),W=t(77466),N=t(13030),Y=t(95945),U=t(18672),j=t(61854),K=t(35080),V=(0,o.iv)("background-color:transparent !important;border:none !important;> span{align-items:center;display:grid;grid-auto-flow:column;grid-gap:4px;}","ZapSort.tsx--buttonStyle"),G=(0,o.iv)("cursor:pointer;","ZapSort.tsx--buttonWrapStyle"),J=(0,o.iv)("position:relative;","ZapSort.tsx--rootStyle"),Q=[{label:"Alphabetical A-Z",value:"title"},{label:"Alphabetical Z-A",value:"-title"}],ee=function(e){var n=e.label,t=e.value,i=e.placeholder;return[t,n,!t&&i].filter(Boolean).join(", ")},ne=function(e,n){return n.type===W.ZP.stateChangeTypes.keyDownEscape?{isOpen:!1}:n},te=function(e){var n=Q.find((function(n){return n.value===e.value}))||Q[0];return(0,r.tZ)(W.ZP,{getLabelForItem:function(e){return e.name},initialSelectedItem:n,inputId:"zapSorting",itemCount:Q.length,itemToString:function(e){return e.name},labelId:"zap-sorter-label",onChange:function(n){n&&e.onChange(n.value)},selectedItem:n,stateReducer:ne,children:function(e){var t=e.closeMenu,i=e.getInputProps,o=e.getItemProps,l=e.getMenuProps,s=e.getRootProps,u=e.highlightedIndex,d=e.isOpen,p=e.openMenu,h=e.selectedItem,v=!!h,m=s(),f=(0,q.Z)({},m);return(0,r.BX)("div",(0,H.Z)((0,O.Z)({css:J},f),{"data-testid":"ZapSort-root",children:[(0,r.tZ)("div",{css:G,children:(0,r.tZ)(N.I,(0,H.Z)((0,O.Z)({},(0,Y.j)(i())),{canClickIconAfter:!1,id:"zapSorter",children:function(e){return(0,r.BX)(a.Fragment,{children:[(0,r.tZ)(U.T,{children:(0,r.tZ)("label",{htmlFor:e.id,id:"zap-sorter-label",children:"Sort Zaps"})}),(0,r.tZ)("button",{"aria-activedescendant":e["aria-activedescendant"],"aria-invalid":e["aria-invalid"],"aria-controls":e["aria-controls"],"aria-expanded":d?"true":"false","aria-haspopup":"true","aria-label":ee({label:e["aria-label"]||"",value:v?h.label:void 0}),css:[e.css,V],disabled:e.disabled,id:e.id,onBlur:function(){return t()},onClick:function(){return p()},onKeyDown:e.onKeyDown,type:"button",children:(0,r.BX)("span",{children:[(0,r.tZ)(c.x,{color:"neutral700",type:"paragraph3",children:"Sort by:"}),(0,r.tZ)(c.x,{color:"neutral700",type:"paragraph3",children:n.label}),(0,r.tZ)(j.J,{color:"neutral700",name:"arrowSmallDown",size:20})]})})]})}}))}),d&&(0,r.tZ)(K.A,{ariaLabel:"zap sort options",getInputProps:i,getItemProps:o,getKeyForItem:function(e){return e.value},getLabelForItem:function(e){return e.label},getMenuProps:l,highlightedIndex:u,items:Q})]}))}})},ie=t(40794),re=t(17688),ae=t(57380),oe=t(76635),le=t(60138);function se(){var e=(0,i.Z)(["\n fragment AppByImplementationId on App {\n id\n slug\n name\n currentImplementation {\n id\n }\n images {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n }\n"]);return se=function(){return e},e}function ce(){var e=(0,i.Z)(["\n ","\n\n query getAppByImplementationIdQuery($id: ID!) {\n appByImplementationId(id: $id) {\n ...AppByImplementationId\n }\n }\n"]);return ce=function(){return e},e}var ue,de=(0,le.Ps)(se()),pe=(0,le.Ps)(ce(),de),he=function(e){var n=e.id,t=(0,ie.a)(pe,{skip:!n,variables:{id:n}}),i=t.data,r=t.loading;if(null===i||void 0===i?void 0:i.appByImplementationId){var a=i.appByImplementationId.images,o=(0,oe.mapKeys)(a,(function(e,n){if(n.includes("url")){var t=n.toLowerCase().split("url")[1];return"url_".concat(t)}}));return{app:(0,H.Z)((0,O.Z)({},i.appByImplementationId),{images:o}),isLoading:r}}return{app:null,isLoading:r}},ve=(0,m.uq)({desktop:{align:"right",maxWidth:"500%",minWidth:"100%"},tablet:{align:"left",maxWidth:"200%",minWidth:"100%"},mobile:{align:"stretch"}}),me=function(e){var n=e.onChange,t=(0,a.useState)(),i=t[0],o=t[1],s=(0,l.useRouter)().query,c=s.appId?s.appId:"",u=he({id:c}).app;(0,a.useEffect)((function(){i!==(null===u||void 0===u?void 0:u.id)&&o(null===u||void 0===u?void 0:u.id)}),[i,u]);var d=function(e){var t,i=null===e||void 0===e||null===(t=e.currentImplementation)||void 0===t?void 0:t.id;n("app",i)};return(0,r.tZ)(re.g,{label:"APPS USED",renderInput:function(){return(0,r.tZ)(ae.U,{ariaLabel:"App Filter",initialSelectedItem:u,menuAriaLabel:"List of apps to filter by",onChange:d,placeholder:"All apps",renderFloatingMenu:function(e){return(0,r.tZ)(K.A,(0,O.Z)({},e,ve))},useQuery:ie.a},i)}})},fe=t(50930),ge=t(3e3),Ze=t(70776),be=t(81901),ye=t(15504),xe=t(16181),Ae=t(60390);!function(e){e.allMyConnections="my",e.allSharedConnections="shared",e.allPrivateConnections="private"}(ue||(ue={}));var Ce={id:void 0,title:"All Connections"},Ie={id:ue.allMyConnections,prefix:"Personal",title:"All personal connections"},Se={id:ue.allPrivateConnections,prefix:"Private",title:"All private connections"},we={id:ue.allSharedConnections,prefix:"Shared",title:"All shared connections"},ke=function(e){return(0,o.iv)("max-height:",40*((e||0)+.5)+10,"px;overflow:auto;padding:10px;","ConnectionFilter.tsx--listStyle")},Te=(0,o.iv)(ge.ZT.smallPrint1," align-items:center;border-radius:10px;cursor:pointer;display:flex;height:",40,"px;padding:0 10px;position:relative;","ConnectionFilter.tsx--menuItemStyle"),De=(0,o.iv)("color:",Ze.w.neutral700,";","ConnectionFilter.tsx--menuItemDisabled"),Be=(0,o.iv)("background-color:",Ze.w.ocean5,";color:",Ze.w.ocean,";font-weight:600;","ConnectionFilter.tsx--menuItemHighlighted"),Me=(0,o.iv)("flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","ConnectionFilter.tsx--menuItemTextStyle"),Le=function(e){return(0,o.iv)("margin-top:42px;:before{",ge.ZT.superTitle3," background-color:",Ze.w.white,";color:",Ze.w.neutral800,';content:"',e,'";position:absolute;top:-20px;}',"ConnectionFilter.tsx--prefixStyle")};function ze(e){var n=e.onFilterChange,t=(0,l.useRouter)().query,i=t.selectedApi?t.selectedApi:"",o=t.serviceSlug?t.serviceSlug:"",s=t.authId,c=(0,xe.gn)().userId,u=(0,Ae.Z)({id:null,selectedApi:i,serviceSlug:o,userId:c}),d=u.myAuthentications.filter((function(e){return e.zapCount>0})),p=u.privateAuthentications.filter((function(e){return e.zapCount>0})),h=u.sharedAuthentications.filter((function(e){return e.zapCount>0})),v=d.length>0?[Ie].concat((0,fe.Z)(d)):[],f=p.length>0?[Se].concat((0,fe.Z)(p)):[],g=h.length>0?[we].concat((0,fe.Z)(h)):[],Z=[Ce].concat((0,fe.Z)(v),(0,fe.Z)(f),(0,fe.Z)(g)).filter(Boolean),b=Z.find((function(e){return e.id===s}));return(0,r.tZ)(re.g,{label:"CONNECTION",renderInput:function(){return(0,r.tZ)(be.L,{getKeyForItem:function(e){return e.id||"default"},getLabelForItem:function(e){return e.title},items:Z,onChange:function(e){return n("connection",e.id)},placeholder:"Select connection",renderFloatingMenu:function(e){var n=e.ariaLabel,t=e.getItemProps,i=e.getKeyForItem,o=e.getLabelForItem,l=e.getMenuProps,s=e.highlightedIndex,c=e.items,u=e.maxWidth,d=e.minWidth;return(0,r.BX)(a.Fragment,{children:[(0,r.tZ)("div",{css:m.Q0,children:(0,r.tZ)(ye.f,{maxWidth:u,minWidth:d,align:"stretch",children:(0,r.tZ)("ul",(0,H.Z)((0,O.Z)({css:ke(6)},l({"aria-label":n})),{children:c.map((function(e,n){return(0,a.createElement)("li",(0,H.Z)((0,O.Z)({},t({disabled:e.disabled,item:e})),{css:[Te,e.disabled&&De,s===n&&Be,e.prefix&&Le(e.prefix)],key:i?i(e):n}),(0,r.tZ)("span",{css:Me,children:o(e)}))}))}))})}),(0,r.tZ)("div",{css:m.eI,children:(0,r.tZ)(ye.f,{maxWidth:u,minWidth:d,align:"left",children:(0,r.tZ)("ul",(0,H.Z)((0,O.Z)({css:ke(6)},l({"aria-label":n})),{children:c.map((function(e,n){return(0,a.createElement)("li",(0,H.Z)((0,O.Z)({},t({disabled:e.disabled,item:e})),{css:[Te,e.disabled&&De,s===n&&Be,e.prefix&&Le(e.prefix)],key:i?i(e):n}),(0,r.tZ)("span",{css:Me,children:o(e)}))}))}))})})]})},selectedItem:b})}})}var Pe,Xe=t(44055),$e=t(56357),Re=function(e){var n=e.onFilterChange,t=(0,l.useRouter)().query,i=(0,$e.H7)(t);return(0,r.tZ)(re.g,{label:"LAST CHANGED",renderInput:function(){return(0,r.BX)(a.Fragment,{children:[(0,r.tZ)("div",{css:m.Q0,children:(0,r.tZ)(Xe.D,{ariaLabel:"Date Filter",closeText:"Apply",menuAlign:"right",menuAriaLabel:"Choice of date ranges",onChange:function(e){return n("activity",e)},placeholder:"Select date range",value:i,size:"small"})}),(0,r.tZ)("div",{css:m.eI,children:(0,r.tZ)(Xe.D,{ariaLabel:"Date Filter",closeText:"Apply",menuAlign:"left",menuAriaLabel:"Choice of date ranges",onChange:function(e){return n("activity",e)},placeholder:"Select date range",value:i,size:"large"})})]})}})};!function(e){e[void 0]="All",e.on="On",e.off="Off"}(Pe||(Pe={}));var Ee=function(e){var n=e.onFilterChange,t=(0,l.useRouter)().query,i=null===t||void 0===t?void 0:t.status,a=[{label:Pe.undefined,value:void 0},{label:Pe.on,value:"on"},{label:Pe.off,value:"off"}].filter(Boolean);return(0,r.tZ)(re.g,{label:"ZAP STATUS",renderInput:function(){return(0,r.tZ)(be.L,{ariaLabel:"Status",items:a,menuAriaLabel:"List of Zap statuses",onChange:function(e){return function(e){n("status",e)}(e.value)},placeholder:"Choose a status...",selectedItem:a.find((function(e){return(null===e||void 0===e?void 0:e.value)===i&&e}))})}})};function Fe(){var e=(0,i.Z)(['\n grid-template-areas: "ConnectionFilter DateFilter StatusFilter AppFilter clearButton";\n grid-template-columns: 1fr 1fr 1fr 1fr 0.5fr;\n grid-template-rows: 1fr;\n ']);return Fe=function(){return e},e}function _e(){var e=(0,i.Z)(['\n grid-template-areas:\n "ConnectionFilter DateFilter"\n "StatusFilter AppFilter"\n "clearButton clearButton";\n grid-template-columns: 1fr 1fr;\n grid-template-rows: 1fr 1fr auto;\n ']);return _e=function(){return e},e}function qe(){var e=(0,i.Z)(['\n grid-template-areas: "ConnectionFilter" "DateFilter" "StatusFilter" "AppFilter" "clearButton";\n display: grid;\n grid-gap: 10px;\n ']);return qe=function(){return e},e}var Oe=(0,m.uq)({desktop:(0,o.iv)(Fe()),tablet:(0,o.iv)(_e()),mobile:(0,o.iv)(qe())}),He=(0,o.iv)("align-self:end;grid-area:clearButton;padding-bottom:5px;","ZapFilters.tsx--clearButtonStyle"),We=function(){var e=(0,l.useRouter)(),n=e.asPath,t=e.push,i=(0,a.useCallback)((function(e,i){var r=n;switch(e){case"activity":var a=i;r=a&&a.from&&a.to?(0,v.aE)(n,(0,H.Z)((0,O.Z)({},(0,$e.xB)(a)),{page:"0"})):(0,v.Hn)(n,["end","start"]);break;case"app":var o=i;r=o?(0,v.aE)(n,{appId:o,page:"0"}):(0,v.Hn)(n,["appId"]);break;case"connection":var l=i;r=l?(0,v.aE)(n,{authId:l,page:"0"}):(0,v.Hn)(n,["authId"]);break;case"status":var s=i;r=s?(0,v.aE)(n,{page:"0",status:s}):(0,v.Hn)(n,["status"])}t(r,void 0,{shallow:!0})}),[n,t]);return(0,r.BX)("section",{css:Oe,children:[(0,r.tZ)(ze,{onFilterChange:i}),(0,r.tZ)(Re,{onFilterChange:i}),(0,r.tZ)(Ee,{onFilterChange:i}),(0,r.tZ)(me,{onChange:i}),(0,r.tZ)("span",{css:He,children:(0,r.tZ)(u.z,{color:"secondary",isFullWidth:!0,onClick:function(){var e=(0,v.Hn)(n,["appId","authId","end","start","status"]);t((0,v.aE)(e,{page:"0"}),void 0,{shallow:!0})},size:"small",children:"Clear all"})})]})},Ne=t(15466);function Ye(){var e=(0,i.Z)(["\n fragment TopZap on TopZap {\n id\n tasks {\n billable\n }\n }\n"]);return Ye=function(){return e},e}function Ue(){var e=(0,i.Z)(["\n ","\n query GetZapStats($accountId: Int!, $rootIds: [ID!]!) {\n account(id: $accountId) {\n id\n topZaps(rootIds: $rootIds) {\n ...TopZap\n }\n }\n }\n"]);return Ue=function(){return e},e}var je=(0,le.Ps)(Ye()),Ke=(0,le.Ps)(Ue(),je);var Ve=function(e){var n,t=e.accountId,i=e.rootIds,r=(0,ie.a)(Ke,{skip:!i||0===i.length||!t,variables:{accountId:t,rootIds:i}}),a=r.loading,o=r.data;return{isLoading:a,zapStats:null===o||void 0===o||null===(n=o.account)||void 0===n?void 0:n.topZaps}};function Ge(){var e=(0,i.Z)(["\n place-items: start;\n grid-template-columns: auto 250px 100px;\n "]);return Ge=function(){return e},e}function Je(){var e=(0,i.Z)(["\n display: grid;\n grid-gap: 20px;\n "]);return Je=function(){return e},e}var Qe=(0,o.iv)("display:grid;grid-gap:20px;padding:20px;","AppZaps.tsx--rootStyle"),en=(0,m.uq)({tablet:(0,o.iv)(Ge()),mobile:(0,o.iv)(Je())}),nn=(0,o.iv)("flex-grow:1;","AppZaps.tsx--headerAndDescStyle"),tn=(0,o.iv)("display:flex;flex-direction:column;flex:1;","AppZaps.tsx--headerTextStyle"),rn=(0,o.iv)("display:flex;justify-content:center;","AppZaps.tsx--paginatorStyle"),an=function(e){var n=e.isZapsLoading,t=e.legacyZapIds,i=e.totalZapCount,o=e.zaps,m=e.zapsError,g=(0,xe.gn)(),Z=g.isTeam,b=g.accountId,y=(0,l.useRouter)(),x=y.push,A=y.query,C=y.asPath,I=(0,a.useState)(!1),S=I[0],w=I[1],k=A.authId?A.authId:"",D=A.selectedApi?A.selectedApi:"",B=A.serviceSlug?A.serviceSlug:"",M=A.zapSort?A.zapSort:void 0,L=parseInt(A.page)||0,z=(0,Ne.Z)({selectedApi:D,serviceSlug:B}).app,P=(0,a.useMemo)((function(){var e=(null===z||void 0===z?void 0:z.name)||(null===z||void 0===z?void 0:z.title);return e?"All Zaps using ".concat(e):""}),[z]),X=Ve({accountId:b,rootIds:t}),$=X.zapStats,R=X.isLoading;return!n&&m?(0,r.tZ)("div",{css:Qe,children:(0,r.tZ)(s.b,{type:"error",children:m})}):(0,r.BX)("div",{css:Qe,children:[(0,r.BX)("div",{css:en,children:[(0,r.BX)("div",{css:nn,children:[(0,r.tZ)("div",{css:tn,children:(0,r.tZ)(c.x,{tag:"h2",type:"subHeader1Semibold",children:P})}),i>0&&(0,r.tZ)(c.x,{tag:"p",type:"smallPrint1",children:"Zap Task counts are from the current billing period."})]}),(0,r.tZ)(te,{onChange:function(e){var n=(0,v.Sr)(C,{zapSort:e});x(n,void 0,{shallow:!0})},value:M}),(0,r.tZ)(u.z,{color:S?"primary-alt":"secondary",iconBefore:"actionFilter",onClick:function(){return w((function(e){return!e}))},size:"small",children:"Filter"})]}),S&&(0,r.tZ)(We,{}),!n&&o.length>0&&(0,r.tZ)(f.Z,{gap:15,id:"zap-list",itemRenderer:function(e){return(0,r.tZ)(_,{hasTeams:Z,isZapStatsLoading:R,zap:e,zapStat:null===$||void 0===$?void 0:$.find((function(n){return n.id===e.id}))})},items:o}),n&&(0,r.tZ)(f.Z,{gap:10,itemRenderer:function(){return(0,r.tZ)(d.g,{children:(0,r.tZ)(p.q,{height:74,width:"100%"})})},items:Array.from({length:T.wt})}),!n&&0===o.length&&(0,r.tZ)(c.x,{color:"neutral700",type:"paragraph1Short",children:k?"There are no Zaps for your given filters":"We couldn't find any Zaps for this app."}),i>T.wt&&(0,r.tZ)("div",{css:rn,children:(0,r.tZ)(h.D,{currentPageIndex:L,pageUrls:Array.from({length:Math.ceil(i/T.wt)},(function(e,n){return(0,v.Sr)(C,{page:n})}))})})]})}},56357:function(e,n,t){t.d(n,{H7:function(){return s},xB:function(){return c}});var i=t(94149),r=t(42838),a=t(50930),o=t(25155);function l(e,n){if(e){var t=e.split("-").map(Number),o=n?[23,59,59.999]:[0,0,0],l=t[1]-1,s=(0,i.Z)(Date,[t[0],l,t[2]].concat((0,a.Z)(o)));return(0,r.Z)(s,Date)&&!isNaN(s.valueOf())?s:void 0}}function s(e){return e.end||e.start?{from:l(e.start,!1),to:l(e.end,!0)}:{}}function c(e){return{end:(null===e||void 0===e?void 0:e.to)?(0,o.format)(e.to,"YYYY-MM-DD"):void 0,start:(null===e||void 0===e?void 0:e.from)?(0,o.format)(e.from,"YYYY-MM-DD"):void 0}}},71937:function(e,n,t){t.d(n,{G:function(){return i}});var i=function(e){if(!e)return"";var n=e.indexOf(" ");return-1!==n?"".concat(e.substring(0,n+2),"."):e}},70398:function(e,n,t){t.d(n,{CD:function(){return c},Q0:function(){return p},eI:function(){return u},pI:function(){return d},uq:function(){return s}});var i=t(47842),r=t(28165),a="@media (min-width: 0)",o="@media (min-width: 660px)",l="@media (min-width: 1024px)",s=function(e){return[e.mobile?(0,i.Z)({},a,(0,r.iv)(e.mobile)):void 0,e.tablet?(0,i.Z)({},o,(0,r.iv)(e.tablet)):void 0,e.desktop?(0,i.Z)({},l,(0,r.iv)(e.desktop)):void 0].filter(Boolean)},c=s({mobile:{display:"inherit",visibility:"visible"},tablet:{display:"none",visibility:"hidden"},desktop:{display:"none",visibility:"hidden"}}),u=(s({mobile:{display:"none",visibility:"hidden"},tablet:{display:"inherit",visibility:"visible"},desktop:{display:"none",visibility:"hidden"}}),s({mobile:{display:"none",visibility:"hidden"},tablet:{display:"none",visibility:"hidden"},desktop:{display:"inherit",visibility:"visible"}})),d=s({mobile:{display:"none",visibility:"hidden"},tablet:{display:"inherit",visibility:"visible"},desktop:{display:"inherit",visibility:"visible"}}),p=s({mobile:{display:"inherit",visibility:"visible"},tablet:{display:"inherit",visibility:"visible"},desktop:{display:"none",visibility:"hidden"}})},49187:function(e,n,t){t.d(n,{f:function(){return r}});var i=t(28165);function r(e){return(0,i.iv)("grid-area:",e,";","[filename]--[local]")}},25277:function(e,n,t){var i=t(52903),r=t(21357),a=t(47553);n.Z=function(e){var n=e.avatarsCount,t=e.avatarsNodes,o=e.multiline,l=void 0!==o&&o,s=e.size,c=e.children,u=[t].slice(0,n),d=(0,i.tZ)(r.H,{children:u});return(0,i.tZ)(a.w,{avatars:d,multiline:l,size:s,children:c})}},80327:function(e,n,t){var i=t(2784);n.Z=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id,n=(0,i.useRef)(null),t=function(){var e;null===n||void 0===n||null===(e=n.current)||void 0===e||e.focus()};return(0,i.useEffect)((function(){setTimeout((function(){var t,i;e?null===(t=document.getElementById(e))||void 0===t||t.focus():null===n||void 0===n||null===(i=n.current)||void 0===i||i.focus()}))}),[e]),[n,t]}}}]); +//# sourceMappingURL=9346-39f2bba9f43e1d73.js.map \ No newline at end of file