forked from sindresorhus/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3153-b603b3e08fed3ebe.js.download
155 lines (148 loc) · 24.6 KB
/
3153-b603b3e08fed3ebe.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3153],{65334:function(e,t,n){"use strict";n.r(t),n.d(t,{canWriteCookieCategory:function(){return l.Lx},readCookie:function(){return r.v},readCookieCategories:function(){return l.DN},readCookies:function(){return r.n},useCookie:function(){return a},useCookieConsent:function(){return s.Y},writeCookie:function(){return i.w}});var o=n(2784),r=n(59251),i=n(26791);const a=e=>{const[t,n]=(0,o.useState)((()=>(0,r.v)(e)));return(0,o.useEffect)((()=>{n((0,r.v)(e))}),[e]),[t,(t,o)=>{!1!==(0,i.w)(e,t,o)&&n(t)}]};var s=n(7727),l=n(3269)},28952:function(e,t,n){"use strict";n.d(t,{u:function(){return v}});var o=n(2784),r=n(28165),i=n(39479),a=n(77293),s=n(91604),l=n(98628),c=n(70776),u=n(61854);const d=()=>"undefined"!==typeof document&&!!document.body,f=["a[href]","button","input","textarea","select","details","[tabindex]"].join(", "),p=e=>Array.from(e.querySelectorAll(f)).filter((e=>e.matches(':not([disabled]):not([tabindex="-1"])'))),h=e=>{const[t,n]=(0,o.useState)(!1);(0,o.useEffect)((()=>{if(!t&&e.current){const t=p(e.current)[0];t&&t.focus(),n(!0)}const o=t=>{const n=t.target,o=e.current;if(n&&o&&!o.contains(n)){const e=((e,t)=>{const n=p(document),o=p(e),r=o[0],i=o[o.length-1];if(!r)return;return n.indexOf(t)<n.indexOf(r)?i:r})(o,n);e&&e.focus()}};return document.addEventListener("focusin",o),()=>{document.removeEventListener("focusin",o)}}),[t,n,e])},g=r.F4`
from { opacity: 0; }
to { opacity: 1; }
`,m=r.F4`
from { opacity: 1; }
to { opacity: 0; }
`,b=(0,i.B)("Modal",{root:r.iv`
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
// Setting height is redundant in most browsers since top/bottom are set,
// but necessary for Safari to properly apply align-items.
height: 100%;
z-index: ${s.C.modalOverlay};
opacity: 0;
display: grid;
align-items: center;
justify-items: center;
`,rootIn:r.iv`
animation: ${g} ${l.f.transitionDuration}
${l.f.transitionTimingFunction} forwards;
`,rootOut:r.iv`
animation: ${m} ${l.f.transitionDuration}
${l.f.transitionTimingFunction} forwards;
`,overlay:r.iv`
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: ${c.w.neutral800};
opacity: 0.8;
z-index: 1;
`,closeButton:r.iv`
display: block;
color: ${c.w.neutral600};
transition: ${l.f.transitionValue};
&:hover,
&:focus {
color: ${c.w.blue};
}
`,modal:r.iv`
position: relative;
z-index: 2;
max-height: 100vh;
// Prevent margin collapsing of children
padding: 1px;
// Ensure children shink by default
display: flex;
`}),v=e=>{const t=!1!==e.canClose,[n,r]=(0,o.useState)(!0),i=(0,o.useRef)(null);(({shouldAllowScroll:e})=>{(0,o.useEffect)((()=>(d()&&(document.body.style.overflow=e?"":"hidden"),()=>{d()&&(document.body.style.overflow="")})),[e])})({shouldAllowScroll:!0===e.canScrollBody});const s=()=>{t&&r(!1)};(0,o.useEffect)((()=>{const e=e=>{"Escape"===e.key&&s()};return window.addEventListener("keyup",e,{capture:!0}),()=>{window.removeEventListener("keyup",e,{capture:!0})}})),h(i);const l=(0,a.U)("div",{css:b.overlay,"data-testid":"ModalOverlay",onClick:s}),c=!!t&&(0,a.U)("button",{css:b.closeButton,"aria-label":"Close modal",onClick:s,type:"button"},(0,a.U)(u.J,{isBlock:!0,name:"formX",size:32})),f=e.children&&o.Children.only(e.children),p=Object.assign(Object.assign({},f),{props:Object.assign(Object.assign({},e.children.props||{}),{closeButton:c})}),g=(0,a.U)("div",{"aria-label":e.ariaLabel,"aria-live":"polite","aria-modal":"true",css:b.modal,ref:i,role:"dialog"},p);return(0,a.U)("div",{css:[b.root,n?b.rootIn:b.rootOut],"data-testid":"Modal",onAnimationEnd:()=>{!1===n&&e.onClosed()}},(0,a.U)("div",null,l,g))}},66266:function(e,t,n){"use strict";n.d(t,{bT:function(){return p},dE:function(){return d},hz:function(){return h},nS:function(){return f}});var o=n(28165),r=n(39479),i=n(77293),a=n(70776),s=n(10391),l=n(3e3);const c=(0,n(38137).F)("ModalMediaContent",["spacing","footerMarginBottom"]),u=(0,r.B)("ModalContent",{root:o.iv`
${c.spacing}: 20px;
${c.footerMarginBottom}: 0px;
position: relative;
display: flex;
flex-direction: column;
max-height: calc(100vh - 70px);
background-color: ${a.w.neutral100};
padding: var(${c.spacing});
// 40px handles bottom toolbar in iOS Safari
margin: 10px 10px calc(10px + 40px);
border-radius: 5px;
border: 1px solid ${a.w.neutral300};
box-shadow: ${s.f.elevation5};
@media screen and (min-width: 650px) {
// Effectively tighten the bottom padding of ModalContent
// by pulling it up via margin.
${c.footerMarginBottom}: -10px;
min-width: 550px;
max-width: 970px;
max-height: 650px;
padding: calc(var(${c.spacing}) * 2);
margin: 30px;
}
`,closeButton:o.iv`
position: absolute;
top: 8px;
right: 8px;
`,modalContentHeader:o.iv`
${l.ZT.paragraph1Bold};
margin-bottom: var(${c.spacing});
color: ${a.w.neutral800};
// Protect header from close button.
padding-right: 20px;
&[data-align='center'] {
// Ensure header is centered with the padding-right above.
padding-left: 20px;
text-align: center;
}
`,modalContentBody:o.iv`
color: ${a.w.neutral700};
position: relative;
flex: 1;
display: flex;
flex-direction: column;
// Support scrolling the child.
min-height: 0;
&[data-size='small'] {
${l.ZT.paragraph3};
color: ${a.w.neutral700};
}
&[data-size='medium'] {
${l.ZT.paragraph3};
}
&[data-align='center'] {
text-align: center;
}
&[data-scrollable] {
// This is the gradient fader that renders over content
// to help indicate that it's scrollable.
&::after {
content: '';
position: absolute;
bottom: -1px;
left: 0;
right: 0;
height: 46px;
pointer-events: none;
background: linear-gradient(0deg, #fffdf9 0%, #fff0 75%);
}
}
`,modalContentBodyInner:o.iv`
flex: 1;
&[data-scrollable] {
overflow: auto;
// Add padding so end content isn't covered by the gradient fader.
// Rebrand linear-gradient is a bit taller
padding-bottom: 26px;
}
`,modalContentFooter:o.iv`
display: flex;
flex-wrap: wrap;
gap: 10px 20px;
justify-content: center;
margin: var(${c.spacing}) auto var(${c.footerMarginBottom});
// Always a little 🤢 to use these selectors, but it helps to ensure
// that they stretch full width on small screens. The attribute qualifiers
// help with specificity.
> *[class],
> *[style] {
flex: 1 1 auto;
}
`}),d=e=>(0,i.U)("header",{css:u.modalContentHeader,"data-align":e.align},e.children),f=e=>{const{size:t=(e.scrollable?"small":"medium")}=e;return(0,i.U)("div",{css:u.modalContentBody,"data-align":e.align,"data-scrollable":!0===e.scrollable?"":void 0,"data-size":t},(0,i.U)("div",{css:u.modalContentBodyInner,"data-scrollable":!0===e.scrollable?"":void 0,tabIndex:!0===e.scrollable?0:void 0},e.children))},p=e=>(0,i.U)("footer",{css:u.modalContentFooter},e.children),h=e=>{const t={maxWidth:e.maxWidth};return(0,i.U)("div",{css:u.root,style:t},e.children,e.closeButton&&(0,i.U)("div",{css:u.closeButton},e.closeButton))}},47043:function(e,t,n){"use strict";n.d(t,{q:function(){return c}});var o=n(28165),r=n(39479),i=n(77293),a=n(70776);const s=(0,o.F4)({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}}),l=(0,r.B)("SkeletonBlock",{root:[{backgroundColor:a.w.neutral200,overflow:"hidden",position:"relative","&::before":{animation:`${s} 1s ease-in-out infinite`,content:'""',background:"linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0))",position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}}]}),c=({aspectRatio:e,borderRadius:t=5,height:n,width:o="100%"})=>{const r={borderRadius:t,width:o,paddingTop:e?`calc(${o} / ${e})`:n};return(0,i.U)("div",{css:l.root,"data-testid":"SkeletonBlock",style:r})}},81901:function(e,t,n){"use strict";n.d(t,{L:function(){return v}});var o=n(77466),r=n(28165),i=n(2784),a=n(61854),s=n(35080),l=n(13030),c=n(70776),u=n(95945),d=n(39479),f=n(77293),p=n(93594);var h=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const g=e=>e.isDisabled||0===e.items.length,m=(0,d.B)("Dropdown",{root:(0,r.iv)({position:"relative"}),buttonWrap:e=>({cursor:g(e)?"default":"pointer"}),button:(0,r.iv)({maxWidth:"100%",overflow:"hidden"}),buttonText:(0,r.iv)({display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),placeholder:(0,r.iv)({color:c.w.neutral600})}),b=({label:e,value:t,placeholder:n})=>[t,e,!t&&n].filter(Boolean).join(", ");function v(e){var{size:t="small",getLabelForItem:n=(e=>e.label),renderFloatingMenu:r=(e=>(0,f.U)(s.A,Object.assign({},e))),menuAriaLabel:c="List of items"}=e,d=h(e,["size","getLabelForItem","renderFloatingMenu","menuAriaLabel"]);const v=Object.assign({size:t,getLabelForItem:n,renderFloatingMenu:r,menuAriaLabel:c},d),y=(0,i.useRef)(null),w=v.renderButtonForItem||v.getLabelForItem;return(0,f.U)(o.ZP,{initialSelectedItem:v.initialSelectedItem,inputId:v.inputId,itemCount:v.items.length,itemToString:e=>e?v.getLabelForItem(e):"",onChange:e=>{var t;e&&(null===(t=v.onChange)||void 0===t||t.call(v,e))},onSelect:e=>{var t;e&&(null===(t=v.onSelect)||void 0===t||t.call(v,e))},stateReducer:(e,t)=>t.type===o.ZP.stateChangeTypes.keyDownEscape?{isOpen:!1}:t,selectedItem:v.selectedItem},(({clearSelection:e,closeMenu:t,getInputProps:n,getItemProps:o,getMenuProps:r,getRootProps:i,highlightedIndex:s,isOpen:c,openMenu:d,selectItem:x,selectedItem:O,setHighlightedIndex:C})=>{const P=!!O,I=(k=i(),j=["aria-labelledby"],(0,p.s)(Object.entries(k).filter((([e])=>!j.includes(e)))));var k,j;const S=e=>{if(v.onBlur){const n={didBlurWithin:!!y.current&&y.current.contains(e.relatedTarget),closeMenu:t};v.onBlur(e,n)}else t()},{onChange:U,onClick:E}=v,L=h(v,["onChange","onClick"]);return(0,f.U)("div",Object.assign({"aria-label":v.menuAriaLabel,"aria-labelledby":v.inputId,css:m.root},I,{onBlur:S,ref:y}),(0,f.U)("div",{css:m.buttonWrap(v)},(0,f.U)(l.I,Object.assign({onClick:()=>{!0===c?t():g(v)||d(),v.onClick&&v.onClick()}},L,(0,u.j)(n()),{canClickIconAfter:!1,id:v.inputId,isDisabled:g(v),renderIconAfter:()=>(0,f.U)(a.J,{name:"arrowDropdown",size:24}),renderIconBefore:()=>"function"===typeof v.renderIcon?v.renderIcon(O):void 0}),(e=>(0,f.U)("button",{"aria-activedescendant":e["aria-activedescendant"],"aria-invalid":e["aria-invalid"],"aria-controls":e["aria-controls"],"aria-expanded":c?"true":"false","aria-haspopup":"true","aria-label":b({label:e["aria-label"]||"",placeholder:v.placeholder,value:P?v.getLabelForItem(O):void 0}),css:[e.css,m.button],disabled:e.disabled,id:e.id,onBlur:S,onFocus:v.onFocus,onKeyDown:e.onKeyDown,type:"button"},P?(0,f.U)("span",{css:m.buttonText},w(O)):(0,f.U)("span",{css:[m.buttonText,m.placeholder]},v.placeholder))))),c&&v.renderFloatingMenu({ariaLabel:v.menuAriaLabel,clearSelection:e,closeMenu:t,items:v.items,highlightedIndex:s,getKeyForItem:v.getKeyForItem,getLabelForItem:v.getLabelForItem,getItemProps:o,getMenuProps:r,getInputProps:n,renderIcon:v.renderIcon,selectItem:x,selectedItem:O,setHighlightedIndex:C}))}))}},81186:function(e,t,n){"use strict";n.d(t,{H:function(){return l}});var o=n(77293),r=n(61854),i=n(87593),a=n(36897),s=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function l(e){var{icon:t,iconSize:n,isCircle:l,label:c,shouldCorrectTooltipPosition:u,tooltipId:d,tooltipPosition:f}=e,p=s(e,["icon","iconSize","isCircle","label","shouldCorrectTooltipPosition","tooltipId","tooltipPosition"]);return(0,o.U)(i.p,{content:c,position:f,shouldCorrectPosition:u,showTooltipOnTouchDevices:!1,tooltipId:d},(({childProps:e})=>(0,o.U)(a.Y,Object.assign({ariaLabel:c},p,e,{isPill:l,isSquare:!0}),(0,o.U)(r.J,{canAcceptPointerEvents:!1,isBlock:!0,name:t,size:24}))))}},66830:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var o=n(77293),r=n(81186),i=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function a(e){var{color:t="icon-primary",size:n="small",tooltipPosition:a="south"}=e,s=i(e,["color","size","tooltipPosition"]);return(0,o.U)(r.H,Object.assign({color:t,size:n,tooltipPosition:a},s))}},90982:function(e,t,n){"use strict";n.d(t,{D:function(){return m}});var o=n(28165),r=n(66830),i=n(3e3),a=n(70776),s=n(39479),l=n(52676),c=n(77293),u=n(37260),d=n(36897),f=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function p(e){var{selected:t,value:n}=e,o=f(e,["selected","value"]);return(0,c.U)(d.Y,Object.assign({},o,{color:t?"primary-alt":"number",isSquare:!0,size:"small"}),n)}const h=(0,s.B)("Paginator",{root:(e,t)=>[{display:"grid",gap:10,gridTemplateColumns:`repeat(${e.numberOfButtons}, 40px)`,alignItems:"center"},e.isCondensed&&(0,l.Q)("condensed",{gridTemplateColumns:"44px 44px min-content 44px 44px"}),t&&(0,l.Q)("isCentered",{justifyContent:"center"})],text:[(0,o.iv)(Object.assign(Object.assign({},i.ZT.base),{fontSize:16,lineHeight:"22px",fontWeight:600,textAlign:"center",whiteSpace:"nowrap",color:a.w.neutral800})),o.iv`
padding-left: 20px;
padding-right: 20px;
`]}),g=e=>{const t=2*`${e.numberOfPages}`.length+3;return(0,c.U)("span",{css:h.text,style:{minWidth:`${t}ch`}},`${e.currentPageIndex+1} of ${e.numberOfPages}`)},m=({currentPageIndex:e,pageUrls:t,ariaLabel:n,condenseAt:o=6,firstPageUrl:i,isCentered:a,lastPageUrl:s,offset:l=0,onPaginate:d})=>{const f=t.length,m=f-1,b=(0,u.u)(e,0,m),v=Math.max(0,b-1),y=Math.min(m,b+1),w=f>=o,x={numberOfPages:f,isCondensed:w,numberOfButtons:f+2+[i,s].filter(Boolean).length},O=(e,t,n)=>o=>{d&&d({buttonType:e,pageIndex:t,pageUrl:n},o)},C=w?(0,c.U)(g,{currentPageIndex:b,numberOfPages:f}):t.map(((e,t)=>{const n=t===b,o=l+t+1;return(0,c.U)(p,{ariaLabel:n?`Current page (${o})`:`${o}`,href:e,key:e||o,onClick:O("number",t,e),value:o,selected:n,hasShadow:n})})),P=i||(w?t[0]:void 0),I=(P||w)&&(0,c.U)(r.h,{ariaLabel:"First page",color:"icon-secondary",disabled:e<=0,href:P,icon:"arrowLineLeft",onClick:O("first",0,P),tooltipPosition:"southwest"}),k=s||(w?t[m]:void 0),j=(k||w)&&(0,c.U)(r.h,{ariaLabel:"Last page",color:"icon-secondary",disabled:b>=m,href:k,icon:"arrowLineRight",onClick:O("last",m,k),tooltipPosition:"southeast"});return(0,c.U)("nav",{"aria-label":n,css:[h.root(x,a)]},I,(0,c.U)(r.h,{ariaLabel:`Previous page (${v+1})`,color:"icon-secondary",disabled:b<=0,href:t[v],icon:"arrowSmallLeft",onClick:O("previous",v,t[v]),tooltipPosition:"southwest"}),C,(0,c.U)(r.h,{ariaLabel:`Next page (${y+1})`,color:"icon-secondary",disabled:b>=m,href:t[y],icon:"arrowSmallRight",onClick:O("next",y,t[y]),tooltipPosition:"southeast"}),j)}},60196:function(e,t,n){"use strict";n.d(t,{I:function(){return r}});var o=n(2784);const r=()=>{const[e,t]=(0,o.useState)(!1),[n,r]=(0,o.useState)(null);return(0,o.useEffect)((()=>{if(n){const e=n.offsetHeight;n.scrollHeight-e>2&&t(!0)}}),[n]),[e,r]}},77409:function(e,t){"use strict";var n=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(n){var o=e.call(this,n.message)||this;return o.name="NetworkError",o.networkErrorMessage=n.message,o.message="We're having some trouble connecting. You might try reloading the page or checking your internet connection. "+o.networkErrorMessage,o.shouldGlobalizeError=!1!==n.shouldGlobalizeError&&!t.isFirefoxFetchError(n),o}return n(t,e),t.isFirefoxFetchError=function(e){return Boolean(e&&"TypeError"===e.name&&"NetworkError when attempting to fetch resource."===e.message)},t.summary=function(e){return e.message},t}(Error);t.default=o},25287:function(e,t,n){"use strict";var o=n(34406),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{l(o.next(e))}catch(t){i(t)}}function s(e){try{l(o.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonWithAccountId=t.isJsonResponse=t.sendFormData=t.postJsonWithAccountId=t.putJson=t.postJson=t.patchJson=t.getJson=t.deleteJson=t.fetchJson=t.onFetchComplete=t.csrfTokenReady=void 0;var l=s(n(76635)),c=n(17712),u=n(65334),d=s(n(77409)),f=function(e){return e.status>=200&&e.status<300?e:e.text().then((function(t){throw e.responseText=t,e}))},p=null;function h(e){return p||(p=function(e){return e?fetch(o.env.ZAPIER_API_BASE_URL+"/api/v3/csrf",{credentials:"include",mode:"cors"}).then(f).catch((function(e){throw new d.default(r(r({},e),{message:"Unable to retrieve CSRF token."}))})):u.readCookie("csrftoken")?Promise.resolve():fetch("/api/v3/csrf",{credentials:"same-origin"}).then(f).catch((function(e){throw new d.default(r(r({},e),{message:"Unable to retrieve CSRF token."}))}))}(e),p)}t.csrfTokenReady=h;var g=function(e){return void 0===e&&(e=0),document.location?Promise.resolve(document.location):e>2e3?Promise.reject("Couldn't find document.location after 2 seconds."):new Promise((function(t){setTimeout((function(){g(e+100).then(t)}),100)}))},m=function(e){return g().then((function(t){var n="//"+t.host,o=t.protocol+n;return e===o||e.slice(0,o.length+1)===o+"/"||e===n||e.slice(0,n.length+1)===n+"/"||!/^(\/\/|http:|https:).*/.test(e)}))};function b(e,t){return i(this,void 0,void 0,(function(){var n,r,i,s,l;return a(this,(function(a){switch(a.label){case 0:return n=t.method||"",/^(GET|HEAD|OPTIONS|TRACE)$/.test(n)||"undefined"===typeof window?[2,t]:[4,m(e)];case 1:return r=a.sent(),i=function(e){if(!o.env.ZAPIER_API_BASE_URL)return!1;var t=new URL(o.env.ZAPIER_API_BASE_URL);try{return new URL(e).origin===t.origin}catch(n){return!1}}(e),r||i?[4,h(i)]:[2,t];case 2:return s=a.sent(),(l=i?s.headers.get("x-upstreamcsrftoken"):u.readCookie("csrftoken"))&&(t.headers=new Headers(t.headers||{}),t.headers.set("X-CSRFToken",l)),[2,t]}}))}))}var v=function(e){};t.onFetchComplete=function(e){v=e};var y=function(e,t){void 0===t&&(t={}),(t=r({},t)).headers=new Headers(t.headers||{}),t.headers.set("X-Requested-With","XMLHttpRequest"),t.credentials="include";var n,i=0!==(n=e).indexOf("//")&&0!==n.indexOf("https://")&&0!==n.indexOf("http://")?""+(o.env.ZAPIER_API_BASE_URL||"")+e:e;return b(i,t).then((function(e){return fetch(i,e).then((function(e){return v(e),e})).catch((function(e){var t=(e.message||"")+" url='"+i+"'";throw new d.default(r(r({},e),{message:t}))}))}))};y.success=f,y.json=function(e){return e.json().then((function(e){return e})).catch((function(t){if(204===e.status)return null;if(e.status>=200&&e.status<300)throw t;throw e}))},y.url=function(e,t){if(!t)return e;var n=Object.keys(t).reduce((function(e,n){var o=t[n],r=e;return"undefined"!==typeof o&&null!==o&&(r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o)),r}),"");return e+(n?"?":"")+n},t.fetchJson=function(e,t){return(t=t?l.default.extend({},t):{}).headers=new Headers(t.headers||{}),t.body&&t.headers.set("Content-Type","application/json"),t.headers.set("Accept","application/json"),y(e,t).then(y.success).then(y.json)};var w=function(e,n,o){return t.fetchJson(n,r(r({},"GET"!==e?{body:o&&JSON.stringify(o)}:{}),{method:e}))};t.deleteJson=l.default.partial(w,"DELETE"),t.getJson=l.default.partial(w,"GET"),t.patchJson=l.default.partial(w,"PATCH"),t.postJson=l.default.partial(w,"POST"),t.putJson=l.default.partial(w,"PUT"),t.postJsonWithAccountId=function(e,n,o){return void 0===o&&(o={}),t.postJson(n,r(r({},o),{account_id:e}))},t.sendFormData=function(e,t,n){void 0===n&&(n={}),n.headers&&(n.headers=new Headers(n.headers||{}),n.headers.set("Accept","application/json"));var o=r(r({method:"POST"},n),{body:t});return y(e,o).then(y.success).then(y.json)};t.isJsonResponse=l.default.partial((function(e,t){return l.default.isFunction(l.default.get(t,["headers","get"]))&&t.headers.get("content-type").indexOf(e)>-1}),"application/json"),t.getJsonWithAccountId=function(e,n){return t.getJson(c.addTruthyParamsToUrl(n,{account_id:e}))},t.default=y},9197:function(e,t,n){"use strict";var o=n(25287);Object.defineProperty(t,"rd",{enumerable:!0,get:function(){return o.fetchJson}}),Object.defineProperty(t,"uz",{enumerable:!0,get:function(){return o.postJson}}),Object.defineProperty(t,"fU",{enumerable:!0,get:function(){return o.putJson}});var r=n(77409)},29620:function(e,t){function n(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"===typeof e)return a[e];var n,i=String(e);return(n=o[i.toLowerCase()])?n:(n=r[i.toLowerCase()])||(1===i.length?i.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"===typeof e){var n=e.which||e.keyCode||e.charCode;if(null===n||void 0===n)return!1;if("string"===typeof t){var i;if(i=o[t.toLowerCase()])return i===n;if(i=r[t.toLowerCase()])return i===n}else if("number"===typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i<123;i++)o[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)o[i-48]=i;for(i=1;i<13;i++)o["f"+i]=i+111;for(i=0;i<10;i++)o["numpad "+i]=i+96;var a=t.names=t.title={};for(i in o)a[o[i]]=i;for(var s in r)o[s]=r[s]},98788:function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(o,r)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,l,"next",e)}function l(e){o(a,r,i,s,l,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return r}})}}]);
//# sourceMappingURL=3153-b603b3e08fed3ebe.js.map