Build 584177stable
Module 873263
6,424 characters · in 15230.72f1553659600211.js, 24992.65abf8f4ac1725f1.jsDependencies
Required by (43)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(t,e,n){"use strict";n.d(e,{B6:()=>S,Ix:()=>m,W5:()=>k,W6:()=>M,XZ:()=>y,dO:()=>T,g:()=>U,qh:()=>E,rd:()=>w,zy:()=>P});var r=n(750573),i=n(64700),o=n(655972),a=n.n(o),s=n(830845),c=n(258635),h=n(542113),u=n(353719),l=n.n(u);n(53635),n(725664),n(833871);var f="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:{},p=i.createContext||function(t,e){var n,o,s="__create-react-context-"+(f.__global_unique_id__=(f.__global_unique_id__||0)+1)+"__",c=function(t){function n(){for(var e,n,r,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=(e=t.call.apply(t,[this].concat(o))||this).props.value,r=[],e.emitter={on:function(t){r.push(t)},off:function(t){r=r.filter(function(e){return e!==t})},get:function(){return n},set:function(t,e){n=t,r.forEach(function(t){return t(n,e)})}},e}(0,r.A)(n,t);var i=n.prototype;return i.getChildContext=function(){var t;return(t={})[s]=this.emitter,t},i.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var n,r=this.props.value,i=t.value;(r===i?0!==r||1/r==1/i:r!=r&&i!=i)?n=0:0!=(n=("function"==typeof e?e(r,i):0x3fffffff)|0)&&this.emitter.set(t.value,n)}},i.render=function(){return this.props.children},n}(i.Component);(n={})[s]=a().object.isRequired,c.childContextTypes=n;var h=function(e){function n(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).observedBits=void 0,t.state={value:t.getValue()},t.onUpdate=function(e,n){(t.observedBits&n)!=0&&t.setState({value:t.getValue()})},t}(0,r.A)(n,e);var i=n.prototype;return i.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?0x3fffffff:e},i.componentDidMount=function(){this.context[s]&&this.context[s].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?0x3fffffff:t},i.componentWillUnmount=function(){this.context[s]&&this.context[s].off(this.onUpdate)},i.getValue=function(){return this.context[s]?this.context[s].get():t},i.render=function(){var t;return(Array.isArray(t=this.props.children)?t[0]:t)(this.state.value)},n}(i.Component);return(o={})[s]=a().object,h.contextTypes=o,{Provider:c,Consumer:h}},d=function(t){var e=p();return e.displayName=t,e},g=d("Router-History"),y=d("Router"),m=function(t){function e(e){var n;return(n=t.call(this,e)||this).state={location:e.history.location},n._isMounted=!1,n._pendingLocation=null,e.staticContext||(n.unlisten=e.history.listen(function(t){n._pendingLocation=t})),n}(0,r.A)(e,t),e.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var n=e.prototype;return n.componentDidMount=function(){var t=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen(function(e){t._isMounted&&t.setState({location:e})})),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.createElement(y.Provider,{value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.createElement(g.Provider,{children:this.props.children||null,value:this.props.history}))},e}(i.Component);i.Component;var x=function(t){function e(){return t.apply(this,arguments)||this}(0,r.A)(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(t){this.props.onUpdate&&this.props.onUpdate.call(this,this,t)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},e}(i.Component),v={},b=0;function _(t,e){return void 0===t&&(t="/"),void 0===e&&(e={}),"/"===t?t:(function(t){if(v[t])return v[t];var e=l().compile(t);return b<1e4&&(v[t]=e,b++),e})(t)(e,{pretty:!0})}function w(t){var e=t.computedMatch,n=t.to,r=t.push,o=void 0!==r&&r;return i.createElement(y.Consumer,null,function(t){t||(0,c.A)(!1);var r=t.history,a=t.staticContext,u=o?r.push:r.replace,l=(0,s.yJ)(e?"string"==typeof n?_(n,e.params):(0,h.A)({},n,{pathname:_(n.pathname,e.params)}):n);return a?(u(l),null):i.createElement(x,{onMount:function(){u(l)},onUpdate:function(t,e){var n=(0,s.yJ)(e.to);(0,s.Fu)(n,(0,h.A)({},l,{key:n.key}))||u(l)},to:n})})}var A={},C=0;function S(t,e){void 0===e&&(e={}),("string"==typeof e||Array.isArray(e))&&(e={path:e});var n=e,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,c=n.sensitive,h=void 0!==c&&c;return[].concat(r).reduce(function(e,n){if(!n&&""!==n)return null;if(e)return e;var r=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=A[n]||(A[n]={});if(r[t])return r[t];var i=[],o={regexp:l()(t,i,e),keys:i};return C<1e4&&(r[t]=o,C++),o}(n,{end:o,strict:s,sensitive:h}),i=r.regexp,a=r.keys,c=i.exec(t);if(!c)return null;var u=c[0],f=c.slice(1),p=t===u;return o&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:a.reduce(function(t,e,n){return t[e.name]=f[n],t},{})}},null)}var E=function(t){function e(){return t.apply(this,arguments)||this}return(0,r.A)(e,t),e.prototype.render=function(){var t=this;return i.createElement(y.Consumer,null,function(e){e||(0,c.A)(!1);var n,r=t.props.location||e.location,o=t.props.computedMatch?t.props.computedMatch:t.props.path?S(r.pathname,t.props):e.match,a=(0,h.A)({},e,{location:r,match:o}),s=t.props,u=s.children,l=s.component,f=s.render;return Array.isArray(u)&&(n=u,0===i.Children.count(n))&&(u=null),i.createElement(y.Provider,{value:a},a.match?u?"function"==typeof u?u(a):u:l?i.createElement(l,a):f?f(a):null:"function"==typeof u?u(a):null)})},e}(i.Component);i.Component;var T=function(t){function e(){return t.apply(this,arguments)||this}return(0,r.A)(e,t),e.prototype.render=function(){var t=this;return i.createElement(y.Consumer,null,function(e){e||(0,c.A)(!1);var n,r,o=t.props.location||e.location;return i.Children.forEach(t.props.children,function(t){if(null==r&&i.isValidElement(t)){n=t;var a=t.props.path||t.props.from;r=a?S(o.pathname,(0,h.A)({},t.props,{path:a})):e.match}}),r?i.cloneElement(n,{location:o,computedMatch:r}):null})},e}(i.Component),R=i.useContext;function M(){return R(g)}function P(){return R(y).location}function U(){var t=R(y).match;return t?t.params:{}}function k(t){var e=P(),n=R(y).match;return t?S(e.pathname,t):n}}