seeder-st2110-components 1.0.5 → 1.1.0

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
@@ -724,19 +724,117 @@ var reactIs_production_min = {};
724
724
  * This source code is licensed under the MIT license found in the
725
725
  * LICENSE file in the root directory of this source tree.
726
726
  */
727
-
728
727
  var hasRequiredReactIs_production_min;
729
-
730
- function requireReactIs_production_min () {
731
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
732
- hasRequiredReactIs_production_min = 1;
733
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
734
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
735
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
736
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
737
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
738
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
739
- return reactIs_production_min;
728
+ function requireReactIs_production_min() {
729
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
730
+ hasRequiredReactIs_production_min = 1;
731
+ var b = "function" === typeof Symbol && Symbol.for,
732
+ c = b ? Symbol.for("react.element") : 60103,
733
+ d = b ? Symbol.for("react.portal") : 60106,
734
+ e = b ? Symbol.for("react.fragment") : 60107,
735
+ f = b ? Symbol.for("react.strict_mode") : 60108,
736
+ g = b ? Symbol.for("react.profiler") : 60114,
737
+ h = b ? Symbol.for("react.provider") : 60109,
738
+ k = b ? Symbol.for("react.context") : 60110,
739
+ l = b ? Symbol.for("react.async_mode") : 60111,
740
+ m = b ? Symbol.for("react.concurrent_mode") : 60111,
741
+ n = b ? Symbol.for("react.forward_ref") : 60112,
742
+ p = b ? Symbol.for("react.suspense") : 60113,
743
+ q = b ? Symbol.for("react.suspense_list") : 60120,
744
+ r = b ? Symbol.for("react.memo") : 60115,
745
+ t = b ? Symbol.for("react.lazy") : 60116,
746
+ v = b ? Symbol.for("react.block") : 60121,
747
+ w = b ? Symbol.for("react.fundamental") : 60117,
748
+ x = b ? Symbol.for("react.responder") : 60118,
749
+ y = b ? Symbol.for("react.scope") : 60119;
750
+ function z(a) {
751
+ if ("object" === typeof a && null !== a) {
752
+ var u = a.$$typeof;
753
+ switch (u) {
754
+ case c:
755
+ switch (a = a.type, a) {
756
+ case l:
757
+ case m:
758
+ case e:
759
+ case g:
760
+ case f:
761
+ case p:
762
+ return a;
763
+ default:
764
+ switch (a = a && a.$$typeof, a) {
765
+ case k:
766
+ case n:
767
+ case t:
768
+ case r:
769
+ case h:
770
+ return a;
771
+ default:
772
+ return u;
773
+ }
774
+ }
775
+ case d:
776
+ return u;
777
+ }
778
+ }
779
+ }
780
+ function A(a) {
781
+ return z(a) === m;
782
+ }
783
+ reactIs_production_min.AsyncMode = l;
784
+ reactIs_production_min.ConcurrentMode = m;
785
+ reactIs_production_min.ContextConsumer = k;
786
+ reactIs_production_min.ContextProvider = h;
787
+ reactIs_production_min.Element = c;
788
+ reactIs_production_min.ForwardRef = n;
789
+ reactIs_production_min.Fragment = e;
790
+ reactIs_production_min.Lazy = t;
791
+ reactIs_production_min.Memo = r;
792
+ reactIs_production_min.Portal = d;
793
+ reactIs_production_min.Profiler = g;
794
+ reactIs_production_min.StrictMode = f;
795
+ reactIs_production_min.Suspense = p;
796
+ reactIs_production_min.isAsyncMode = function (a) {
797
+ return A(a) || z(a) === l;
798
+ };
799
+ reactIs_production_min.isConcurrentMode = A;
800
+ reactIs_production_min.isContextConsumer = function (a) {
801
+ return z(a) === k;
802
+ };
803
+ reactIs_production_min.isContextProvider = function (a) {
804
+ return z(a) === h;
805
+ };
806
+ reactIs_production_min.isElement = function (a) {
807
+ return "object" === typeof a && null !== a && a.$$typeof === c;
808
+ };
809
+ reactIs_production_min.isForwardRef = function (a) {
810
+ return z(a) === n;
811
+ };
812
+ reactIs_production_min.isFragment = function (a) {
813
+ return z(a) === e;
814
+ };
815
+ reactIs_production_min.isLazy = function (a) {
816
+ return z(a) === t;
817
+ };
818
+ reactIs_production_min.isMemo = function (a) {
819
+ return z(a) === r;
820
+ };
821
+ reactIs_production_min.isPortal = function (a) {
822
+ return z(a) === d;
823
+ };
824
+ reactIs_production_min.isProfiler = function (a) {
825
+ return z(a) === g;
826
+ };
827
+ reactIs_production_min.isStrictMode = function (a) {
828
+ return z(a) === f;
829
+ };
830
+ reactIs_production_min.isSuspense = function (a) {
831
+ return z(a) === p;
832
+ };
833
+ reactIs_production_min.isValidElementType = function (a) {
834
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
835
+ };
836
+ reactIs_production_min.typeOf = z;
837
+ return reactIs_production_min;
740
838
  }
741
839
 
742
840
  var reactIs_development = {};
@@ -749,197 +847,179 @@ var reactIs_development = {};
749
847
  * This source code is licensed under the MIT license found in the
750
848
  * LICENSE file in the root directory of this source tree.
751
849
  */
752
-
753
850
  var hasRequiredReactIs_development;
754
-
755
- function requireReactIs_development () {
756
- if (hasRequiredReactIs_development) return reactIs_development;
757
- hasRequiredReactIs_development = 1;
758
-
759
-
760
-
761
- if (process.env.NODE_ENV !== "production") {
762
- (function() {
763
-
764
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
765
- // nor polyfill, then a plain number is used for performance.
766
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
767
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
768
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
769
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
770
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
771
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
772
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
773
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
774
- // (unstable) APIs that have been removed. Can we remove the symbols?
775
-
776
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
777
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
778
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
779
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
780
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
781
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
782
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
783
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
784
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
785
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
786
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
787
-
788
- function isValidElementType(type) {
789
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
790
- 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);
791
- }
792
-
793
- function typeOf(object) {
794
- if (typeof object === 'object' && object !== null) {
795
- var $$typeof = object.$$typeof;
796
-
797
- switch ($$typeof) {
798
- case REACT_ELEMENT_TYPE:
799
- var type = object.type;
800
-
801
- switch (type) {
802
- case REACT_ASYNC_MODE_TYPE:
803
- case REACT_CONCURRENT_MODE_TYPE:
804
- case REACT_FRAGMENT_TYPE:
805
- case REACT_PROFILER_TYPE:
806
- case REACT_STRICT_MODE_TYPE:
807
- case REACT_SUSPENSE_TYPE:
808
- return type;
809
-
810
- default:
811
- var $$typeofType = type && type.$$typeof;
812
-
813
- switch ($$typeofType) {
814
- case REACT_CONTEXT_TYPE:
815
- case REACT_FORWARD_REF_TYPE:
816
- case REACT_LAZY_TYPE:
817
- case REACT_MEMO_TYPE:
818
- case REACT_PROVIDER_TYPE:
819
- return $$typeofType;
820
-
821
- default:
822
- return $$typeof;
823
- }
824
-
825
- }
826
-
827
- case REACT_PORTAL_TYPE:
828
- return $$typeof;
829
- }
830
- }
831
-
832
- return undefined;
833
- } // AsyncMode is deprecated along with isAsyncMode
834
-
835
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
836
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
837
- var ContextConsumer = REACT_CONTEXT_TYPE;
838
- var ContextProvider = REACT_PROVIDER_TYPE;
839
- var Element = REACT_ELEMENT_TYPE;
840
- var ForwardRef = REACT_FORWARD_REF_TYPE;
841
- var Fragment = REACT_FRAGMENT_TYPE;
842
- var Lazy = REACT_LAZY_TYPE;
843
- var Memo = REACT_MEMO_TYPE;
844
- var Portal = REACT_PORTAL_TYPE;
845
- var Profiler = REACT_PROFILER_TYPE;
846
- var StrictMode = REACT_STRICT_MODE_TYPE;
847
- var Suspense = REACT_SUSPENSE_TYPE;
848
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
849
-
850
- function isAsyncMode(object) {
851
- {
852
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
853
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
854
-
855
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
856
- }
857
- }
858
-
859
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
860
- }
861
- function isConcurrentMode(object) {
862
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
863
- }
864
- function isContextConsumer(object) {
865
- return typeOf(object) === REACT_CONTEXT_TYPE;
866
- }
867
- function isContextProvider(object) {
868
- return typeOf(object) === REACT_PROVIDER_TYPE;
869
- }
870
- function isElement(object) {
871
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
872
- }
873
- function isForwardRef(object) {
874
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
875
- }
876
- function isFragment(object) {
877
- return typeOf(object) === REACT_FRAGMENT_TYPE;
878
- }
879
- function isLazy(object) {
880
- return typeOf(object) === REACT_LAZY_TYPE;
881
- }
882
- function isMemo(object) {
883
- return typeOf(object) === REACT_MEMO_TYPE;
884
- }
885
- function isPortal(object) {
886
- return typeOf(object) === REACT_PORTAL_TYPE;
887
- }
888
- function isProfiler(object) {
889
- return typeOf(object) === REACT_PROFILER_TYPE;
890
- }
891
- function isStrictMode(object) {
892
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
893
- }
894
- function isSuspense(object) {
895
- return typeOf(object) === REACT_SUSPENSE_TYPE;
896
- }
897
-
898
- reactIs_development.AsyncMode = AsyncMode;
899
- reactIs_development.ConcurrentMode = ConcurrentMode;
900
- reactIs_development.ContextConsumer = ContextConsumer;
901
- reactIs_development.ContextProvider = ContextProvider;
902
- reactIs_development.Element = Element;
903
- reactIs_development.ForwardRef = ForwardRef;
904
- reactIs_development.Fragment = Fragment;
905
- reactIs_development.Lazy = Lazy;
906
- reactIs_development.Memo = Memo;
907
- reactIs_development.Portal = Portal;
908
- reactIs_development.Profiler = Profiler;
909
- reactIs_development.StrictMode = StrictMode;
910
- reactIs_development.Suspense = Suspense;
911
- reactIs_development.isAsyncMode = isAsyncMode;
912
- reactIs_development.isConcurrentMode = isConcurrentMode;
913
- reactIs_development.isContextConsumer = isContextConsumer;
914
- reactIs_development.isContextProvider = isContextProvider;
915
- reactIs_development.isElement = isElement;
916
- reactIs_development.isForwardRef = isForwardRef;
917
- reactIs_development.isFragment = isFragment;
918
- reactIs_development.isLazy = isLazy;
919
- reactIs_development.isMemo = isMemo;
920
- reactIs_development.isPortal = isPortal;
921
- reactIs_development.isProfiler = isProfiler;
922
- reactIs_development.isStrictMode = isStrictMode;
923
- reactIs_development.isSuspense = isSuspense;
924
- reactIs_development.isValidElementType = isValidElementType;
925
- reactIs_development.typeOf = typeOf;
926
- })();
927
- }
928
- return reactIs_development;
851
+ function requireReactIs_development() {
852
+ if (hasRequiredReactIs_development) return reactIs_development;
853
+ hasRequiredReactIs_development = 1;
854
+ if (process.env.NODE_ENV !== "production") {
855
+ (function () {
856
+
857
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
858
+ // nor polyfill, then a plain number is used for performance.
859
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
860
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
861
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
862
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
863
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
864
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
865
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
866
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
867
+ // (unstable) APIs that have been removed. Can we remove the symbols?
868
+
869
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
870
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
871
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
872
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
873
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
874
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
875
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
876
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
877
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
878
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
879
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
880
+ function isValidElementType(type) {
881
+ return typeof type === 'string' || typeof type === 'function' ||
882
+ // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
883
+ 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);
884
+ }
885
+ function typeOf(object) {
886
+ if (typeof object === 'object' && object !== null) {
887
+ var $$typeof = object.$$typeof;
888
+ switch ($$typeof) {
889
+ case REACT_ELEMENT_TYPE:
890
+ var type = object.type;
891
+ switch (type) {
892
+ case REACT_ASYNC_MODE_TYPE:
893
+ case REACT_CONCURRENT_MODE_TYPE:
894
+ case REACT_FRAGMENT_TYPE:
895
+ case REACT_PROFILER_TYPE:
896
+ case REACT_STRICT_MODE_TYPE:
897
+ case REACT_SUSPENSE_TYPE:
898
+ return type;
899
+ default:
900
+ var $$typeofType = type && type.$$typeof;
901
+ switch ($$typeofType) {
902
+ case REACT_CONTEXT_TYPE:
903
+ case REACT_FORWARD_REF_TYPE:
904
+ case REACT_LAZY_TYPE:
905
+ case REACT_MEMO_TYPE:
906
+ case REACT_PROVIDER_TYPE:
907
+ return $$typeofType;
908
+ default:
909
+ return $$typeof;
910
+ }
911
+ }
912
+ case REACT_PORTAL_TYPE:
913
+ return $$typeof;
914
+ }
915
+ }
916
+ return undefined;
917
+ } // AsyncMode is deprecated along with isAsyncMode
918
+
919
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
920
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
921
+ var ContextConsumer = REACT_CONTEXT_TYPE;
922
+ var ContextProvider = REACT_PROVIDER_TYPE;
923
+ var Element = REACT_ELEMENT_TYPE;
924
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
925
+ var Fragment = REACT_FRAGMENT_TYPE;
926
+ var Lazy = REACT_LAZY_TYPE;
927
+ var Memo = REACT_MEMO_TYPE;
928
+ var Portal = REACT_PORTAL_TYPE;
929
+ var Profiler = REACT_PROFILER_TYPE;
930
+ var StrictMode = REACT_STRICT_MODE_TYPE;
931
+ var Suspense = REACT_SUSPENSE_TYPE;
932
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
933
+
934
+ function isAsyncMode(object) {
935
+ {
936
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
937
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
938
+
939
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
940
+ }
941
+ }
942
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
943
+ }
944
+ function isConcurrentMode(object) {
945
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
946
+ }
947
+ function isContextConsumer(object) {
948
+ return typeOf(object) === REACT_CONTEXT_TYPE;
949
+ }
950
+ function isContextProvider(object) {
951
+ return typeOf(object) === REACT_PROVIDER_TYPE;
952
+ }
953
+ function isElement(object) {
954
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
955
+ }
956
+ function isForwardRef(object) {
957
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
958
+ }
959
+ function isFragment(object) {
960
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
961
+ }
962
+ function isLazy(object) {
963
+ return typeOf(object) === REACT_LAZY_TYPE;
964
+ }
965
+ function isMemo(object) {
966
+ return typeOf(object) === REACT_MEMO_TYPE;
967
+ }
968
+ function isPortal(object) {
969
+ return typeOf(object) === REACT_PORTAL_TYPE;
970
+ }
971
+ function isProfiler(object) {
972
+ return typeOf(object) === REACT_PROFILER_TYPE;
973
+ }
974
+ function isStrictMode(object) {
975
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
976
+ }
977
+ function isSuspense(object) {
978
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
979
+ }
980
+ reactIs_development.AsyncMode = AsyncMode;
981
+ reactIs_development.ConcurrentMode = ConcurrentMode;
982
+ reactIs_development.ContextConsumer = ContextConsumer;
983
+ reactIs_development.ContextProvider = ContextProvider;
984
+ reactIs_development.Element = Element;
985
+ reactIs_development.ForwardRef = ForwardRef;
986
+ reactIs_development.Fragment = Fragment;
987
+ reactIs_development.Lazy = Lazy;
988
+ reactIs_development.Memo = Memo;
989
+ reactIs_development.Portal = Portal;
990
+ reactIs_development.Profiler = Profiler;
991
+ reactIs_development.StrictMode = StrictMode;
992
+ reactIs_development.Suspense = Suspense;
993
+ reactIs_development.isAsyncMode = isAsyncMode;
994
+ reactIs_development.isConcurrentMode = isConcurrentMode;
995
+ reactIs_development.isContextConsumer = isContextConsumer;
996
+ reactIs_development.isContextProvider = isContextProvider;
997
+ reactIs_development.isElement = isElement;
998
+ reactIs_development.isForwardRef = isForwardRef;
999
+ reactIs_development.isFragment = isFragment;
1000
+ reactIs_development.isLazy = isLazy;
1001
+ reactIs_development.isMemo = isMemo;
1002
+ reactIs_development.isPortal = isPortal;
1003
+ reactIs_development.isProfiler = isProfiler;
1004
+ reactIs_development.isStrictMode = isStrictMode;
1005
+ reactIs_development.isSuspense = isSuspense;
1006
+ reactIs_development.isValidElementType = isValidElementType;
1007
+ reactIs_development.typeOf = typeOf;
1008
+ })();
1009
+ }
1010
+ return reactIs_development;
929
1011
  }
