sixseconds-modules 1.1.7 → 1.1.8

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.cjs.js CHANGED
@@ -6,7 +6,6 @@ const MenuIcon = require("@mui/icons-material/Menu");
6
6
  const KeyboardArrowDownIcon = require("@mui/icons-material/KeyboardArrowDown");
7
7
  const material = require("@mui/material");
8
8
  const CheckIcon = require("@mui/icons-material/Check");
9
- const reactRedux = require("react-redux");
10
9
  const toolkit = require("@reduxjs/toolkit");
11
10
  function _interopNamespaceDefault(e) {
12
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -533,8 +532,322 @@ const DangerDialog = ({
533
532
  }
534
533
  );
535
534
  };
536
- const useAppDispatch = reactRedux.useDispatch;
537
- const useAppSelector = reactRedux.useSelector;
535
+ var withSelector = { exports: {} };
536
+ var useSyncExternalStoreWithSelector_production = {};
537
+ /**
538
+ * @license React
539
+ * use-sync-external-store-with-selector.production.js
540
+ *
541
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
542
+ *
543
+ * This source code is licensed under the MIT license found in the
544
+ * LICENSE file in the root directory of this source tree.
545
+ */
546
+ var hasRequiredUseSyncExternalStoreWithSelector_production;
547
+ function requireUseSyncExternalStoreWithSelector_production() {
548
+ if (hasRequiredUseSyncExternalStoreWithSelector_production) return useSyncExternalStoreWithSelector_production;
549
+ hasRequiredUseSyncExternalStoreWithSelector_production = 1;
550
+ var React$1 = React;
551
+ function is(x, y) {
552
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
553
+ }
554
+ var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React$1.useSyncExternalStore, useRef = React$1.useRef, useEffect = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue = React$1.useDebugValue;
555
+ useSyncExternalStoreWithSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
556
+ var instRef = useRef(null);
557
+ if (null === instRef.current) {
558
+ var inst = { hasValue: false, value: null };
559
+ instRef.current = inst;
560
+ } else inst = instRef.current;
561
+ instRef = useMemo(
562
+ function() {
563
+ function memoizedSelector(nextSnapshot) {
564
+ if (!hasMemo) {
565
+ hasMemo = true;
566
+ memoizedSnapshot = nextSnapshot;
567
+ nextSnapshot = selector(nextSnapshot);
568
+ if (void 0 !== isEqual && inst.hasValue) {
569
+ var currentSelection = inst.value;
570
+ if (isEqual(currentSelection, nextSnapshot))
571
+ return memoizedSelection = currentSelection;
572
+ }
573
+ return memoizedSelection = nextSnapshot;
574
+ }
575
+ currentSelection = memoizedSelection;
576
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
577
+ var nextSelection = selector(nextSnapshot);
578
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
579
+ return memoizedSnapshot = nextSnapshot, currentSelection;
580
+ memoizedSnapshot = nextSnapshot;
581
+ return memoizedSelection = nextSelection;
582
+ }
583
+ var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
584
+ return [
585
+ function() {
586
+ return memoizedSelector(getSnapshot());
587
+ },
588
+ null === maybeGetServerSnapshot ? void 0 : function() {
589
+ return memoizedSelector(maybeGetServerSnapshot());
590
+ }
591
+ ];
592
+ },
593
+ [getSnapshot, getServerSnapshot, selector, isEqual]
594
+ );
595
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
596
+ useEffect(
597
+ function() {
598
+ inst.hasValue = true;
599
+ inst.value = value;
600
+ },
601
+ [value]
602
+ );
603
+ useDebugValue(value);
604
+ return value;
605
+ };
606
+ return useSyncExternalStoreWithSelector_production;
607
+ }
608
+ var useSyncExternalStoreWithSelector_development = {};
609
+ /**
610
+ * @license React
611
+ * use-sync-external-store-with-selector.development.js
612
+ *
613
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
614
+ *
615
+ * This source code is licensed under the MIT license found in the
616
+ * LICENSE file in the root directory of this source tree.
617
+ */
618
+ var hasRequiredUseSyncExternalStoreWithSelector_development;
619
+ function requireUseSyncExternalStoreWithSelector_development() {
620
+ if (hasRequiredUseSyncExternalStoreWithSelector_development) return useSyncExternalStoreWithSelector_development;
621
+ hasRequiredUseSyncExternalStoreWithSelector_development = 1;
622
+ "production" !== process.env.NODE_ENV && function() {
623
+ function is(x, y) {
624
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
625
+ }
626
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
627
+ var React$1 = React, objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React$1.useSyncExternalStore, useRef = React$1.useRef, useEffect = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue = React$1.useDebugValue;
628
+ useSyncExternalStoreWithSelector_development.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
629
+ var instRef = useRef(null);
630
+ if (null === instRef.current) {
631
+ var inst = { hasValue: false, value: null };
632
+ instRef.current = inst;
633
+ } else inst = instRef.current;
634
+ instRef = useMemo(
635
+ function() {
636
+ function memoizedSelector(nextSnapshot) {
637
+ if (!hasMemo) {
638
+ hasMemo = true;
639
+ memoizedSnapshot = nextSnapshot;
640
+ nextSnapshot = selector(nextSnapshot);
641
+ if (void 0 !== isEqual && inst.hasValue) {
642
+ var currentSelection = inst.value;
643
+ if (isEqual(currentSelection, nextSnapshot))
644
+ return memoizedSelection = currentSelection;
645
+ }
646
+ return memoizedSelection = nextSnapshot;
647
+ }
648
+ currentSelection = memoizedSelection;
649
+ if (objectIs(memoizedSnapshot, nextSnapshot))
650
+ return currentSelection;
651
+ var nextSelection = selector(nextSnapshot);
652
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
653
+ return memoizedSnapshot = nextSnapshot, currentSelection;
654
+ memoizedSnapshot = nextSnapshot;
655
+ return memoizedSelection = nextSelection;
656
+ }
657
+ var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
658
+ return [
659
+ function() {
660
+ return memoizedSelector(getSnapshot());
661
+ },
662
+ null === maybeGetServerSnapshot ? void 0 : function() {
663
+ return memoizedSelector(maybeGetServerSnapshot());
664
+ }
665
+ ];
666
+ },
667
+ [getSnapshot, getServerSnapshot, selector, isEqual]
668
+ );
669
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
670
+ useEffect(
671
+ function() {
672
+ inst.hasValue = true;
673
+ inst.value = value;
674
+ },
675
+ [value]
676
+ );
677
+ useDebugValue(value);
678
+ return value;
679
+ };
680
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
681
+ }();
682
+ return useSyncExternalStoreWithSelector_development;
683
+ }
684
+ var hasRequiredWithSelector;
685
+ function requireWithSelector() {
686
+ if (hasRequiredWithSelector) return withSelector.exports;
687
+ hasRequiredWithSelector = 1;
688
+ if (process.env.NODE_ENV === "production") {
689
+ withSelector.exports = requireUseSyncExternalStoreWithSelector_production();
690
+ } else {
691
+ withSelector.exports = requireUseSyncExternalStoreWithSelector_development();
692
+ }
693
+ return withSelector.exports;
694
+ }
695
+ var withSelectorExports = requireWithSelector();
696
+ var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);
697
+ var gT = typeof globalThis !== "undefined" ? globalThis : (
698
+ /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
699
+ {}
700
+ );
701
+ function getContext() {
702
+ if (!React__namespace.createContext) return {};
703
+ const contextMap = gT[ContextKey] ?? (gT[ContextKey] = /* @__PURE__ */ new Map());
704
+ let realContext = contextMap.get(React__namespace.createContext);
705
+ if (!realContext) {
706
+ realContext = React__namespace.createContext(
707
+ null
708
+ );
709
+ if (process.env.NODE_ENV !== "production") {
710
+ realContext.displayName = "ReactRedux";
711
+ }
712
+ contextMap.set(React__namespace.createContext, realContext);
713
+ }
714
+ return realContext;
715
+ }
716
+ var ReactReduxContext = /* @__PURE__ */ getContext();
717
+ function createReduxContextHook(context = ReactReduxContext) {
718
+ return function useReduxContext2() {
719
+ const contextValue = React__namespace.useContext(context);
720
+ if (process.env.NODE_ENV !== "production" && !contextValue) {
721
+ throw new Error(
722
+ "could not find react-redux context value; please ensure the component is wrapped in a <Provider>"
723
+ );
724
+ }
725
+ return contextValue;
726
+ };
727
+ }
728
+ var useReduxContext = /* @__PURE__ */ createReduxContextHook();
729
+ function createStoreHook(context = ReactReduxContext) {
730
+ const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (
731
+ // @ts-ignore
732
+ createReduxContextHook(context)
733
+ );
734
+ const useStore2 = () => {
735
+ const { store } = useReduxContext2();
736
+ return store;
737
+ };
738
+ Object.assign(useStore2, {
739
+ withTypes: () => useStore2
740
+ });
741
+ return useStore2;
742
+ }
743
+ var useStore = /* @__PURE__ */ createStoreHook();
744
+ function createDispatchHook(context = ReactReduxContext) {
745
+ const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);
746
+ const useDispatch2 = () => {
747
+ const store = useStore2();
748
+ return store.dispatch;
749
+ };
750
+ Object.assign(useDispatch2, {
751
+ withTypes: () => useDispatch2
752
+ });
753
+ return useDispatch2;
754
+ }
755
+ var useDispatch = /* @__PURE__ */ createDispatchHook();
756
+ var refEquality = (a, b) => a === b;
757
+ function createSelectorHook(context = ReactReduxContext) {
758
+ const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);
759
+ const useSelector2 = (selector, equalityFnOrOptions = {}) => {
760
+ const { equalityFn = refEquality } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;
761
+ if (process.env.NODE_ENV !== "production") {
762
+ if (!selector) {
763
+ throw new Error(`You must pass a selector to useSelector`);
764
+ }
765
+ if (typeof selector !== "function") {
766
+ throw new Error(`You must pass a function as a selector to useSelector`);
767
+ }
768
+ if (typeof equalityFn !== "function") {
769
+ throw new Error(
770
+ `You must pass a function as an equality function to useSelector`
771
+ );
772
+ }
773
+ }
774
+ const reduxContext = useReduxContext2();
775
+ const { store, subscription, getServerState } = reduxContext;
776
+ const firstRun = React__namespace.useRef(true);
777
+ const wrappedSelector = React__namespace.useCallback(
778
+ {
779
+ [selector.name](state) {
780
+ const selected = selector(state);
781
+ if (process.env.NODE_ENV !== "production") {
782
+ const { devModeChecks = {} } = typeof equalityFnOrOptions === "function" ? {} : equalityFnOrOptions;
783
+ const { identityFunctionCheck, stabilityCheck } = reduxContext;
784
+ const {
785
+ identityFunctionCheck: finalIdentityFunctionCheck,
786
+ stabilityCheck: finalStabilityCheck
787
+ } = {
788
+ stabilityCheck,
789
+ identityFunctionCheck,
790
+ ...devModeChecks
791
+ };
792
+ if (finalStabilityCheck === "always" || finalStabilityCheck === "once" && firstRun.current) {
793
+ const toCompare = selector(state);
794
+ if (!equalityFn(selected, toCompare)) {
795
+ let stack = void 0;
796
+ try {
797
+ throw new Error();
798
+ } catch (e) {
799
+ ({ stack } = e);
800
+ }
801
+ console.warn(
802
+ "Selector " + (selector.name || "unknown") + " returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",
803
+ {
804
+ state,
805
+ selected,
806
+ selected2: toCompare,
807
+ stack
808
+ }
809
+ );
810
+ }
811
+ }
812
+ if (finalIdentityFunctionCheck === "always" || finalIdentityFunctionCheck === "once" && firstRun.current) {
813
+ if (selected === state) {
814
+ let stack = void 0;
815
+ try {
816
+ throw new Error();
817
+ } catch (e) {
818
+ ({ stack } = e);
819
+ }
820
+ console.warn(
821
+ "Selector " + (selector.name || "unknown") + " returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",
822
+ { stack }
823
+ );
824
+ }
825
+ }
826
+ if (firstRun.current) firstRun.current = false;
827
+ }
828
+ return selected;
829
+ }
830
+ }[selector.name],
831
+ [selector]
832
+ );
833
+ const selectedState = withSelectorExports.useSyncExternalStoreWithSelector(
834
+ subscription.addNestedSub,
835
+ store.getState,
836
+ getServerState || store.getState,
837
+ wrappedSelector,
838
+ equalityFn
839
+ );
840
+ React__namespace.useDebugValue(selectedState);
841
+ return selectedState;
842
+ };
843
+ Object.assign(useSelector2, {
844
+ withTypes: () => useSelector2
845
+ });
846
+ return useSelector2;
847
+ }
848
+ var useSelector = /* @__PURE__ */ createSelectorHook();
849
+ const useAppDispatch = useDispatch;
850
+ const useAppSelector = useSelector;
538
851
  const initialState = { name: "" };
539
852
  const userSlice = toolkit.createSlice({
540
853
  name: "user",