-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2418-7fe30bf6f9b87fee41df.js
1 lines (1 loc) · 11.4 KB
/
2418-7fe30bf6f9b87fee41df.js
1
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2418],{70839:function(n,e,t){t.d(e,{u:function(){return j}});var o=t(30126),r=t(22951),a=t(91976),s=t(47169),i=t(67132),c=t(99492),l=t(27597),u=t(64649),d=t(27378),p=t(50953),m=t(37305),f=t(55175),v=t(97121),h=t(50669),y=t(53169),O=t(83874),b=t(93777),E=t(86634),g=t(40251);function w(){var n=(0,h.Z)(["",""]);return w=function(){return n},n}function C(){var n=(0,h.Z)(["\n #page,\n .modal-content {\n transition: transform ","ms ",";\n }\n\n .__ds_modal {\n z-index: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n transform: translateY(100%);\n\n animation: "," ","ms ",";\n animation-fill-mode: forwards;\n\n &.open {\n animation: "," ","ms ",";\n animation-fill-mode: forwards;\n }\n\n &:not(.open) {\n pointer-events: none !important;\n\n * {\n pointer-events: none !important;\n }\n }\n\n &:not(.opened) {\n animation: none;\n }\n }\n\n .__ds_modal,\n .modal-backsplash {\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n }\n\n .modal-backsplash {\n background: ",";\n opacity: 0.55;\n }\n\n .modal-content {\n z-index: ",";\n transform: scale3d(",", ",", 1);\n height: auto;\n max-height: 100vh;\n overflow-y: auto;\n overflow-x: hidden;\n\n .__ds_modal.open && {\n transform: scale3d(1, 1, 1);\n }\n }\n\n .modal-close-x {\n text-indent: -9999em;\n line-height: 0;\n font-size: 0;\n cursor: pointer;\n z-index: ",";\n position: fixed;\n -webkit-appearance: none;\n background: none;\n border: none;\n\n svg {\n width: 12px;\n height: 12px;\n\n path {\n fill: ",";\n transition: fill 100ms ease-in-out;\n }\n }\n\n &:hover {\n svg path {\n fill: ",";\n }\n }\n }\n\n .tr-modal-close-x {\n transition: background-color 100ms ease-in-out;\n background-color: rgba(0, 0, 0, 0.12);\n border-radius: 50%;\n padding: 18px;\n\n svg {\n path {\n fill: ",";\n }\n }\n\n &:hover {\n background-color: rgba(0, 0, 0, 0.24);\n svg path {\n fill: ",";\n }\n }\n }\n\n .variant-blackout {\n &.modal-theme--dark {\n .modal-backsplash {\n opacity: 0.55;\n }\n }\n\n .modal-backsplash {\n background: ",";\n opacity: 1;\n }\n\n .modal-close-x {\n svg path {\n fill: ",";\n }\n\n &:hover {\n svg path {\n fill: ",";\n }\n }\n }\n\n .tr-modal-close-x {\n background-color: rgba(255, 255, 255, 0.12);\n\n &:hover {\n background-color: rgba(255, 255, 255, 0.24);\n svg path {\n fill: ",";\n }\n }\n\n svg path {\n fill: ",";\n }\n\n &:hover {\n svg path {\n fill: ",";\n }\n }\n }\n }\n"]);return C=function(){return n},n}function L(){var n=(0,h.Z)(["\n\t0% {\n\t\ttransform: translateY(0%);\n\t\topacity: 1;\n\t}\n\n\t99% {\n\t\ttransform: translateY(0%);\n\t\topacity: 0;\n\t}\n\n\t100% {\n\t\ttransform: translateY(100%);\n\t\topacity: 0;\n\t}\n"]);return L=function(){return n},n}function k(){var n=(0,h.Z)(["\n\t0% {\n\t\ttransform: translateY(100%);\n\t\topacity: 0;\n\t}\n\n\t1% {\n\t\ttransform: translateY(0%);\n\t\topacity: 0;\n\t}\n\n\t100% {\n\t\ttransform: translateY(0%);\n\t\topacity: 1;\n\t}\n"]);return k=function(){return n},n}var N=(0,y.css)(C(),O.z.normal,b.m.easeInOutQuart,E.G.modal,(function(){return(0,y.keyframes)(L())}),O.z.normal,b.m.easeInOutQuart,(function(){return(0,y.keyframes)(k())}),O.z.normal,b.m.easeInOutQuart,g.G.grey1000,E.G.modal+2,.95,.95,E.G.modal+3,g.G.grey900,g.G.grey500,g.G.grey900,g.G.grey1000,g.G.grey1000,g.G.white,g.G.grey400,g.G.grey200,g.G.white,g.G.grey200),_=(0,y.createGlobalStyle)(w(),N);function P(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,o)}return t}function D(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?P(Object(t),!0).forEach((function(e){(0,u.Z)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function A(n){var e=function(){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(n){return!1}}();return function(){var t,o=(0,l.Z)(n);if(e){var r=(0,l.Z)(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return(0,c.Z)(this,t)}}d.createContext(null);var j=function(n){(0,i.Z)(t,n);var e=A(t);function t(n){var o;return(0,r.Z)(this,t),o=e.call(this,n),(0,u.Z)((0,s.Z)(o),"state",{MODAL_OPEN:!1,MODAL_OPENED:!1,MODAL_OPEN_CALLBACK:null,MODAL_CLOSE_CALLBACK:null}),(0,u.Z)((0,s.Z)(o),"openEventName",o.props.eventName),(0,u.Z)((0,s.Z)(o),"closeEventName","".concat(o.props.eventName,"-close")),(0,u.Z)((0,s.Z)(o),"eventNameSuffix",""),(0,u.Z)((0,s.Z)(o),"keyPressCloseEventName","".concat(o.props.eventName,"-close-esc")),o.modelOpen=o.modelOpen.bind((0,s.Z)(o)),o.modelClose=o.modelClose.bind((0,s.Z)(o)),o.escKeypress=o.escKeypress.bind((0,s.Z)(o)),o.openFromUrlParam=o.openFromUrlParam.bind((0,s.Z)(o)),o.activeClass=o.activeClass.bind((0,s.Z)(o)),o.activeClass=o.activeClass.bind((0,s.Z)(o)),o}return(0,a.Z)(t,[{key:"openFromUrlParam",value:function(){var n=this,e=location.search;if(e){var t=[this.props.eventName].concat((0,o.Z)(this.props.extraEventNames));e.includes(t.toString())&&setTimeout((function(){window.dispatchEvent(new CustomEvent(n.openEventName))}),400)}}},{key:"activeClass",value:function(n){n?document.body.classList.contains("__ds_modal-open")||document.body.classList.add("__ds_modal-open"):document.body.classList.contains("__ds_modal-open")&&document.body.classList.remove("__ds_modal-open")}},{key:"escKeypress",value:function(n){("key"in(n=n||window.event)?"Escape"===n.key||"Esc"===n.key:27===n.keyCode)&&window.dispatchEvent(new CustomEvent(this.closeEventName))}},{key:"modelOpen",value:function(){this.state.MODAL_OPEN||(this.state.MODAL_OPENED?this.setState({MODAL_OPEN:!0}):this.setState({MODAL_OPEN:!0,MODAL_OPENED:!0}),this.activeClass(!0),this.dispatchEvent("inv-modal-opened",{eventType:"modal-opened"}),this.state.MODAL_OPEN_CALLBACK&&this.state.MODAL_OPEN_CALLBACK(),this.props.openModalCallback&&this.props.openModalCallback())}},{key:"modelClose",value:function(){this.state.MODAL_OPEN&&(this.setState({MODAL_OPEN:!1}),this.activeClass(!1),this.dispatchEvent("inv-modal-closed",{eventType:"modal-closed"}),this.state.MODAL_CLOSE_CALLBACK&&this.state.MODAL_CLOSE_CALLBACK(),this.props.closeModalCallback&&this.props.closeModalCallback())}},{key:"componentDidMount",value:function(){var n=this;window.addEventListener(this.openEventName,this.modelOpen,!1),window.addEventListener(this.closeEventName,this.modelClose,!1),document.addEventListener("keydown",(function(e){return n.escKeypress(e)}),!1),this.openFromUrlParam()}},{key:"componentWillUnmount",value:function(){var n=this;window.removeEventListener(this.openEventName,this.modelOpen,!1),window.removeEventListener(this.closeEventName,this.modelClose,!1),document.removeEventListener("keydown",(function(e){return n.escKeypress(e)}),!1),this.activeClass(!1)}},{key:"dispatchEvent",value:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return window.dispatchEvent(new CustomEvent(n,{detail:D({component:t.displayName,key:"auto",location:"modal",modalName:this.props.eventName,extraEventNames:this.props.extraEventNames},e)}))}},{key:"render",value:function(){var n=this,e=this.props,t=e.children,o=e.className,r=e.componentClassName,a=e.eventName,s=e.showCloseButton,i=e.variant,c=this.state,l=c.MODAL_OPEN,u=c.MODAL_OPENED,h=l?"open":"",y=u?"opened":"",O=function(){return n.dispatchEvent(n.closeEventName)};return d.createElement(p.K,{destination:"modal-root"},d.createElement("div",{id:a,className:(0,f.A)(r,"".concat(o," variant-").concat(i," ").concat(y," ").concat(h))},d.createElement("div",{className:"modal-content"},(0,v.m)({children:t,modalOpen:l,modalOpened:u,modalOpenCallback:function(e){return n.setState({MODAL_OPEN_CALLBACK:e})},modalCloseCallback:function(e){return n.setState({MODAL_CLOSE_CALLBACK:e})}})),s&&d.createElement(m.W,{className:"modal-close-x tr-modal-close-x",onClick:O,ct:{0:2,768:1},cr:{0:2,768:1}},d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",role:"img","aria-label":"Close Modal Button",focusable:"false"},d.createElement("path",{d:"M10.2.3L6 4.6 1.8.3C1.4 0 .7 0 .3.3s-.4 1 0 1.4L4.6 6 .4 10.2c-.4.4-.4 1 0 1.4.4.4 1 .4 1.4 0L6 7.4l4.2 4.2c.4.4 1 .4 1.4 0 .4-.4.4-1 0-1.4L7.4 6l4.2-4.2c.4-.4.4-1 0-1.4-.3-.4-1-.4-1.4-.1"}))),d.createElement("div",{className:"modal-backsplash","aria-label":"click or press escape key to close this modal",onClick:O,onKeyDown:function(e){return n.escKeypress(e)},tabIndex:0})),d.createElement(_,null))}}]),t}(d.PureComponent);j.displayName="Modal",(0,u.Z)(j,"displayName","modal"),(0,u.Z)(j,"defaultProps",{className:"",componentClassName:"modal",eventName:"my-modal",extraEventNames:[],showCloseButton:!0,variant:"default"})},50953:function(n,e,t){t.d(e,{K:function(){return i}});var o=t(65809),r=t(27378),a=t(31542),s=t(43345),i=function(n){var e=n.children,t=n.destination,i=r.useContext(s.T),c={root:i.rootRef.current,page:i.pageRef.current,"modal-root":i.modalRef.current},l=r.useState(!1),u=(0,o.Z)(l,2),d=u[0],p=u[1];return r.useEffect((function(){return p(!0)}),[]),d&&(0,a.createPortal)(e,c[t])};i.defaultProps={destination:"modal-root"},i.displayName="RootPortal"},635:function(n,e,t){t.d(e,{h:function(){return s}});var o=t(64649);function r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,o)}return t}function a(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?r(Object(t),!0).forEach((function(e){(0,o.Z)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}var s=function(n,e){return window.dispatchEvent(new CustomEvent(n,{detail:a({},e)}))}},97121:function(n,e,t){t.d(e,{m:function(){return i}});var o=t(64649),r=t(18808),a=t(27378);function s(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,o)}return t}function i(n){var e=n.children,t=void 0===e?[]:e,i=(0,r.Z)(n,["children"]);return a.Children.map(t,(function(n){return a.isValidElement(n)?a.cloneElement(n,function(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){(0,o.Z)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}({},i)):n}))}}}]);