930
1012
 
931
1013
  var hasRequiredReactIs;
932
-
933
- function requireReactIs () {
934
- if (hasRequiredReactIs) return reactIs.exports;
935
- hasRequiredReactIs = 1;
936
-
937
- if (process.env.NODE_ENV === 'production') {
938
- reactIs.exports = requireReactIs_production_min();
939
- } else {
940
- reactIs.exports = requireReactIs_development();
941
- }
942
- return reactIs.exports;
1014
+ function requireReactIs() {
1015
+ if (hasRequiredReactIs) return reactIs.exports;
1016
+ hasRequiredReactIs = 1;
1017
+ if (process.env.NODE_ENV === 'production') {
1018
+ reactIs.exports = requireReactIs_production_min();
1019
+ } else {
1020
+ reactIs.exports = requireReactIs_development();
1021
+ }
1022
+ return reactIs.exports;
943
1023
  }
944
1024
 
945
1025
  /*
@@ -947,97 +1027,85 @@ object-assign
947
1027
  (c) Sindre Sorhus
948
1028
  @license MIT
949
1029
  */
950
-
951
1030
  var objectAssign;
952
1031
  var hasRequiredObjectAssign;
1032
+ function requireObjectAssign() {
1033
+ if (hasRequiredObjectAssign) return objectAssign;
1034
+ hasRequiredObjectAssign = 1;
1035
+ /* eslint-disable no-unused-vars */
1036
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1037
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1038
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1039
+ function toObject(val) {
1040
+ if (val === null || val === undefined) {
1041
+ throw new TypeError('Object.assign cannot be called with null or undefined');
1042
+ }
1043
+ return Object(val);
1044
+ }
1045
+ function shouldUseNative() {
1046
+ try {
1047
+ if (!Object.assign) {
1048
+ return false;
1049
+ }
1050
+
1051
+ // Detect buggy property enumeration order in older V8 versions.
953
1052
 
954
- function requireObjectAssign () {
955
- if (hasRequiredObjectAssign) return objectAssign;
956
- hasRequiredObjectAssign = 1;
957
- /* eslint-disable no-unused-vars */
958
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
959
- var hasOwnProperty = Object.prototype.hasOwnProperty;
960
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
961
-
962
- function toObject(val) {
963
- if (val === null || val === undefined) {
964
- throw new TypeError('Object.assign cannot be called with null or undefined');
965
- }
966
-
967
- return Object(val);
968
- }
969
-
970
- function shouldUseNative() {
971
- try {
972
- if (!Object.assign) {
973
- return false;
974
- }
975
-
976
- // Detect buggy property enumeration order in older V8 versions.
977
-
978
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
979
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
980
- test1[5] = 'de';
981
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
982
- return false;
983
- }
984
-
985
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
986
- var test2 = {};
987
- for (var i = 0; i < 10; i++) {
988
- test2['_' + String.fromCharCode(i)] = i;
989
- }
990
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
991
- return test2[n];
992
- });
993
- if (order2.join('') !== '0123456789') {
994
- return false;
995
- }
996
-
997
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
998
- var test3 = {};
999
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1000
- test3[letter] = letter;
1001
- });
1002
- if (Object.keys(Object.assign({}, test3)).join('') !==
1003
- 'abcdefghijklmnopqrst') {
1004
- return false;
1005
- }
1006
-
1007
- return true;
1008
- } catch (err) {
1009
- // We don't expect any of the above to throw, but better to be safe.
1010
- return false;
1011
- }
1012
- }
1013
-
1014
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
1015
- var from;
1016
- var to = toObject(target);
1017
- var symbols;
1018
-
1019
- for (var s = 1; s < arguments.length; s++) {
1020
- from = Object(arguments[s]);
1021
-
1022
- for (var key in from) {
1023
- if (hasOwnProperty.call(from, key)) {
1024
- to[key] = from[key];
1025
- }
1026
- }
1027
-
1028
- if (getOwnPropertySymbols) {
1029
- symbols = getOwnPropertySymbols(from);
1030
- for (var i = 0; i < symbols.length; i++) {
1031
- if (propIsEnumerable.call(from, symbols[i])) {
1032
- to[symbols[i]] = from[symbols[i]];
1033
- }
1034
- }
1035
- }
1036
- }
1037
-
1038
- return to;
1039
- };
1040
- return objectAssign;
1053
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1054
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1055
+ test1[5] = 'de';
1056
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
1057
+ return false;
1058
+ }
1059
+
1060
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1061
+ var test2 = {};
1062
+ for (var i = 0; i < 10; i++) {
1063
+ test2['_' + String.fromCharCode(i)] = i;
1064
+ }
1065
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1066
+ return test2[n];
1067
+ });
1068
+ if (order2.join('') !== '0123456789') {
1069
+ return false;
1070
+ }
1071
+
1072
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1073
+ var test3 = {};
1074
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1075
+ test3[letter] = letter;
1076
+ });
1077
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
1078
+ return false;
1079
+ }
1080
+ return true;
1081
+ } catch (err) {
1082
+ // We don't expect any of the above to throw, but better to be safe.
1083
+ return false;
1084
+ }
1085
+ }
1086
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
1087
+ var from;
1088
+ var to = toObject(target);
1089
+ var symbols;
1090
+ for (var s = 1; s < arguments.length; s++) {
1091
+ from = Object(arguments[s]);
1092
+ for (var key in from) {
1093
+ if (hasOwnProperty.call(from, key)) {
1094
+ to[key] = from[key];
1095
+ }
1096
+ }
1097
+ if (getOwnPropertySymbols) {
1098
+ symbols = getOwnPropertySymbols(from);
1099
+ for (var i = 0; i < symbols.length; i++) {
1100
+ if (propIsEnumerable.call(from, symbols[i])) {
1101
+ to[symbols[i]] = from[symbols[i]];
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+ return to;
1107
+ };
1108
+ return objectAssign;
1041
1109
  }
1042
1110
 
1043
1111
  /**
@@ -1046,28 +1114,23 @@ function requireObjectAssign () {
1046
1114
  * This source code is licensed under the MIT license found in the
1047
1115
  * LICENSE file in the root directory of this source tree.
1048
1116
  */
1049
-
1050
1117
  var ReactPropTypesSecret_1;
1051
1118
  var hasRequiredReactPropTypesSecret;
1052
-
1053
- function requireReactPropTypesSecret () {
1054
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
1055
- hasRequiredReactPropTypesSecret = 1;
1056
-
1057
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1058
-
1059
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
1060
- return ReactPropTypesSecret_1;
1119
+ function requireReactPropTypesSecret() {
1120
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
1121
+ hasRequiredReactPropTypesSecret = 1;
1122
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1123
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
1124
+ return ReactPropTypesSecret_1;
1061
1125
  }
1062
1126
 
1063
1127
  var has;
1064
1128
  var hasRequiredHas;
1065
-
1066
- function requireHas () {
1067
- if (hasRequiredHas) return has;
1068
- hasRequiredHas = 1;
1069
- has = Function.call.bind(Object.prototype.hasOwnProperty);
1070
- return has;
1129
+ function requireHas() {
1130
+ if (hasRequiredHas) return has;
1131
+ hasRequiredHas = 1;
1132
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
1133
+ return has;
1071
1134
  }
1072
1135
 
1073
1136
  /**
@@ -1076,109 +1139,88 @@ function requireHas () {
1076
1139
  * This source code is licensed under the MIT license found in the
1077
1140
  * LICENSE file in the root directory of this source tree.
1078
1141
  */
1079
-
1080
1142
  var checkPropTypes_1;
1081
1143
  var hasRequiredCheckPropTypes;
1144
+ function requireCheckPropTypes() {
1145
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
1146
+ hasRequiredCheckPropTypes = 1;
1147
+ var printWarning = function () {};
1148
+ if (process.env.NODE_ENV !== 'production') {
1149
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
1150
+ var loggedTypeFailures = {};
1151
+ var has = /*@__PURE__*/requireHas();
1152
+ printWarning = function (text) {
1153
+ var message = 'Warning: ' + text;
1154
+ if (typeof console !== 'undefined') {
1155
+ console.error(message);
1156
+ }
1157
+ try {
1158
+ // --- Welcome to debugging React ---
1159
+ // This error was thrown as a convenience so that you can use this stack
1160
+ // to find the callsite that caused this warning to fire.
1161
+ throw new Error(message);
1162
+ } catch (x) {/**/}
1163
+ };
1164
+ }
1165
+
1166
+ /**
1167
+ * Assert that the values match with the type specs.
1168
+ * Error messages are memorized and will only be shown once.
1169
+ *
1170
+ * @param {object} typeSpecs Map of name to a ReactPropType
1171
+ * @param {object} values Runtime values that need to be type-checked
1172
+ * @param {string} location e.g. "prop", "context", "child context"
1173
+ * @param {string} componentName Name of the component for error messages.
1174
+ * @param {?Function} getStack Returns the component stack.
1175
+ * @private
1176
+ */
1177
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1178
+ if (process.env.NODE_ENV !== 'production') {
1179
+ for (var typeSpecName in typeSpecs) {
1180
+ if (has(typeSpecs, typeSpecName)) {
1181
+ var error;
1182
+ // Prop type validation may throw. In case they do, we don't want to
1183
+ // fail the render phase where it didn't fail before. So we log it.
1184
+ // After these have been cleaned up, we'll let them throw.
1185
+ try {
1186
+ // This is intentionally an invariant that gets caught. It's the same
1187
+ // behavior as without this statement except with a better message.
1188
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
1189
+ 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`.');
1190
+ err.name = 'Invariant Violation';
1191
+ throw err;
1192
+ }
1193
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1194
+ } catch (ex) {
1195
+ error = ex;
1196
+ }
1197
+ if (error && !(error instanceof Error)) {
1198
+ 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).');
1199
+ }
1200
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1201
+ // Only monitor this failure once because there tends to be a lot of the
1202
+ // same error.
1203
+ loggedTypeFailures[error.message] = true;
1204
+ var stack = getStack ? getStack() : '';
1205
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
1206
+ }
1207
+ }
1208
+ }
1209
+ }
1210
+ }
1082
1211
 
1083
- function requireCheckPropTypes () {
1084
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
1085
- hasRequiredCheckPropTypes = 1;
1086
-
1087
- var printWarning = function() {};
1088
-
1089
- if (process.env.NODE_ENV !== 'production') {
1090
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
1091
- var loggedTypeFailures = {};
1092
- var has = /*@__PURE__*/ requireHas();
1093
-
1094
- printWarning = function(text) {
1095
- var message = 'Warning: ' + text;
1096
- if (typeof console !== 'undefined') {
1097
- console.error(message);
1098
- }
1099
- try {
1100
- // --- Welcome to debugging React ---
1101
- // This error was thrown as a convenience so that you can use this stack
1102
- // to find the callsite that caused this warning to fire.
1103
- throw new Error(message);
1104
- } catch (x) { /**/ }
1105
- };
1106
- }
1107
-
1108
- /**
1109
- * Assert that the values match with the type specs.
1110
- * Error messages are memorized and will only be shown once.
1111
- *
1112
- * @param {object} typeSpecs Map of name to a ReactPropType
1113
- * @param {object} values Runtime values that need to be type-checked
1114
- * @param {string} location e.g. "prop", "context", "child context"
1115
- * @param {string} componentName Name of the component for error messages.
1116
- * @param {?Function} getStack Returns the component stack.
1117
- * @private
1118
- */
1119
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1120
- if (process.env.NODE_ENV !== 'production') {
1121
- for (var typeSpecName in typeSpecs) {
1122
- if (has(typeSpecs, typeSpecName)) {
1123
- var error;
1124
- // Prop type validation may throw. In case they do, we don't want to
1125
- // fail the render phase where it didn't fail before. So we log it.
1126
- // After these have been cleaned up, we'll let them throw.
1127
- try {
1128
- // This is intentionally an invariant that gets caught. It's the same
1129
- // behavior as without this statement except with a better message.
1130
- if (typeof typeSpecs[typeSpecName] !== 'function') {
1131
- var err = Error(
1132
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
1133
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
1134
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
1135
- );
1136
- err.name = 'Invariant Violation';
1137
- throw err;
1138
- }
1139
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1140
- } catch (ex) {
1141
- error = ex;
1142
- }
1143
- if (error && !(error instanceof Error)) {
1144
- printWarning(
1145
- (componentName || 'React class') + ': type specification of ' +
1146
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
1147
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
1148
- 'You may have forgotten to pass an argument to the type checker ' +
1149
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
1150
- 'shape all require an argument).'
1151
- );
1152
- }
1153
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1154
- // Only monitor this failure once because there tends to be a lot of the
1155
- // same error.
1156
- loggedTypeFailures[error.message] = true;
1157
-
1158
- var stack = getStack ? getStack() : '';
1159
-
1160
- printWarning(
1161
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
1162
- );
1163
- }
1164
- }
1165
- }
1166
- }
1167
- }
1168
-
1169
- /**
1170
- * Resets warning cache when testing.
1171
- *
1172
- * @private
1173
- */
1174
- checkPropTypes.resetWarningCache = function() {
1175
- if (process.env.NODE_ENV !== 'production') {
1176
- loggedTypeFailures = {};
1177
- }
1178
- };
1179
-
1180
- checkPropTypes_1 = checkPropTypes;
1181
- return checkPropTypes_1;
1212
+ /**
1213
+ * Resets warning cache when testing.
1214
+ *
1215
+ * @private
1216
+ */
1217
+ checkPropTypes.resetWarningCache = function () {
1218
+ if (process.env.NODE_ENV !== 'production') {
1219
+ loggedTypeFailures = {};
1220
+ }
1221
+ };
1222
+ checkPropTypes_1 = checkPropTypes;
1223
+ return checkPropTypes_1;
1182
1224
  }
1183
1225
 
1184
1226
  /**
@@ -1187,616 +1229,551 @@ function requireCheckPropTypes () {
1187
1229
  * This source code is licensed under the MIT license found in the
1188
1230
  * LICENSE file in the root directory of this source tree.
1189
1231
  */
1190
-
1191
1232
  var factoryWithTypeCheckers;
1192
1233
  var hasRequiredFactoryWithTypeCheckers;
1234
+ function requireFactoryWithTypeCheckers() {
1235
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
1236
+ hasRequiredFactoryWithTypeCheckers = 1;
1237
+ var ReactIs = requireReactIs();
1238
+ var assign = requireObjectAssign();
1239
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
1240
+ var has = /*@__PURE__*/requireHas();
1241
+ var checkPropTypes = /*@__PURE__*/requireCheckPropTypes();
1242
+ var printWarning = function () {};
1243
+ if (process.env.NODE_ENV !== 'production') {
1244
+ printWarning = function (text) {
1245
+ var message = 'Warning: ' + text;
1246
+ if (typeof console !== 'undefined') {
1247
+ console.error(message);
1248
+ }
1249
+ try {
1250
+ // --- Welcome to debugging React ---
1251
+ // This error was thrown as a convenience so that you can use this stack
1252
+ // to find the callsite that caused this warning to fire.
1253
+ throw new Error(message);
1254
+ } catch (x) {}
1255
+ };
1256
+ }
1257
+ function emptyFunctionThatReturnsNull() {
1258
+ return null;
1259
+ }
1260
+ factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) {
1261
+ /* global Symbol */
1262
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1263
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
1264
+
1265
+ /**
1266
+ * Returns the iterator method function contained on the iterable object.
1267
+ *
1268
+ * Be sure to invoke the function with the iterable as context:
1269
+ *
1270
+ * var iteratorFn = getIteratorFn(myIterable);
1271
+ * if (iteratorFn) {
1272
+ * var iterator = iteratorFn.call(myIterable);
1273
+ * ...
1274
+ * }
1275
+ *
1276
+ * @param {?object} maybeIterable
1277
+ * @return {?function}
1278
+ */
1279
+ function getIteratorFn(maybeIterable) {
1280
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
1281
+ if (typeof iteratorFn === 'function') {
1282
+ return iteratorFn;
1283
+ }
1284
+ }
1285
+
1286
+ /**
1287
+ * Collection of methods that allow declaration and validation of props that are
1288
+ * supplied to React components. Example usage:
1289
+ *
1290
+ * var Props = require('ReactPropTypes');
1291
+ * var MyArticle = React.createClass({
1292
+ * propTypes: {
1293
+ * // An optional string prop named "description".
1294
+ * description: Props.string,
1295
+ *
1296
+ * // A required enum prop named "category".
1297
+ * category: Props.oneOf(['News','Photos']).isRequired,
1298
+ *
1299
+ * // A prop named "dialog" that requires an instance of Dialog.
1300
+ * dialog: Props.instanceOf(Dialog).isRequired
1301
+ * },
1302
+ * render: function() { ... }
1303
+ * });
1304
+ *
1305
+ * A more formal specification of how these methods are used:
1306
+ *
1307
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
1308
+ * decl := ReactPropTypes.{type}(.isRequired)?
1309
+ *
1310
+ * Each and every declaration produces a function with the same signature. This
1311
+ * allows the creation of custom validation functions. For example:
1312
+ *
1313
+ * var MyLink = React.createClass({
1314
+ * propTypes: {
1315
+ * // An optional string or URI prop named "href".
1316
+ * href: function(props, propName, componentName) {
1317
+ * var propValue = props[propName];
1318
+ * if (propValue != null && typeof propValue !== 'string' &&
1319
+ * !(propValue instanceof URI)) {
1320
+ * return new Error(
1321
+ * 'Expected a string or an URI for ' + propName + ' in ' +
1322
+ * componentName
1323
+ * );
1324
+ * }
1325
+ * }
1326
+ * },
1327
+ * render: function() {...}
1328
+ * });
1329
+ *
1330
+ * @internal
1331
+ */
1332
+
1333
+ var ANONYMOUS = '<<anonymous>>';
1334
+
1335
+ // Important!
1336
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
1337
+ var ReactPropTypes = {
1338
+ array: createPrimitiveTypeChecker('array'),
1339
+ bigint: createPrimitiveTypeChecker('bigint'),
1340
+ bool: createPrimitiveTypeChecker('boolean'),
1341
+ func: createPrimitiveTypeChecker('function'),
1342
+ number: createPrimitiveTypeChecker('number'),
1343
+ object: createPrimitiveTypeChecker('object'),
1344
+ string: createPrimitiveTypeChecker('string'),
1345
+ symbol: createPrimitiveTypeChecker('symbol'),
1346
+ any: createAnyTypeChecker(),
1347
+ arrayOf: createArrayOfTypeChecker,
1348
+ element: createElementTypeChecker(),
1349
+ elementType: createElementTypeTypeChecker(),
1350
+ instanceOf: createInstanceTypeChecker,
1351
+ node: createNodeChecker(),
1352
+ objectOf: createObjectOfTypeChecker,
1353
+ oneOf: createEnumTypeChecker,
1354
+ oneOfType: createUnionTypeChecker,
1355
+ shape: createShapeTypeChecker,
1356
+ exact: createStrictShapeTypeChecker
1357
+ };
1358
+
1359
+ /**
1360
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
1361
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1362
+ */
1363
+ /*eslint-disable no-self-compare*/
1364
+ function is(x, y) {
1365
+ // SameValue algorithm
1366
+ if (x === y) {
1367
+ // Steps 1-5, 7-10
1368
+ // Steps 6.b-6.e: +0 != -0
1369
+ return x !== 0 || 1 / x === 1 / y;
1370
+ } else {
1371
+ // Step 6.a: NaN == NaN
1372
+ return x !== x && y !== y;
1373
+ }
1374
+ }
1375
+ /*eslint-enable no-self-compare*/
1376
+
1377
+ /**
1378
+ * We use an Error-like object for backward compatibility as people may call
1379
+ * PropTypes directly and inspect their output. However, we don't use real
1380
+ * Errors anymore. We don't inspect their stack anyway, and creating them
1381
+ * is prohibitively expensive if they are created too often, such as what
1382
+ * happens in oneOfType() for any type before the one that matched.
1383
+ */
1384
+ function PropTypeError(message, data) {
1385
+ this.message = message;
1386
+ this.data = data && typeof data === 'object' ? data : {};
1387
+ this.stack = '';
1388
+ }
1389
+ // Make `instanceof Error` still work for returned errors.
1390
+ PropTypeError.prototype = Error.prototype;
1391
+ function createChainableTypeChecker(validate) {
1392
+ if (process.env.NODE_ENV !== 'production') {
1393
+ var manualPropTypeCallCache = {};
1394
+ var manualPropTypeWarningCount = 0;
1395
+ }
1396
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1397
+ componentName = componentName || ANONYMOUS;
1398
+ propFullName = propFullName || propName;
1399
+ if (secret !== ReactPropTypesSecret) {
1400
+ if (throwOnDirectAccess) {
1401
+ // New behavior only for users of `prop-types` package
1402
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
1403
+ err.name = 'Invariant Violation';
1404
+ throw err;
1405
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
1406
+ // Old behavior for people using React.PropTypes
1407
+ var cacheKey = componentName + ':' + propName;
1408
+ if (!manualPropTypeCallCache[cacheKey] &&
1409
+ // Avoid spamming the console because they are often not actionable except for lib authors
1410
+ manualPropTypeWarningCount < 3) {
1411
+ printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
1412
+ manualPropTypeCallCache[cacheKey] = true;
1413
+ manualPropTypeWarningCount++;
1414
+ }
1415
+ }
1416
+ }
1417
+ if (props[propName] == null) {
1418
+ if (isRequired) {
1419
+ if (props[propName] === null) {
1420
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1421
+ }
1422
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1423
+ }
1424
+ return null;
1425
+ } else {
1426
+ return validate(props, propName, componentName, location, propFullName);
1427
+ }
1428
+ }
1429
+ var chainedCheckType = checkType.bind(null, false);
1430
+ chainedCheckType.isRequired = checkType.bind(null, true);
1431
+ return chainedCheckType;
1432
+ }
1433
+ function createPrimitiveTypeChecker(expectedType) {
1434
+ function validate(props, propName, componentName, location, propFullName, secret) {
1435
+ var propValue = props[propName];
1436
+ var propType = getPropType(propValue);
1437
+ if (propType !== expectedType) {
1438
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
1439
+ // check, but we can offer a more precise error message here rather than
1440
+ // 'of type `object`'.
1441
+ var preciseType = getPreciseType(propValue);
1442
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
1443
+ expectedType: expectedType
1444
+ });
1445
+ }
1446
+ return null;
1447
+ }
1448
+ return createChainableTypeChecker(validate);
1449
+ }
1450
+ function createAnyTypeChecker() {
1451
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1452
+ }
1453
+ function createArrayOfTypeChecker(typeChecker) {
1454
+ function validate(props, propName, componentName, location, propFullName) {
1455
+ if (typeof typeChecker !== 'function') {
1456
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1457
+ }
1458
+ var propValue = props[propName];
1459
+ if (!Array.isArray(propValue)) {
1460
+ var propType = getPropType(propValue);
1461
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1462
+ }
1463
+ for (var i = 0; i < propValue.length; i++) {
1464
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1465
+ if (error instanceof Error) {
1466
+ return error;
1467
+ }
1468
+ }
1469
+ return null;
1470
+ }
1471
+ return createChainableTypeChecker(validate);
1472
+ }
1473
+ function createElementTypeChecker() {
1474
+ function validate(props, propName, componentName, location, propFullName) {
1475
+ var propValue = props[propName];
1476
+ if (!isValidElement(propValue)) {
1477
+ var propType = getPropType(propValue);
1478
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1479
+ }
1480
+ return null;
1481
+ }
1482
+ return createChainableTypeChecker(validate);
1483
+ }
1484
+ function createElementTypeTypeChecker() {
1485
+ function validate(props, propName, componentName, location, propFullName) {
1486
+ var propValue = props[propName];
1487
+ if (!ReactIs.isValidElementType(propValue)) {
1488
+ var propType = getPropType(propValue);
1489
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1490
+ }
1491
+ return null;
1492
+ }
1493
+ return createChainableTypeChecker(validate);
1494
+ }
1495
+ function createInstanceTypeChecker(expectedClass) {
1496
+ function validate(props, propName, componentName, location, propFullName) {
1497
+ if (!(props[propName] instanceof expectedClass)) {
1498
+ var expectedClassName = expectedClass.name || ANONYMOUS;
1499
+ var actualClassName = getClassName(props[propName]);
1500
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1501
+ }
1502
+ return null;
1503
+ }
1504
+ return createChainableTypeChecker(validate);
1505
+ }
1506
+ function createEnumTypeChecker(expectedValues) {
1507
+ if (!Array.isArray(expectedValues)) {
1508
+ if (process.env.NODE_ENV !== 'production') {
1509
+ if (arguments.length > 1) {
1510
+ printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
1511
+ } else {
1512
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
1513
+ }
1514
+ }
1515
+ return emptyFunctionThatReturnsNull;
1516
+ }
1517
+ function validate(props, propName, componentName, location, propFullName) {
1518
+ var propValue = props[propName];
1519
+ for (var i = 0; i < expectedValues.length; i++) {
1520
+ if (is(propValue, expectedValues[i])) {
1521
+ return null;
1522
+ }
1523
+ }
1524
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1525
+ var type = getPreciseType(value);
1526
+ if (type === 'symbol') {
1527
+ return String(value);
1528
+ }
1529
+ return value;
1530
+ });
1531
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1532
+ }
1533
+ return createChainableTypeChecker(validate);
1534
+ }
1535
+ function createObjectOfTypeChecker(typeChecker) {
1536
+ function validate(props, propName, componentName, location, propFullName) {
1537
+ if (typeof typeChecker !== 'function') {
1538
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1539
+ }
1540
+ var propValue = props[propName];
1541
+ var propType = getPropType(propValue);
1542
+ if (propType !== 'object') {
1543
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1544
+ }
1545
+ for (var key in propValue) {
1546
+ if (has(propValue, key)) {
1547
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1548
+ if (error instanceof Error) {
1549
+ return error;
1550
+ }
1551
+ }
1552
+ }
1553
+ return null;
1554
+ }
1555
+ return createChainableTypeChecker(validate);
1556
+ }
1557
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
1558
+ if (!Array.isArray(arrayOfTypeCheckers)) {
1559
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1560
+ return emptyFunctionThatReturnsNull;
1561
+ }
1562
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1563
+ var checker = arrayOfTypeCheckers[i];
1564
+ if (typeof checker !== 'function') {
1565
+ printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
1566
+ return emptyFunctionThatReturnsNull;
1567
+ }
1568
+ }
1569
+ function validate(props, propName, componentName, location, propFullName) {
1570
+ var expectedTypes = [];
1571
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1572
+ var checker = arrayOfTypeCheckers[i];
1573
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1574
+ if (checkerResult == null) {
1575
+ return null;
1576
+ }
1577
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1578
+ expectedTypes.push(checkerResult.data.expectedType);
1579
+ }
1580
+ }
1581
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
1582
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1583
+ }
1584
+ return createChainableTypeChecker(validate);
1585
+ }
1586
+ function createNodeChecker() {
1587
+ function validate(props, propName, componentName, location, propFullName) {
1588
+ if (!isNode(props[propName])) {
1589
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1590
+ }
1591
+ return null;
1592
+ }
1593
+ return createChainableTypeChecker(validate);
1594
+ }
1595
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
1596
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
1597
+ }
1598
+ function createShapeTypeChecker(shapeTypes) {
1599
+ function validate(props, propName, componentName, location, propFullName) {
1600
+ var propValue = props[propName];
1601
+ var propType = getPropType(propValue);
1602
+ if (propType !== 'object') {
1603
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1604
+ }
1605
+ for (var key in shapeTypes) {
1606
+ var checker = shapeTypes[key];
1607
+ if (typeof checker !== 'function') {
1608
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1609
+ }
1610
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1611
+ if (error) {
1612
+ return error;
1613
+ }
1614
+ }
1615
+ return null;
1616
+ }
1617
+ return createChainableTypeChecker(validate);
1618
+ }
1619
+ function createStrictShapeTypeChecker(shapeTypes) {
1620
+ function validate(props, propName, componentName, location, propFullName) {
1621
+ var propValue = props[propName];
1622
+ var propType = getPropType(propValue);
1623
+ if (propType !== 'object') {
1624
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1625
+ }
1626
+ // We need to check all keys in case some are required but missing from props.
1627
+ var allKeys = assign({}, props[propName], shapeTypes);
1628
+ for (var key in allKeys) {
1629
+ var checker = shapeTypes[key];
1630
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
1631
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1632
+ }
1633
+ if (!checker) {
1634
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
1635
+ }
1636
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1637
+ if (error) {
1638
+ return error;
1639
+ }
1640
+ }
1641
+ return null;
1642
+ }
1643
+ return createChainableTypeChecker(validate);
1644
+ }
1645
+ function isNode(propValue) {
1646
+ switch (typeof propValue) {
1647
+ case 'number':
1648
+ case 'string':
1649
+ case 'undefined':
1650
+ return true;
1651
+ case 'boolean':
1652
+ return !propValue;
1653
+ case 'object':
1654
+ if (Array.isArray(propValue)) {
1655
+ return propValue.every(isNode);
1656
+ }
1657
+ if (propValue === null || isValidElement(propValue)) {
1658
+ return true;
1659
+ }
1660
+ var iteratorFn = getIteratorFn(propValue);
1661
+ if (iteratorFn) {
1662
+ var iterator = iteratorFn.call(propValue);
1663
+ var step;
1664
+ if (iteratorFn !== propValue.entries) {
1665
+ while (!(step = iterator.next()).done) {
1666
+ if (!isNode(step.value)) {
1667
+ return false;
1668
+ }
1669
+ }
1670
+ } else {
1671
+ // Iterator will provide entry [k,v] tuples rather than values.
1672
+ while (!(step = iterator.next()).done) {
1673
+ var entry = step.value;
1674
+ if (entry) {
1675
+ if (!isNode(entry[1])) {
1676
+ return false;
1677
+ }
1678
+ }
1679
+ }
1680
+ }
1681
+ } else {
1682
+ return false;
1683
+ }
1684
+ return true;
1685
+ default:
1686
+ return false;
1687
+ }
1688
+ }
1689
+ function isSymbol(propType, propValue) {
1690
+ // Native Symbol.
1691
+ if (propType === 'symbol') {
1692
+ return true;
1693
+ }
1694
+
1695
+ // falsy value can't be a Symbol
1696
+ if (!propValue) {
1697
+ return false;
1698
+ }
1699
+
1700
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1701
+ if (propValue['@@toStringTag'] === 'Symbol') {
1702
+ return true;
1703
+ }
1704
+
1705
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1706
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1707
+ return true;
1708
+ }
1709
+ return false;
1710
+ }
1711
+
1712
+ // Equivalent of `typeof` but with special handling for array and regexp.
1713
+ function getPropType(propValue) {
1714
+ var propType = typeof propValue;
1715
+ if (Array.isArray(propValue)) {
1716
+ return 'array';
1717
+ }
1718
+ if (propValue instanceof RegExp) {
1719
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1720
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1721
+ // passes PropTypes.object.
1722
+ return 'object';
1723
+ }
1724
+ if (isSymbol(propType, propValue)) {
1725
+ return 'symbol';
1726
+ }
1727
+ return propType;
1728
+ }
1729
+
1730
+ // This handles more types than `getPropType`. Only used for error messages.
1731
+ // See `createPrimitiveTypeChecker`.
1732
+ function getPreciseType(propValue) {
1733
+ if (typeof propValue === 'undefined' || propValue === null) {
1734
+ return '' + propValue;
1735
+ }
1736
+ var propType = getPropType(propValue);
1737
+ if (propType === 'object') {
1738
+ if (propValue instanceof Date) {
1739
+ return 'date';
1740
+ } else if (propValue instanceof RegExp) {
1741
+ return 'regexp';
1742
+ }
1743
+ }
1744
+ return propType;
1745
+ }
1746
+
1747
+ // Returns a string that is postfixed to a warning about an invalid type.
1748
+ // For example, "undefined" or "of type array"
1749
+ function getPostfixForTypeWarning(value) {
1750
+ var type = getPreciseType(value);
1751
+ switch (type) {
1752
+ case 'array':
1753
+ case 'object':
1754
+ return 'an ' + type;
1755
+ case 'boolean':
1756
+ case 'date':
1757
+ case 'regexp':
1758
+ return 'a ' + type;
1759
+ default:
1760
+ return type;
1761
+ }
1762
+ }
1193
1763
 
1194
- function requireFactoryWithTypeCheckers () {
1195
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
1196
- hasRequiredFactoryWithTypeCheckers = 1;
1197
-
1198
- var ReactIs = requireReactIs();
1199
- var assign = requireObjectAssign();
1200
-
1201
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
1202
- var has = /*@__PURE__*/ requireHas();
1203
- var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
1204
-
1205
- var printWarning = function() {};
1206
-
1207
- if (process.env.NODE_ENV !== 'production') {
1208
- printWarning = function(text) {
1209
- var message = 'Warning: ' + text;
1210
- if (typeof console !== 'undefined') {
1211
- console.error(message);
1212
- }
1213
- try {
1214
- // --- Welcome to debugging React ---
1215
- // This error was thrown as a convenience so that you can use this stack
1216
- // to find the callsite that caused this warning to fire.
1217
- throw new Error(message);
1218
- } catch (x) {}
1219
- };
1220
- }
1221
-
1222
- function emptyFunctionThatReturnsNull() {
1223
- return null;
1224
- }
1225
-
1226
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1227
- /* global Symbol */
1228
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1229
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
1230
-
1231
- /**
1232
- * Returns the iterator method function contained on the iterable object.
1233
- *
1234
- * Be sure to invoke the function with the iterable as context:
1235
- *
1236
- * var iteratorFn = getIteratorFn(myIterable);
1237
- * if (iteratorFn) {
1238
- * var iterator = iteratorFn.call(myIterable);
1239
- * ...
1240
- * }
1241
- *
1242
- * @param {?object} maybeIterable
1243
- * @return {?function}
1244
- */
1245
- function getIteratorFn(maybeIterable) {
1246
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
1247
- if (typeof iteratorFn === 'function') {
1248
- return iteratorFn;
1249
- }
1250
- }
1251
-
1252
- /**
1253
- * Collection of methods that allow declaration and validation of props that are
1254
- * supplied to React components. Example usage:
1255
- *
1256
- * var Props = require('ReactPropTypes');
1257
- * var MyArticle = React.createClass({
1258
- * propTypes: {
1259
- * // An optional string prop named "description".
1260
- * description: Props.string,
1261
- *
1262
- * // A required enum prop named "category".
1263
- * category: Props.oneOf(['News','Photos']).isRequired,
1264
- *
1265
- * // A prop named "dialog" that requires an instance of Dialog.
1266
- * dialog: Props.instanceOf(Dialog).isRequired
1267
- * },
1268
- * render: function() { ... }
1269
- * });
1270
- *
1271
- * A more formal specification of how these methods are used:
1272
- *
1273
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
1274
- * decl := ReactPropTypes.{type}(.isRequired)?
1275
- *
1276
- * Each and every declaration produces a function with the same signature. This
1277
- * allows the creation of custom validation functions. For example:
1278
- *
1279
- * var MyLink = React.createClass({
1280
- * propTypes: {
1281
- * // An optional string or URI prop named "href".
1282
- * href: function(props, propName, componentName) {
1283
- * var propValue = props[propName];
1284
- * if (propValue != null && typeof propValue !== 'string' &&
1285
- * !(propValue instanceof URI)) {
1286
- * return new Error(
1287
- * 'Expected a string or an URI for ' + propName + ' in ' +
1288
- * componentName
1289
- * );
1290
- * }
1291
- * }
1292
- * },
1293
- * render: function() {...}
1294
- * });
1295
- *
1296
- * @internal
1297
- */
1298
-
1299
- var ANONYMOUS = '<<anonymous>>';
1300
-
1301
- // Important!
1302
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
1303
- var ReactPropTypes = {
1304
- array: createPrimitiveTypeChecker('array'),
1305
- bigint: createPrimitiveTypeChecker('bigint'),
1306
- bool: createPrimitiveTypeChecker('boolean'),
1307
- func: createPrimitiveTypeChecker('function'),
1308
- number: createPrimitiveTypeChecker('number'),
1309
- object: createPrimitiveTypeChecker('object'),
1310
- string: createPrimitiveTypeChecker('string'),
1311
- symbol: createPrimitiveTypeChecker('symbol'),
1312
-
1313
- any: createAnyTypeChecker(),
1314
- arrayOf: createArrayOfTypeChecker,
1315
- element: createElementTypeChecker(),
1316
- elementType: createElementTypeTypeChecker(),
1317
- instanceOf: createInstanceTypeChecker,
1318
- node: createNodeChecker(),
1319
- objectOf: createObjectOfTypeChecker,
1320
- oneOf: createEnumTypeChecker,
1321
- oneOfType: createUnionTypeChecker,
1322
- shape: createShapeTypeChecker,
1323
- exact: createStrictShapeTypeChecker,
1324
- };
1325
-
1326
- /**
1327
- * inlined Object.is polyfill to avoid requiring consumers ship their own
1328
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1329
- */
1330
- /*eslint-disable no-self-compare*/
1331
- function is(x, y) {
1332
- // SameValue algorithm
1333
- if (x === y) {
1334
- // Steps 1-5, 7-10
1335
- // Steps 6.b-6.e: +0 != -0
1336
- return x !== 0 || 1 / x === 1 / y;
1337
- } else {
1338
- // Step 6.a: NaN == NaN
1339
- return x !== x && y !== y;
1340
- }
1341
- }
1342
- /*eslint-enable no-self-compare*/
1343
-
1344
- /**
1345
- * We use an Error-like object for backward compatibility as people may call
1346
- * PropTypes directly and inspect their output. However, we don't use real
1347
- * Errors anymore. We don't inspect their stack anyway, and creating them
1348
- * is prohibitively expensive if they are created too often, such as what
1349
- * happens in oneOfType() for any type before the one that matched.
1350
- */
1351
- function PropTypeError(message, data) {
1352
- this.message = message;
1353
- this.data = data && typeof data === 'object' ? data: {};
1354
- this.stack = '';
1355
- }
1356
- // Make `instanceof Error` still work for returned errors.
1357
- PropTypeError.prototype = Error.prototype;
1358
-
1359
- function createChainableTypeChecker(validate) {
1360
- if (process.env.NODE_ENV !== 'production') {
1361
- var manualPropTypeCallCache = {};
1362
- var manualPropTypeWarningCount = 0;
1363
- }
1364
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1365
- componentName = componentName || ANONYMOUS;
1366
- propFullName = propFullName || propName;
1367
-
1368
- if (secret !== ReactPropTypesSecret) {
1369
- if (throwOnDirectAccess) {
1370
- // New behavior only for users of `prop-types` package
1371
- var err = new Error(
1372
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1373
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
1374
- 'Read more at http://fb.me/use-check-prop-types'
1375
- );
1376
- err.name = 'Invariant Violation';
1377
- throw err;
1378
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
1379
- // Old behavior for people using React.PropTypes
1380
- var cacheKey = componentName + ':' + propName;
1381
- if (
1382
- !manualPropTypeCallCache[cacheKey] &&
1383
- // Avoid spamming the console because they are often not actionable except for lib authors
1384
- manualPropTypeWarningCount < 3
1385
- ) {
1386
- printWarning(
1387
- 'You are manually calling a React.PropTypes validation ' +
1388
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
1389
- 'and will throw in the standalone `prop-types` package. ' +
1390
- 'You may be seeing this warning due to a third-party PropTypes ' +
1391
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
1392
- );
1393
- manualPropTypeCallCache[cacheKey] = true;
1394
- manualPropTypeWarningCount++;
1395
- }
1396
- }
1397
- }
1398
- if (props[propName] == null) {
1399
- if (isRequired) {
1400
- if (props[propName] === null) {
1401
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1402
- }
1403
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1404
- }
1405
- return null;
1406
- } else {
1407
- return validate(props, propName, componentName, location, propFullName);
1408
- }
1409
- }
1410
-
1411
- var chainedCheckType = checkType.bind(null, false);
1412
- chainedCheckType.isRequired = checkType.bind(null, true);
1413
-
1414
- return chainedCheckType;
1415
- }
1416
-
1417
- function createPrimitiveTypeChecker(expectedType) {
1418
- function validate(props, propName, componentName, location, propFullName, secret) {
1419
- var propValue = props[propName];
1420
- var propType = getPropType(propValue);
1421
- if (propType !== expectedType) {
1422
- // `propValue` being instance of, say, date/regexp, pass the 'object'
1423
- // check, but we can offer a more precise error message here rather than
1424
- // 'of type `object`'.
1425
- var preciseType = getPreciseType(propValue);
1426
-
1427
- return new PropTypeError(
1428
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
1429
- {expectedType: expectedType}
1430
- );
1431
- }
1432
- return null;
1433
- }
1434
- return createChainableTypeChecker(validate);
1435
- }
1436
-
1437
- function createAnyTypeChecker() {
1438
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1439
- }
1440
-
1441
- function createArrayOfTypeChecker(typeChecker) {
1442
- function validate(props, propName, componentName, location, propFullName) {
1443
- if (typeof typeChecker !== 'function') {
1444
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1445
- }
1446
- var propValue = props[propName];
1447
- if (!Array.isArray(propValue)) {
1448
- var propType = getPropType(propValue);
1449
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1450
- }
1451
- for (var i = 0; i < propValue.length; i++) {
1452
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1453
- if (error instanceof Error) {
1454
- return error;
1455
- }
1456
- }
1457
- return null;
1458
- }
1459
- return createChainableTypeChecker(validate);
1460
- }
1461
-
1462
- function createElementTypeChecker() {
1463
- function validate(props, propName, componentName, location, propFullName) {
1464
- var propValue = props[propName];
1465
- if (!isValidElement(propValue)) {
1466
- var propType = getPropType(propValue);
1467
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1468
- }
1469
- return null;
1470
- }
1471
- return createChainableTypeChecker(validate);
1472
- }
1473
-
1474
- function createElementTypeTypeChecker() {
1475
- function validate(props, propName, componentName, location, propFullName) {
1476
- var propValue = props[propName];
1477
- if (!ReactIs.isValidElementType(propValue)) {
1478
- var propType = getPropType(propValue);
1479
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1480
- }
1481
- return null;
1482
- }
1483
- return createChainableTypeChecker(validate);
1484
- }
1485
-
1486
- function createInstanceTypeChecker(expectedClass) {
1487
- function validate(props, propName, componentName, location, propFullName) {
1488
- if (!(props[propName] instanceof expectedClass)) {
1489
- var expectedClassName = expectedClass.name || ANONYMOUS;
1490
- var actualClassName = getClassName(props[propName]);
1491
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1492
- }
1493
- return null;
1494
- }
1495
- return createChainableTypeChecker(validate);
1496
- }
1497
-
1498
- function createEnumTypeChecker(expectedValues) {
1499
- if (!Array.isArray(expectedValues)) {
1500
- if (process.env.NODE_ENV !== 'production') {
1501
- if (arguments.length > 1) {
1502
- printWarning(
1503
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1504
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1505
- );
1506
- } else {
1507
- printWarning('Invalid argument supplied to oneOf, expected an array.');
1508
- }
1509
- }
1510
- return emptyFunctionThatReturnsNull;
1511
- }
1512
-
1513
- function validate(props, propName, componentName, location, propFullName) {
1514
- var propValue = props[propName];
1515
- for (var i = 0; i < expectedValues.length; i++) {
1516
- if (is(propValue, expectedValues[i])) {
1517
- return null;
1518
- }
1519
- }
1520
-
1521
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1522
- var type = getPreciseType(value);
1523
- if (type === 'symbol') {
1524
- return String(value);
1525
- }
1526
- return value;
1527
- });
1528
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1529
- }
1530
- return createChainableTypeChecker(validate);
1531
- }
1532
-
1533
- function createObjectOfTypeChecker(typeChecker) {
1534
- function validate(props, propName, componentName, location, propFullName) {
1535
- if (typeof typeChecker !== 'function') {
1536
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1537
- }
1538
- var propValue = props[propName];
1539
- var propType = getPropType(propValue);
1540
- if (propType !== 'object') {
1541
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1542
- }
1543
- for (var key in propValue) {
1544
- if (has(propValue, key)) {
1545
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1546
- if (error instanceof Error) {
1547
- return error;
1548
- }
1549
- }
1550
- }
1551
- return null;
1552
- }
1553
- return createChainableTypeChecker(validate);
1554
- }
1555
-
1556
- function createUnionTypeChecker(arrayOfTypeCheckers) {
1557
- if (!Array.isArray(arrayOfTypeCheckers)) {
1558
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1559
- return emptyFunctionThatReturnsNull;
1560
- }
1561
-
1562
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1563
- var checker = arrayOfTypeCheckers[i];
1564
- if (typeof checker !== 'function') {
1565
- printWarning(
1566
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1567
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1568
- );
1569
- return emptyFunctionThatReturnsNull;
1570
- }
1571
- }
1572
-
1573
- function validate(props, propName, componentName, location, propFullName) {
1574
- var expectedTypes = [];
1575
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1576
- var checker = arrayOfTypeCheckers[i];
1577
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1578
- if (checkerResult == null) {
1579
- return null;
1580
- }
1581
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1582
- expectedTypes.push(checkerResult.data.expectedType);
1583
- }
1584
- }
1585
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1586
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1587
- }
1588
- return createChainableTypeChecker(validate);
1589
- }
1590
-
1591
- function createNodeChecker() {
1592
- function validate(props, propName, componentName, location, propFullName) {
1593
- if (!isNode(props[propName])) {
1594
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1595
- }
1596
- return null;
1597
- }
1598
- return createChainableTypeChecker(validate);
1599
- }
1600
-
1601
- function invalidValidatorError(componentName, location, propFullName, key, type) {
1602
- return new PropTypeError(
1603
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1604
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1605
- );
1606
- }
1607
-
1608
- function createShapeTypeChecker(shapeTypes) {
1609
- function validate(props, propName, componentName, location, propFullName) {
1610
- var propValue = props[propName];
1611
- var propType = getPropType(propValue);
1612
- if (propType !== 'object') {
1613
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1614
- }
1615
- for (var key in shapeTypes) {
1616
- var checker = shapeTypes[key];
1617
- if (typeof checker !== 'function') {
1618
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1619
- }
1620
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1621
- if (error) {
1622
- return error;
1623
- }
1624
- }
1625
- return null;
1626
- }
1627
- return createChainableTypeChecker(validate);
1628
- }
1629
-
1630
- function createStrictShapeTypeChecker(shapeTypes) {
1631
- function validate(props, propName, componentName, location, propFullName) {
1632
- var propValue = props[propName];
1633
- var propType = getPropType(propValue);
1634
- if (propType !== 'object') {
1635
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1636
- }
1637
- // We need to check all keys in case some are required but missing from props.
1638
- var allKeys = assign({}, props[propName], shapeTypes);
1639
- for (var key in allKeys) {
1640
- var checker = shapeTypes[key];
1641
- if (has(shapeTypes, key) && typeof checker !== 'function') {
1642
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1643
- }
1644
- if (!checker) {
1645
- return new PropTypeError(
1646
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1647
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1648
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1649
- );
1650
- }
1651
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1652
- if (error) {
1653
- return error;
1654
- }
1655
- }
1656
- return null;
1657
- }
1658
-
1659
- return createChainableTypeChecker(validate);
1660
- }
1661
-
1662
- function isNode(propValue) {
1663
- switch (typeof propValue) {
1664
- case 'number':
1665
- case 'string':
1666
- case 'undefined':
1667
- return true;
1668
- case 'boolean':
1669
- return !propValue;
1670
- case 'object':
1671
- if (Array.isArray(propValue)) {
1672
- return propValue.every(isNode);
1673
- }
1674
- if (propValue === null || isValidElement(propValue)) {
1675
- return true;
1676
- }
1677
-
1678
- var iteratorFn = getIteratorFn(propValue);
1679
- if (iteratorFn) {
1680
- var iterator = iteratorFn.call(propValue);
1681
- var step;
1682
- if (iteratorFn !== propValue.entries) {
1683
- while (!(step = iterator.next()).done) {
1684
- if (!isNode(step.value)) {
1685
- return false;
1686
- }
1687
- }
1688
- } else {
1689
- // Iterator will provide entry [k,v] tuples rather than values.
1690
- while (!(step = iterator.next()).done) {
1691
- var entry = step.value;
1692
- if (entry) {
1693
- if (!isNode(entry[1])) {
1694
- return false;
1695
- }
1696
- }
1697
- }
1698
- }
1699
- } else {
1700
- return false;
1701
- }
1702
-
1703
- return true;
1704
- default:
1705
- return false;
1706
- }
1707
- }
1708
-
1709
- function isSymbol(propType, propValue) {
1710
- // Native Symbol.
1711
- if (propType === 'symbol') {
1712
- return true;
1713
- }
1714
-
1715
- // falsy value can't be a Symbol
1716
- if (!propValue) {
1717
- return false;
1718
- }
1719
-
1720
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1721
- if (propValue['@@toStringTag'] === 'Symbol') {
1722
- return true;
1723
- }
1724
-
1725
- // Fallback for non-spec compliant Symbols which are polyfilled.
1726
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1727
- return true;
1728
- }
1729
-
1730
- return false;
1731
- }
1732
-
1733
- // Equivalent of `typeof` but with special handling for array and regexp.
1734
- function getPropType(propValue) {
1735
- var propType = typeof propValue;
1736
- if (Array.isArray(propValue)) {
1737
- return 'array';
1738
- }
1739
- if (propValue instanceof RegExp) {
1740
- // Old webkits (at least until Android 4.0) return 'function' rather than
1741
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1742
- // passes PropTypes.object.
1743
- return 'object';
1744
- }
1745
- if (isSymbol(propType, propValue)) {
1746
- return 'symbol';
1747
- }
1748
- return propType;
1749
- }
1750
-
1751
- // This handles more types than `getPropType`. Only used for error messages.
1752
- // See `createPrimitiveTypeChecker`.
1753
- function getPreciseType(propValue) {
1754
- if (typeof propValue === 'undefined' || propValue === null) {
1755
- return '' + propValue;
1756
- }
1757
- var propType = getPropType(propValue);
1758
- if (propType === 'object') {
1759
- if (propValue instanceof Date) {
1760
- return 'date';
1761
- } else if (propValue instanceof RegExp) {
1762
- return 'regexp';
1763
- }
1764
- }
1765
- return propType;
1766
- }
1767
-
1768
- // Returns a string that is postfixed to a warning about an invalid type.
1769
- // For example, "undefined" or "of type array"
1770
- function getPostfixForTypeWarning(value) {
1771
- var type = getPreciseType(value);
1772
- switch (type) {
1773
- case 'array':
1774
- case 'object':
1775
- return 'an ' + type;
1776
- case 'boolean':
1777
- case 'date':
1778
- case 'regexp':
1779
- return 'a ' + type;
1780
- default:
1781
- return type;
1782
- }
1783
- }
1784
-
1785
- // Returns class name of the object, if any.
1786
- function getClassName(propValue) {
1787
- if (!propValue.constructor || !propValue.constructor.name) {
1788
- return ANONYMOUS;
1789
- }
1790
- return propValue.constructor.name;
1791
- }
1792
-
1793
- ReactPropTypes.checkPropTypes = checkPropTypes;
1794
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1795
- ReactPropTypes.PropTypes = ReactPropTypes;
1796
-
1797
- return ReactPropTypes;
1798
- };
1799
- return factoryWithTypeCheckers;
1764
+ // Returns class name of the object, if any.
1765
+ function getClassName(propValue) {
1766
+ if (!propValue.constructor || !propValue.constructor.name) {
1767
+ return ANONYMOUS;
1768
+ }
1769
+ return propValue.constructor.name;
1770
+ }
1771
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1772
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1773
+ ReactPropTypes.PropTypes = ReactPropTypes;
1774
+ return ReactPropTypes;
1775
+ };
1776
+ return factoryWithTypeCheckers;
1800
1777
  }
1801
1778
 
1802
1779
  /**
@@ -1805,69 +1782,58 @@ function requireFactoryWithTypeCheckers () {
1805
1782
  * This source code is licensed under the MIT license found in the
1806
1783
  * LICENSE file in the root directory of this source tree.
1807
1784
  */
1808
-
1809
1785
  var factoryWithThrowingShims;
1810
1786
  var hasRequiredFactoryWithThrowingShims;
1811
-
1812
- function requireFactoryWithThrowingShims () {
1813
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1814
- hasRequiredFactoryWithThrowingShims = 1;
1815
-
1816
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
1817
-
1818
- function emptyFunction() {}
1819
- function emptyFunctionWithReset() {}
1820
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1821
-
1822
- factoryWithThrowingShims = function() {
1823
- function shim(props, propName, componentName, location, propFullName, secret) {
1824
- if (secret === ReactPropTypesSecret) {
1825
- // It is still safe when called from React.
1826
- return;
1827
- }
1828
- var err = new Error(
1829
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1830
- 'Use PropTypes.checkPropTypes() to call them. ' +
1831
- 'Read more at http://fb.me/use-check-prop-types'
1832
- );
1833
- err.name = 'Invariant Violation';
1834
- throw err;
1835
- } shim.isRequired = shim;
1836
- function getShim() {
1837
- return shim;
1838
- } // Important!
1839
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1840
- var ReactPropTypes = {
1841
- array: shim,
1842
- bigint: shim,
1843
- bool: shim,
1844
- func: shim,
1845
- number: shim,
1846
- object: shim,
1847
- string: shim,
1848
- symbol: shim,
1849
-
1850
- any: shim,
1851
- arrayOf: getShim,
1852
- element: shim,
1853
- elementType: shim,
1854
- instanceOf: getShim,
1855
- node: shim,
1856
- objectOf: getShim,
1857
- oneOf: getShim,
1858
- oneOfType: getShim,
1859
- shape: getShim,
1860
- exact: getShim,
1861
-
1862
- checkPropTypes: emptyFunctionWithReset,
1863
- resetWarningCache: emptyFunction
1864
- };
1865
-
1866
- ReactPropTypes.PropTypes = ReactPropTypes;
1867
-
1868
- return ReactPropTypes;
1869
- };
1870
- return factoryWithThrowingShims;
1787
+ function requireFactoryWithThrowingShims() {
1788
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1789
+ hasRequiredFactoryWithThrowingShims = 1;
1790
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
1791
+ function emptyFunction() {}
1792
+ function emptyFunctionWithReset() {}
1793
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
1794
+ factoryWithThrowingShims = function () {
1795
+ function shim(props, propName, componentName, location, propFullName, secret) {
1796
+ if (secret === ReactPropTypesSecret) {
1797
+ // It is still safe when called from React.
1798
+ return;
1799
+ }
1800
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
1801
+ err.name = 'Invariant Violation';
1802
+ throw err;
1803
+ }
1804
+ shim.isRequired = shim;
1805
+ function getShim() {
1806
+ return shim;
1807
+ }
1808
+ // Important!
1809
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1810
+ var ReactPropTypes = {
1811
+ array: shim,
1812
+ bigint: shim,
1813
+ bool: shim,
1814
+ func: shim,
1815
+ number: shim,
1816
+ object: shim,
1817
+ string: shim,
1818
+ symbol: shim,
1819
+ any: shim,
1820
+ arrayOf: getShim,
1821
+ element: shim,
1822
+ elementType: shim,
1823
+ instanceOf: getShim,
1824
+ node: shim,
1825
+ objectOf: getShim,
1826
+ oneOf: getShim,
1827
+ oneOfType: getShim,
1828
+ shape: getShim,
1829
+ exact: getShim,
1830
+ checkPropTypes: emptyFunctionWithReset,
1831
+ resetWarningCache: emptyFunction
1832
+ };
1833
+ ReactPropTypes.PropTypes = ReactPropTypes;
1834
+ return ReactPropTypes;
1835
+ };
1836
+ return factoryWithThrowingShims;
1871
1837
  }
1872
1838
 
1873
1839
  /**
@@ -1876,25 +1842,23 @@ function requireFactoryWithThrowingShims () {
1876
1842
  * This source code is licensed under the MIT license found in the
1877
1843
  * LICENSE file in the root directory of this source tree.
1878
1844
  */
1879
-
1880
1845
  var hasRequiredPropTypes;
1881
-
1882
- function requirePropTypes () {
1883
- if (hasRequiredPropTypes) return propTypes.exports;
1884
- hasRequiredPropTypes = 1;
1885
- if (process.env.NODE_ENV !== 'production') {
1886
- var ReactIs = requireReactIs();
1887
-
1888
- // By explicitly using `prop-types` you are opting into new development behavior.
1889
- // http://fb.me/prop-types-in-prod
1890
- var throwOnDirectAccess = true;
1891
- propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1892
- } else {
1893
- // By explicitly using `prop-types` you are opting into new production behavior.
1894
- // http://fb.me/prop-types-in-prod
1895
- propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
1896
- }
1897
- return propTypes.exports;
1846
+ function requirePropTypes() {
1847
+ if (hasRequiredPropTypes) return propTypes.exports;
1848
+ hasRequiredPropTypes = 1;
1849
+ if (process.env.NODE_ENV !== 'production') {
1850
+ var ReactIs = requireReactIs();
1851
+
1852
+ // By explicitly using `prop-types` you are opting into new development behavior.
1853
+ // http://fb.me/prop-types-in-prod
1854
+ var throwOnDirectAccess = true;
1855
+ propTypes.exports = /*@__PURE__*/requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1856
+ } else {
1857
+ // By explicitly using `prop-types` you are opting into new production behavior.
1858
+ // http://fb.me/prop-types-in-prod
1859
+ propTypes.exports = /*@__PURE__*/requireFactoryWithThrowingShims()();
1860
+ }
1861
+ return propTypes.exports;
1898
1862
  }
1899
1863
 
1900
1864
  var propTypesExports = /*@__PURE__*/ requirePropTypes();
@@ -2270,12 +2234,10 @@ const NetworkFieldGroup = _ref => {
2270
2234
  }), mergedFieldConfig.ip.enabled && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
2271
2235
  label: mergedFieldConfig.ip.label,
2272
2236
  name: [prefix, index, "ip_address"],
2273
- initialValue: iface.ip_address,
2274
2237
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {})
2275
2238
  }), mergedFieldConfig.netmask.enabled && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
2276
2239
  label: mergedFieldConfig.netmask.label,
2277
2240
  name: [prefix, index, "netmask"],
2278
- initialValue: iface.netmask,
2279
2241
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {})
2280
2242
  }), index < interfaces.length - 1 && /*#__PURE__*/jsxRuntime.jsx(antd.Divider, {
2281
2243
  style: {
@@ -2308,39 +2270,40 @@ const NetworkSettingsModal = _ref2 => {
2308
2270
  const [lanConfigs, setLanConfigs] = react.useState([]);
2309
2271
  const [submitLoading, setSubmitLoading] = react.useState(false);
2310
2272
  const [isInitialized, setIsInitialized] = react.useState(false);
2311
- const fetchData = react.useCallback(async () => {
2273
+ const hasFetchedRef = react.useRef(false);
2274
+ react.useEffect(() => {
2312
2275
  if (!open) return;
2313
- try {
2314
- const promises = [];
2315
- if (sections.includes('LAN')) {
2316
- promises.push(getLanConfig());
2317
- }
2318
- if (sections.includes('QSFP')) {
2319
- promises.push(getSysConfig());
2320
- }
2321
- const results = await Promise.allSettled(promises);
2322
- if (sections.includes('LAN')) {
2323
- const lanResult = results[0];
2324
- if (lanResult.status === 'fulfilled') {
2325
- setLanConfigs(lanResult.value || []);
2276
+ const fetchData = async () => {
2277
+ if (hasFetchedRef.current) return;
2278
+ try {
2279
+ hasFetchedRef.current = true;
2280
+ const promises = [];
2281
+ if (sections.includes('LAN')) {
2282
+ promises.push(getLanConfig());
2326
2283
  }
2327
- }
2328
- if (sections.includes('QSFP')) {
2329
- const sysResult = sections.includes('LAN') ? results[1] : results[0];
2330
- if (sysResult.status === 'fulfilled' && sysResult.value) {
2331
- setSt2110Interfaces(sysResult.value.st2110_interfaces || []);
2284
+ if (sections.includes('QSFP')) {
2285
+ promises.push(getSysConfig());
2286
+ }
2287
+ const results = await Promise.allSettled(promises);
2288
+ if (sections.includes('LAN')) {
2289
+ const lanResult = results[0];
2290
+ if (lanResult.status === 'fulfilled') {
2291
+ setLanConfigs(lanResult.value || []);
2292
+ }
2293
+ }
2294
+ if (sections.includes('QSFP')) {
2295
+ const sysResult = sections.includes('LAN') ? results[1] : results[0];
2296
+ if (sysResult.status === 'fulfilled' && sysResult.value) {
2297
+ setSt2110Interfaces(sysResult.value.st2110_interfaces || []);
2298
+ }
2332
2299
  }
2300
+ setIsInitialized(true);
2301
+ } catch (error) {
2302
+ console.error('Failed to fetch data:', error);
2333
2303
  }
2334
- setIsInitialized(true);
2335
- } catch (error) {
2336
- console.error('Failed to fetch data:', error);
2337
- }
2304
+ };
2305
+ fetchData();
2338
2306
  }, [open, getLanConfig, getSysConfig, sections]);
2339
- react.useEffect(() => {
2340
- if (open) {
2341
- fetchData();
2342
- }
2343
- }, [open, fetchData]);
2344
2307
 
2345
2308
  // 当模态框关闭时重置状态
2346
2309
  react.useEffect(() => {
@@ -2349,6 +2312,7 @@ const NetworkSettingsModal = _ref2 => {
2349
2312
  setLanConfigs([]);
2350
2313
  setSt2110Interfaces([]);
2351
2314
  form.resetFields();
2315
+ hasFetchedRef.current = false;
2352
2316
  }
2353
2317
  }, [open, form]);
2354
2318
 
@@ -2375,10 +2339,10 @@ const NetworkSettingsModal = _ref2 => {
2375
2339
 
2376
2340
  // 当初始值准备好后设置表单值
2377
2341
  react.useEffect(() => {
2378
- if (isInitialized && Object.keys(initialValues).length > 0) {
2342
+ if (isInitialized) {
2379
2343
  form.setFieldsValue(initialValues);
2380
2344
  }
2381
- }, [initialValues, isInitialized, form]);
2345
+ }, [isInitialized, form, initialValues]);
2382
2346
  const handleSuccess = react.useCallback(async function () {
2383
2347
  let isPopup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2384
2348
  let messageText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Success';