1 line
44 KiB
JavaScript
1 line
44 KiB
JavaScript
(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[1],{115:function(e,t,n){"use strict";var o=n(0),i=n(20),r=n.n(i),a=n(71),u=Object(o.forwardRef)((function(e,t){var n=e.didUpdate,i=e.getContainer,u=e.children,s=Object(o.useRef)();Object(o.useImperativeHandle)(t,(function(){return{}}));var c=Object(o.useRef)(!1);return!c.current&&Object(a.a)()&&(s.current=i(),c.current=!0),Object(o.useEffect)((function(){null===n||void 0===n||n(e)})),Object(o.useEffect)((function(){return function(){var e,t;null===(e=s.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(s.current)}}),[]),s.current?r.a.createPortal(u,s.current):null}));t.a=u},116:function(e,t,n){"use strict";t.a=function(){if("undefined"===typeof navigator||"undefined"===typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null===e||void 0===e?void 0:e.substr(0,4)))}},117:function(e,t,n){"use strict";(function(e){var n=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,o){return e[0]===t&&(n=o,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(t,n){var o=e(this.__entries__,t);~o?this.__entries__[o][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,o=e(n,t);~o&&n.splice(o,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,o=this.__entries__;n<o.length;n++){var i=o[n];e.call(t,i[1],i[0])}},t}()}(),o="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,i="undefined"!==typeof e&&e.Math===Math?e:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),r="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var a=["top","right","bottom","left","width","height","size","weight"],u="undefined"!==typeof MutationObserver,s=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,o=!1,i=0;function a(){n&&(n=!1,e()),o&&s()}function u(){r(a)}function s(){var e=Date.now();if(n){if(e-i<2)return;o=!0}else n=!0,o=!1,setTimeout(u,t);i=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){o&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){o&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;a.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},l=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},f=g(0,0,0,0);function p(e){return parseFloat(e)||0}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+p(e["border-"+n+"-width"])}),0)}function h(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var o=l(e).getComputedStyle(e),i=function(e){for(var t={},n=0,o=["top","right","bottom","left"];n<o.length;n++){var i=o[n],r=e["padding-"+i];t[i]=p(r)}return t}(o),r=i.left+i.right,a=i.top+i.bottom,u=p(o.width),s=p(o.height);if("border-box"===o.boxSizing&&(Math.round(u+r)!==t&&(u-=d(o,"left","right")+r),Math.round(s+a)!==n&&(s-=d(o,"top","bottom")+a)),!function(e){return e===l(e).document.documentElement}(e)){var c=Math.round(u+r)-t,h=Math.round(s+a)-n;1!==Math.abs(c)&&(u-=c),1!==Math.abs(h)&&(s-=h)}return g(i.left,i.top,u,s)}var v="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof l(e).SVGGraphicsElement}:function(e){return e instanceof l(e).SVGElement&&"function"===typeof e.getBBox};function m(e){return o?v(e)?function(e){var t=e.getBBox();return g(0,0,t.width,t.height)}(e):h(e):f}function g(e,t,n,o){return{x:e,y:t,width:n,height:o}}var b=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=g(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=m(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),w=function(e,t){var n=function(e){var t=e.x,n=e.y,o=e.width,i=e.height,r="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(r.prototype);return c(a,{x:t,y:n,width:o,height:i,top:n,right:t+o,bottom:i+n,left:t}),a}(t);c(this,{target:e,contentRect:n})},y=function(){function e(e,t,o){if(this.activeObservations_=[],this.observations_=new n,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=o}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof l(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new b(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof l(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new w(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),O="undefined"!==typeof WeakMap?new WeakMap:new n,x=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=s.getInstance(),o=new y(t,n,this);O.set(this,o)};["observe","unobserve","disconnect"].forEach((function(e){x.prototype[e]=function(){var t;return(t=O.get(this))[e].apply(t,arguments)}}));var M="undefined"!==typeof i.ResizeObserver?i.ResizeObserver:x;t.a=M}).call(this,n(24))},118:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}));var o=n(63),i=Object(o.a)("success","processing","error","default","warning"),r=Object(o.a)("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime")},160:function(e,t,n){"use strict";function o(e,t){return!!e&&e.contains(t)}n.d(t,"a",(function(){return o}))},161:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(20),i=n.n(o);function r(e,t,n,o){var r=i.a.unstable_batchedUpdates?function(e){i.a.unstable_batchedUpdates(n,e)}:n;return e.addEventListener&&e.addEventListener(t,r,o),{remove:function(){e.removeEventListener&&e.removeEventListener(t,r)}}}},162:function(e,t,n){"use strict";t.a=function(e){if(!e)return!1;if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox();if(t.width||t.height)return!0}if(e.getBoundingClientRect){var n=e.getBoundingClientRect();if(n.width||n.height)return!0}return!1}},72:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(41),i=n(0);function r(e,t){var n=t||{},r=n.defaultValue,a=n.value,u=n.onChange,s=n.postState,c=i.useState((function(){return void 0!==a?a:void 0!==r?"function"===typeof r?r():r:"function"===typeof e?e():e})),l=Object(o.a)(c,2),f=l[0],p=l[1],d=void 0!==a?a:f;s&&(d=s(d));var h=i.useRef(!0);return i.useEffect((function(){h.current?h.current=!1:void 0===a&&p(a)}),[a]),[d,function(e){p(e),d!==e&&u&&u(e,d)}]}},86:function(e,t,n){"use strict";n.d(t,"b",(function(){return u}));var o=function(){return{height:0,opacity:0}},i=function(e){return{height:e.scrollHeight,opacity:1}},r=function(e,t){return!0===(null===t||void 0===t?void 0:t.deadline)||"height"===t.propertyName},a={motionName:"ant-motion-collapse",onAppearStart:o,onEnterStart:o,onAppearActive:i,onEnterActive:i,onLeaveStart:function(e){return{height:e.offsetHeight}},onLeaveActive:o,onAppearEnd:r,onEnterEnd:r,onLeaveEnd:r,motionDeadline:500},u=function(e,t,n){return void 0!==n?n:"".concat(e,"-").concat(t)};t.a=a},88:function(e,t,n){"use strict";var o=n(42),i=n(3),r=n(44),a=n(45),u=n(70),s=n(46),c=n(47),l=n(0),f=n.n(l),p=n(20),d=n.n(p),h=n(55),v=n(160),m=n(83),g=n(57),b=n(161),w=n(115),y=n(39),O=n.n(y);function x(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var M=n(41),T=n(49),E=n(116),C=n(67);function k(e){var t=e.prefixCls,n=e.motion,o=e.animation,i=e.transitionName;return n||(o?{motionName:"".concat(t,"-").concat(o)}:i?{motionName:i}:null)}function j(e){var t=e.prefixCls,n=e.visible,r=e.zIndex,a=e.mask,u=e.maskMotion,s=e.maskAnimation,c=e.maskTransitionName;if(!a)return null;var f={};return(u||c||s)&&(f=Object(o.a)({motionAppear:!0},k({motion:u,prefixCls:t,transitionName:c,animation:s}))),l.createElement(C.b,Object(i.a)({},f,{visible:n,removeOnLeave:!0}),(function(e){var n=e.className;return l.createElement("div",{style:{zIndex:r},className:O()("".concat(t,"-mask"),n)})}))}var P,_=n(48),D=n(162);function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e){return(A="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function N(){if(void 0!==P)return P;P="";var e=document.createElement("p").style;for(var t in V)t+"Transform"in e&&(P=t);return P}function L(){return N()?"".concat(N(),"TransitionProperty"):"transitionProperty"}function W(){return N()?"".concat(N(),"Transform"):"transform"}function z(e,t){var n=L();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function B(e,t){var n=W();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var F,X=/matrix\((.*)\)/,Y=/matrix3d\((.*)\)/;function I(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function q(e,t,n){var o=n;if("object"!==A(t))return"undefined"!==typeof o?("number"===typeof o&&(o="".concat(o,"px")),void(e.style[t]=o)):F(e,t);for(var i in t)t.hasOwnProperty(i)&&q(e,i,t[i])}function U(e,t){var n=e["page".concat(t?"Y":"X","Offset")],o="scroll".concat(t?"Top":"Left");if("number"!==typeof n){var i=e.document;"number"!==typeof(n=i.documentElement[o])&&(n=i.body[o])}return n}function G(e){return U(e)}function $(e){return U(e,!0)}function J(e){var t=function(e){var t,n,o,i=e.ownerDocument,r=i.body,a=i&&i.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=a.clientLeft||r.clientLeft||0,top:o-=a.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=G(o),t.top+=$(o),t}function Z(e){return null!==e&&void 0!==e&&e==e.window}function K(e){return Z(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Q=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),ee=/^(top|right|bottom|left)$/;function te(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function ne(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function oe(e,t,n){"static"===q(e,"position")&&(e.style.position="relative");var o=-999,i=-999,r=te("left",n),a=te("top",n),u=ne(r),s=ne(a);"left"!==r&&(o=999),"top"!==a&&(i=999);var c,l="",f=J(e);("left"in t||"top"in t)&&(l=(c=e).style.transitionProperty||c.style[L()]||"",z(e,"none")),"left"in t&&(e.style[u]="",e.style[r]="".concat(o,"px")),"top"in t&&(e.style[s]="",e.style[a]="".concat(i,"px")),I(e);var p=J(e),d={};for(var h in t)if(t.hasOwnProperty(h)){var v=te(h,n),m="left"===h?o:i,g=f[h]-p[h];d[v]=v===h?m+g:m-g}q(e,d),I(e),("left"in t||"top"in t)&&z(e,l);var b={};for(var w in t)if(t.hasOwnProperty(w)){var y=te(w,n),O=t[w]-f[w];b[y]=w===y?d[y]+O:d[y]-O}q(e,b)}function ie(e,t){var n=J(e),o=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(W());if(n&&"none"!==n){var o=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(o[12]||o[4],0),y:parseFloat(o[13]||o[5],0)}}return{x:0,y:0}}(e),i={x:o.x,y:o.y};"left"in t&&(i.x=o.x+t.left-n.left),"top"in t&&(i.y=o.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),o=n.getPropertyValue("transform")||n.getPropertyValue(W());if(o&&"none"!==o){var i,r=o.match(X);r?((i=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,B(e,"matrix(".concat(i.join(","),")"))):((i=o.match(Y)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,B(e,"matrix3d(".concat(i.join(","),")")))}else B(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function re(e,t){for(var n=0;n<e.length;n++)t(e[n])}function ae(e){return"border-box"===F(e,"boxSizing")}"undefined"!==typeof window&&(F=window.getComputedStyle?function(e,t,n){var o=n,i="",r=K(e);return(o=o||r.defaultView.getComputedStyle(e,null))&&(i=o.getPropertyValue(t)||o[t]),i}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(Q.test(n)&&!ee.test(t)){var o=e.style,i=o.left,r=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=i,e.runtimeStyle.left=r}return""===n?"auto":n});var ue=["margin","border","padding"];function se(e,t,n){var o,i={},r=e.style;for(o in t)t.hasOwnProperty(o)&&(i[o]=r[o],r[o]=t[o]);for(o in n.call(e),t)t.hasOwnProperty(o)&&(r[o]=i[o])}function ce(e,t,n){var o,i,r,a=0;for(i=0;i<t.length;i++)if(o=t[i])for(r=0;r<n.length;r++){var u=void 0;u="border"===o?"".concat(o).concat(n[r],"Width"):o+n[r],a+=parseFloat(F(e,u))||0}return a}var le={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function fe(e,t,n){var o=n;if(Z(e))return"width"===t?le.viewportWidth(e):le.viewportHeight(e);if(9===e.nodeType)return"width"===t?le.docWidth(e):le.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.getBoundingClientRect().width:e.getBoundingClientRect().height,a=ae(e),u=0;(null===r||void 0===r||r<=0)&&(r=void 0,(null===(u=F(e,t))||void 0===u||Number(u)<0)&&(u=e.style[t]||0),u=parseFloat(u)||0),void 0===o&&(o=a?1:-1);var s=void 0!==r||a,c=r||u;return-1===o?s?c-ce(e,["border","padding"],i):u:s?1===o?c:c+(2===o?-ce(e,["border"],i):ce(e,["margin"],i)):u+ce(e,ue.slice(o),i)}re(["Width","Height"],(function(e){le["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],le["viewport".concat(e)](n))},le["viewport".concat(e)]=function(t){var n="client".concat(e),o=t.document,i=o.body,r=o.documentElement[n];return"CSS1Compat"===o.compatMode&&r||i&&i[n]||r}}));var pe={position:"absolute",visibility:"hidden",display:"block"};function de(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i=t[0];return 0!==i.offsetWidth?o=fe.apply(void 0,t):se(i,pe,(function(){o=fe.apply(void 0,t)})),o}function he(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}re(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);le["outer".concat(t)]=function(t,n){return t&&de(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];le[e]=function(t,o){var i=o;return void 0!==i?t?(ae(t)&&(i+=ce(t,["padding","border"],n)),q(t,e,i)):void 0:t&&de(t,e,-1)}}));var ve={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:K,offset:function(e,t,n){if("undefined"===typeof t)return J(e);!function(e,t,n){if(n.ignoreShake){var o=J(e),i=o.left.toFixed(0),r=o.top.toFixed(0),a=t.left.toFixed(0),u=t.top.toFixed(0);if(i===a&&r===u)return}n.useCssRight||n.useCssBottom?oe(e,t,n):n.useCssTransform&&W()in document.body.style?ie(e,t):oe(e,t,n)}(e,t,n||{})},isWindow:Z,each:re,css:q,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:he,getWindowScrollLeft:function(e){return G(e)},getWindowScrollTop:function(e){return $(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)ve.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};he(ve,le);var me=ve.getParent;function ge(e){if(ve.isWindow(e)||9===e.nodeType)return null;var t,n=ve.getDocument(e).body,o=ve.css(e,"position");if(!("fixed"===o||"absolute"===o))return"html"===e.nodeName.toLowerCase()?null:me(e);for(t=me(e);t&&t!==n&&9!==t.nodeType;t=me(t))if("static"!==(o=ve.css(t,"position")))return t;return null}var be=ve.getParent;function we(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},o=ge(e),i=ve.getDocument(e),r=i.defaultView||i.parentWindow,a=i.body,u=i.documentElement;o;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===o.clientWidth||o===a||o===u||"visible"===ve.css(o,"overflow")){if(o===a||o===u)break}else{var s=ve.offset(o);s.left+=o.clientLeft,s.top+=o.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+o.clientWidth),n.bottom=Math.min(n.bottom,s.top+o.clientHeight),n.left=Math.max(n.left,s.left)}o=ge(o)}var c=null;ve.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===ve.css(e,"position")&&(e.style.position="fixed"));var l=ve.getWindowScrollLeft(r),f=ve.getWindowScrollTop(r),p=ve.viewportWidth(r),d=ve.viewportHeight(r),h=u.scrollWidth,v=u.scrollHeight,m=window.getComputedStyle(a);if("hidden"===m.overflowX&&(h=r.innerWidth),"hidden"===m.overflowY&&(v=r.innerHeight),e.style&&(e.style.position=c),t||function(e){if(ve.isWindow(e)||9===e.nodeType)return!1;var t=ve.getDocument(e),n=t.body,o=null;for(o=be(e);o&&o!==n&&o!==t;o=be(o))if("fixed"===ve.css(o,"position"))return!0;return!1}(e))n.left=Math.max(n.left,l),n.top=Math.max(n.top,f),n.right=Math.min(n.right,l+p),n.bottom=Math.min(n.bottom,f+d);else{var g=Math.max(h,l+p);n.right=Math.min(n.right,g);var b=Math.max(v,f+d);n.bottom=Math.min(n.bottom,b)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function ye(e){var t,n,o;if(ve.isWindow(e)||9===e.nodeType){var i=ve.getWindow(e);t={left:ve.getWindowScrollLeft(i),top:ve.getWindowScrollTop(i)},n=ve.viewportWidth(i),o=ve.viewportHeight(i)}else t=ve.offset(e),n=ve.outerWidth(e),o=ve.outerHeight(e);return t.width=n,t.height=o,t}function Oe(e,t){var n=t.charAt(0),o=t.charAt(1),i=e.width,r=e.height,a=e.left,u=e.top;return"c"===n?u+=r/2:"b"===n&&(u+=r),"c"===o?a+=i/2:"r"===o&&(a+=i),{left:a,top:u}}function xe(e,t,n,o,i){var r=Oe(t,n[1]),a=Oe(e,n[0]),u=[a.left-r.left,a.top-r.top];return{left:Math.round(e.left-u[0]+o[0]-i[0]),top:Math.round(e.top-u[1]+o[1]-i[1])}}function Me(e,t,n){return e.left<n.left||e.left+t.width>n.right}function Te(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function Ee(e,t,n){var o=[];return ve.each(e,(function(e){o.push(e.replace(t,(function(e){return n[e]})))})),o}function Ce(e,t){return e[t]=-e[t],e}function ke(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function je(e,t){e[0]=ke(e[0],t.width),e[1]=ke(e[1],t.height)}function Pe(e,t,n,o){var i=n.points,r=n.offset||[0,0],a=n.targetOffset||[0,0],u=n.overflow,s=n.source||e;r=[].concat(r),a=[].concat(a);var c={},l=0,f=we(s,!(!(u=u||{})||!u.alwaysByViewport)),p=ye(s);je(r,p),je(a,t);var d=xe(p,t,i,r,a),h=ve.merge(p,d);if(f&&(u.adjustX||u.adjustY)&&o){if(u.adjustX&&Me(d,p,f)){var v=Ee(i,/[lr]/gi,{l:"r",r:"l"}),m=Ce(r,0),g=Ce(a,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(xe(p,t,v,m,g),p,f)||(l=1,i=v,r=m,a=g)}if(u.adjustY&&Te(d,p,f)){var b=Ee(i,/[tb]/gi,{t:"b",b:"t"}),w=Ce(r,1),y=Ce(a,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(xe(p,t,b,w,y),p,f)||(l=1,i=b,r=w,a=y)}l&&(d=xe(p,t,i,r,a),ve.mix(h,d));var O=Me(d,p,f),x=Te(d,p,f);if(O||x){var M=i;O&&(M=Ee(i,/[lr]/gi,{l:"r",r:"l"})),x&&(M=Ee(i,/[tb]/gi,{t:"b",b:"t"})),i=M,r=n.offset||[0,0],a=n.targetOffset||[0,0]}c.adjustX=u.adjustX&&O,c.adjustY=u.adjustY&&x,(c.adjustX||c.adjustY)&&(h=function(e,t,n,o){var i=ve.clone(e),r={width:t.width,height:t.height};return o.adjustX&&i.left<n.left&&(i.left=n.left),o.resizeWidth&&i.left>=n.left&&i.left+r.width>n.right&&(r.width-=i.left+r.width-n.right),o.adjustX&&i.left+r.width>n.right&&(i.left=Math.max(n.right-r.width,n.left)),o.adjustY&&i.top<n.top&&(i.top=n.top),o.resizeHeight&&i.top>=n.top&&i.top+r.height>n.bottom&&(r.height-=i.top+r.height-n.bottom),o.adjustY&&i.top+r.height>n.bottom&&(i.top=Math.max(n.bottom-r.height,n.top)),ve.mix(i,r)}(d,p,f,c))}return h.width!==p.width&&ve.css(s,"width",ve.width(s)+h.width-p.width),h.height!==p.height&&ve.css(s,"height",ve.height(s)+h.height-p.height),ve.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:r,targetOffset:a,overflow:c}}function _e(e,t,n){var o=n.target||t;return Pe(e,ye(o),n,!function(e,t){var n=we(e,t),o=ye(e);return!n||o.left+o.width<=n.left||o.top+o.height<=n.top||o.left>=n.right||o.top>=n.bottom}(o,n.overflow&&n.overflow.alwaysByViewport))}_e.__getOffsetParent=ge,_e.__getVisibleRectForElement=we;var De=n(117);function Se(e,t){var n=null,o=null;var i=new De.a((function(e){var i=Object(M.a)(e,1)[0].target;if(document.documentElement.contains(i)){var r=i.getBoundingClientRect(),a=r.width,u=r.height,s=Math.floor(a),c=Math.floor(u);n===s&&o===c||Promise.resolve().then((function(){t({width:s,height:c})})),n=s,o=c}}));return e&&i.observe(e),function(){i.disconnect()}}function Re(e){return"function"!==typeof e?null:e()}function Ae(e){return"object"===Object(_.a)(e)&&e?e:null}var He=f.a.forwardRef((function(e,t){var n=e.children,o=e.disabled,i=e.target,r=e.align,a=e.onAlign,u=e.monitorWindowResize,s=e.monitorBufferTime,c=void 0===s?0:s,l=f.a.useRef({}),p=f.a.useRef(),d=f.a.Children.only(n),h=f.a.useRef({});h.current.disabled=o,h.current.target=i,h.current.onAlign=a;var m=function(e,t){var n=f.a.useRef(!1),o=f.a.useRef(null);function i(){window.clearTimeout(o.current)}return[function r(a){if(n.current&&!0!==a)i(),o.current=window.setTimeout((function(){n.current=!1,r()}),t);else{if(!1===e())return;n.current=!0,i(),o.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,i()}]}((function(){var e=h.current,t=e.disabled,n=e.target,o=e.onAlign;if(!t&&n){var i,a=p.current,u=Re(n),s=Ae(n);l.current.element=u,l.current.point=s;var c=document.activeElement;return u&&Object(D.a)(u)?i=_e(a,u,r):s&&(i=function(e,t,n){var o,i,r=ve.getDocument(e),a=r.defaultView||r.parentWindow,u=ve.getWindowScrollLeft(a),s=ve.getWindowScrollTop(a),c=ve.viewportWidth(a),l=ve.viewportHeight(a),f={left:o="pageX"in t?t.pageX:u+t.clientX,top:i="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=o>=0&&o<=u+c&&i>=0&&i<=s+l,d=[n.points[0],"cc"];return Pe(e,f,R(R({},n),{},{points:d}),p)}(a,s,r)),function(e,t){e!==document.activeElement&&Object(v.a)(t,e)&&"function"===typeof e.focus&&e.focus()}(c,a),o&&i&&o(a,i),!0}return!1}),c),w=Object(M.a)(m,2),y=w[0],O=w[1],x=f.a.useRef({cancel:function(){}}),T=f.a.useRef({cancel:function(){}});f.a.useEffect((function(){var e,t,n=Re(i),o=Ae(i);p.current!==T.current.element&&(T.current.cancel(),T.current.element=p.current,T.current.cancel=Se(p.current,y)),l.current.element===n&&((e=l.current.point)===(t=o)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))||(y(),x.current.element!==n&&(x.current.cancel(),x.current.element=n,x.current.cancel=Se(n,y)))})),f.a.useEffect((function(){o?O():y()}),[o]);var E=f.a.useRef(null);return f.a.useEffect((function(){u?E.current||(E.current=Object(b.a)(window,"resize",y)):E.current&&(E.current.remove(),E.current=null)}),[u]),f.a.useEffect((function(){return function(){x.current.cancel(),T.current.cancel(),E.current&&E.current.remove(),O()}}),[]),f.a.useImperativeHandle(t,(function(){return{forceAlign:function(){return y(!0)}}})),f.a.isValidElement(d)&&(d=f.a.cloneElement(d,{ref:Object(g.a)(d.ref,p)})),d}));He.displayName="Align";var Ve=He,Ne=n(110),Le=n.n(Ne),We=n(146),ze=["measure","align",null,"motion"],Be=l.forwardRef((function(e,t){var n=e.visible,r=e.prefixCls,a=e.className,u=e.style,s=e.children,c=e.zIndex,f=e.stretch,p=e.destroyPopupOnHide,d=e.forceRender,v=e.align,m=e.point,g=e.getRootDomNode,b=e.getClassNameFromAlign,w=e.onAlign,y=e.onMouseEnter,x=e.onMouseLeave,T=e.onMouseDown,E=e.onTouchStart,j=Object(l.useRef)(),P=Object(l.useRef)(),_=Object(l.useState)(),D=Object(M.a)(_,2),S=D[0],R=D[1],A=function(e){var t=l.useState({width:0,height:0}),n=Object(M.a)(t,2),o=n[0],i=n[1];return[l.useMemo((function(){var t={};if(e){var n=o.width,i=o.height;-1!==e.indexOf("height")&&i?t.height=i:-1!==e.indexOf("minHeight")&&i&&(t.minHeight=i),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,o]),function(e){i({width:e.offsetWidth,height:e.offsetHeight})}]}(f),H=Object(M.a)(A,2),V=H[0],N=H[1];var L=function(e,t){var n=Object(l.useState)(null),o=Object(M.a)(n,2),i=o[0],r=o[1],a=Object(l.useRef)(),u=Object(l.useRef)(!1);function s(e){u.current||r(e)}function c(){h.a.cancel(a.current)}return Object(l.useEffect)((function(){s("measure")}),[e]),Object(l.useEffect)((function(){switch(i){case"measure":t()}i&&(a.current=Object(h.a)(Object(We.a)(Le.a.mark((function e(){var t,n;return Le.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=ze.indexOf(i),(n=ze[t+1])&&-1!==t&&s(n);case 3:case"end":return e.stop()}}),e)})))))}),[i]),Object(l.useEffect)((function(){return function(){u.current=!0,c()}}),[]),[i,function(e){c(),a.current=Object(h.a)((function(){s((function(e){switch(i){case"align":return"motion";case"motion":return"stable"}return e})),null===e||void 0===e||e()}))}]}(n,(function(){f&&N(g())})),W=Object(M.a)(L,2),z=W[0],B=W[1],F=Object(l.useRef)();function X(){var e;null===(e=j.current)||void 0===e||e.forceAlign()}function Y(e,t){if("align"===z){var n=b(t);R(n),S!==n?Promise.resolve().then((function(){X()})):B((function(){var e;null===(e=F.current)||void 0===e||e.call(F)})),null===w||void 0===w||w(e,t)}}var I=Object(o.a)({},k(e));function q(){return new Promise((function(e){F.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=I[e];I[e]=function(e,n){return B(),null===t||void 0===t?void 0:t(e,n)}})),l.useEffect((function(){I.motionName||"motion"!==z||B()}),[I.motionName,z]),l.useImperativeHandle(t,(function(){return{forceAlign:X,getElement:function(){return P.current}}}));var U=Object(o.a)(Object(o.a)({},V),{},{zIndex:c,opacity:"motion"!==z&&"stable"!==z&&n?0:void 0,pointerEvents:"stable"===z?void 0:"none"},u),G=!0;!(null===v||void 0===v?void 0:v.points)||"align"!==z&&"stable"!==z||(G=!1);var $=s;return l.Children.count(s)>1&&($=l.createElement("div",{className:"".concat(r,"-content")},s)),l.createElement(C.b,Object(i.a)({visible:n,ref:P,leavedClassName:"".concat(r,"-hidden")},I,{onAppearPrepare:q,onEnterPrepare:q,removeOnLeave:p,forceRender:d}),(function(e,t){var n=e.className,i=e.style,u=O()(r,a,S,n);return l.createElement(Ve,{target:m||g,key:"popup",ref:j,monitorWindowResize:!0,disabled:G,align:v,onAlign:Y},l.createElement("div",{ref:t,className:u,onMouseEnter:y,onMouseLeave:x,onMouseDownCapture:T,onTouchStartCapture:E,style:Object(o.a)(Object(o.a)({},i),U)},$))}))}));Be.displayName="PopupInner";var Fe=Be,Xe=l.forwardRef((function(e,t){var n=e.prefixCls,r=e.visible,a=e.zIndex,u=e.children,s=e.mobile,c=(s=void 0===s?{}:s).popupClassName,f=s.popupStyle,p=s.popupMotion,d=void 0===p?{}:p,h=s.popupRender,v=l.useRef();l.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return v.current}}}));var m=Object(o.a)({zIndex:a},f),g=u;return l.Children.count(u)>1&&(g=l.createElement("div",{className:"".concat(n,"-content")},u)),h&&(g=h(g)),l.createElement(C.b,Object(i.a)({visible:r,ref:v,removeOnLeave:!0},d),(function(e,t){var i=e.className,r=e.style,a=O()(n,c,i);return l.createElement("div",{ref:t,className:a,style:Object(o.a)(Object(o.a)({},r),m)},g)}))}));Xe.displayName="MobilePopupInner";var Ye=Xe,Ie=l.forwardRef((function(e,t){var n=e.visible,r=e.mobile,a=Object(T.a)(e,["visible","mobile"]),u=Object(l.useState)(n),s=Object(M.a)(u,2),c=s[0],f=s[1],p=Object(l.useState)(!1),d=Object(M.a)(p,2),h=d[0],v=d[1],m=Object(o.a)(Object(o.a)({},a),{},{visible:c});Object(l.useEffect)((function(){f(n),n&&r&&v(Object(E.a)())}),[n,r]);var g=h?l.createElement(Ye,Object(i.a)({},m,{mobile:r,ref:t})):l.createElement(Fe,Object(i.a)({},m,{ref:t}));return l.createElement("div",null,l.createElement(j,m),g)}));Ie.displayName="Popup";var qe=Ie,Ue=l.createContext(null);function Ge(){}function $e(){return""}function Je(e){return e?e.ownerDocument:window.document}var Ze=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];t.a=function(e){var t=function(t){Object(s.a)(f,t);var n=Object(c.a)(f);function f(e){var t,o;return Object(r.a)(this,f),(t=n.call(this,e)).popupRef=l.createRef(),t.triggerRef=l.createRef(),t.onMouseEnter=function(e){var n=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,n,n?null:e)},t.onMouseMove=function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)},t.onMouseLeave=function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)},t.onPopupMouseEnter=function(){t.clearDelayTimer()},t.onPopupMouseLeave=function(e){var n;e.relatedTarget&&!e.relatedTarget.setTimeout&&Object(v.a)(null===(n=t.popupRef.current)||void 0===n?void 0:n.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)},t.onFocus=function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))},t.onMouseDown=function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()},t.onTouchStart=function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()},t.onBlur=function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)},t.onContextMenu=function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)},t.onContextMenuClose=function(){t.isContextMenuToShow()&&t.close()},t.onClick=function(e){if(t.fireEvents("onClick",e),t.focusTime){var n;if(t.preClickTime&&t.preTouchTime?n=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?n=t.preClickTime:t.preTouchTime&&(n=t.preTouchTime),Math.abs(n-t.focusTime)<20)return;t.focusTime=0}t.preClickTime=0,t.preTouchTime=0,t.isClickToShow()&&(t.isClickToHide()||t.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var o=!t.state.popupVisible;(t.isClickToHide()&&!o||o&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)},t.onPopupMouseDown=function(){var e;(t.hasPopupMouseDown=!0,clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=window.setTimeout((function(){t.hasPopupMouseDown=!1}),0),t.context)&&(e=t.context).onPopupMouseDown.apply(e,arguments)},t.onDocumentClick=function(e){if(!t.props.mask||t.props.maskClosable){var n=e.target,o=t.getRootDomNode(),i=t.getPopupDomNode();Object(v.a)(o,n)&&!t.isContextMenuOnly()||Object(v.a)(i,n)||t.hasPopupMouseDown||t.close()}},t.getRootDomNode=function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var n=Object(m.a)(t.triggerRef.current);if(n)return n}catch(o){}return d.a.findDOMNode(Object(u.a)(t))},t.getPopupClassNameFromAlign=function(e){var n=[],o=t.props,i=o.popupPlacement,r=o.builtinPlacements,a=o.prefixCls,u=o.alignPoint,s=o.getPopupClassNameFromAlign;return i&&r&&n.push(function(e,t,n,o){for(var i=n.points,r=Object.keys(e),a=0;a<r.length;a+=1){var u=r[a];if(x(e[u].points,i,o))return"".concat(t,"-placement-").concat(u)}return""}(r,a,e,u)),s&&n.push(s(e)),n.join(" ")},t.getComponent=function(){var e=t.props,n=e.prefixCls,o=e.destroyPopupOnHide,r=e.popupClassName,a=e.onPopupAlign,u=e.popupMotion,s=e.popupAnimation,c=e.popupTransitionName,f=e.popupStyle,p=e.mask,d=e.maskAnimation,h=e.maskTransitionName,v=e.maskMotion,m=e.zIndex,g=e.popup,b=e.stretch,w=e.alignPoint,y=e.mobile,O=e.forceRender,x=t.state,M=x.popupVisible,T=x.point,E=t.getPopupAlign(),C={};return t.isMouseEnterToShow()&&(C.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(C.onMouseLeave=t.onPopupMouseLeave),C.onMouseDown=t.onPopupMouseDown,C.onTouchStart=t.onPopupMouseDown,l.createElement(qe,Object(i.a)({prefixCls:n,destroyPopupOnHide:o,visible:M,point:w&&T,className:r,align:E,onAlign:a,animation:s,getClassNameFromAlign:t.getPopupClassNameFromAlign},C,{stretch:b,getRootDomNode:t.getRootDomNode,style:f,mask:p,zIndex:m,transitionName:c,maskAnimation:d,maskTransitionName:h,maskMotion:v,ref:t.popupRef,motion:u,mobile:y,forceRender:O}),"function"===typeof g?g():g)},t.attachParent=function(e){h.a.cancel(t.attachId);var n,o=t.props,i=o.getPopupContainer,r=o.getDocument,a=t.getRootDomNode();i?(a||0===i.length)&&(n=i(a)):n=r(t.getRootDomNode()).body,n?n.appendChild(e):t.attachId=Object(h.a)((function(){t.attachParent(e)}))},t.getContainer=function(){var e=(0,t.props.getDocument)(t.getRootDomNode()).createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",t.attachParent(e),e},t.setPoint=function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})},t.handlePortalUpdate=function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)},t.triggerContextValue={onPopupMouseDown:t.onPopupMouseDown},o="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:o,popupVisible:o},Ze.forEach((function(e){t["fire".concat(e)]=function(n){t.fireEvents(e,n)}})),t}return Object(a.a)(f,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(b.a)(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(b.a)(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(b.a)(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(b.a)(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),h.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,i=e.builtinPlacements;return t&&i?function(e,t,n){var i=e[t]||{};return Object(o.a)(Object(o.a)({},i),n)}(i,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,o=this.state.popupVisible;this.clearDelayTimer(),o!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:o}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var o=this,i=1e3*t;if(this.clearDelayTimer(),i){var r=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){o.setPopupVisible(e,r),o.clearDelayTimer()}),i)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var o=this.props[e];o&&o(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,n=this.props,i=n.children,r=n.forceRender,a=n.alignPoint,u=n.className,s=n.autoDestroy,c=l.Children.only(i),f={key:"trigger"};this.isContextMenuToShow()?f.onContextMenu=this.onContextMenu:f.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(f.onClick=this.onClick,f.onMouseDown=this.onMouseDown,f.onTouchStart=this.onTouchStart):(f.onClick=this.createTwoChains("onClick"),f.onMouseDown=this.createTwoChains("onMouseDown"),f.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(f.onMouseEnter=this.onMouseEnter,a&&(f.onMouseMove=this.onMouseMove)):f.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?f.onMouseLeave=this.onMouseLeave:f.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(f.onFocus=this.onFocus,f.onBlur=this.onBlur):(f.onFocus=this.createTwoChains("onFocus"),f.onBlur=this.createTwoChains("onBlur"));var p=O()(c&&c.props&&c.props.className,u);p&&(f.className=p);var d=Object(o.a)({},f);Object(g.c)(c)&&(d.ref=Object(g.a)(this.triggerRef,c.ref));var h,v=l.cloneElement(c,d);return(t||this.popupRef.current||r)&&(h=l.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&s&&(h=null),l.createElement(Ue.Provider,{value:this.triggerContextValue},v,h)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,o={};return void 0!==n&&t.popupVisible!==n&&(o.popupVisible=n,o.prevPopupVisible=t.popupVisible),o}}]),f}(l.Component);return t.contextType=Ue,t.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:$e,getDocument:Je,onPopupVisibleChange:Ge,afterPopupVisibleChange:Ge,onPopupAlign:Ge,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},t}(w.a)}}]); |