(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[195],{2703:function(e,t,n){"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,u){if(u!==r){var a=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4568:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=p(n(7294)),u=p(n(5697)),a=p(n(2593)),l=p(n(4112)),s=p(n(3228)),c=p(n(2673)),f=p(n(1413)),d=n(5597);function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){return e.scrollWidth-1<=t}function y(e,t){return e.scrollHeight-1<=t}var v=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={fontSize:null,ready:!1},n.handleWindowResize=function(){n.process()},"perfectFit"in e&&console.warn("TextFit property perfectFit has been removed."),n.handleWindowResize=(0,c.default)(n.handleWindowResize,e.throttle),n}return!function(e,t){if("function"!=typeof t&&null!==t)throw 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)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.autoResize&&window.addEventListener("resize",this.handleWindowResize),this.process()}},{key:"componentDidUpdate",value:function(e){this.state.ready&&((0,a.default)(this.props,e)||this.process())}},{key:"componentWillUnmount",value:function(){this.props.autoResize&&window.removeEventListener("resize",this.handleWindowResize),this.pid=(0,f.default)()}},{key:"process",value:function(){var e=this,t=this.props,n=t.min,r=t.max,i=t.mode,o=t.forceSingleModeWidth,u=t.onReady,a=this._parent,c=this._child,p=(0,d.innerWidth)(a),v=(0,d.innerHeight)(a);if(v<=0||isNaN(v)){console.warn("Can not process element without height. Make sure the element is displayed and has a static height.");return}if(p<=0||isNaN(p)){console.warn("Can not process element without width. Make sure the element is displayed and has a static width.");return}var m=(0,f.default)();this.pid=m;var b=function(){return m!==e.pid},g="multi"===i?function(){return y(c,v)}:function(){return h(c,p)},_="multi"===i?function(){return h(c,p)}:function(){return y(c,v)},w=void 0,O=n,P=r;this.setState({ready:!1}),(0,l.default)([function(t){return(0,s.default)(function(){return O<=P},function(t){if(b())return t(!0);w=parseInt((O+P)/2,10),e.setState({fontSize:w},function(){return b()?t(!0):(g()?O=w+1:P=w-1,t())})},t)},function(t){return"single"===i&&o||_()?t():(O=n,P=w,(0,s.default)(function(){return O<P},function(t){if(b())return t(!0);w=parseInt((O+P)/2,10),e.setState({fontSize:w},function(){return m!==e.pid?t(!0):(_()?O=w+1:P=w-1,t())})},t))},function(t){if(w=Math.max(w=Math.min(w=Math.max(w=Math.min(O,P),n),r),0),b())return t(!0);e.setState({fontSize:w},t)}],function(t){t||b()||e.setState({ready:!0},function(){return u(w)})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,i=t.text,u=t.style,a=(t.min,t.max,t.mode),l=(t.forceWidth,t.forceSingleModeWidth,t.throttle,t.autoResize,t.onReady,function(e,t){var n={};for(var r in e)!(t.indexOf(r)>=0)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","text","style","min","max","mode","forceWidth","forceSingleModeWidth","throttle","autoResize","onReady"])),s=this.state,c=s.fontSize,f=s.ready,d=r({},u,{fontSize:c}),p={display:f?"block":"inline-block"};return"single"===a&&(p.whiteSpace="nowrap"),o.default.createElement("div",r({ref:function(t){return e._parent=t},style:d},l),o.default.createElement("div",{ref:function(t){return e._child=t},style:p},i&&"function"==typeof n?f?n(i):i:n))}}]),t}(o.default.Component);v.propTypes={children:u.default.node,text:u.default.string,min:u.default.number,max:u.default.number,mode:u.default.oneOf(["single","multi"]),forceSingleModeWidth:u.default.bool,throttle:u.default.number,onReady:u.default.func},v.defaultProps={min:1,max:100,mode:"multi",forceSingleModeWidth:!0,throttle:50,autoResize:!0,onReady:function(){}},t.default=v},3195:function(e,t,n){"use strict";t.iF=void 0;var r,i=(r=n(4568))&&r.__esModule?r:{default:r};t.iF=i.default,i.default},5597:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.innerHeight=function(e){var t=window.getComputedStyle(e,null);return t?e.clientHeight-parseInt(t.getPropertyValue("padding-top"),10)-parseInt(t.getPropertyValue("padding-bottom"),10):e.clientHeight},t.innerWidth=function(e){var t=window.getComputedStyle(e,null);return t?e.clientWidth-parseInt(t.getPropertyValue("padding-left"),10)-parseInt(t.getPropertyValue("padding-right"),10):e.clientWidth}},4112:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=[],r=0,o=!0;function u(e){function r(){t&&t(e,n)}o?i.default.nextTick(r):r()}e.length>0?e[0](function t(i,o){n.push(o),++r>=e.length||i?u(i):e[r](t)}):u(null),o=!1};var r,i=(r=n(4155))&&r.__esModule?r:{default:r}},2593:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++)if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;return!0}},2673:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=void 0,r=void 0,i=void 0,o=void 0,u=0;function a(){o=0,u=+new Date,i=e.apply(n,r),n=null,r=null}return function(){n=this,r=arguments;var e=new Date-u;return o||(e>=t?a():o=setTimeout(a,t-e)),i}}},1413:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return n++};var n=0},3228:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;e()?t(function n(i){for(var o=arguments.length,u=Array(o>1?o-1:0),a=1;a<o;a++)u[a-1]=arguments[a];i?r(i):e.apply(this,u)?t(n):r(null)}):r(null)};var n=function(){}}}]);