@visactor/react-vrender 0.11.0-alpha.1 → 0.11.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,2298 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@visactor/vrender"),require("react-reconciler")):"function"==typeof define&&define.amd?define(["exports","@visactor/vrender","react-reconciler"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactVRender={},e.vrender,e.ReactReconciler)}(this,(function(e,t,r){"use strict";function n(e){return e}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}};function i(e){return i="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},i(e)}var u,c,s,l={};
2
- /*
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@visactor/vrender'), require('react-reconciler')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@visactor/vrender', 'react-reconciler'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactVRender = {}, global.VRender, global.ReactReconciler));
5
+ })(this, (function (exports, vrender, ReactReconciler) { 'use strict';
6
+
7
+ function ElementOf(type) {
8
+ return type;
9
+ }
10
+ const TYPES = {
11
+ layer: 'Layer',
12
+ arc: 'Arc',
13
+ rect: 'Rect',
14
+ circle: 'Circle',
15
+ area: 'Area',
16
+ group: 'Group'
17
+ };
18
+ const Layer = ElementOf('layer');
19
+ const Arc = ElementOf('arc');
20
+ const Area = ElementOf('area');
21
+ const Circle = ElementOf('circle');
22
+ const Group = ElementOf('group');
23
+ const Image = ElementOf('image');
24
+ const Line = ElementOf('line');
25
+ const Path = ElementOf('path');
26
+ const Rect = ElementOf('rect');
27
+ const Rect3d = ElementOf('rect3d');
28
+ const VRenderSymbol = ElementOf('symbol');
29
+ const Text = ElementOf('text');
30
+ const RichText = ElementOf('richtext');
31
+ const Polygon = ElementOf('polygon');
32
+ const Glyph = ElementOf('glyph');
33
+ const ShadowRoot = ElementOf('shadowroot');
34
+
35
+ function getDefaultExportFromCjs (x) {
36
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
37
+ }
38
+
39
+ var react = {exports: {}};
40
+
41
+ function _typeof(obj) {
42
+ "@babel/helpers - typeof";
43
+
44
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
45
+ return typeof obj;
46
+ } : function (obj) {
47
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
48
+ }, _typeof(obj);
49
+ }
50
+
51
+ var react_production_min = {};
52
+
53
+ /*
3
54
  object-assign
4
55
  (c) Sindre Sorhus
5
56
  @license MIT
6
- */function f(){if(c)return u;c=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return u=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var a,i,u=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),c=1;c<arguments.length;c++){for(var s in a=Object(arguments[c]))t.call(a,s)&&(u[s]=a[s]);if(e){i=e(a);for(var l=0;l<i.length;l++)r.call(a,i[l])&&(u[i[l]]=a[i[l]])}}return u},u}var p,d,y,h,m,v,b,g={};function C(){return h?y:(h=1,y=Function.call.bind(Object.prototype.hasOwnProperty))}function _(){if(v)return m;v=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=d?p:(d=1,p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"),r={},n=C();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,a,u,c,s){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var f;try{if("function"!=typeof o[l]){var p=Error((c||"React class")+": "+u+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i(o[l])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=o[l](a,l,c,u,null,t)}catch(e){f=e}if(!f||f instanceof Error||e((c||"React class")+": type specification of "+u+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+i(f)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in r)){r[f.message]=!0;var d=s?s():"";e("Failed "+u+" type: "+f.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},m=o}"production"===process.env.NODE_ENV?a.exports=function(){if(s)return l;s=1;var e=f(),t="function"==typeof Symbol&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,a=t?Symbol.for("react.strict_mode"):60108,u=t?Symbol.for("react.profiler"):60114,c=t?Symbol.for("react.provider"):60109,p=t?Symbol.for("react.context"):60110,d=t?Symbol.for("react.forward_ref"):60112,y=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C={};function _(e,t,r){this.props=e,this.context=t,this.refs=C,this.updater=r||g}function w(){}function S(e,t,r){this.props=e,this.context=t,this.refs=C,this.updater=r||g}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!==i(e)&&"function"!=typeof e&&null!=e)throw Error(b(85));this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=_.prototype;var P=S.prototype=new w;P.constructor=S,e(P,_.prototype),P.isPureReactComponent=!0;var R={current:null},E=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function O(e,t,n){var o,a={},i=null,u=null;if(null!=t)for(o in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)E.call(t,o)&&!x.hasOwnProperty(o)&&(a[o]=t[o]);var c=arguments.length-2;if(1===c)a.children=n;else if(1<c){for(var s=Array(c),l=0;l<c;l++)s[l]=arguments[l+2];a.children=s}if(e&&e.defaultProps)for(o in c=e.defaultProps)void 0===a[o]&&(a[o]=c[o]);return{$$typeof:r,type:e,key:i,ref:u,props:a,_owner:R.current}}function k(e){return"object"===i(e)&&null!==e&&e.$$typeof===r}var j=/\/+/g,$=[];function I(e,t,r,n){if($.length){var o=$.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function T(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>$.length&&$.push(e)}function D(e,t,o,a){var u=i(e);"undefined"!==u&&"boolean"!==u||(e=null);var c=!1;if(null===e)c=!0;else switch(u){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case r:case n:c=!0}}if(c)return o(a,e,""===t?"."+A(e,0):t),1;if(c=0,t=""===t?".":t+":",Array.isArray(e))for(var s=0;s<e.length;s++){var l=t+A(u=e[s],s);c+=D(u,l,o,a)}else if("function"==typeof(l=null===e||"object"!==i(e)?null:"function"==typeof(l=v&&e[v]||e["@@iterator"])?l:null))for(e=l.call(e),s=0;!(u=e.next()).done;)c+=D(u=u.value,l=t+A(u,s++),o,a);else if("object"===u)throw o=""+e,Error(b(31,"[object Object]"===o?"object with keys {"+Object.keys(e).join(", ")+"}":o,""));return c}function N(e,t,r){return null==e?0:D(e,"",t,r)}function A(e,t){return"object"===i(e)&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function L(e,t){e.func.call(e.context,t,e.count++)}function F(e,t,n){var o=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?U(e,o,n,(function(e){return e})):null!=e&&(k(e)&&(e=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(j,"$&/")+"/")+n)),o.push(e))}function U(e,t,r,n,o){var a="";null!=r&&(a=(""+r).replace(j,"$&/")+"/"),N(e,F,t=I(t,a,n,o)),T(t)}var M={current:null};function V(){var e=M.current;if(null===e)throw Error(b(321));return e}var H={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:R,IsSomeRendererActing:{current:!1},assign:e};return l.Children={map:function(e,t,r){if(null==e)return e;var n=[];return U(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;N(e,L,t=I(null,null,t,r)),T(t)},count:function(e){return N(e,(function(){return null}),null)},toArray:function(e){var t=[];return U(e,t,null,(function(e){return e})),t},only:function(e){if(!k(e))throw Error(b(143));return e}},l.Component=_,l.Fragment=o,l.Profiler=u,l.PureComponent=S,l.StrictMode=a,l.Suspense=y,l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,l.cloneElement=function(t,n,o){if(null==t)throw Error(b(267,t));var a=e({},t.props),i=t.key,u=t.ref,c=t._owner;if(null!=n){if(void 0!==n.ref&&(u=n.ref,c=R.current),void 0!==n.key&&(i=""+n.key),t.type&&t.type.defaultProps)var s=t.type.defaultProps;for(l in n)E.call(n,l)&&!x.hasOwnProperty(l)&&(a[l]=void 0===n[l]&&void 0!==s?s[l]:n[l])}var l=arguments.length-2;if(1===l)a.children=o;else if(1<l){s=Array(l);for(var f=0;f<l;f++)s[f]=arguments[f+2];a.children=s}return{$$typeof:r,type:t.type,key:i,ref:u,props:a,_owner:c}},l.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:p,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},l.createElement=O,l.createFactory=function(e){var t=O.bind(null,e);return t.type=e,t},l.createRef=function(){return{current:null}},l.forwardRef=function(e){return{$$typeof:d,render:e}},l.isValidElement=k,l.lazy=function(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},l.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},l.useCallback=function(e,t){return V().useCallback(e,t)},l.useContext=function(e,t){return V().useContext(e,t)},l.useDebugValue=function(){},l.useEffect=function(e,t){return V().useEffect(e,t)},l.useImperativeHandle=function(e,t,r){return V().useImperativeHandle(e,t,r)},l.useLayoutEffect=function(e,t){return V().useLayoutEffect(e,t)},l.useMemo=function(e,t){return V().useMemo(e,t)},l.useReducer=function(e,t,r){return V().useReducer(e,t,r)},l.useRef=function(e){return V().useRef(e)},l.useState=function(e){return V().useState(e)},l.version="16.13.0",l}():a.exports=(b||(b=1,"production"!==process.env.NODE_ENV&&function(){var e=f(),t=_(),r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,C=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,S=r?Symbol.for("react.scope"):60119,P="function"==typeof Symbol&&Symbol.iterator,R="@@iterator";function E(e){if(null===e||"object"!==i(e))return null;var t=P&&e[P]||e[R];return"function"==typeof t?t:null}var x={current:null},O={current:null},k=/^(.*)[\\\/]/,j=1;function $(e){if(null==e)return null;if("number"==typeof e.tag&&L("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case o:return"Portal";case c:return"Profiler";case u:return"StrictMode";case y:return"Suspense";case h:return"SuspenseList"}if("object"===i(e))switch(e.$$typeof){case l:return"Context.Consumer";case s:return"Context.Provider";case d:return n=e,p="ForwardRef",g=(f=e.render).displayName||f.name||"",n.displayName||(""!==g?p+"("+g+")":p);case m:return $(e.type);case b:return $(e.render);case v:var t=(r=e)._status===j?r._result:null;if(t)return $(t)}var r,n,f,p,g;return null}var I={},T=null;function D(e){T=e}I.getCurrentStack=null,I.getStackAddendum=function(){var e="";if(T){var t=$(T.type),r=T._owner;e+=function(e,t,r){var n="";if(t){var o=t.fileName,a=o.replace(k,"");if(/^index\./.test(a)){var i=o.match(k);if(i){var u=i[1];u&&(a=u.replace(k,"")+"/"+a)}}n=" (at "+a+":"+t.lineNumber+")"}else r&&(n=" (created by "+r+")");return"\n in "+(e||"Unknown")+n}(t,T._source,r&&$(r.type))}var n=I.getCurrentStack;return n&&(e+=n()||""),e};var N={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:O,IsSomeRendererActing:{current:!1},assign:e};function A(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];F("warn",e,r)}function L(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];F("error",e,r)}function F(e,t,r){if(!(r.length>0&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in"))){var n=N.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]))}var o=r.map((function(e){return""+e}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o);try{var a=0,i="Warning: "+t.replace(/%s/g,(function(){return r[a++]}));throw new Error(i)}catch(e){}}e(N,{ReactDebugCurrentFrame:I,ReactComponentTreeHook:{}});var U={};function M(e,t){var r=e.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+t;U[o]||(L("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,n),U[o]=!0)}var V={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){M(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){M(e,"replaceState")},enqueueSetState:function(e,t,r,n){M(e,"setState")}},H={};function B(e,t,r){this.props=e,this.context=t,this.refs=H,this.updater=r||V}Object.freeze(H),B.prototype.isReactComponent={},B.prototype.setState=function(e,t){if("object"!==i(e)&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},B.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var q={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},z=function(e,t){Object.defineProperty(B.prototype,e,{get:function(){A("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var W in q)q.hasOwnProperty(W)&&z(W,q[W]);function G(){}function Y(e,t,r){this.props=e,this.context=t,this.refs=H,this.updater=r||V}G.prototype=B.prototype;var J=Y.prototype=new G;J.constructor=Y,e(J,B.prototype),J.isPureReactComponent=!0;var X,K,Q,Z=Object.prototype.hasOwnProperty,ee={key:!0,ref:!0,__self:!0,__source:!0};function te(e){if(Z.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function re(e){if(Z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}Q={};var ne=function(e,t,r,o,a,i,u){var c={$$typeof:n,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function oe(e,t,r){var n,o={},a=null,i=null,u=null,c=null;if(null!=t)for(n in te(t)&&(i=t.ref,function(e){if("string"==typeof e.ref&&O.current&&e.__self&&O.current.stateNode!==e.__self){var t=$(O.current.type);Q[t]||(L('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',$(O.current.type),e.ref),Q[t]=!0)}}(t)),re(t)&&(a=""+t.key),u=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)Z.call(t,n)&&!ee.hasOwnProperty(n)&&(o[n]=t[n]);var s=arguments.length-2;if(1===s)o.children=r;else if(s>1){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];Object.freeze&&Object.freeze(l),o.children=l}if(e&&e.defaultProps){var p=e.defaultProps;for(n in p)void 0===o[n]&&(o[n]=p[n])}if(a||i){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&function(e,t){var r=function(){X||(X=!0,L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,d),i&&function(e,t){var r=function(){K||(K=!0,L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(o,d)}return ne(e,a,i,u,c,O.current,o)}function ae(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o,a,i=e({},t.props),u=t.key,c=t.ref,s=t._self,l=t._source,f=t._owner;if(null!=r)for(o in te(r)&&(c=r.ref,f=O.current),re(r)&&(u=""+r.key),t.type&&t.type.defaultProps&&(a=t.type.defaultProps),r)Z.call(r,o)&&!ee.hasOwnProperty(o)&&(void 0===r[o]&&void 0!==a?i[o]=a[o]:i[o]=r[o]);var p=arguments.length-2;if(1===p)i.children=n;else if(p>1){for(var d=Array(p),y=0;y<p;y++)d[y]=arguments[y+2];i.children=d}return ne(t.type,u,c,s,l,f,i)}function ie(e){return"object"===i(e)&&null!==e&&e.$$typeof===n}var ue=".",ce=":",se=!1,le=/\/+/g;function fe(e){return(""+e).replace(le,"$&/")}var pe,de=10,ye=[];function he(e,t,r,n){if(ye.length){var o=ye.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function me(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ye.length<de&&ye.push(e)}function ve(e,t,r,a){var u=i(e);"undefined"!==u&&"boolean"!==u||(e=null);var c,s=!1;if(null===e)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case n:case o:s=!0}}if(s)return r(a,e,""===t?ue+ge(e,0):t),1;var l=0,f=""===t?ue:t+ce;if(Array.isArray(e))for(var p=0;p<e.length;p++)l+=ve(c=e[p],f+ge(c,p),r,a);else{var d=E(e);if("function"==typeof d){d===e.entries&&(se||A("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),se=!0);for(var y,h=d.call(e),m=0;!(y=h.next()).done;)l+=ve(c=y.value,f+ge(c,m++),r,a)}else if("object"===u){var v;v=" If you meant to render a collection of children, use an array instead."+I.getStackAddendum();var b=""+e;throw Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(e).join(", ")+"}":b)+")."+v)}}return l}function be(e,t,r){return null==e?0:ve(e,"",t,r)}function ge(e,t){return"object"===i(e)&&null!==e&&null!=e.key?(r=e.key,n={"=":"=0",":":"=2"},"$"+(""+r).replace(/[=:]/g,(function(e){return n[e]}))):t.toString(36);var r,n}function Ce(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function _e(e,t,r){var n,o,a=e.result,i=e.keyPrefix,u=e.func,c=e.context,s=u.call(c,t,e.count++);Array.isArray(s)?we(s,a,r,(function(e){return e})):null!=s&&(ie(s)&&(n=s,o=i+(!s.key||t&&t.key===s.key?"":fe(s.key)+"/")+r,s=ne(n.type,o,n.ref,n._self,n._source,n._owner,n.props)),a.push(s))}function we(e,t,r,n,o){var a="";null!=r&&(a=fe(r)+"/");var i=he(t,a,n,o);be(e,_e,i),me(i)}function Se(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===c||e===u||e===y||e===h||"object"===i(e)&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===s||e.$$typeof===l||e.$$typeof===d||e.$$typeof===C||e.$$typeof===w||e.$$typeof===S||e.$$typeof===b)}function Pe(){var e=x.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function Re(){if(O.current){var e=$(O.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}pe=!1;var Ee={};function xe(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=Re();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!Ee[r]){Ee[r]=!0;var n="";e&&e._owner&&e._owner!==O.current&&(n=" It was passed a child from "+$(e._owner.type)+"."),D(e),L('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,n),D(null)}}}function Oe(e,t){if("object"===i(e))if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];ie(n)&&xe(n,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var o=E(e);if("function"==typeof o&&o!==e.entries)for(var a,u=o.call(e);!(a=u.next()).done;)ie(a.value)&&xe(a.value,t)}}function ke(e){var r=e.type;if(null!=r&&"string"!=typeof r){var n,o=$(r);if("function"==typeof r)n=r.propTypes;else{if("object"!==i(r)||r.$$typeof!==d&&r.$$typeof!==m)return;n=r.propTypes}n?(D(e),t(n,e.props,"prop",o,I.getStackAddendum),D(null)):void 0===r.PropTypes||pe||(pe=!0,L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")),"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function je(e,t,r){var o,u,c=Se(e);if(!c){var s,l="";(void 0===e||"object"===i(e)&&null!==e&&0===Object.keys(e).length)&&(l+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),l+=(null!=(o=t)&&void 0!==(u=o.__source)?"\n\nCheck your code at "+u.fileName.replace(/^.*[\\\/]/,"")+":"+u.lineNumber+".":"")||Re(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===n?(s="<"+($(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):s=i(e),L("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,l)}var f=oe.apply(this,arguments);if(null==f)return f;if(c)for(var p=2;p<arguments.length;p++)Oe(arguments[p],e);return e===a?function(e){D(e);for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n);break}}null!==e.ref&&L("Invalid attribute `ref` supplied to `React.Fragment`."),D(null)}(f):ke(f),f}var $e=!1;try{var Ie=Object.freeze({}),Te=new Map([[Ie,null]]),De=new Set([Ie]);Te.set(0,0),De.add(0)}catch(e){}var Ne=je,Ae=function(e,t,r){for(var n=ae.apply(this,arguments),o=2;o<arguments.length;o++)Oe(arguments[o],n.type);return ke(n),n},Le=function(e){var t=je.bind(null,e);return t.type=e,$e||($e=!0,A("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return A("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},Fe={map:function(e,t,r){if(null==e)return e;var n=[];return we(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;var n=he(null,null,t,r);be(e,Ce,n),me(n)},count:function(e){return be(e,(function(){return null}),null)},toArray:function(e){var t=[];return we(e,t,null,(function(e){return e})),t},only:function(e){if(!ie(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};g.Children=Fe,g.Component=B,g.Fragment=a,g.Profiler=c,g.PureComponent=Y,g.StrictMode=u,g.Suspense=y,g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,g.cloneElement=Ae,g.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&L("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};r.Provider={$$typeof:s,_context:r};var n=!1,o=!1,a={$$typeof:l,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(a,{Provider:{get:function(){return o||(o=!0,L("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,L("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=a,r._currentRenderer=null,r._currentRenderer2=null,r},g.createElement=Ne,g.createFactory=Le,g.createRef=function(){var e={current:null};return Object.seal(e),e},g.forwardRef=function(e){return null!=e&&e.$$typeof===m?L("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?L("forwardRef requires a render function but was given %s.",null===e?"null":i(e)):0!==e.length&&2!==e.length&&L("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||L("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:d,render:e}},g.isValidElement=ie,g.lazy=function(e){var t,r,n={$$typeof:v,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){L("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){L("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},g.memo=function(e,t){return Se(e)||L("memo: The first argument must be a component. Instead received: %s",null===e?"null":i(e)),{$$typeof:m,type:e,compare:void 0===t?null:t}},g.useCallback=function(e,t){return Pe().useCallback(e,t)},g.useContext=function(e,t){var r=Pe();if(void 0!==t&&L("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var n=e._context;n.Consumer===e?L("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&L("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(e,t)},g.useDebugValue=function(e,t){return Pe().useDebugValue(e,t)},g.useEffect=function(e,t){return Pe().useEffect(e,t)},g.useImperativeHandle=function(e,t,r){return Pe().useImperativeHandle(e,t,r)},g.useLayoutEffect=function(e,t){return Pe().useLayoutEffect(e,t)},g.useMemo=function(e,t){return Pe().useMemo(e,t)},g.useReducer=function(e,t,r){return Pe().useReducer(e,t,r)},g.useRef=function(e){return Pe().useRef(e)},g.useState=function(e){return Pe().useState(e)},g.version="16.13.0"}()),g);var w,S=a.exports,P=o(S),R={exports:{}},E={};var x,O={};
7
- /**
57
+ */
58
+ var objectAssign;
59
+ var hasRequiredObjectAssign;
60
+ function requireObjectAssign() {
61
+ if (hasRequiredObjectAssign) return objectAssign;
62
+ hasRequiredObjectAssign = 1;
63
+ /* eslint-disable no-unused-vars */
64
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
65
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
66
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
67
+ function toObject(val) {
68
+ if (val === null || val === undefined) {
69
+ throw new TypeError('Object.assign cannot be called with null or undefined');
70
+ }
71
+ return Object(val);
72
+ }
73
+ function shouldUseNative() {
74
+ try {
75
+ if (!Object.assign) {
76
+ return false;
77
+ }
78
+
79
+ // Detect buggy property enumeration order in older V8 versions.
80
+
81
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
82
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
83
+ test1[5] = 'de';
84
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
85
+ return false;
86
+ }
87
+
88
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
89
+ var test2 = {};
90
+ for (var i = 0; i < 10; i++) {
91
+ test2['_' + String.fromCharCode(i)] = i;
92
+ }
93
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
94
+ return test2[n];
95
+ });
96
+ if (order2.join('') !== '0123456789') {
97
+ return false;
98
+ }
99
+
100
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
101
+ var test3 = {};
102
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
103
+ test3[letter] = letter;
104
+ });
105
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
106
+ return false;
107
+ }
108
+ return true;
109
+ } catch (err) {
110
+ // We don't expect any of the above to throw, but better to be safe.
111
+ return false;
112
+ }
113
+ }
114
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
115
+ var from;
116
+ var to = toObject(target);
117
+ var symbols;
118
+ for (var s = 1; s < arguments.length; s++) {
119
+ from = Object(arguments[s]);
120
+ for (var key in from) {
121
+ if (hasOwnProperty.call(from, key)) {
122
+ to[key] = from[key];
123
+ }
124
+ }
125
+ if (getOwnPropertySymbols) {
126
+ symbols = getOwnPropertySymbols(from);
127
+ for (var i = 0; i < symbols.length; i++) {
128
+ if (propIsEnumerable.call(from, symbols[i])) {
129
+ to[symbols[i]] = from[symbols[i]];
130
+ }
131
+ }
132
+ }
133
+ }
134
+ return to;
135
+ };
136
+ return objectAssign;
137
+ }
138
+
139
+ var hasRequiredReact_production_min;
140
+ function requireReact_production_min() {
141
+ if (hasRequiredReact_production_min) return react_production_min;
142
+ hasRequiredReact_production_min = 1;
143
+ var l = requireObjectAssign(),
144
+ n = "function" === typeof Symbol && Symbol["for"],
145
+ p = n ? Symbol["for"]("react.element") : 60103,
146
+ q = n ? Symbol["for"]("react.portal") : 60106,
147
+ r = n ? Symbol["for"]("react.fragment") : 60107,
148
+ t = n ? Symbol["for"]("react.strict_mode") : 60108,
149
+ u = n ? Symbol["for"]("react.profiler") : 60114,
150
+ v = n ? Symbol["for"]("react.provider") : 60109,
151
+ w = n ? Symbol["for"]("react.context") : 60110,
152
+ x = n ? Symbol["for"]("react.forward_ref") : 60112,
153
+ y = n ? Symbol["for"]("react.suspense") : 60113,
154
+ z = n ? Symbol["for"]("react.memo") : 60115,
155
+ A = n ? Symbol["for"]("react.lazy") : 60116,
156
+ B = "function" === typeof Symbol && Symbol.iterator;
157
+ function C(a) {
158
+ for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) b += "&args[]=" + encodeURIComponent(arguments[c]);
159
+ return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
160
+ }
161
+ var D = {
162
+ isMounted: function isMounted() {
163
+ return !1;
164
+ },
165
+ enqueueForceUpdate: function enqueueForceUpdate() {},
166
+ enqueueReplaceState: function enqueueReplaceState() {},
167
+ enqueueSetState: function enqueueSetState() {}
168
+ },
169
+ E = {};
170
+ function F(a, b, c) {
171
+ this.props = a;
172
+ this.context = b;
173
+ this.refs = E;
174
+ this.updater = c || D;
175
+ }
176
+ F.prototype.isReactComponent = {};
177
+ F.prototype.setState = function (a, b) {
178
+ if ("object" !== _typeof(a) && "function" !== typeof a && null != a) throw Error(C(85));
179
+ this.updater.enqueueSetState(this, a, b, "setState");
180
+ };
181
+ F.prototype.forceUpdate = function (a) {
182
+ this.updater.enqueueForceUpdate(this, a, "forceUpdate");
183
+ };
184
+ function G() {}
185
+ G.prototype = F.prototype;
186
+ function H(a, b, c) {
187
+ this.props = a;
188
+ this.context = b;
189
+ this.refs = E;
190
+ this.updater = c || D;
191
+ }
192
+ var I = H.prototype = new G();
193
+ I.constructor = H;
194
+ l(I, F.prototype);
195
+ I.isPureReactComponent = !0;
196
+ var J = {
197
+ current: null
198
+ },
199
+ K = Object.prototype.hasOwnProperty,
200
+ L = {
201
+ key: !0,
202
+ ref: !0,
203
+ __self: !0,
204
+ __source: !0
205
+ };
206
+ function M(a, b, c) {
207
+ var e,
208
+ d = {},
209
+ g = null,
210
+ k = null;
211
+ if (null != b) for (e in void 0 !== b.ref && (k = b.ref), void 0 !== b.key && (g = "" + b.key), b) K.call(b, e) && !L.hasOwnProperty(e) && (d[e] = b[e]);
212
+ var f = arguments.length - 2;
213
+ if (1 === f) d.children = c;else if (1 < f) {
214
+ for (var h = Array(f), m = 0; m < f; m++) h[m] = arguments[m + 2];
215
+ d.children = h;
216
+ }
217
+ if (a && a.defaultProps) for (e in f = a.defaultProps, f) void 0 === d[e] && (d[e] = f[e]);
218
+ return {
219
+ $$typeof: p,
220
+ type: a,
221
+ key: g,
222
+ ref: k,
223
+ props: d,
224
+ _owner: J.current
225
+ };
226
+ }
227
+ function N(a, b) {
228
+ return {
229
+ $$typeof: p,
230
+ type: a.type,
231
+ key: b,
232
+ ref: a.ref,
233
+ props: a.props,
234
+ _owner: a._owner
235
+ };
236
+ }
237
+ function O(a) {
238
+ return "object" === _typeof(a) && null !== a && a.$$typeof === p;
239
+ }
240
+ function escape(a) {
241
+ var b = {
242
+ "=": "=0",
243
+ ":": "=2"
244
+ };
245
+ return "$" + ("" + a).replace(/[=:]/g, function (a) {
246
+ return b[a];
247
+ });
248
+ }
249
+ var P = /\/+/g,
250
+ Q = [];
251
+ function R(a, b, c, e) {
252
+ if (Q.length) {
253
+ var d = Q.pop();
254
+ d.result = a;
255
+ d.keyPrefix = b;
256
+ d.func = c;
257
+ d.context = e;
258
+ d.count = 0;
259
+ return d;
260
+ }
261
+ return {
262
+ result: a,
263
+ keyPrefix: b,
264
+ func: c,
265
+ context: e,
266
+ count: 0
267
+ };
268
+ }
269
+ function S(a) {
270
+ a.result = null;
271
+ a.keyPrefix = null;
272
+ a.func = null;
273
+ a.context = null;
274
+ a.count = 0;
275
+ 10 > Q.length && Q.push(a);
276
+ }
277
+ function T(a, b, c, e) {
278
+ var d = _typeof(a);
279
+ if ("undefined" === d || "boolean" === d) a = null;
280
+ var g = !1;
281
+ if (null === a) g = !0;else switch (d) {
282
+ case "string":
283
+ case "number":
284
+ g = !0;
285
+ break;
286
+ case "object":
287
+ switch (a.$$typeof) {
288
+ case p:
289
+ case q:
290
+ g = !0;
291
+ }
292
+ }
293
+ if (g) return c(e, a, "" === b ? "." + U(a, 0) : b), 1;
294
+ g = 0;
295
+ b = "" === b ? "." : b + ":";
296
+ if (Array.isArray(a)) for (var k = 0; k < a.length; k++) {
297
+ d = a[k];
298
+ var f = b + U(d, k);
299
+ g += T(d, f, c, e);
300
+ } else if (null === a || "object" !== _typeof(a) ? f = null : (f = B && a[B] || a["@@iterator"], f = "function" === typeof f ? f : null), "function" === typeof f) for (a = f.call(a), k = 0; !(d = a.next()).done;) d = d.value, f = b + U(d, k++), g += T(d, f, c, e);else if ("object" === d) throw c = "" + a, Error(C(31, "[object Object]" === c ? "object with keys {" + Object.keys(a).join(", ") + "}" : c, ""));
301
+ return g;
302
+ }
303
+ function V(a, b, c) {
304
+ return null == a ? 0 : T(a, "", b, c);
305
+ }
306
+ function U(a, b) {
307
+ return "object" === _typeof(a) && null !== a && null != a.key ? escape(a.key) : b.toString(36);
308
+ }
309
+ function W(a, b) {
310
+ a.func.call(a.context, b, a.count++);
311
+ }
312
+ function aa(a, b, c) {
313
+ var e = a.result,
314
+ d = a.keyPrefix;
315
+ a = a.func.call(a.context, b, a.count++);
316
+ Array.isArray(a) ? X(a, e, c, function (a) {
317
+ return a;
318
+ }) : null != a && (O(a) && (a = N(a, d + (!a.key || b && b.key === a.key ? "" : ("" + a.key).replace(P, "$&/") + "/") + c)), e.push(a));
319
+ }
320
+ function X(a, b, c, e, d) {
321
+ var g = "";
322
+ null != c && (g = ("" + c).replace(P, "$&/") + "/");
323
+ b = R(b, g, e, d);
324
+ V(a, aa, b);
325
+ S(b);
326
+ }
327
+ var Y = {
328
+ current: null
329
+ };
330
+ function Z() {
331
+ var a = Y.current;
332
+ if (null === a) throw Error(C(321));
333
+ return a;
334
+ }
335
+ var ba = {
336
+ ReactCurrentDispatcher: Y,
337
+ ReactCurrentBatchConfig: {
338
+ suspense: null
339
+ },
340
+ ReactCurrentOwner: J,
341
+ IsSomeRendererActing: {
342
+ current: !1
343
+ },
344
+ assign: l
345
+ };
346
+ react_production_min.Children = {
347
+ map: function map(a, b, c) {
348
+ if (null == a) return a;
349
+ var e = [];
350
+ X(a, e, null, b, c);
351
+ return e;
352
+ },
353
+ forEach: function forEach(a, b, c) {
354
+ if (null == a) return a;
355
+ b = R(null, null, b, c);
356
+ V(a, W, b);
357
+ S(b);
358
+ },
359
+ count: function count(a) {
360
+ return V(a, function () {
361
+ return null;
362
+ }, null);
363
+ },
364
+ toArray: function toArray(a) {
365
+ var b = [];
366
+ X(a, b, null, function (a) {
367
+ return a;
368
+ });
369
+ return b;
370
+ },
371
+ only: function only(a) {
372
+ if (!O(a)) throw Error(C(143));
373
+ return a;
374
+ }
375
+ };
376
+ react_production_min.Component = F;
377
+ react_production_min.Fragment = r;
378
+ react_production_min.Profiler = u;
379
+ react_production_min.PureComponent = H;
380
+ react_production_min.StrictMode = t;
381
+ react_production_min.Suspense = y;
382
+ react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ba;
383
+ react_production_min.cloneElement = function (a, b, c) {
384
+ if (null === a || void 0 === a) throw Error(C(267, a));
385
+ var e = l({}, a.props),
386
+ d = a.key,
387
+ g = a.ref,
388
+ k = a._owner;
389
+ if (null != b) {
390
+ void 0 !== b.ref && (g = b.ref, k = J.current);
391
+ void 0 !== b.key && (d = "" + b.key);
392
+ if (a.type && a.type.defaultProps) var f = a.type.defaultProps;
393
+ for (h in b) K.call(b, h) && !L.hasOwnProperty(h) && (e[h] = void 0 === b[h] && void 0 !== f ? f[h] : b[h]);
394
+ }
395
+ var h = arguments.length - 2;
396
+ if (1 === h) e.children = c;else if (1 < h) {
397
+ f = Array(h);
398
+ for (var m = 0; m < h; m++) f[m] = arguments[m + 2];
399
+ e.children = f;
400
+ }
401
+ return {
402
+ $$typeof: p,
403
+ type: a.type,
404
+ key: d,
405
+ ref: g,
406
+ props: e,
407
+ _owner: k
408
+ };
409
+ };
410
+ react_production_min.createContext = function (a, b) {
411
+ void 0 === b && (b = null);
412
+ a = {
413
+ $$typeof: w,
414
+ _calculateChangedBits: b,
415
+ _currentValue: a,
416
+ _currentValue2: a,
417
+ _threadCount: 0,
418
+ Provider: null,
419
+ Consumer: null
420
+ };
421
+ a.Provider = {
422
+ $$typeof: v,
423
+ _context: a
424
+ };
425
+ return a.Consumer = a;
426
+ };
427
+ react_production_min.createElement = M;
428
+ react_production_min.createFactory = function (a) {
429
+ var b = M.bind(null, a);
430
+ b.type = a;
431
+ return b;
432
+ };
433
+ react_production_min.createRef = function () {
434
+ return {
435
+ current: null
436
+ };
437
+ };
438
+ react_production_min.forwardRef = function (a) {
439
+ return {
440
+ $$typeof: x,
441
+ render: a
442
+ };
443
+ };
444
+ react_production_min.isValidElement = O;
445
+ react_production_min.lazy = function (a) {
446
+ return {
447
+ $$typeof: A,
448
+ _ctor: a,
449
+ _status: -1,
450
+ _result: null
451
+ };
452
+ };
453
+ react_production_min.memo = function (a, b) {
454
+ return {
455
+ $$typeof: z,
456
+ type: a,
457
+ compare: void 0 === b ? null : b
458
+ };
459
+ };
460
+ react_production_min.useCallback = function (a, b) {
461
+ return Z().useCallback(a, b);
462
+ };
463
+ react_production_min.useContext = function (a, b) {
464
+ return Z().useContext(a, b);
465
+ };
466
+ react_production_min.useDebugValue = function () {};
467
+ react_production_min.useEffect = function (a, b) {
468
+ return Z().useEffect(a, b);
469
+ };
470
+ react_production_min.useImperativeHandle = function (a, b, c) {
471
+ return Z().useImperativeHandle(a, b, c);
472
+ };
473
+ react_production_min.useLayoutEffect = function (a, b) {
474
+ return Z().useLayoutEffect(a, b);
475
+ };
476
+ react_production_min.useMemo = function (a, b) {
477
+ return Z().useMemo(a, b);
478
+ };
479
+ react_production_min.useReducer = function (a, b, c) {
480
+ return Z().useReducer(a, b, c);
481
+ };
482
+ react_production_min.useRef = function (a) {
483
+ return Z().useRef(a);
484
+ };
485
+ react_production_min.useState = function (a) {
486
+ return Z().useState(a);
487
+ };
488
+ react_production_min.version = "16.13.0";
489
+ return react_production_min;
490
+ }
491
+
492
+ var react_development = {};
493
+
494
+ /**
495
+ * Copyright (c) 2013-present, Facebook, Inc.
496
+ *
497
+ * This source code is licensed under the MIT license found in the
498
+ * LICENSE file in the root directory of this source tree.
499
+ */
500
+ var ReactPropTypesSecret_1;
501
+ var hasRequiredReactPropTypesSecret;
502
+ function requireReactPropTypesSecret() {
503
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
504
+ hasRequiredReactPropTypesSecret = 1;
505
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
506
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
507
+ return ReactPropTypesSecret_1;
508
+ }
509
+
510
+ var has;
511
+ var hasRequiredHas;
512
+ function requireHas() {
513
+ if (hasRequiredHas) return has;
514
+ hasRequiredHas = 1;
515
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
516
+ return has;
517
+ }
518
+
519
+ var checkPropTypes_1;
520
+ var hasRequiredCheckPropTypes;
521
+ function requireCheckPropTypes() {
522
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
523
+ hasRequiredCheckPropTypes = 1;
524
+ var printWarning = function printWarning() {};
525
+ if (process.env.NODE_ENV !== 'production') {
526
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
527
+ var loggedTypeFailures = {};
528
+ var has = requireHas();
529
+ printWarning = function printWarning(text) {
530
+ var message = 'Warning: ' + text;
531
+ if (typeof console !== 'undefined') {
532
+ console.error(message);
533
+ }
534
+ try {
535
+ // --- Welcome to debugging React ---
536
+ // This error was thrown as a convenience so that you can use this stack
537
+ // to find the callsite that caused this warning to fire.
538
+ throw new Error(message);
539
+ } catch (x) {/**/}
540
+ };
541
+ }
542
+
543
+ /**
544
+ * Assert that the values match with the type specs.
545
+ * Error messages are memorized and will only be shown once.
546
+ *
547
+ * @param {object} typeSpecs Map of name to a ReactPropType
548
+ * @param {object} values Runtime values that need to be type-checked
549
+ * @param {string} location e.g. "prop", "context", "child context"
550
+ * @param {string} componentName Name of the component for error messages.
551
+ * @param {?Function} getStack Returns the component stack.
552
+ * @private
553
+ */
554
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
555
+ if (process.env.NODE_ENV !== 'production') {
556
+ for (var typeSpecName in typeSpecs) {
557
+ if (has(typeSpecs, typeSpecName)) {
558
+ var error;
559
+ // Prop type validation may throw. In case they do, we don't want to
560
+ // fail the render phase where it didn't fail before. So we log it.
561
+ // After these have been cleaned up, we'll let them throw.
562
+ try {
563
+ // This is intentionally an invariant that gets caught. It's the same
564
+ // behavior as without this statement except with a better message.
565
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
566
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + _typeof(typeSpecs[typeSpecName]) + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
567
+ err.name = 'Invariant Violation';
568
+ throw err;
569
+ }
570
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
571
+ } catch (ex) {
572
+ error = ex;
573
+ }
574
+ if (error && !(error instanceof Error)) {
575
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + _typeof(error) + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
576
+ }
577
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
578
+ // Only monitor this failure once because there tends to be a lot of the
579
+ // same error.
580
+ loggedTypeFailures[error.message] = true;
581
+ var stack = getStack ? getStack() : '';
582
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
583
+ }
584
+ }
585
+ }
586
+ }
587
+ }
588
+
589
+ /**
590
+ * Resets warning cache when testing.
591
+ *
592
+ * @private
593
+ */
594
+ checkPropTypes.resetWarningCache = function () {
595
+ if (process.env.NODE_ENV !== 'production') {
596
+ loggedTypeFailures = {};
597
+ }
598
+ };
599
+ checkPropTypes_1 = checkPropTypes;
600
+ return checkPropTypes_1;
601
+ }
602
+
603
+ var hasRequiredReact_development;
604
+ function requireReact_development() {
605
+ if (hasRequiredReact_development) return react_development;
606
+ hasRequiredReact_development = 1;
607
+ if (process.env.NODE_ENV !== "production") {
608
+ (function () {
609
+
610
+ var _assign = requireObjectAssign();
611
+ var checkPropTypes = requireCheckPropTypes();
612
+ var ReactVersion = '16.13.0';
613
+
614
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
615
+ // nor polyfill, then a plain number is used for performance.
616
+ var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
617
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7;
618
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
619
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol["for"]('react.fragment') : 0xeacb;
620
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.strict_mode') : 0xeacc;
621
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol["for"]('react.profiler') : 0xead2;
622
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol["for"]('react.provider') : 0xeacd;
623
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol["for"]('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
624
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.concurrent_mode') : 0xeacf;
625
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0;
626
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol["for"]('react.suspense') : 0xead1;
627
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol["for"]('react.suspense_list') : 0xead8;
628
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol["for"]('react.memo') : 0xead3;
629
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol["for"]('react.lazy') : 0xead4;
630
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol["for"]('react.block') : 0xead9;
631
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5;
632
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6;
633
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7;
634
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
635
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
636
+ function getIteratorFn(maybeIterable) {
637
+ if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {
638
+ return null;
639
+ }
640
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
641
+ if (typeof maybeIterator === 'function') {
642
+ return maybeIterator;
643
+ }
644
+ return null;
645
+ }
646
+
647
+ /**
648
+ * Keeps track of the current dispatcher.
649
+ */
650
+ var ReactCurrentDispatcher = {
651
+ /**
652
+ * @internal
653
+ * @type {ReactComponent}
654
+ */
655
+ current: null
656
+ };
657
+
658
+ /**
659
+ * Keeps track of the current batch's configuration such as how long an update
660
+ * should suspend for if it needs to.
661
+ */
662
+ var ReactCurrentBatchConfig = {
663
+ suspense: null
664
+ };
665
+
666
+ /**
667
+ * Keeps track of the current owner.
668
+ *
669
+ * The current owner is the component who should own any components that are
670
+ * currently being constructed.
671
+ */
672
+ var ReactCurrentOwner = {
673
+ /**
674
+ * @internal
675
+ * @type {ReactComponent}
676
+ */
677
+ current: null
678
+ };
679
+ var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
680
+ function describeComponentFrame(name, source, ownerName) {
681
+ var sourceInfo = '';
682
+ if (source) {
683
+ var path = source.fileName;
684
+ var fileName = path.replace(BEFORE_SLASH_RE, '');
685
+ {
686
+ // In DEV, include code for a common special case:
687
+ // prefer "folder/index.js" instead of just "index.js".
688
+ if (/^index\./.test(fileName)) {
689
+ var match = path.match(BEFORE_SLASH_RE);
690
+ if (match) {
691
+ var pathBeforeSlash = match[1];
692
+ if (pathBeforeSlash) {
693
+ var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
694
+ fileName = folderName + '/' + fileName;
695
+ }
696
+ }
697
+ }
698
+ }
699
+ sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
700
+ } else if (ownerName) {
701
+ sourceInfo = ' (created by ' + ownerName + ')';
702
+ }
703
+ return '\n in ' + (name || 'Unknown') + sourceInfo;
704
+ }
705
+ var Resolved = 1;
706
+ function refineResolvedLazyComponent(lazyComponent) {
707
+ return lazyComponent._status === Resolved ? lazyComponent._result : null;
708
+ }
709
+ function getWrappedName(outerType, innerType, wrapperName) {
710
+ var functionName = innerType.displayName || innerType.name || '';
711
+ return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
712
+ }
713
+ function getComponentName(type) {
714
+ if (type == null) {
715
+ // Host root, text node or just invalid type.
716
+ return null;
717
+ }
718
+ {
719
+ if (typeof type.tag === 'number') {
720
+ error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
721
+ }
722
+ }
723
+ if (typeof type === 'function') {
724
+ return type.displayName || type.name || null;
725
+ }
726
+ if (typeof type === 'string') {
727
+ return type;
728
+ }
729
+ switch (type) {
730
+ case REACT_FRAGMENT_TYPE:
731
+ return 'Fragment';
732
+ case REACT_PORTAL_TYPE:
733
+ return 'Portal';
734
+ case REACT_PROFILER_TYPE:
735
+ return "Profiler";
736
+ case REACT_STRICT_MODE_TYPE:
737
+ return 'StrictMode';
738
+ case REACT_SUSPENSE_TYPE:
739
+ return 'Suspense';
740
+ case REACT_SUSPENSE_LIST_TYPE:
741
+ return 'SuspenseList';
742
+ }
743
+ if (_typeof(type) === 'object') {
744
+ switch (type.$$typeof) {
745
+ case REACT_CONTEXT_TYPE:
746
+ return 'Context.Consumer';
747
+ case REACT_PROVIDER_TYPE:
748
+ return 'Context.Provider';
749
+ case REACT_FORWARD_REF_TYPE:
750
+ return getWrappedName(type, type.render, 'ForwardRef');
751
+ case REACT_MEMO_TYPE:
752
+ return getComponentName(type.type);
753
+ case REACT_BLOCK_TYPE:
754
+ return getComponentName(type.render);
755
+ case REACT_LAZY_TYPE:
756
+ {
757
+ var thenable = type;
758
+ var resolvedThenable = refineResolvedLazyComponent(thenable);
759
+ if (resolvedThenable) {
760
+ return getComponentName(resolvedThenable);
761
+ }
762
+ break;
763
+ }
764
+ }
765
+ }
766
+ return null;
767
+ }
768
+ var ReactDebugCurrentFrame = {};
769
+ var currentlyValidatingElement = null;
770
+ function setCurrentlyValidatingElement(element) {
771
+ {
772
+ currentlyValidatingElement = element;
773
+ }
774
+ }
775
+ {
776
+ // Stack implementation injected by the current renderer.
777
+ ReactDebugCurrentFrame.getCurrentStack = null;
778
+ ReactDebugCurrentFrame.getStackAddendum = function () {
779
+ var stack = ''; // Add an extra top frame while an element is being validated
780
+
781
+ if (currentlyValidatingElement) {
782
+ var name = getComponentName(currentlyValidatingElement.type);
783
+ var owner = currentlyValidatingElement._owner;
784
+ stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
785
+ } // Delegate to the injected renderer-specific implementation
786
+
787
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
788
+ if (impl) {
789
+ stack += impl() || '';
790
+ }
791
+ return stack;
792
+ };
793
+ }
794
+
795
+ /**
796
+ * Used by act() to track whether you're inside an act() scope.
797
+ */
798
+ var IsSomeRendererActing = {
799
+ current: false
800
+ };
801
+ var ReactSharedInternals = {
802
+ ReactCurrentDispatcher: ReactCurrentDispatcher,
803
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
804
+ ReactCurrentOwner: ReactCurrentOwner,
805
+ IsSomeRendererActing: IsSomeRendererActing,
806
+ // Used by renderers to avoid bundling object-assign twice in UMD bundles:
807
+ assign: _assign
808
+ };
809
+ {
810
+ _assign(ReactSharedInternals, {
811
+ // These should not be included in production.
812
+ ReactDebugCurrentFrame: ReactDebugCurrentFrame,
813
+ // Shim for React DOM 16.0.0 which still destructured (but not used) this.
814
+ // TODO: remove in React 17.0.
815
+ ReactComponentTreeHook: {}
816
+ });
817
+ }
818
+
819
+ // by calls to these methods by a Babel plugin.
820
+ //
821
+ // In PROD (or in packages without access to React internals),
822
+ // they are left as they are instead.
823
+
824
+ function warn(format) {
825
+ {
826
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
827
+ args[_key - 1] = arguments[_key];
828
+ }
829
+ printWarning('warn', format, args);
830
+ }
831
+ }
832
+ function error(format) {
833
+ {
834
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
835
+ args[_key2 - 1] = arguments[_key2];
836
+ }
837
+ printWarning('error', format, args);
838
+ }
839
+ }
840
+ function printWarning(level, format, args) {
841
+ // When changing this logic, you might want to also
842
+ // update consoleWithStackDev.www.js as well.
843
+ {
844
+ var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
845
+ if (!hasExistingStack) {
846
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
847
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
848
+ if (stack !== '') {
849
+ format += '%s';
850
+ args = args.concat([stack]);
851
+ }
852
+ }
853
+ var argsWithFormat = args.map(function (item) {
854
+ return '' + item;
855
+ }); // Careful: RN currently depends on this prefix
856
+
857
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
858
+ // breaks IE9: https://github.com/facebook/react/issues/13610
859
+ // eslint-disable-next-line react-internal/no-production-logging
860
+
861
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
862
+ try {
863
+ // --- Welcome to debugging React ---
864
+ // This error was thrown as a convenience so that you can use this stack
865
+ // to find the callsite that caused this warning to fire.
866
+ var argIndex = 0;
867
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
868
+ return args[argIndex++];
869
+ });
870
+ throw new Error(message);
871
+ } catch (x) {}
872
+ }
873
+ }
874
+ var didWarnStateUpdateForUnmountedComponent = {};
875
+ function warnNoop(publicInstance, callerName) {
876
+ {
877
+ var _constructor = publicInstance.constructor;
878
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
879
+ var warningKey = componentName + "." + callerName;
880
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
881
+ return;
882
+ }
883
+ error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
884
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
885
+ }
886
+ }
887
+ /**
888
+ * This is the abstract API for an update queue.
889
+ */
890
+
891
+ var ReactNoopUpdateQueue = {
892
+ /**
893
+ * Checks whether or not this composite component is mounted.
894
+ * @param {ReactClass} publicInstance The instance we want to test.
895
+ * @return {boolean} True if mounted, false otherwise.
896
+ * @protected
897
+ * @final
898
+ */
899
+ isMounted: function isMounted(publicInstance) {
900
+ return false;
901
+ },
902
+ /**
903
+ * Forces an update. This should only be invoked when it is known with
904
+ * certainty that we are **not** in a DOM transaction.
905
+ *
906
+ * You may want to call this when you know that some deeper aspect of the
907
+ * component's state has changed but `setState` was not called.
908
+ *
909
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
910
+ * `componentWillUpdate` and `componentDidUpdate`.
911
+ *
912
+ * @param {ReactClass} publicInstance The instance that should rerender.
913
+ * @param {?function} callback Called after component is updated.
914
+ * @param {?string} callerName name of the calling function in the public API.
915
+ * @internal
916
+ */
917
+ enqueueForceUpdate: function enqueueForceUpdate(publicInstance, callback, callerName) {
918
+ warnNoop(publicInstance, 'forceUpdate');
919
+ },
920
+ /**
921
+ * Replaces all of the state. Always use this or `setState` to mutate state.
922
+ * You should treat `this.state` as immutable.
923
+ *
924
+ * There is no guarantee that `this.state` will be immediately updated, so
925
+ * accessing `this.state` after calling this method may return the old value.
926
+ *
927
+ * @param {ReactClass} publicInstance The instance that should rerender.
928
+ * @param {object} completeState Next state.
929
+ * @param {?function} callback Called after component is updated.
930
+ * @param {?string} callerName name of the calling function in the public API.
931
+ * @internal
932
+ */
933
+ enqueueReplaceState: function enqueueReplaceState(publicInstance, completeState, callback, callerName) {
934
+ warnNoop(publicInstance, 'replaceState');
935
+ },
936
+ /**
937
+ * Sets a subset of the state. This only exists because _pendingState is
938
+ * internal. This provides a merging strategy that is not available to deep
939
+ * properties which is confusing. TODO: Expose pendingState or don't use it
940
+ * during the merge.
941
+ *
942
+ * @param {ReactClass} publicInstance The instance that should rerender.
943
+ * @param {object} partialState Next partial state to be merged with state.
944
+ * @param {?function} callback Called after component is updated.
945
+ * @param {?string} Name of the calling function in the public API.
946
+ * @internal
947
+ */
948
+ enqueueSetState: function enqueueSetState(publicInstance, partialState, callback, callerName) {
949
+ warnNoop(publicInstance, 'setState');
950
+ }
951
+ };
952
+ var emptyObject = {};
953
+ {
954
+ Object.freeze(emptyObject);
955
+ }
956
+ /**
957
+ * Base class helpers for the updating state of a component.
958
+ */
959
+
960
+ function Component(props, context, updater) {
961
+ this.props = props;
962
+ this.context = context; // If a component has string refs, we will assign a different object later.
963
+
964
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
965
+ // renderer.
966
+
967
+ this.updater = updater || ReactNoopUpdateQueue;
968
+ }
969
+ Component.prototype.isReactComponent = {};
970
+ /**
971
+ * Sets a subset of the state. Always use this to mutate
972
+ * state. You should treat `this.state` as immutable.
973
+ *
974
+ * There is no guarantee that `this.state` will be immediately updated, so
975
+ * accessing `this.state` after calling this method may return the old value.
976
+ *
977
+ * There is no guarantee that calls to `setState` will run synchronously,
978
+ * as they may eventually be batched together. You can provide an optional
979
+ * callback that will be executed when the call to setState is actually
980
+ * completed.
981
+ *
982
+ * When a function is provided to setState, it will be called at some point in
983
+ * the future (not synchronously). It will be called with the up to date
984
+ * component arguments (state, props, context). These values can be different
985
+ * from this.* because your function may be called after receiveProps but before
986
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
987
+ * assigned to this.
988
+ *
989
+ * @param {object|function} partialState Next partial state or function to
990
+ * produce next partial state to be merged with current state.
991
+ * @param {?function} callback Called after state is updated.
992
+ * @final
993
+ * @protected
994
+ */
995
+
996
+ Component.prototype.setState = function (partialState, callback) {
997
+ if (!(_typeof(partialState) === 'object' || typeof partialState === 'function' || partialState == null)) {
998
+ {
999
+ throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
1000
+ }
1001
+ }
1002
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
1003
+ };
1004
+ /**
1005
+ * Forces an update. This should only be invoked when it is known with
1006
+ * certainty that we are **not** in a DOM transaction.
1007
+ *
1008
+ * You may want to call this when you know that some deeper aspect of the
1009
+ * component's state has changed but `setState` was not called.
1010
+ *
1011
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
1012
+ * `componentWillUpdate` and `componentDidUpdate`.
1013
+ *
1014
+ * @param {?function} callback Called after update is complete.
1015
+ * @final
1016
+ * @protected
1017
+ */
1018
+
1019
+ Component.prototype.forceUpdate = function (callback) {
1020
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
1021
+ };
1022
+ /**
1023
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
1024
+ * we would like to deprecate them, we're not going to move them over to this
1025
+ * modern base class. Instead, we define a getter that warns if it's accessed.
1026
+ */
1027
+
1028
+ {
1029
+ var deprecatedAPIs = {
1030
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
1031
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
1032
+ };
1033
+ var defineDeprecationWarning = function defineDeprecationWarning(methodName, info) {
1034
+ Object.defineProperty(Component.prototype, methodName, {
1035
+ get: function get() {
1036
+ warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
1037
+ return undefined;
1038
+ }
1039
+ });
1040
+ };
1041
+ for (var fnName in deprecatedAPIs) {
1042
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
1043
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1044
+ }
1045
+ }
1046
+ }
1047
+ function ComponentDummy() {}
1048
+ ComponentDummy.prototype = Component.prototype;
1049
+ /**
1050
+ * Convenience component with default shallow equality check for sCU.
1051
+ */
1052
+
1053
+ function PureComponent(props, context, updater) {
1054
+ this.props = props;
1055
+ this.context = context; // If a component has string refs, we will assign a different object later.
1056
+
1057
+ this.refs = emptyObject;
1058
+ this.updater = updater || ReactNoopUpdateQueue;
1059
+ }
1060
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
1061
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
1062
+
1063
+ _assign(pureComponentPrototype, Component.prototype);
1064
+ pureComponentPrototype.isPureReactComponent = true;
1065
+
1066
+ // an immutable object with a single mutable value
1067
+ function createRef() {
1068
+ var refObject = {
1069
+ current: null
1070
+ };
1071
+ {
1072
+ Object.seal(refObject);
1073
+ }
1074
+ return refObject;
1075
+ }
1076
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1077
+ var RESERVED_PROPS = {
1078
+ key: true,
1079
+ ref: true,
1080
+ __self: true,
1081
+ __source: true
1082
+ };
1083
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
1084
+ {
1085
+ didWarnAboutStringRefs = {};
1086
+ }
1087
+ function hasValidRef(config) {
1088
+ {
1089
+ if (hasOwnProperty.call(config, 'ref')) {
1090
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1091
+ if (getter && getter.isReactWarning) {
1092
+ return false;
1093
+ }
1094
+ }
1095
+ }
1096
+ return config.ref !== undefined;
1097
+ }
1098
+ function hasValidKey(config) {
1099
+ {
1100
+ if (hasOwnProperty.call(config, 'key')) {
1101
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1102
+ if (getter && getter.isReactWarning) {
1103
+ return false;
1104
+ }
1105
+ }
1106
+ }
1107
+ return config.key !== undefined;
1108
+ }
1109
+ function defineKeyPropWarningGetter(props, displayName) {
1110
+ var warnAboutAccessingKey = function warnAboutAccessingKey() {
1111
+ {
1112
+ if (!specialPropKeyWarningShown) {
1113
+ specialPropKeyWarningShown = true;
1114
+ error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
1115
+ }
1116
+ }
1117
+ };
1118
+ warnAboutAccessingKey.isReactWarning = true;
1119
+ Object.defineProperty(props, 'key', {
1120
+ get: warnAboutAccessingKey,
1121
+ configurable: true
1122
+ });
1123
+ }
1124
+ function defineRefPropWarningGetter(props, displayName) {
1125
+ var warnAboutAccessingRef = function warnAboutAccessingRef() {
1126
+ {
1127
+ if (!specialPropRefWarningShown) {
1128
+ specialPropRefWarningShown = true;
1129
+ error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
1130
+ }
1131
+ }
1132
+ };
1133
+ warnAboutAccessingRef.isReactWarning = true;
1134
+ Object.defineProperty(props, 'ref', {
1135
+ get: warnAboutAccessingRef,
1136
+ configurable: true
1137
+ });
1138
+ }
1139
+ function warnIfStringRefCannotBeAutoConverted(config) {
1140
+ {
1141
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
1142
+ var componentName = getComponentName(ReactCurrentOwner.current.type);
1143
+ if (!didWarnAboutStringRefs[componentName]) {
1144
+ error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
1145
+ didWarnAboutStringRefs[componentName] = true;
1146
+ }
1147
+ }
1148
+ }
1149
+ }
1150
+ /**
1151
+ * Factory method to create a new React element. This no longer adheres to
1152
+ * the class pattern, so do not use new to call it. Also, instanceof check
1153
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
1154
+ * if something is a React Element.
1155
+ *
1156
+ * @param {*} type
1157
+ * @param {*} props
1158
+ * @param {*} key
1159
+ * @param {string|object} ref
1160
+ * @param {*} owner
1161
+ * @param {*} self A *temporary* helper to detect places where `this` is
1162
+ * different from the `owner` when React.createElement is called, so that we
1163
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
1164
+ * functions, and as long as `this` and owner are the same, there will be no
1165
+ * change in behavior.
1166
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
1167
+ * indicating filename, line number, and/or other information.
1168
+ * @internal
1169
+ */
1170
+
1171
+ var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) {
1172
+ var element = {
1173
+ // This tag allows us to uniquely identify this as a React Element
1174
+ $$typeof: REACT_ELEMENT_TYPE,
1175
+ // Built-in properties that belong on the element
1176
+ type: type,
1177
+ key: key,
1178
+ ref: ref,
1179
+ props: props,
1180
+ // Record the component responsible for creating this element.
1181
+ _owner: owner
1182
+ };
1183
+ {
1184
+ // The validation flag is currently mutative. We put it on
1185
+ // an external backing store so that we can freeze the whole object.
1186
+ // This can be replaced with a WeakMap once they are implemented in
1187
+ // commonly used development environments.
1188
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1189
+ // the validation flag non-enumerable (where possible, which should
1190
+ // include every environment we run tests in), so the test framework
1191
+ // ignores it.
1192
+
1193
+ Object.defineProperty(element._store, 'validated', {
1194
+ configurable: false,
1195
+ enumerable: false,
1196
+ writable: true,
1197
+ value: false
1198
+ }); // self and source are DEV only properties.
1199
+
1200
+ Object.defineProperty(element, '_self', {
1201
+ configurable: false,
1202
+ enumerable: false,
1203
+ writable: false,
1204
+ value: self
1205
+ }); // Two elements created in two different places should be considered
1206
+ // equal for testing purposes and therefore we hide it from enumeration.
1207
+
1208
+ Object.defineProperty(element, '_source', {
1209
+ configurable: false,
1210
+ enumerable: false,
1211
+ writable: false,
1212
+ value: source
1213
+ });
1214
+ if (Object.freeze) {
1215
+ Object.freeze(element.props);
1216
+ Object.freeze(element);
1217
+ }
1218
+ }
1219
+ return element;
1220
+ };
1221
+ /**
1222
+ * Create and return a new ReactElement of the given type.
1223
+ * See https://reactjs.org/docs/react-api.html#createelement
1224
+ */
1225
+
1226
+ function createElement(type, config, children) {
1227
+ var propName; // Reserved names are extracted
1228
+
1229
+ var props = {};
1230
+ var key = null;
1231
+ var ref = null;
1232
+ var self = null;
1233
+ var source = null;
1234
+ if (config != null) {
1235
+ if (hasValidRef(config)) {
1236
+ ref = config.ref;
1237
+ {
1238
+ warnIfStringRefCannotBeAutoConverted(config);
1239
+ }
1240
+ }
1241
+ if (hasValidKey(config)) {
1242
+ key = '' + config.key;
1243
+ }
1244
+ self = config.__self === undefined ? null : config.__self;
1245
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
1246
+
1247
+ for (propName in config) {
1248
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1249
+ props[propName] = config[propName];
1250
+ }
1251
+ }
1252
+ } // Children can be more than one argument, and those are transferred onto
1253
+ // the newly allocated props object.
1254
+
1255
+ var childrenLength = arguments.length - 2;
1256
+ if (childrenLength === 1) {
1257
+ props.children = children;
1258
+ } else if (childrenLength > 1) {
1259
+ var childArray = Array(childrenLength);
1260
+ for (var i = 0; i < childrenLength; i++) {
1261
+ childArray[i] = arguments[i + 2];
1262
+ }
1263
+ {
1264
+ if (Object.freeze) {
1265
+ Object.freeze(childArray);
1266
+ }
1267
+ }
1268
+ props.children = childArray;
1269
+ } // Resolve default props
1270
+
1271
+ if (type && type.defaultProps) {
1272
+ var defaultProps = type.defaultProps;
1273
+ for (propName in defaultProps) {
1274
+ if (props[propName] === undefined) {
1275
+ props[propName] = defaultProps[propName];
1276
+ }
1277
+ }
1278
+ }
1279
+ {
1280
+ if (key || ref) {
1281
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1282
+ if (key) {
1283
+ defineKeyPropWarningGetter(props, displayName);
1284
+ }
1285
+ if (ref) {
1286
+ defineRefPropWarningGetter(props, displayName);
1287
+ }
1288
+ }
1289
+ }
1290
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1291
+ }
1292
+ function cloneAndReplaceKey(oldElement, newKey) {
1293
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
1294
+ return newElement;
1295
+ }
1296
+ /**
1297
+ * Clone and return a new ReactElement using element as the starting point.
1298
+ * See https://reactjs.org/docs/react-api.html#cloneelement
1299
+ */
1300
+
1301
+ function cloneElement(element, config, children) {
1302
+ if (!!(element === null || element === undefined)) {
1303
+ {
1304
+ throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
1305
+ }
1306
+ }
1307
+ var propName; // Original props are copied
1308
+
1309
+ var props = _assign({}, element.props); // Reserved names are extracted
1310
+
1311
+ var key = element.key;
1312
+ var ref = element.ref; // Self is preserved since the owner is preserved.
1313
+
1314
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
1315
+ // transpiler, and the original source is probably a better indicator of the
1316
+ // true owner.
1317
+
1318
+ var source = element._source; // Owner will be preserved, unless ref is overridden
1319
+
1320
+ var owner = element._owner;
1321
+ if (config != null) {
1322
+ if (hasValidRef(config)) {
1323
+ // Silently steal the ref from the parent.
1324
+ ref = config.ref;
1325
+ owner = ReactCurrentOwner.current;
1326
+ }
1327
+ if (hasValidKey(config)) {
1328
+ key = '' + config.key;
1329
+ } // Remaining properties override existing props
1330
+
1331
+ var defaultProps;
1332
+ if (element.type && element.type.defaultProps) {
1333
+ defaultProps = element.type.defaultProps;
1334
+ }
1335
+ for (propName in config) {
1336
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1337
+ if (config[propName] === undefined && defaultProps !== undefined) {
1338
+ // Resolve default props
1339
+ props[propName] = defaultProps[propName];
1340
+ } else {
1341
+ props[propName] = config[propName];
1342
+ }
1343
+ }
1344
+ }
1345
+ } // Children can be more than one argument, and those are transferred onto
1346
+ // the newly allocated props object.
1347
+
1348
+ var childrenLength = arguments.length - 2;
1349
+ if (childrenLength === 1) {
1350
+ props.children = children;
1351
+ } else if (childrenLength > 1) {
1352
+ var childArray = Array(childrenLength);
1353
+ for (var i = 0; i < childrenLength; i++) {
1354
+ childArray[i] = arguments[i + 2];
1355
+ }
1356
+ props.children = childArray;
1357
+ }
1358
+ return ReactElement(element.type, key, ref, self, source, owner, props);
1359
+ }
1360
+ /**
1361
+ * Verifies the object is a ReactElement.
1362
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
1363
+ * @param {?object} object
1364
+ * @return {boolean} True if `object` is a ReactElement.
1365
+ * @final
1366
+ */
1367
+
1368
+ function isValidElement(object) {
1369
+ return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1370
+ }
1371
+ var SEPARATOR = '.';
1372
+ var SUBSEPARATOR = ':';
1373
+ /**
1374
+ * Escape and wrap key so it is safe to use as a reactid
1375
+ *
1376
+ * @param {string} key to be escaped.
1377
+ * @return {string} the escaped key.
1378
+ */
1379
+
1380
+ function escape(key) {
1381
+ var escapeRegex = /[=:]/g;
1382
+ var escaperLookup = {
1383
+ '=': '=0',
1384
+ ':': '=2'
1385
+ };
1386
+ var escapedString = ('' + key).replace(escapeRegex, function (match) {
1387
+ return escaperLookup[match];
1388
+ });
1389
+ return '$' + escapedString;
1390
+ }
1391
+ /**
1392
+ * TODO: Test that a single child and an array with one item have the same key
1393
+ * pattern.
1394
+ */
1395
+
1396
+ var didWarnAboutMaps = false;
1397
+ var userProvidedKeyEscapeRegex = /\/+/g;
1398
+ function escapeUserProvidedKey(text) {
1399
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
1400
+ }
1401
+ var POOL_SIZE = 10;
1402
+ var traverseContextPool = [];
1403
+ function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
1404
+ if (traverseContextPool.length) {
1405
+ var traverseContext = traverseContextPool.pop();
1406
+ traverseContext.result = mapResult;
1407
+ traverseContext.keyPrefix = keyPrefix;
1408
+ traverseContext.func = mapFunction;
1409
+ traverseContext.context = mapContext;
1410
+ traverseContext.count = 0;
1411
+ return traverseContext;
1412
+ } else {
1413
+ return {
1414
+ result: mapResult,
1415
+ keyPrefix: keyPrefix,
1416
+ func: mapFunction,
1417
+ context: mapContext,
1418
+ count: 0
1419
+ };
1420
+ }
1421
+ }
1422
+ function releaseTraverseContext(traverseContext) {
1423
+ traverseContext.result = null;
1424
+ traverseContext.keyPrefix = null;
1425
+ traverseContext.func = null;
1426
+ traverseContext.context = null;
1427
+ traverseContext.count = 0;
1428
+ if (traverseContextPool.length < POOL_SIZE) {
1429
+ traverseContextPool.push(traverseContext);
1430
+ }
1431
+ }
1432
+ /**
1433
+ * @param {?*} children Children tree container.
1434
+ * @param {!string} nameSoFar Name of the key path so far.
1435
+ * @param {!function} callback Callback to invoke with each child found.
1436
+ * @param {?*} traverseContext Used to pass information throughout the traversal
1437
+ * process.
1438
+ * @return {!number} The number of children in this subtree.
1439
+ */
1440
+
1441
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1442
+ var type = _typeof(children);
1443
+ if (type === 'undefined' || type === 'boolean') {
1444
+ // All of the above are perceived as null.
1445
+ children = null;
1446
+ }
1447
+ var invokeCallback = false;
1448
+ if (children === null) {
1449
+ invokeCallback = true;
1450
+ } else {
1451
+ switch (type) {
1452
+ case 'string':
1453
+ case 'number':
1454
+ invokeCallback = true;
1455
+ break;
1456
+ case 'object':
1457
+ switch (children.$$typeof) {
1458
+ case REACT_ELEMENT_TYPE:
1459
+ case REACT_PORTAL_TYPE:
1460
+ invokeCallback = true;
1461
+ }
1462
+ }
1463
+ }
1464
+ if (invokeCallback) {
1465
+ callback(traverseContext, children,
1466
+ // If it's the only child, treat the name as if it was wrapped in an array
1467
+ // so that it's consistent if the number of children grows.
1468
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1469
+ return 1;
1470
+ }
1471
+ var child;
1472
+ var nextName;
1473
+ var subtreeCount = 0; // Count of children found in the current subtree.
1474
+
1475
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1476
+ if (Array.isArray(children)) {
1477
+ for (var i = 0; i < children.length; i++) {
1478
+ child = children[i];
1479
+ nextName = nextNamePrefix + getComponentKey(child, i);
1480
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1481
+ }
1482
+ } else {
1483
+ var iteratorFn = getIteratorFn(children);
1484
+ if (typeof iteratorFn === 'function') {
1485
+ {
1486
+ // Warn about using Maps as children
1487
+ if (iteratorFn === children.entries) {
1488
+ if (!didWarnAboutMaps) {
1489
+ warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');
1490
+ }
1491
+ didWarnAboutMaps = true;
1492
+ }
1493
+ }
1494
+ var iterator = iteratorFn.call(children);
1495
+ var step;
1496
+ var ii = 0;
1497
+ while (!(step = iterator.next()).done) {
1498
+ child = step.value;
1499
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
1500
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1501
+ }
1502
+ } else if (type === 'object') {
1503
+ var addendum = '';
1504
+ {
1505
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
1506
+ }
1507
+ var childrenString = '' + children;
1508
+ {
1509
+ {
1510
+ throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
1511
+ }
1512
+ }
1513
+ }
1514
+ }
1515
+ return subtreeCount;
1516
+ }
1517
+ /**
1518
+ * Traverses children that are typically specified as `props.children`, but
1519
+ * might also be specified through attributes:
1520
+ *
1521
+ * - `traverseAllChildren(this.props.children, ...)`
1522
+ * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
1523
+ *
1524
+ * The `traverseContext` is an optional argument that is passed through the
1525
+ * entire traversal. It can be used to store accumulations or anything else that
1526
+ * the callback might find relevant.
1527
+ *
1528
+ * @param {?*} children Children tree object.
1529
+ * @param {!function} callback To invoke upon traversing each child.
1530
+ * @param {?*} traverseContext Context for traversal.
1531
+ * @return {!number} The number of children in this subtree.
1532
+ */
1533
+
1534
+ function traverseAllChildren(children, callback, traverseContext) {
1535
+ if (children == null) {
1536
+ return 0;
1537
+ }
1538
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
1539
+ }
1540
+ /**
1541
+ * Generate a key string that identifies a component within a set.
1542
+ *
1543
+ * @param {*} component A component that could contain a manual key.
1544
+ * @param {number} index Index that is used if a manual key is not provided.
1545
+ * @return {string}
1546
+ */
1547
+
1548
+ function getComponentKey(component, index) {
1549
+ // Do some typechecking here since we call this blindly. We want to ensure
1550
+ // that we don't block potential future ES APIs.
1551
+ if (_typeof(component) === 'object' && component !== null && component.key != null) {
1552
+ // Explicit key
1553
+ return escape(component.key);
1554
+ } // Implicit key determined by the index in the set
1555
+
1556
+ return index.toString(36);
1557
+ }
1558
+ function forEachSingleChild(bookKeeping, child, name) {
1559
+ var func = bookKeeping.func,
1560
+ context = bookKeeping.context;
1561
+ func.call(context, child, bookKeeping.count++);
1562
+ }
1563
+ /**
1564
+ * Iterates through children that are typically specified as `props.children`.
1565
+ *
1566
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1567
+ *
1568
+ * The provided forEachFunc(child, index) will be called for each
1569
+ * leaf child.
1570
+ *
1571
+ * @param {?*} children Children tree container.
1572
+ * @param {function(*, int)} forEachFunc
1573
+ * @param {*} forEachContext Context for forEachContext.
1574
+ */
1575
+
1576
+ function forEachChildren(children, forEachFunc, forEachContext) {
1577
+ if (children == null) {
1578
+ return children;
1579
+ }
1580
+ var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
1581
+ traverseAllChildren(children, forEachSingleChild, traverseContext);
1582
+ releaseTraverseContext(traverseContext);
1583
+ }
1584
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1585
+ var result = bookKeeping.result,
1586
+ keyPrefix = bookKeeping.keyPrefix,
1587
+ func = bookKeeping.func,
1588
+ context = bookKeeping.context;
1589
+ var mappedChild = func.call(context, child, bookKeeping.count++);
1590
+ if (Array.isArray(mappedChild)) {
1591
+ mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
1592
+ return c;
1593
+ });
1594
+ } else if (mappedChild != null) {
1595
+ if (isValidElement(mappedChild)) {
1596
+ mappedChild = cloneAndReplaceKey(mappedChild,
1597
+ // Keep both the (mapped) and old keys if they differ, just as
1598
+ // traverseAllChildren used to do for objects as children
1599
+ keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1600
+ }
1601
+ result.push(mappedChild);
1602
+ }
1603
+ }
1604
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1605
+ var escapedPrefix = '';
1606
+ if (prefix != null) {
1607
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1608
+ }
1609
+ var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
1610
+ traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
1611
+ releaseTraverseContext(traverseContext);
1612
+ }
1613
+ /**
1614
+ * Maps children that are typically specified as `props.children`.
1615
+ *
1616
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1617
+ *
1618
+ * The provided mapFunction(child, key, index) will be called for each
1619
+ * leaf child.
1620
+ *
1621
+ * @param {?*} children Children tree container.
1622
+ * @param {function(*, int)} func The map function.
1623
+ * @param {*} context Context for mapFunction.
1624
+ * @return {object} Object containing the ordered map of results.
1625
+ */
1626
+
1627
+ function mapChildren(children, func, context) {
1628
+ if (children == null) {
1629
+ return children;
1630
+ }
1631
+ var result = [];
1632
+ mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1633
+ return result;
1634
+ }
1635
+ /**
1636
+ * Count the number of children that are typically specified as
1637
+ * `props.children`.
1638
+ *
1639
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1640
+ *
1641
+ * @param {?*} children Children tree container.
1642
+ * @return {number} The number of children.
1643
+ */
1644
+
1645
+ function countChildren(children) {
1646
+ return traverseAllChildren(children, function () {
1647
+ return null;
1648
+ }, null);
1649
+ }
1650
+ /**
1651
+ * Flatten a children object (typically specified as `props.children`) and
1652
+ * return an array with appropriately re-keyed children.
1653
+ *
1654
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1655
+ */
1656
+
1657
+ function toArray(children) {
1658
+ var result = [];
1659
+ mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
1660
+ return child;
1661
+ });
1662
+ return result;
1663
+ }
1664
+ /**
1665
+ * Returns the first child in a collection of children and verifies that there
1666
+ * is only one child in the collection.
1667
+ *
1668
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1669
+ *
1670
+ * The current implementation of this function assumes that a single child gets
1671
+ * passed without a wrapper, but the purpose of this helper function is to
1672
+ * abstract away the particular structure of children.
1673
+ *
1674
+ * @param {?object} children Child collection structure.
1675
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1676
+ * structure.
1677
+ */
1678
+
1679
+ function onlyChild(children) {
1680
+ if (!isValidElement(children)) {
1681
+ {
1682
+ throw Error("React.Children.only expected to receive a single React element child.");
1683
+ }
1684
+ }
1685
+ return children;
1686
+ }
1687
+ function createContext(defaultValue, calculateChangedBits) {
1688
+ if (calculateChangedBits === undefined) {
1689
+ calculateChangedBits = null;
1690
+ } else {
1691
+ {
1692
+ if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
1693
+ error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
1694
+ }
1695
+ }
1696
+ }
1697
+ var context = {
1698
+ $$typeof: REACT_CONTEXT_TYPE,
1699
+ _calculateChangedBits: calculateChangedBits,
1700
+ // As a workaround to support multiple concurrent renderers, we categorize
1701
+ // some renderers as primary and others as secondary. We only expect
1702
+ // there to be two concurrent renderers at most: React Native (primary) and
1703
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1704
+ // Secondary renderers store their context values on separate fields.
1705
+ _currentValue: defaultValue,
1706
+ _currentValue2: defaultValue,
1707
+ // Used to track how many concurrent renderers this context currently
1708
+ // supports within in a single renderer. Such as parallel server rendering.
1709
+ _threadCount: 0,
1710
+ // These are circular
1711
+ Provider: null,
1712
+ Consumer: null
1713
+ };
1714
+ context.Provider = {
1715
+ $$typeof: REACT_PROVIDER_TYPE,
1716
+ _context: context
1717
+ };
1718
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1719
+ var hasWarnedAboutUsingConsumerProvider = false;
1720
+ {
1721
+ // A separate object, but proxies back to the original context object for
1722
+ // backwards compatibility. It has a different $$typeof, so we can properly
1723
+ // warn for the incorrect usage of Context as a Consumer.
1724
+ var Consumer = {
1725
+ $$typeof: REACT_CONTEXT_TYPE,
1726
+ _context: context,
1727
+ _calculateChangedBits: context._calculateChangedBits
1728
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1729
+
1730
+ Object.defineProperties(Consumer, {
1731
+ Provider: {
1732
+ get: function get() {
1733
+ if (!hasWarnedAboutUsingConsumerProvider) {
1734
+ hasWarnedAboutUsingConsumerProvider = true;
1735
+ error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
1736
+ }
1737
+ return context.Provider;
1738
+ },
1739
+ set: function set(_Provider) {
1740
+ context.Provider = _Provider;
1741
+ }
1742
+ },
1743
+ _currentValue: {
1744
+ get: function get() {
1745
+ return context._currentValue;
1746
+ },
1747
+ set: function set(_currentValue) {
1748
+ context._currentValue = _currentValue;
1749
+ }
1750
+ },
1751
+ _currentValue2: {
1752
+ get: function get() {
1753
+ return context._currentValue2;
1754
+ },
1755
+ set: function set(_currentValue2) {
1756
+ context._currentValue2 = _currentValue2;
1757
+ }
1758
+ },
1759
+ _threadCount: {
1760
+ get: function get() {
1761
+ return context._threadCount;
1762
+ },
1763
+ set: function set(_threadCount) {
1764
+ context._threadCount = _threadCount;
1765
+ }
1766
+ },
1767
+ Consumer: {
1768
+ get: function get() {
1769
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1770
+ hasWarnedAboutUsingNestedContextConsumers = true;
1771
+ error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
1772
+ }
1773
+ return context.Consumer;
1774
+ }
1775
+ }
1776
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1777
+
1778
+ context.Consumer = Consumer;
1779
+ }
1780
+ {
1781
+ context._currentRenderer = null;
1782
+ context._currentRenderer2 = null;
1783
+ }
1784
+ return context;
1785
+ }
1786
+ function lazy(ctor) {
1787
+ var lazyType = {
1788
+ $$typeof: REACT_LAZY_TYPE,
1789
+ _ctor: ctor,
1790
+ // React uses these fields to store the result.
1791
+ _status: -1,
1792
+ _result: null
1793
+ };
1794
+ {
1795
+ // In production, this would just set it on the object.
1796
+ var defaultProps;
1797
+ var propTypes;
1798
+ Object.defineProperties(lazyType, {
1799
+ defaultProps: {
1800
+ configurable: true,
1801
+ get: function get() {
1802
+ return defaultProps;
1803
+ },
1804
+ set: function set(newDefaultProps) {
1805
+ error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1806
+ defaultProps = newDefaultProps; // Match production behavior more closely:
1807
+
1808
+ Object.defineProperty(lazyType, 'defaultProps', {
1809
+ enumerable: true
1810
+ });
1811
+ }
1812
+ },
1813
+ propTypes: {
1814
+ configurable: true,
1815
+ get: function get() {
1816
+ return propTypes;
1817
+ },
1818
+ set: function set(newPropTypes) {
1819
+ error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1820
+ propTypes = newPropTypes; // Match production behavior more closely:
1821
+
1822
+ Object.defineProperty(lazyType, 'propTypes', {
1823
+ enumerable: true
1824
+ });
1825
+ }
1826
+ }
1827
+ });
1828
+ }
1829
+ return lazyType;
1830
+ }
1831
+ function forwardRef(render) {
1832
+ {
1833
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1834
+ error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
1835
+ } else if (typeof render !== 'function') {
1836
+ error('forwardRef requires a render function but was given %s.', render === null ? 'null' : _typeof(render));
1837
+ } else {
1838
+ if (render.length !== 0 && render.length !== 2) {
1839
+ error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
1840
+ }
1841
+ }
1842
+ if (render != null) {
1843
+ if (render.defaultProps != null || render.propTypes != null) {
1844
+ error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
1845
+ }
1846
+ }
1847
+ }
1848
+ return {
1849
+ $$typeof: REACT_FORWARD_REF_TYPE,
1850
+ render: render
1851
+ };
1852
+ }
1853
+ function isValidElementType(type) {
1854
+ return typeof type === 'string' || typeof type === 'function' ||
1855
+ // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1856
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || _typeof(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
1857
+ }
1858
+ function memo(type, compare) {
1859
+ {
1860
+ if (!isValidElementType(type)) {
1861
+ error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : _typeof(type));
1862
+ }
1863
+ }
1864
+ return {
1865
+ $$typeof: REACT_MEMO_TYPE,
1866
+ type: type,
1867
+ compare: compare === undefined ? null : compare
1868
+ };
1869
+ }
1870
+ function resolveDispatcher() {
1871
+ var dispatcher = ReactCurrentDispatcher.current;
1872
+ if (!(dispatcher !== null)) {
1873
+ {
1874
+ throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
1875
+ }
1876
+ }
1877
+ return dispatcher;
1878
+ }
1879
+ function useContext(Context, unstable_observedBits) {
1880
+ var dispatcher = resolveDispatcher();
1881
+ {
1882
+ if (unstable_observedBits !== undefined) {
1883
+ error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '');
1884
+ } // TODO: add a more generic warning for invalid values.
1885
+
1886
+ if (Context._context !== undefined) {
1887
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1888
+ // and nobody should be using this in existing code.
1889
+
1890
+ if (realContext.Consumer === Context) {
1891
+ error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
1892
+ } else if (realContext.Provider === Context) {
1893
+ error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
1894
+ }
1895
+ }
1896
+ }
1897
+ return dispatcher.useContext(Context, unstable_observedBits);
1898
+ }
1899
+ function useState(initialState) {
1900
+ var dispatcher = resolveDispatcher();
1901
+ return dispatcher.useState(initialState);
1902
+ }
1903
+ function useReducer(reducer, initialArg, init) {
1904
+ var dispatcher = resolveDispatcher();
1905
+ return dispatcher.useReducer(reducer, initialArg, init);
1906
+ }
1907
+ function useRef(initialValue) {
1908
+ var dispatcher = resolveDispatcher();
1909
+ return dispatcher.useRef(initialValue);
1910
+ }
1911
+ function useEffect(create, deps) {
1912
+ var dispatcher = resolveDispatcher();
1913
+ return dispatcher.useEffect(create, deps);
1914
+ }
1915
+ function useLayoutEffect(create, deps) {
1916
+ var dispatcher = resolveDispatcher();
1917
+ return dispatcher.useLayoutEffect(create, deps);
1918
+ }
1919
+ function useCallback(callback, deps) {
1920
+ var dispatcher = resolveDispatcher();
1921
+ return dispatcher.useCallback(callback, deps);
1922
+ }
1923
+ function useMemo(create, deps) {
1924
+ var dispatcher = resolveDispatcher();
1925
+ return dispatcher.useMemo(create, deps);
1926
+ }
1927
+ function useImperativeHandle(ref, create, deps) {
1928
+ var dispatcher = resolveDispatcher();
1929
+ return dispatcher.useImperativeHandle(ref, create, deps);
1930
+ }
1931
+ function useDebugValue(value, formatterFn) {
1932
+ {
1933
+ var dispatcher = resolveDispatcher();
1934
+ return dispatcher.useDebugValue(value, formatterFn);
1935
+ }
1936
+ }
1937
+ var propTypesMisspellWarningShown;
1938
+ {
1939
+ propTypesMisspellWarningShown = false;
1940
+ }
1941
+ function getDeclarationErrorAddendum() {
1942
+ if (ReactCurrentOwner.current) {
1943
+ var name = getComponentName(ReactCurrentOwner.current.type);
1944
+ if (name) {
1945
+ return '\n\nCheck the render method of `' + name + '`.';
1946
+ }
1947
+ }
1948
+ return '';
1949
+ }
1950
+ function getSourceInfoErrorAddendum(source) {
1951
+ if (source !== undefined) {
1952
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1953
+ var lineNumber = source.lineNumber;
1954
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
1955
+ }
1956
+ return '';
1957
+ }
1958
+ function getSourceInfoErrorAddendumForProps(elementProps) {
1959
+ if (elementProps !== null && elementProps !== undefined) {
1960
+ return getSourceInfoErrorAddendum(elementProps.__source);
1961
+ }
1962
+ return '';
1963
+ }
1964
+ /**
1965
+ * Warn if there's no key explicitly set on dynamic arrays of children or
1966
+ * object keys are not valid. This allows us to keep track of children between
1967
+ * updates.
1968
+ */
1969
+
1970
+ var ownerHasKeyUseWarning = {};
1971
+ function getCurrentComponentErrorInfo(parentType) {
1972
+ var info = getDeclarationErrorAddendum();
1973
+ if (!info) {
1974
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1975
+ if (parentName) {
1976
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1977
+ }
1978
+ }
1979
+ return info;
1980
+ }
1981
+ /**
1982
+ * Warn if the element doesn't have an explicit key assigned to it.
1983
+ * This element is in an array. The array could grow and shrink or be
1984
+ * reordered. All children that haven't already been validated are required to
1985
+ * have a "key" property assigned to it. Error statuses are cached so a warning
1986
+ * will only be shown once.
1987
+ *
1988
+ * @internal
1989
+ * @param {ReactElement} element Element that requires a key.
1990
+ * @param {*} parentType element's parent's type.
1991
+ */
1992
+
1993
+ function validateExplicitKey(element, parentType) {
1994
+ if (!element._store || element._store.validated || element.key != null) {
1995
+ return;
1996
+ }
1997
+ element._store.validated = true;
1998
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1999
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2000
+ return;
2001
+ }
2002
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2003
+ // property, it may be the creator of the child that's responsible for
2004
+ // assigning it a key.
2005
+
2006
+ var childOwner = '';
2007
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2008
+ // Give the component that originally created this child.
2009
+ childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
2010
+ }
2011
+ setCurrentlyValidatingElement(element);
2012
+ {
2013
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
2014
+ }
2015
+ setCurrentlyValidatingElement(null);
2016
+ }
2017
+ /**
2018
+ * Ensure that every element either is passed in a static location, in an
2019
+ * array with an explicit keys property defined, or in an object literal
2020
+ * with valid key property.
2021
+ *
2022
+ * @internal
2023
+ * @param {ReactNode} node Statically passed child of any type.
2024
+ * @param {*} parentType node's parent's type.
2025
+ */
2026
+
2027
+ function validateChildKeys(node, parentType) {
2028
+ if (_typeof(node) !== 'object') {
2029
+ return;
2030
+ }
2031
+ if (Array.isArray(node)) {
2032
+ for (var i = 0; i < node.length; i++) {
2033
+ var child = node[i];
2034
+ if (isValidElement(child)) {
2035
+ validateExplicitKey(child, parentType);
2036
+ }
2037
+ }
2038
+ } else if (isValidElement(node)) {
2039
+ // This element was passed in a valid location.
2040
+ if (node._store) {
2041
+ node._store.validated = true;
2042
+ }
2043
+ } else if (node) {
2044
+ var iteratorFn = getIteratorFn(node);
2045
+ if (typeof iteratorFn === 'function') {
2046
+ // Entry iterators used to provide implicit keys,
2047
+ // but now we print a separate warning for them later.
2048
+ if (iteratorFn !== node.entries) {
2049
+ var iterator = iteratorFn.call(node);
2050
+ var step;
2051
+ while (!(step = iterator.next()).done) {
2052
+ if (isValidElement(step.value)) {
2053
+ validateExplicitKey(step.value, parentType);
2054
+ }
2055
+ }
2056
+ }
2057
+ }
2058
+ }
2059
+ }
2060
+ /**
2061
+ * Given an element, validate that its props follow the propTypes definition,
2062
+ * provided by the type.
2063
+ *
2064
+ * @param {ReactElement} element
2065
+ */
2066
+
2067
+ function validatePropTypes(element) {
2068
+ {
2069
+ var type = element.type;
2070
+ if (type === null || type === undefined || typeof type === 'string') {
2071
+ return;
2072
+ }
2073
+ var name = getComponentName(type);
2074
+ var propTypes;
2075
+ if (typeof type === 'function') {
2076
+ propTypes = type.propTypes;
2077
+ } else if (_typeof(type) === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
2078
+ // Note: Memo only checks outer props here.
2079
+ // Inner props are checked in the reconciler.
2080
+ type.$$typeof === REACT_MEMO_TYPE)) {
2081
+ propTypes = type.propTypes;
2082
+ } else {
2083
+ return;
2084
+ }
2085
+ if (propTypes) {
2086
+ setCurrentlyValidatingElement(element);
2087
+ checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
2088
+ setCurrentlyValidatingElement(null);
2089
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2090
+ propTypesMisspellWarningShown = true;
2091
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
2092
+ }
2093
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2094
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2095
+ }
2096
+ }
2097
+ }
2098
+ /**
2099
+ * Given a fragment, validate that it can only be provided with fragment props
2100
+ * @param {ReactElement} fragment
2101
+ */
2102
+
2103
+ function validateFragmentProps(fragment) {
2104
+ {
2105
+ setCurrentlyValidatingElement(fragment);
2106
+ var keys = Object.keys(fragment.props);
2107
+ for (var i = 0; i < keys.length; i++) {
2108
+ var key = keys[i];
2109
+ if (key !== 'children' && key !== 'key') {
2110
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2111
+ break;
2112
+ }
2113
+ }
2114
+ if (fragment.ref !== null) {
2115
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
2116
+ }
2117
+ setCurrentlyValidatingElement(null);
2118
+ }
2119
+ }
2120
+ function createElementWithValidation(type, props, children) {
2121
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2122
+ // succeed and there will likely be errors in render.
2123
+
2124
+ if (!validType) {
2125
+ var info = '';
2126
+ if (type === undefined || _typeof(type) === 'object' && type !== null && Object.keys(type).length === 0) {
2127
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
2128
+ }
2129
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2130
+ if (sourceInfo) {
2131
+ info += sourceInfo;
2132
+ } else {
2133
+ info += getDeclarationErrorAddendum();
2134
+ }
2135
+ var typeString;
2136
+ if (type === null) {
2137
+ typeString = 'null';
2138
+ } else if (Array.isArray(type)) {
2139
+ typeString = 'array';
2140
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2141
+ typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
2142
+ info = ' Did you accidentally export a JSX literal instead of a component?';
2143
+ } else {
2144
+ typeString = _typeof(type);
2145
+ }
2146
+ {
2147
+ error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
2148
+ }
2149
+ }
2150
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2151
+ // TODO: Drop this when these are no longer allowed as the type argument.
2152
+
2153
+ if (element == null) {
2154
+ return element;
2155
+ } // Skip key warning if the type isn't valid since our key validation logic
2156
+ // doesn't expect a non-string/function type and can throw confusing errors.
2157
+ // We don't want exception behavior to differ between dev and prod.
2158
+ // (Rendering will throw with a helpful message and as soon as the type is
2159
+ // fixed, the key warnings will appear.)
2160
+
2161
+ if (validType) {
2162
+ for (var i = 2; i < arguments.length; i++) {
2163
+ validateChildKeys(arguments[i], type);
2164
+ }
2165
+ }
2166
+ if (type === REACT_FRAGMENT_TYPE) {
2167
+ validateFragmentProps(element);
2168
+ } else {
2169
+ validatePropTypes(element);
2170
+ }
2171
+ return element;
2172
+ }
2173
+ var didWarnAboutDeprecatedCreateFactory = false;
2174
+ function createFactoryWithValidation(type) {
2175
+ var validatedFactory = createElementWithValidation.bind(null, type);
2176
+ validatedFactory.type = type;
2177
+ {
2178
+ if (!didWarnAboutDeprecatedCreateFactory) {
2179
+ didWarnAboutDeprecatedCreateFactory = true;
2180
+ warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2181
+ } // Legacy hook: remove it
2182
+
2183
+ Object.defineProperty(validatedFactory, 'type', {
2184
+ enumerable: false,
2185
+ get: function get() {
2186
+ warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2187
+ Object.defineProperty(this, 'type', {
2188
+ value: type
2189
+ });
2190
+ return type;
2191
+ }
2192
+ });
2193
+ }
2194
+ return validatedFactory;
2195
+ }
2196
+ function cloneElementWithValidation(element, props, children) {
2197
+ var newElement = cloneElement.apply(this, arguments);
2198
+ for (var i = 2; i < arguments.length; i++) {
2199
+ validateChildKeys(arguments[i], newElement.type);
2200
+ }
2201
+ validatePropTypes(newElement);
2202
+ return newElement;
2203
+ }
2204
+ {
2205
+ try {
2206
+ var frozenObject = Object.freeze({});
2207
+ var testMap = new Map([[frozenObject, null]]);
2208
+ var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
2209
+ // https://github.com/rollup/rollup/issues/1771
2210
+ // TODO: we can remove these if Rollup fixes the bug.
2211
+
2212
+ testMap.set(0, 0);
2213
+ testSet.add(0);
2214
+ } catch (e) {}
2215
+ }
2216
+ var createElement$1 = createElementWithValidation;
2217
+ var cloneElement$1 = cloneElementWithValidation;
2218
+ var createFactory = createFactoryWithValidation;
2219
+ var Children = {
2220
+ map: mapChildren,
2221
+ forEach: forEachChildren,
2222
+ count: countChildren,
2223
+ toArray: toArray,
2224
+ only: onlyChild
2225
+ };
2226
+ react_development.Children = Children;
2227
+ react_development.Component = Component;
2228
+ react_development.Fragment = REACT_FRAGMENT_TYPE;
2229
+ react_development.Profiler = REACT_PROFILER_TYPE;
2230
+ react_development.PureComponent = PureComponent;
2231
+ react_development.StrictMode = REACT_STRICT_MODE_TYPE;
2232
+ react_development.Suspense = REACT_SUSPENSE_TYPE;
2233
+ react_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
2234
+ react_development.cloneElement = cloneElement$1;
2235
+ react_development.createContext = createContext;
2236
+ react_development.createElement = createElement$1;
2237
+ react_development.createFactory = createFactory;
2238
+ react_development.createRef = createRef;
2239
+ react_development.forwardRef = forwardRef;
2240
+ react_development.isValidElement = isValidElement;
2241
+ react_development.lazy = lazy;
2242
+ react_development.memo = memo;
2243
+ react_development.useCallback = useCallback;
2244
+ react_development.useContext = useContext;
2245
+ react_development.useDebugValue = useDebugValue;
2246
+ react_development.useEffect = useEffect;
2247
+ react_development.useImperativeHandle = useImperativeHandle;
2248
+ react_development.useLayoutEffect = useLayoutEffect;
2249
+ react_development.useMemo = useMemo;
2250
+ react_development.useReducer = useReducer;
2251
+ react_development.useRef = useRef;
2252
+ react_development.useState = useState;
2253
+ react_development.version = ReactVersion;
2254
+ })();
2255
+ }
2256
+ return react_development;
2257
+ }
2258
+
2259
+ if (process.env.NODE_ENV === 'production') {
2260
+ react.exports = requireReact_production_min();
2261
+ } else {
2262
+ react.exports = requireReact_development();
2263
+ }
2264
+ var reactExports = react.exports;
2265
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2266
+
2267
+ var constants = {exports: {}};
2268
+
2269
+ var reactReconcilerConstants_production_min = {};
2270
+
2271
+ /**
2272
+ * @license React
2273
+ * react-reconciler-constants.production.min.js
2274
+ *
2275
+ * Copyright (c) Facebook, Inc. and its affiliates.
2276
+ *
2277
+ * This source code is licensed under the MIT license found in the
2278
+ * LICENSE file in the root directory of this source tree.
2279
+ */
2280
+ var hasRequiredReactReconcilerConstants_production_min;
2281
+ function requireReactReconcilerConstants_production_min() {
2282
+ if (hasRequiredReactReconcilerConstants_production_min) return reactReconcilerConstants_production_min;
2283
+ hasRequiredReactReconcilerConstants_production_min = 1;
2284
+ reactReconcilerConstants_production_min.ConcurrentRoot = 1;
2285
+ reactReconcilerConstants_production_min.ContinuousEventPriority = 4;
2286
+ reactReconcilerConstants_production_min.DefaultEventPriority = 16;
2287
+ reactReconcilerConstants_production_min.DiscreteEventPriority = 1;
2288
+ reactReconcilerConstants_production_min.IdleEventPriority = 536870912;
2289
+ reactReconcilerConstants_production_min.LegacyRoot = 0;
2290
+ return reactReconcilerConstants_production_min;
2291
+ }
2292
+
2293
+ var reactReconcilerConstants_development = {};
2294
+
2295
+ /**
8
2296
  * @license React
9
2297
  * react-reconciler-constants.development.js
10
2298
  *
@@ -12,4 +2300,563 @@
12
2300
  *
13
2301
  * This source code is licensed under the MIT license found in the
14
2302
  * LICENSE file in the root directory of this source tree.
15
- */"production"===process.env.NODE_ENV?R.exports=(w||(w=1,E.ConcurrentRoot=1,E.ContinuousEventPriority=4,E.DefaultEventPriority=16,E.DiscreteEventPriority=1,E.IdleEventPriority=536870912,E.LegacyRoot=0),E):R.exports=(x||(x=1,"production"!==process.env.NODE_ENV&&(O.ConcurrentRoot=1,O.ContinuousEventPriority=4,O.DefaultEventPriority=16,O.DiscreteEventPriority=1,O.IdleEventPriority=536870912,O.LegacyRoot=0)),O);var k=R.exports;const j={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},$=e=>!!j[e],I=__DEV__?(...e)=>{console.log(...e)}:()=>{},T=__DEV__?e=>{throw new Error(e)}:()=>{},D=e=>e.stage===e,N=e=>e.layer===e,A=e=>"glyph"===e.type,L=e=>"shadowroot"===e.type,F=(e,r,n)=>{const o=e.toLowerCase(),{graphicProps:a,eventProps:i}=(e=>{const t={},r={};return Object.keys(e).forEach((n=>{j[n]?t[n]=e[n]:r[n]=e[n]})),{graphicProps:r,eventProps:t}})(r);let u;return u="glyph"===o?t.createGlyph(a):"layer"===o&&n?D(n)?n.createLayer():n.stage?n.stage.createLayer():null:"shadowroot"===o?t.createShadowRoot():t.graphicCreator[o](a),((e,t)=>{Object.keys(e).forEach((r=>{"function"==typeof e[r]&&t.addEventListener(j[r],e[r])}))})(i,u),I("createInstance ",o,u),u},U=(e,t)=>{const r=D(e),n=N(t);r&&!n&&e.defaultLayer?e.defaultLayer.appendChild(t):A(e)?e.setSubGraphic((e.getSubGraphic()??[]).concat(t)):L(t)?r?T("stage can not attach shadow root"):e.attachShadow(t):e.appendChild(t)},M=(e,t,r)=>{const n=D(e),o=N(t),a=N(r);if(n)o||a?o&&a&&e.insertBefore(t,r):e.defaultLayer?e.defaultLayer.insertBefore(t,r):T("default layer has been removed ");else if(!n&&o)T(`layer can not be inserted into other graphic: ${e.type}`);else if(A(e)){const n=e.getSubGraphic(),o=n.indexOf(t),a=n.indexOf(r);if(o>=0&&a>=0&&o!==a){const i=n.slice();i[a]=t,i[o]=r,e.setSubGraphic(i)}}else e.insertBefore(t,r)},V=(e,t)=>{const r=D(e),n=N(t);if(r&&!n&&e.defaultLayer)e.defaultLayer.removeChild(t);else if(A(e)){const r=e.getSubGraphic(),n=r.indexOf(t);n>=0&&e.setSubGraphic([...r.slice(0,n-1),...r.slice(n+1)])}else L(t)?r?T("stage can not attach shadow root"):e.detachShadow(t):e.removeChild(t)},H=r({getPublicInstance:e=>e,getRootHostContext(e){},getChildHostContext(e,t,r){},prepareForCommit:e=>null,resetAfterCommit(e){},preparePortalMount(e){},createInstance:(e,t,r,n,o)=>F(e,t,r),appendInitialChild(e,t){I("appendInitialChild",e,t),U(e,t)},finalizeInitialChildren:(e,t,r,n,o)=>!1,prepareUpdate:(e,t,r,n,o,a)=>!0,shouldSetTextContent:(e,t)=>!1,createTextInstance:(e,r,n,o)=>t.createText({text:e}),scheduleTimeout(e,t){},cancelTimeout(e){},noTimeout:void 0,getCurrentEventPriority:()=>k.DefaultEventPriority,getInstanceFromNode(e){throw new Error("Not implemented.")},beforeActiveInstanceBlur(){},isPrimaryRenderer:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,appendChild(e,t){I("appendChild"),U(e,t)},appendChildToContainer(e,t){I("appendChildToContainer",e,t),U(e,t)},commitTextUpdate(e,t,r){},commitMount(e,t,r,n){},commitUpdate(e,t,r,n,o,a){I("commitUpdate",e,o),((e,t,r)=>{Object.keys(r).forEach((n=>{r&&r[n]!==t[n]&&($(n)?e.removeEventListener(j[n],r[n]):e.setAttribute(n,void 0))})),Object.keys(t).forEach((n=>{r[n]!==t[n]&&($(n)?"function"==typeof t[n]&&e.addEventListener(j[n],t[n]):e.setAttribute(n,t[n]))}))})(e,o,n)},insertBefore(e,t,r){M(e,t,r)},insertInContainerBefore(e,t,r){M(e,t,r)},removeChild(e,t){I("removeChild",e,t),V(e,t)},removeChildFromContainer(e,t){V(e,t)},resetTextContent(e){},hideInstance(e){},hideTextInstance(e){},unhideInstance(e,t){},unhideTextInstance(e,t){},clearContainer(e){(e=>{if(D(e))for(e.defaultLayer&&e.defaultLayer.removeAllChild();e.childrenCount>1;)e.removeChild(e.getChildAt(1));else e.removeAllChild()})(e)},cloneInstance:(e,t,r,n,o,a,i,u)=>e,createContainerChildSet(e){},appendChildToContainerChildSet(e,t){},finalizeContainerChildren(e,t){},replaceContainerChildren(e,t){},canHydrateInstance:(e,t,r)=>e,canHydrateTextInstance:(e,t)=>null,getNextHydratableSibling(e){},getFirstHydratableChild(e){},hydrateInstance(e,t,r,n,o,a){},hydrateTextInstance:(e,t,r)=>!1,didNotMatchHydratedContainerTextInstance(e,t,r){},didNotMatchHydratedTextInstance(e,t,r,n,o){},didNotHydrateContainerInstance(e,t){},didNotHydrateInstance(e,t,r,n){},didNotFindHydratableContainerInstance(e,t,r){},didNotFindHydratableContainerTextInstance(e,t){},didNotFindHydratableInstance(e,t,r,n,o){},didNotFindHydratableTextInstance(e,t,r,n){},afterActiveInstanceBlur(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,detachDeletedInstance(){}});H.injectIntoDevTools({bundleType:"production"!==process.env.NODE_ENV?1:0,version:P.version,rendererPackageName:"react-g",rendererConfig:{getInspectorDataForViewTag:e=>{console.log(e)}}});const B=S.forwardRef(((e,r)=>{const{viewBox:n,width:o,height:a,dpr:i,background:u,canvasControled:c,title:s,canvas:l,disableDirtyBounds:f,beforeRender:p,afterRender:d,renderStyle:y,stage3dOptions:h,containerId:m,containerTitle:v,children:b,...g}=e;"function"==typeof r&&T("Callback ref not support!");const C=S.useRef(),_=S.useRef(null),w=S.useRef(null),R=r||w,E=S.useRef(!1);return S.useLayoutEffect((()=>{const e=t.createStage({viewBox:n,width:o,height:a,dpr:i,background:u,canvasControled:c,title:s,autoRender:!0,disableDirtyBounds:f,beforeRender:p,afterRender:d,renderStyle:y,canvas:l,container:_.current});return h&&e.set3dOptions(h),R.current=e,C.current=H.createContainer(e,1,null,!1,!1,""),()=>{H.updateContainer(null,C.current,null)}}),[]),S.useLayoutEffect((()=>{n&&R.current&&E.current&&R.current.setViewBox(n.x1,n.y1,n.x2-n.x1,n.y2-n.y1,!1)}),[R,n,E]),S.useLayoutEffect((()=>{i&&R.current&&E.current&&R.current.setDpr(i)}),[R,i,E]),S.useLayoutEffect((()=>{o>0&&a>0&&R.current&&E.current&&R.current.resize(o,a)}),[o,a,R,E]),S.useLayoutEffect((()=>{E.current=!0,C.current&&H.updateContainer(b,C.current,null)}),[b]),P.createElement("div",{...g,id:m,title:v,ref:_})}));e.Arc="arc",e.Area="area",e.Circle="circle",e.ElementOf=n,e.Glyph="glyph",e.Group="group",e.Image="image",e.Layer="layer",e.Line="line",e.Path="path",e.Polygon="polygon",e.Rect="rect",e.Rect3d="rect3d",e.RichText="richtext",e.ShadowRoot="shadowroot",e.Stage=B,e.TYPES={layer:"Layer",arc:"Arc",rect:"Rect",circle:"Circle",area:"Area",group:"Group"},e.Text="text",e.VRenderSymbol="symbol",e.createInstance=F,e.reconcilor=H,e.render=(e,t,r)=>{const n=H.createContainer(t,1,!1,null);H.updateContainer(e,n,null,r)}}));
2303
+ */
2304
+ var hasRequiredReactReconcilerConstants_development;
2305
+ function requireReactReconcilerConstants_development() {
2306
+ if (hasRequiredReactReconcilerConstants_development) return reactReconcilerConstants_development;
2307
+ hasRequiredReactReconcilerConstants_development = 1;
2308
+ if (process.env.NODE_ENV !== "production") {
2309
+ (function () {
2310
+
2311
+ var SyncLane = /* */
2312
+ 1;
2313
+ var InputContinuousLane = /* */
2314
+ 4;
2315
+ var DefaultLane = /* */
2316
+ 16;
2317
+ var IdleLane = /* */
2318
+ 536870912;
2319
+ var DiscreteEventPriority = SyncLane;
2320
+ var ContinuousEventPriority = InputContinuousLane;
2321
+ var DefaultEventPriority = DefaultLane;
2322
+ var IdleEventPriority = IdleLane;
2323
+ var LegacyRoot = 0;
2324
+ var ConcurrentRoot = 1;
2325
+ reactReconcilerConstants_development.ConcurrentRoot = ConcurrentRoot;
2326
+ reactReconcilerConstants_development.ContinuousEventPriority = ContinuousEventPriority;
2327
+ reactReconcilerConstants_development.DefaultEventPriority = DefaultEventPriority;
2328
+ reactReconcilerConstants_development.DiscreteEventPriority = DiscreteEventPriority;
2329
+ reactReconcilerConstants_development.IdleEventPriority = IdleEventPriority;
2330
+ reactReconcilerConstants_development.LegacyRoot = LegacyRoot;
2331
+ })();
2332
+ }
2333
+ return reactReconcilerConstants_development;
2334
+ }
2335
+
2336
+ if (process.env.NODE_ENV === 'production') {
2337
+ constants.exports = requireReactReconcilerConstants_production_min();
2338
+ } else {
2339
+ constants.exports = requireReactReconcilerConstants_development();
2340
+ }
2341
+ var constantsExports = constants.exports;
2342
+
2343
+ const REACT_TO_CANOPUS_EVENTS = {
2344
+ onPointerDown: 'pointerdown',
2345
+ onPointerUp: 'pointerup',
2346
+ onPointerUpOutside: 'pointerupoutside',
2347
+ onPointerTap: 'pointertap',
2348
+ onPointerOver: 'pointerover',
2349
+ onPointerMove: 'pointermove',
2350
+ onPointerEnter: 'pointerenter',
2351
+ onPointerLeave: 'pointerleave',
2352
+ onPointerOut: 'pointerout',
2353
+ onMouseDown: 'mousedown',
2354
+ onMouseUp: 'mouseup',
2355
+ onMouseUpOutside: 'mouseupoutside',
2356
+ onMouseMove: 'mousemove',
2357
+ onMouseOver: 'mouseover',
2358
+ onMouseOut: 'mouseout',
2359
+ onMouseEnter: 'mouseenter',
2360
+ onMouseLeave: 'mouseleave',
2361
+ onPinch: 'pinch',
2362
+ onPinchStart: 'pinchstart',
2363
+ onPinchEnd: 'pinchend',
2364
+ onPan: 'pan',
2365
+ onPanStart: 'panstart',
2366
+ onPanEnd: 'panend',
2367
+ onDrag: 'drag',
2368
+ onDragStart: 'dragstart',
2369
+ onDragEnter: 'dragenter',
2370
+ onDragLeave: 'dragleave',
2371
+ onDragOver: 'dragover',
2372
+ onDragEnd: 'dragend',
2373
+ onRightDown: 'rightdown',
2374
+ onRightUp: 'rightup',
2375
+ onRightUpOutside: 'rightupoutside',
2376
+ onTouchStart: 'touchstart',
2377
+ onTouchEnd: 'touchend',
2378
+ onTouchEndOutside: 'touchendoutside',
2379
+ onTouchMove: 'touchmove',
2380
+ onTouchCancel: 'touchcancel',
2381
+ onPress: 'press',
2382
+ onPressUp: 'pressup',
2383
+ onPressEnd: 'pressend',
2384
+ onSwipe: 'swipe',
2385
+ onDrop: 'drop',
2386
+ onWeel: 'wheel',
2387
+ onClick: 'click',
2388
+ onDblClick: 'dblclick'
2389
+ };
2390
+ const isEvent = (key) => !!REACT_TO_CANOPUS_EVENTS[key];
2391
+ const splitProps = (props) => {
2392
+ const eventProps = {};
2393
+ const graphicProps = {};
2394
+ Object.keys(props).forEach(key => {
2395
+ if (REACT_TO_CANOPUS_EVENTS[key]) {
2396
+ eventProps[key] = props[key];
2397
+ }
2398
+ else {
2399
+ graphicProps[key] = props[key];
2400
+ }
2401
+ });
2402
+ return { graphicProps, eventProps };
2403
+ };
2404
+ const bindGraphicEvent = (eventProps, instance) => {
2405
+ Object.keys(eventProps).forEach(propKey => {
2406
+ if (typeof eventProps[propKey] === 'function') {
2407
+ instance.addEventListener(REACT_TO_CANOPUS_EVENTS[propKey], eventProps[propKey]);
2408
+ }
2409
+ });
2410
+ };
2411
+ const updateProps = (instance, newProps, oldProps) => {
2412
+ Object.keys(oldProps).forEach(key => {
2413
+ const propChanged = oldProps && oldProps[key] !== newProps[key];
2414
+ if (propChanged) {
2415
+ if (isEvent(key)) {
2416
+ instance.removeEventListener(REACT_TO_CANOPUS_EVENTS[key], oldProps[key]);
2417
+ }
2418
+ else {
2419
+ instance.setAttribute(key, undefined);
2420
+ }
2421
+ }
2422
+ });
2423
+ Object.keys(newProps).forEach(key => {
2424
+ const propChanged = oldProps[key] !== newProps[key];
2425
+ if (propChanged) {
2426
+ if (isEvent(key)) {
2427
+ if (typeof newProps[key] === 'function') {
2428
+ instance.addEventListener(REACT_TO_CANOPUS_EVENTS[key], newProps[key]);
2429
+ }
2430
+ }
2431
+ else {
2432
+ instance.setAttribute(key, newProps[key]);
2433
+ }
2434
+ }
2435
+ });
2436
+ };
2437
+
2438
+ const log = __DEV__
2439
+ ? (...args) => {
2440
+ console.log(...args);
2441
+ }
2442
+ : () => {
2443
+ return;
2444
+ };
2445
+ const error = __DEV__
2446
+ ? (errorMsg) => {
2447
+ throw new Error(errorMsg);
2448
+ }
2449
+ : () => {
2450
+ return;
2451
+ };
2452
+
2453
+ const isStage = (instance) => {
2454
+ return instance.stage === instance;
2455
+ };
2456
+ const isLayer = (instance) => {
2457
+ return instance.layer === instance;
2458
+ };
2459
+ const isGlyph = (instance) => {
2460
+ return instance.type === 'glyph';
2461
+ };
2462
+ const isShadowRoot = (instance) => {
2463
+ return instance.type === 'shadowroot';
2464
+ };
2465
+ const createInstance = (type, props, rootContainerInstance) => {
2466
+ const graphicType = type.toLowerCase();
2467
+ const { graphicProps, eventProps } = splitProps(props);
2468
+ let instance;
2469
+ if (graphicType === 'glyph') {
2470
+ instance = vrender.createGlyph(graphicProps);
2471
+ }
2472
+ else if (graphicType === 'layer' && rootContainerInstance) {
2473
+ instance = isStage(rootContainerInstance)
2474
+ ? rootContainerInstance.createLayer()
2475
+ : rootContainerInstance.stage
2476
+ ? rootContainerInstance.stage.createLayer()
2477
+ : null;
2478
+ }
2479
+ else if (graphicType === 'shadowroot') {
2480
+ instance = vrender.createShadowRoot();
2481
+ }
2482
+ else {
2483
+ instance = vrender.graphicCreator[graphicType](graphicProps);
2484
+ }
2485
+ bindGraphicEvent(eventProps, instance);
2486
+ log('createInstance ', graphicType, instance);
2487
+ return instance;
2488
+ };
2489
+ const appendChild = (parentInstance, child) => {
2490
+ const isParentStage = isStage(parentInstance);
2491
+ const isChildLayer = isLayer(child);
2492
+ if (isParentStage && !isChildLayer && parentInstance.defaultLayer) {
2493
+ parentInstance.defaultLayer.appendChild(child);
2494
+ }
2495
+ else if (isGlyph(parentInstance)) {
2496
+ parentInstance.setSubGraphic((parentInstance.getSubGraphic() ?? []).concat(child));
2497
+ }
2498
+ else if (isShadowRoot(child)) {
2499
+ if (isParentStage) {
2500
+ error('stage can not attach shadow root');
2501
+ }
2502
+ else {
2503
+ parentInstance.attachShadow(child);
2504
+ }
2505
+ }
2506
+ else {
2507
+ parentInstance.appendChild(child);
2508
+ }
2509
+ };
2510
+ const insertBeforeChild = (parentInstance, child, beforeChild) => {
2511
+ const isParentStage = isStage(parentInstance);
2512
+ const isChildLayer = isLayer(child);
2513
+ const isBeforeChildLayer = isLayer(beforeChild);
2514
+ if (isParentStage) {
2515
+ if (!isChildLayer && !isBeforeChildLayer) {
2516
+ if (parentInstance.defaultLayer) {
2517
+ parentInstance.defaultLayer.insertBefore(child, beforeChild);
2518
+ }
2519
+ else {
2520
+ error('default layer has been removed ');
2521
+ }
2522
+ }
2523
+ else if (isChildLayer && isBeforeChildLayer) {
2524
+ parentInstance.insertBefore(child, beforeChild);
2525
+ }
2526
+ }
2527
+ else if (!isParentStage && isChildLayer) {
2528
+ error(`layer can not be inserted into other graphic: ${parentInstance.type}`);
2529
+ }
2530
+ else if (isGlyph(parentInstance)) {
2531
+ const prevSubGraphics = parentInstance.getSubGraphic();
2532
+ const index = prevSubGraphics.indexOf(child);
2533
+ const beforeIndex = prevSubGraphics.indexOf(beforeChild);
2534
+ if (index >= 0 && beforeIndex >= 0 && index !== beforeIndex) {
2535
+ const newSubGraphics = prevSubGraphics.slice();
2536
+ newSubGraphics[beforeIndex] = child;
2537
+ newSubGraphics[index] = beforeChild;
2538
+ parentInstance.setSubGraphic(newSubGraphics);
2539
+ }
2540
+ }
2541
+ else {
2542
+ parentInstance.insertBefore(child, beforeChild);
2543
+ }
2544
+ };
2545
+ const removeChild = (parentInstance, child) => {
2546
+ const isParentStage = isStage(parentInstance);
2547
+ const isChildLayer = isLayer(child);
2548
+ if (isParentStage && !isChildLayer && parentInstance.defaultLayer) {
2549
+ parentInstance.defaultLayer.removeChild(child);
2550
+ }
2551
+ else if (isGlyph(parentInstance)) {
2552
+ const prevSubGraphics = parentInstance.getSubGraphic();
2553
+ const index = prevSubGraphics.indexOf(child);
2554
+ if (index >= 0) {
2555
+ parentInstance.setSubGraphic([...prevSubGraphics.slice(0, index - 1), ...prevSubGraphics.slice(index + 1)]);
2556
+ }
2557
+ }
2558
+ else if (isShadowRoot(child)) {
2559
+ if (isParentStage) {
2560
+ error('stage can not attach shadow root');
2561
+ }
2562
+ else {
2563
+ parentInstance.detachShadow(child);
2564
+ }
2565
+ }
2566
+ else {
2567
+ parentInstance.removeChild(child);
2568
+ }
2569
+ };
2570
+ const clearContainer = (container) => {
2571
+ if (isStage(container)) {
2572
+ if (container.defaultLayer) {
2573
+ container.defaultLayer.removeAllChild();
2574
+ }
2575
+ while (container.childrenCount > 1) {
2576
+ container.removeChild(container.getChildAt(1));
2577
+ }
2578
+ }
2579
+ else {
2580
+ container.removeAllChild();
2581
+ }
2582
+ };
2583
+ const reconcilor = ReactReconciler({
2584
+ getPublicInstance(instance) {
2585
+ return instance;
2586
+ },
2587
+ getRootHostContext(rootContainerInstance) {
2588
+ return;
2589
+ },
2590
+ getChildHostContext(parentHostContext, type, rootContainerInstance) {
2591
+ return;
2592
+ },
2593
+ prepareForCommit(containerInfo) {
2594
+ return null;
2595
+ },
2596
+ resetAfterCommit(containerInfo) {
2597
+ return;
2598
+ },
2599
+ preparePortalMount(containerInfo) {
2600
+ return;
2601
+ },
2602
+ createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
2603
+ return createInstance(type, props, rootContainerInstance);
2604
+ },
2605
+ appendInitialChild(parentInstance, child) {
2606
+ log('appendInitialChild', parentInstance, child);
2607
+ appendChild(parentInstance, child);
2608
+ },
2609
+ finalizeInitialChildren(parentInstance, type, props, rootContainerInstance, hostContext) {
2610
+ return false;
2611
+ },
2612
+ prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, hostContext) {
2613
+ return true;
2614
+ },
2615
+ shouldSetTextContent(type, props) {
2616
+ return false;
2617
+ },
2618
+ createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
2619
+ return vrender.createText({ text });
2620
+ },
2621
+ scheduleTimeout(handler, timeout) {
2622
+ return;
2623
+ },
2624
+ cancelTimeout(handle) {
2625
+ return;
2626
+ },
2627
+ noTimeout: undefined,
2628
+ getCurrentEventPriority() {
2629
+ return constantsExports.DefaultEventPriority;
2630
+ },
2631
+ getInstanceFromNode(node) {
2632
+ throw new Error('Not implemented.');
2633
+ },
2634
+ beforeActiveInstanceBlur() {
2635
+ return;
2636
+ },
2637
+ isPrimaryRenderer: false,
2638
+ supportsMutation: true,
2639
+ supportsPersistence: false,
2640
+ supportsHydration: false,
2641
+ appendChild(parentInstance, child) {
2642
+ log('appendChild');
2643
+ appendChild(parentInstance, child);
2644
+ },
2645
+ appendChildToContainer(container, child) {
2646
+ log('appendChildToContainer', container, child);
2647
+ appendChild(container, child);
2648
+ },
2649
+ commitTextUpdate(textInstance, oldText, newText) {
2650
+ return;
2651
+ },
2652
+ commitMount(instance, type, newProps, internalInstanceHandle) {
2653
+ return;
2654
+ },
2655
+ commitUpdate(instance, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
2656
+ log('commitUpdate', instance, newProps);
2657
+ updateProps(instance, newProps, oldProps);
2658
+ },
2659
+ insertBefore(parentInstance, child, beforeChild) {
2660
+ insertBeforeChild(parentInstance, child, beforeChild);
2661
+ },
2662
+ insertInContainerBefore(container, child, beforeChild) {
2663
+ insertBeforeChild(container, child, beforeChild);
2664
+ },
2665
+ removeChild(parentInstance, child) {
2666
+ log('removeChild', parentInstance, child);
2667
+ removeChild(parentInstance, child);
2668
+ },
2669
+ removeChildFromContainer(container, child) {
2670
+ removeChild(container, child);
2671
+ },
2672
+ resetTextContent(instance) {
2673
+ return;
2674
+ },
2675
+ hideInstance(instance) {
2676
+ return;
2677
+ },
2678
+ hideTextInstance(textInstance) {
2679
+ return;
2680
+ },
2681
+ unhideInstance(instance, props) {
2682
+ return;
2683
+ },
2684
+ unhideTextInstance(textInstance, text) {
2685
+ return;
2686
+ },
2687
+ clearContainer(container) {
2688
+ clearContainer(container);
2689
+ },
2690
+ cloneInstance(instance, updatePayload, type, oldProps, newProps, internalInstanceHandle, keepChildren, recyclableInstance) {
2691
+ return instance;
2692
+ },
2693
+ createContainerChildSet(container) {
2694
+ return;
2695
+ },
2696
+ appendChildToContainerChildSet(childSet, child) {
2697
+ return;
2698
+ },
2699
+ finalizeContainerChildren(container, newChildren) {
2700
+ return;
2701
+ },
2702
+ replaceContainerChildren(container, newChildren) {
2703
+ return;
2704
+ },
2705
+ canHydrateInstance(instance, type, props) {
2706
+ return instance;
2707
+ },
2708
+ canHydrateTextInstance(instance, text) {
2709
+ return null;
2710
+ },
2711
+ getNextHydratableSibling(instance) {
2712
+ return;
2713
+ },
2714
+ getFirstHydratableChild(parentInstance) {
2715
+ return;
2716
+ },
2717
+ hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
2718
+ return;
2719
+ },
2720
+ hydrateTextInstance(textInstance, text, internalInstanceHandle) {
2721
+ return false;
2722
+ },
2723
+ didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
2724
+ return;
2725
+ },
2726
+ didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
2727
+ return;
2728
+ },
2729
+ didNotHydrateContainerInstance(parentContainer, instance) {
2730
+ return;
2731
+ },
2732
+ didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
2733
+ return;
2734
+ },
2735
+ didNotFindHydratableContainerInstance(parentContainer, type, props) {
2736
+ return;
2737
+ },
2738
+ didNotFindHydratableContainerTextInstance(parentContainer, text) {
2739
+ return;
2740
+ },
2741
+ didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
2742
+ return;
2743
+ },
2744
+ didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
2745
+ return;
2746
+ },
2747
+ afterActiveInstanceBlur() {
2748
+ return;
2749
+ },
2750
+ prepareScopeUpdate() {
2751
+ return;
2752
+ },
2753
+ getInstanceFromScope() {
2754
+ return null;
2755
+ },
2756
+ detachDeletedInstance() {
2757
+ return;
2758
+ }
2759
+ });
2760
+ reconcilor.injectIntoDevTools({
2761
+ bundleType: process.env.NODE_ENV !== 'production' ? 1 : 0,
2762
+ version: React.version,
2763
+ rendererPackageName: 'react-g',
2764
+ rendererConfig: {
2765
+ getInspectorDataForViewTag: (tag) => {
2766
+ console.log(tag);
2767
+ }
2768
+ }
2769
+ });
2770
+ const render = (component, target, callback) => {
2771
+ const container = reconcilor.createContainer(target, 1, false, null);
2772
+ reconcilor.updateContainer(component, container, null, callback);
2773
+ };
2774
+
2775
+ function assertRef(forwardedRef) {
2776
+ if (typeof forwardedRef === 'function') {
2777
+ error('Callback ref not support!');
2778
+ }
2779
+ }
2780
+
2781
+ const Stage = reactExports.forwardRef((props, ref) => {
2782
+ const { viewBox, width, height, dpr, background, canvasControled, title, canvas, disableDirtyBounds, beforeRender, afterRender, renderStyle, stage3dOptions, containerId, containerTitle, children, ...others } = props;
2783
+ assertRef(ref);
2784
+ const fiberRoot = reactExports.useRef();
2785
+ const divRef = reactExports.useRef(null);
2786
+ const innerStageRef = reactExports.useRef(null);
2787
+ const stageRef = ref || innerStageRef;
2788
+ const initedRef = reactExports.useRef(false);
2789
+ reactExports.useLayoutEffect(() => {
2790
+ const stage = vrender.createStage({
2791
+ viewBox,
2792
+ width,
2793
+ height,
2794
+ dpr,
2795
+ background,
2796
+ canvasControled,
2797
+ title,
2798
+ autoRender: true,
2799
+ disableDirtyBounds,
2800
+ beforeRender,
2801
+ afterRender,
2802
+ renderStyle,
2803
+ canvas,
2804
+ container: divRef.current
2805
+ });
2806
+ if (stage3dOptions) {
2807
+ stage.set3dOptions(stage3dOptions);
2808
+ }
2809
+ stageRef.current = stage;
2810
+ fiberRoot.current = reconcilor.createContainer(stage, 1, null, false, false, '');
2811
+ return () => {
2812
+ reconcilor.updateContainer(null, fiberRoot.current, null);
2813
+ };
2814
+ }, []);
2815
+ reactExports.useLayoutEffect(() => {
2816
+ if (viewBox && stageRef.current && initedRef.current) {
2817
+ stageRef.current.setViewBox(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1, false);
2818
+ }
2819
+ }, [stageRef, viewBox, initedRef]);
2820
+ reactExports.useLayoutEffect(() => {
2821
+ if (dpr && stageRef.current && initedRef.current) {
2822
+ stageRef.current.setDpr(dpr);
2823
+ }
2824
+ }, [stageRef, dpr, initedRef]);
2825
+ reactExports.useLayoutEffect(() => {
2826
+ if (width > 0 && height > 0 && stageRef.current && initedRef.current) {
2827
+ stageRef.current.resize(width, height);
2828
+ }
2829
+ }, [width, height, stageRef, initedRef]);
2830
+ reactExports.useLayoutEffect(() => {
2831
+ initedRef.current = true;
2832
+ if (fiberRoot.current) {
2833
+ reconcilor.updateContainer(children, fiberRoot.current, null);
2834
+ }
2835
+ }, [children]);
2836
+ return React.createElement("div", { ...others, id: containerId, title: containerTitle, ref: divRef });
2837
+ });
2838
+
2839
+ exports.Arc = Arc;
2840
+ exports.Area = Area;
2841
+ exports.Circle = Circle;
2842
+ exports.ElementOf = ElementOf;
2843
+ exports.Glyph = Glyph;
2844
+ exports.Group = Group;
2845
+ exports.Image = Image;
2846
+ exports.Layer = Layer;
2847
+ exports.Line = Line;
2848
+ exports.Path = Path;
2849
+ exports.Polygon = Polygon;
2850
+ exports.Rect = Rect;
2851
+ exports.Rect3d = Rect3d;
2852
+ exports.RichText = RichText;
2853
+ exports.ShadowRoot = ShadowRoot;
2854
+ exports.Stage = Stage;
2855
+ exports.TYPES = TYPES;
2856
+ exports.Text = Text;
2857
+ exports.VRenderSymbol = VRenderSymbol;
2858
+ exports.createInstance = createInstance;
2859
+ exports.reconcilor = reconcilor;
2860
+ exports.render = render;
2861
+
2862
+ }));