lawgic-dev-kit 0.12.8 → 0.12.9
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/_virtual/client.js +22 -3
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/components/atoms/Avatar/Avatar.js +31 -73
- package/dist/components/atoms/UploadContainer/UploadContainer.js +47 -89
- package/dist/components/molecules/AlertModal/AlertModal.js +26 -68
- package/dist/components/molecules/CalendarSelector/CalendarSelector.js +45 -87
- package/dist/components/molecules/DialogModal/DialogModal.js +37 -79
- package/dist/components/molecules/FloatingMenu/FloatingMenu.js +25 -67
- package/dist/components/molecules/Tabs/Tabs.js +41 -83
- package/dist/lawgic-dev-kit.umd.js +243 -884
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/scheduler/index.js +1 -1
- package/dist/utils/modal.js +59 -101
- package/dist/utils/toast.js +73 -106
- package/package.json +1 -1
- package/dist/dist/_virtual/_commonjsHelpers.js +0 -8
- package/dist/dist/_virtual/index.js +0 -7
- package/dist/dist/_virtual/index3.js +0 -5
- package/dist/dist/_virtual/index4.js +0 -5
- package/dist/dist/_virtual/index5.js +0 -7
- package/dist/dist/_virtual/index6.js +0 -4
- package/dist/dist/_virtual/index7.js +0 -4
- package/dist/dist/_virtual/index8.js +0 -4
- package/dist/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/dist/_virtual/jsx-runtime2.js +0 -4
- package/dist/dist/_virtual/lodash.js +0 -2
- package/dist/dist/_virtual/lodash2.js +0 -4
- package/dist/dist/_virtual/react-is.development.js +0 -4
- package/dist/dist/_virtual/react-is.production.min.js +0 -4
- package/dist/dist/_virtual/react-jsx-runtime.development.js +0 -4
- package/dist/dist/_virtual/react-jsx-runtime.production.js +0 -4
- package/dist/dist/components/atoms/AsyncToast/index.js +0 -33
- package/dist/dist/components/atoms/ImageProfileInput/ImageProfileInput.validators.js +0 -5
- package/dist/dist/components/atoms/Toast/Toast.js +0 -113
- package/dist/dist/constants/countries.js +0 -8
- package/dist/dist/contexts/themeContext.js +0 -3
- package/dist/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -4
- package/dist/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -2661
- package/dist/dist/node_modules/@fortawesome/pro-light-svg-icons/index.js +0 -33
- package/dist/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +0 -266
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animate/single-value.js +0 -11
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.js +0 -205
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.js +0 -83
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.js +0 -147
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.js +0 -12
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.js +0 -23
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/index.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/animation/generators/inertia.js +0 -37
- package/dist/dist/node_modules/framer-motion/dist/es/animation/generators/keyframes.js +0 -30
- package/dist/dist/node_modules/framer-motion/dist/es/animation/generators/spring/defaults.js +0 -32
- package/dist/dist/node_modules/framer-motion/dist/es/animation/generators/spring/find.js +0 -52
- package/dist/dist/node_modules/framer-motion/dist/es/animation/generators/spring/index.js +0 -92
- package/dist/dist/node_modules/framer-motion/dist/es/animation/generators/utils/velocity.js +0 -10
- package/dist/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.js +0 -47
- package/dist/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js +0 -46
- package/dist/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js +0 -33
- package/dist/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.js +0 -22
- package/dist/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.js +0 -7
- package/dist/dist/node_modules/framer-motion/dist/es/animation/utils/default-transitions.js +0 -22
- package/dist/dist/node_modules/framer-motion/dist/es/animation/utils/is-animatable.js +0 -7
- package/dist/dist/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/animation/utils/is-none.js +0 -7
- package/dist/dist/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -53
- package/dist/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -41
- package/dist/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -45
- package/dist/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -17
- package/dist/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -12
- package/dist/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -9
- package/dist/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -15
- package/dist/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/easing/anticipate.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/easing/back.js +0 -9
- package/dist/dist/node_modules/framer-motion/dist/es/easing/circ.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/easing/cubic-bezier.js +0 -19
- package/dist/dist/node_modules/framer-motion/dist/es/easing/ease.js +0 -7
- package/dist/dist/node_modules/framer-motion/dist/es/easing/modifiers/mirror.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/easing/modifiers/reverse.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/easing/utils/is-easing-array.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/easing/utils/map.js +0 -32
- package/dist/dist/node_modules/framer-motion/dist/es/events/add-dom-event.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -15
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -256
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -19
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -68
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -28
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -22
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -85
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -44
- package/dist/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -24
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/Feature.js +0 -10
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -27
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -34
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -27
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -75
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -11
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -44
- package/dist/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -21
- package/dist/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -59
- package/dist/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -65
- package/dist/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -53
- package/dist/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -38
- package/dist/dist/node_modules/framer-motion/dist/es/projection/animation/mix-values.js +0 -31
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/conversion.js +0 -25
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/copy.js +0 -14
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.js +0 -52
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.js +0 -36
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.js +0 -25
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/models.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/projection/geometry/utils.js +0 -34
- package/dist/dist/node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.js +0 -25
- package/dist/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.js +0 -608
- package/dist/dist/node_modules/framer-motion/dist/es/projection/node/state.js +0 -15
- package/dist/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -59
- package/dist/dist/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.js +0 -21
- package/dist/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.js +0 -16
- package/dist/dist/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -10
- package/dist/dist/node_modules/framer-motion/dist/es/projection/styles/transform.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/projection/utils/each-axis.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/projection/utils/has-transform.js +0 -20
- package/dist/dist/node_modules/framer-motion/dist/es/projection/utils/measure.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/render/VisualElement.js +0 -229
- package/dist/dist/node_modules/framer-motion/dist/es/render/components/create-factory.js +0 -20
- package/dist/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/render/components/motion/create.js +0 -15
- package/dist/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.js +0 -66
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.js +0 -27
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -10
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js +0 -31
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -20
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -24
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js +0 -31
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js +0 -10
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js +0 -24
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js +0 -9
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/find.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.js +0 -41
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/number.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/test.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/transform.js +0 -31
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js +0 -7
- package/dist/dist/node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -37
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/config-motion.js +0 -12
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -27
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -29
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -31
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -9
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/keys-position.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/keys-transform.js +0 -23
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.js +0 -16
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/parse-transform.js +0 -64
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/render.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -12
- package/dist/dist/node_modules/framer-motion/dist/es/render/store.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -48
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/config-motion.js +0 -44
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -30
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -22
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -26
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js +0 -28
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/measure.js +0 -15
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/render.js +0 -11
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
- package/dist/dist/node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js +0 -11
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.js +0 -77
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.js +0 -128
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/flat-tree.js +0 -20
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/get-variant-context.js +0 -20
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/is-variant-label.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/motion-values.js +0 -27
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/resolve-variants.js +0 -20
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/setters.js +0 -19
- package/dist/dist/node_modules/framer-motion/dist/es/render/utils/variant-props.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/utils/clamp.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/delay.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
- package/dist/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.js +0 -22
- package/dist/dist/node_modules/framer-motion/dist/es/utils/interpolate.js +0 -41
- package/dist/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/is-numerical-string.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/utils/is-zero-value-string.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/mix/color.js +0 -29
- package/dist/dist/node_modules/framer-motion/dist/es/utils/mix/complex.js +0 -52
- package/dist/dist/node_modules/framer-motion/dist/es/utils/mix/immediate.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/utils/mix/index.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/utils/mix/number.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/mix/visibility.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/utils/offsets/default.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/utils/offsets/fill.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/utils/offsets/time.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/utils/pipe.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -13
- package/dist/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/state.js +0 -5
- package/dist/dist/node_modules/framer-motion/dist/es/utils/resolve-value.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/utils/shallow-compare.js +0 -14
- package/dist/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -8
- package/dist/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/color/hex.js +0 -19
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/color/hsla.js +0 -12
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/color/index.js +0 -11
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/color/rgba.js +0 -16
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/color/utils.js +0 -18
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/complex/filter.js +0 -24
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/complex/index.js +0 -49
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/numbers/index.js +0 -17
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/numbers/units.js +0 -17
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/utils/color-regex.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/utils/float-regex.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/utils/is-nullish.js +0 -6
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/utils/sanitize.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.js +0 -9
- package/dist/dist/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
- package/dist/dist/node_modules/framer-motion/dist/es/value/utils/is-motion-value.js +0 -4
- package/dist/dist/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -9
- package/dist/dist/node_modules/lodash/lodash.js +0 -3677
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/animation/optimized-appear/data-id.js +0 -6
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/context/LayoutGroupContext.js +0 -2
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/context/LazyContext.js +0 -2
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/context/MotionConfigContext.js +0 -6
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -2
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/projection/node/create-projection-node.js +0 -12
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -9
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/render/dom/utils/unit-conversion.js +0 -5
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/render/dom/value-types/type-int.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/render/html/utils/keys-transform.js +0 -23
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/utils/clamp.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/color/hex.js +0 -19
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/color/hsla.js +0 -12
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/color/index.js +0 -11
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/color/rgba.js +0 -16
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/color/utils.js +0 -18
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/complex/filter.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/complex/index.js +0 -49
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/numbers/index.js +0 -16
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/numbers/units.js +0 -11
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/utils/color-regex.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/utils/float-regex.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/utils/is-nullish.js +0 -6
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/utils/sanitize.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/framer-motion/dist/es/value/types/utils/single-color-regex.js +0 -4
- package/dist/dist/node_modules/motion/dist/es/motion-utils/dist/es/errors.js +0 -1
- package/dist/dist/node_modules/motion/dist/es/motion-utils/dist/es/noop.js +0 -4
- package/dist/dist/node_modules/motion-dom/dist/es/animation/controls/BaseGroup.js +0 -74
- package/dist/dist/node_modules/motion-dom/dist/es/animation/controls/Group.js +0 -9
- package/dist/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -13
- package/dist/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -6
- package/dist/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -6
- package/dist/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.js +0 -6
- package/dist/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/easing.js +0 -27
- package/dist/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -12
- package/dist/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -27
- package/dist/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -10
- package/dist/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -5
- package/dist/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -17
- package/dist/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -41
- package/dist/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -16
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -11
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -11
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -24
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -32
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -13
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -27
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -4
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -4
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -4
- package/dist/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -12
- package/dist/dist/node_modules/motion-dom/dist/es/utils/is-bezier-definition.js +0 -4
- package/dist/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -14
- package/dist/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -6
- package/dist/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -12
- package/dist/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -13
- package/dist/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -6
- package/dist/dist/node_modules/motion-dom/dist/es/value/index.js +0 -202
- package/dist/dist/node_modules/motion-utils/dist/es/array.js +0 -11
- package/dist/dist/node_modules/motion-utils/dist/es/errors.js +0 -12
- package/dist/dist/node_modules/motion-utils/dist/es/global-config.js +0 -6
- package/dist/dist/node_modules/motion-utils/dist/es/memo.js +0 -8
- package/dist/dist/node_modules/motion-utils/dist/es/noop.js +0 -4
- package/dist/dist/node_modules/motion-utils/dist/es/progress.js +0 -7
- package/dist/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -29
- package/dist/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -5
- package/dist/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -6
- package/dist/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -7
- package/dist/dist/node_modules/object-assign/index.js +0 -54
- package/dist/dist/node_modules/prop-types/checkPropTypes.js +0 -54
- package/dist/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -52
- package/dist/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -329
- package/dist/dist/node_modules/prop-types/index.js +0 -17
- package/dist/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -10
- package/dist/dist/node_modules/prop-types/lib/has.js +0 -7
- package/dist/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -95
- package/dist/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -78
- package/dist/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -10
- package/dist/dist/node_modules/property-expr/index.js +0 -82
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -247
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -35
- package/dist/dist/node_modules/react/jsx-runtime.js +0 -10
- package/dist/dist/node_modules/tiny-case/index.js +0 -22
- package/dist/dist/node_modules/toposort/index.js +0 -66
- package/dist/dist/node_modules/yup/index.esm.js +0 -1359
- package/dist/dist/themes/default.js +0 -9
- package/dist/src/utils/toast.d.ts +0 -15
|
@@ -1,1359 +0,0 @@
|
|
|
1
|
-
import { p as k } from "../../_virtual/index3.js";
|
|
2
|
-
import { t as q } from "../../_virtual/index4.js";
|
|
3
|
-
import ue from "../../_virtual/index5.js";
|
|
4
|
-
const ce = Object.prototype.toString, he = Error.prototype.toString, pe = RegExp.prototype.toString, fe = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", de = /^Symbol\((.*)\)(.*)$/;
|
|
5
|
-
function me(i) {
|
|
6
|
-
return i != +i ? "NaN" : i === 0 && 1 / i < 0 ? "-0" : "" + i;
|
|
7
|
-
}
|
|
8
|
-
function W(i, t = !1) {
|
|
9
|
-
if (i == null || i === !0 || i === !1) return "" + i;
|
|
10
|
-
const e = typeof i;
|
|
11
|
-
if (e === "number") return me(i);
|
|
12
|
-
if (e === "string") return t ? `"${i}"` : i;
|
|
13
|
-
if (e === "function") return "[Function " + (i.name || "anonymous") + "]";
|
|
14
|
-
if (e === "symbol") return fe.call(i).replace(de, "Symbol($1)");
|
|
15
|
-
const s = ce.call(i).slice(8, -1);
|
|
16
|
-
return s === "Date" ? isNaN(i.getTime()) ? "" + i : i.toISOString(i) : s === "Error" || i instanceof Error ? "[" + he.call(i) + "]" : s === "RegExp" ? pe.call(i) : null;
|
|
17
|
-
}
|
|
18
|
-
function E(i, t) {
|
|
19
|
-
let e = W(i, t);
|
|
20
|
-
return e !== null ? e : JSON.stringify(i, function(s, r) {
|
|
21
|
-
let a = W(this[s], t);
|
|
22
|
-
return a !== null ? a : r;
|
|
23
|
-
}, 2);
|
|
24
|
-
}
|
|
25
|
-
function se(i) {
|
|
26
|
-
return i == null ? [] : [].concat(i);
|
|
27
|
-
}
|
|
28
|
-
let re, ie, ae, ge = /\$\{\s*(\w+)\s*\}/g;
|
|
29
|
-
re = Symbol.toStringTag;
|
|
30
|
-
class X {
|
|
31
|
-
constructor(t, e, s, r) {
|
|
32
|
-
this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[re] = "Error", this.name = "ValidationError", this.value = e, this.path = s, this.type = r, this.errors = [], this.inner = [], se(t).forEach((a) => {
|
|
33
|
-
if (m.isError(a)) {
|
|
34
|
-
this.errors.push(...a.errors);
|
|
35
|
-
const n = a.inner.length ? a.inner : [a];
|
|
36
|
-
this.inner.push(...n);
|
|
37
|
-
} else
|
|
38
|
-
this.errors.push(a);
|
|
39
|
-
}), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
ie = Symbol.hasInstance;
|
|
43
|
-
ae = Symbol.toStringTag;
|
|
44
|
-
class m extends Error {
|
|
45
|
-
static formatError(t, e) {
|
|
46
|
-
const s = e.label || e.path || "this";
|
|
47
|
-
return e = Object.assign({}, e, {
|
|
48
|
-
path: s,
|
|
49
|
-
originalPath: e.path
|
|
50
|
-
}), typeof t == "string" ? t.replace(ge, (r, a) => E(e[a])) : typeof t == "function" ? t(e) : t;
|
|
51
|
-
}
|
|
52
|
-
static isError(t) {
|
|
53
|
-
return t && t.name === "ValidationError";
|
|
54
|
-
}
|
|
55
|
-
constructor(t, e, s, r, a) {
|
|
56
|
-
const n = new X(t, e, s, r);
|
|
57
|
-
if (a)
|
|
58
|
-
return n;
|
|
59
|
-
super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[ae] = "Error", this.name = n.name, this.message = n.message, this.type = n.type, this.value = n.value, this.path = n.path, this.errors = n.errors, this.inner = n.inner, Error.captureStackTrace && Error.captureStackTrace(this, m);
|
|
60
|
-
}
|
|
61
|
-
static [ie](t) {
|
|
62
|
-
return X[Symbol.hasInstance](t) || super[Symbol.hasInstance](t);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
let y = {
|
|
66
|
-
default: "${path} is invalid",
|
|
67
|
-
required: "${path} is a required field",
|
|
68
|
-
defined: "${path} must be defined",
|
|
69
|
-
notNull: "${path} cannot be null",
|
|
70
|
-
oneOf: "${path} must be one of the following values: ${values}",
|
|
71
|
-
notOneOf: "${path} must not be one of the following values: ${values}",
|
|
72
|
-
notType: ({
|
|
73
|
-
path: i,
|
|
74
|
-
type: t,
|
|
75
|
-
value: e,
|
|
76
|
-
originalValue: s
|
|
77
|
-
}) => {
|
|
78
|
-
const r = s != null && s !== e ? ` (cast from the value \`${E(s, !0)}\`).` : ".";
|
|
79
|
-
return t !== "mixed" ? `${i} must be a \`${t}\` type, but the final value was: \`${E(e, !0)}\`` + r : `${i} must match the configured type. The validated value was: \`${E(e, !0)}\`` + r;
|
|
80
|
-
}
|
|
81
|
-
}, d = {
|
|
82
|
-
length: "${path} must be exactly ${length} characters",
|
|
83
|
-
min: "${path} must be at least ${min} characters",
|
|
84
|
-
max: "${path} must be at most ${max} characters",
|
|
85
|
-
matches: '${path} must match the following: "${regex}"',
|
|
86
|
-
email: "${path} must be a valid email",
|
|
87
|
-
url: "${path} must be a valid URL",
|
|
88
|
-
uuid: "${path} must be a valid UUID",
|
|
89
|
-
datetime: "${path} must be a valid ISO date-time",
|
|
90
|
-
datetime_precision: "${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",
|
|
91
|
-
datetime_offset: '${path} must be a valid ISO date-time with UTC "Z" timezone',
|
|
92
|
-
trim: "${path} must be a trimmed string",
|
|
93
|
-
lowercase: "${path} must be a lowercase string",
|
|
94
|
-
uppercase: "${path} must be a upper case string"
|
|
95
|
-
}, ve = {
|
|
96
|
-
min: "${path} must be greater than or equal to ${min}",
|
|
97
|
-
max: "${path} must be less than or equal to ${max}",
|
|
98
|
-
lessThan: "${path} must be less than ${less}",
|
|
99
|
-
moreThan: "${path} must be greater than ${more}",
|
|
100
|
-
positive: "${path} must be a positive number",
|
|
101
|
-
negative: "${path} must be a negative number",
|
|
102
|
-
integer: "${path} must be an integer"
|
|
103
|
-
}, U = {
|
|
104
|
-
min: "${path} field must be later than ${min}",
|
|
105
|
-
max: "${path} field must be at earlier than ${max}"
|
|
106
|
-
}, ye = {
|
|
107
|
-
isValue: "${path} field must be ${value}"
|
|
108
|
-
}, C = {
|
|
109
|
-
noUnknown: "${path} field has unspecified keys: ${unknown}",
|
|
110
|
-
exact: "${path} object contains unknown properties: ${properties}"
|
|
111
|
-
}, be = {
|
|
112
|
-
min: "${path} field must have at least ${min} items",
|
|
113
|
-
max: "${path} field must have less than or equal to ${max} items",
|
|
114
|
-
length: "${path} must have ${length} items"
|
|
115
|
-
}, Fe = {
|
|
116
|
-
notType: (i) => {
|
|
117
|
-
const {
|
|
118
|
-
path: t,
|
|
119
|
-
value: e,
|
|
120
|
-
spec: s
|
|
121
|
-
} = i, r = s.types.length;
|
|
122
|
-
if (Array.isArray(e)) {
|
|
123
|
-
if (e.length < r) return `${t} tuple value has too few items, expected a length of ${r} but got ${e.length} for value: \`${E(e, !0)}\``;
|
|
124
|
-
if (e.length > r) return `${t} tuple value has too many items, expected a length of ${r} but got ${e.length} for value: \`${E(e, !0)}\``;
|
|
125
|
-
}
|
|
126
|
-
return m.formatError(y.notType, i);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
130
|
-
mixed: y,
|
|
131
|
-
string: d,
|
|
132
|
-
number: ve,
|
|
133
|
-
date: U,
|
|
134
|
-
object: C,
|
|
135
|
-
array: be,
|
|
136
|
-
boolean: ye,
|
|
137
|
-
tuple: Fe
|
|
138
|
-
});
|
|
139
|
-
const Z = (i) => i && i.__isYupSchema__;
|
|
140
|
-
class N {
|
|
141
|
-
static fromOptions(t, e) {
|
|
142
|
-
if (!e.then && !e.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
|
|
143
|
-
let {
|
|
144
|
-
is: s,
|
|
145
|
-
then: r,
|
|
146
|
-
otherwise: a
|
|
147
|
-
} = e, n = typeof s == "function" ? s : (...o) => o.every((l) => l === s);
|
|
148
|
-
return new N(t, (o, l) => {
|
|
149
|
-
var u;
|
|
150
|
-
let c = n(...o) ? r : a;
|
|
151
|
-
return (u = c == null ? void 0 : c(l)) != null ? u : l;
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
constructor(t, e) {
|
|
155
|
-
this.fn = void 0, this.refs = t, this.refs = t, this.fn = e;
|
|
156
|
-
}
|
|
157
|
-
resolve(t, e) {
|
|
158
|
-
let s = this.refs.map((a) => (
|
|
159
|
-
// TODO: ? operator here?
|
|
160
|
-
a.getValue(e == null ? void 0 : e.value, e == null ? void 0 : e.parent, e == null ? void 0 : e.context)
|
|
161
|
-
)), r = this.fn(s, t, e);
|
|
162
|
-
if (r === void 0 || // @ts-ignore this can be base
|
|
163
|
-
r === t)
|
|
164
|
-
return t;
|
|
165
|
-
if (!Z(r)) throw new TypeError("conditions must return a schema object");
|
|
166
|
-
return r.resolve(e);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
const A = {
|
|
170
|
-
context: "$",
|
|
171
|
-
value: "."
|
|
172
|
-
};
|
|
173
|
-
class T {
|
|
174
|
-
constructor(t, e = {}) {
|
|
175
|
-
if (this.key = void 0, this.isContext = void 0, this.isValue = void 0, this.isSibling = void 0, this.path = void 0, this.getter = void 0, this.map = void 0, typeof t != "string") throw new TypeError("ref must be a string, got: " + t);
|
|
176
|
-
if (this.key = t.trim(), t === "") throw new TypeError("ref must be a non-empty string");
|
|
177
|
-
this.isContext = this.key[0] === A.context, this.isValue = this.key[0] === A.value, this.isSibling = !this.isContext && !this.isValue;
|
|
178
|
-
let s = this.isContext ? A.context : this.isValue ? A.value : "";
|
|
179
|
-
this.path = this.key.slice(s.length), this.getter = this.path && k.getter(this.path, !0), this.map = e.map;
|
|
180
|
-
}
|
|
181
|
-
getValue(t, e, s) {
|
|
182
|
-
let r = this.isContext ? s : this.isValue ? t : e;
|
|
183
|
-
return this.getter && (r = this.getter(r || {})), this.map && (r = this.map(r)), r;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
*
|
|
187
|
-
* @param {*} value
|
|
188
|
-
* @param {Object} options
|
|
189
|
-
* @param {Object=} options.context
|
|
190
|
-
* @param {Object=} options.parent
|
|
191
|
-
*/
|
|
192
|
-
cast(t, e) {
|
|
193
|
-
return this.getValue(t, e == null ? void 0 : e.parent, e == null ? void 0 : e.context);
|
|
194
|
-
}
|
|
195
|
-
resolve() {
|
|
196
|
-
return this;
|
|
197
|
-
}
|
|
198
|
-
describe() {
|
|
199
|
-
return {
|
|
200
|
-
type: "ref",
|
|
201
|
-
key: this.key
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
toString() {
|
|
205
|
-
return `Ref(${this.key})`;
|
|
206
|
-
}
|
|
207
|
-
static isRef(t) {
|
|
208
|
-
return t && t.__isYupRef;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
T.prototype.__isYupRef = !0;
|
|
212
|
-
const O = (i) => i == null;
|
|
213
|
-
function S(i) {
|
|
214
|
-
function t({
|
|
215
|
-
value: e,
|
|
216
|
-
path: s = "",
|
|
217
|
-
options: r,
|
|
218
|
-
originalValue: a,
|
|
219
|
-
schema: n
|
|
220
|
-
}, o, l) {
|
|
221
|
-
const {
|
|
222
|
-
name: u,
|
|
223
|
-
test: c,
|
|
224
|
-
params: h,
|
|
225
|
-
message: p,
|
|
226
|
-
skipAbsent: v
|
|
227
|
-
} = i;
|
|
228
|
-
let {
|
|
229
|
-
parent: w,
|
|
230
|
-
context: g,
|
|
231
|
-
abortEarly: _ = n.spec.abortEarly,
|
|
232
|
-
disableStackTrace: $ = n.spec.disableStackTrace
|
|
233
|
-
} = r;
|
|
234
|
-
function Y(f) {
|
|
235
|
-
return T.isRef(f) ? f.getValue(e, w, g) : f;
|
|
236
|
-
}
|
|
237
|
-
function K(f = {}) {
|
|
238
|
-
const x = Object.assign({
|
|
239
|
-
value: e,
|
|
240
|
-
originalValue: a,
|
|
241
|
-
label: n.spec.label,
|
|
242
|
-
path: f.path || s,
|
|
243
|
-
spec: n.spec,
|
|
244
|
-
disableStackTrace: f.disableStackTrace || $
|
|
245
|
-
}, h, f.params);
|
|
246
|
-
for (const Q of Object.keys(x)) x[Q] = Y(x[Q]);
|
|
247
|
-
const H = new m(m.formatError(f.message || p, x), e, x.path, f.type || u, x.disableStackTrace);
|
|
248
|
-
return H.params = x, H;
|
|
249
|
-
}
|
|
250
|
-
const P = _ ? o : l;
|
|
251
|
-
let I = {
|
|
252
|
-
path: s,
|
|
253
|
-
parent: w,
|
|
254
|
-
type: u,
|
|
255
|
-
from: r.from,
|
|
256
|
-
createError: K,
|
|
257
|
-
resolve: Y,
|
|
258
|
-
options: r,
|
|
259
|
-
originalValue: a,
|
|
260
|
-
schema: n
|
|
261
|
-
};
|
|
262
|
-
const M = (f) => {
|
|
263
|
-
m.isError(f) ? P(f) : f ? l(null) : P(K());
|
|
264
|
-
}, J = (f) => {
|
|
265
|
-
m.isError(f) ? P(f) : o(f);
|
|
266
|
-
};
|
|
267
|
-
if (v && O(e))
|
|
268
|
-
return M(!0);
|
|
269
|
-
let j;
|
|
270
|
-
try {
|
|
271
|
-
var B;
|
|
272
|
-
if (j = c.call(I, e, I), typeof ((B = j) == null ? void 0 : B.then) == "function") {
|
|
273
|
-
if (r.sync)
|
|
274
|
-
throw new Error(`Validation test of type: "${I.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
|
|
275
|
-
return Promise.resolve(j).then(M, J);
|
|
276
|
-
}
|
|
277
|
-
} catch (f) {
|
|
278
|
-
J(f);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
M(j);
|
|
282
|
-
}
|
|
283
|
-
return t.OPTIONS = i, t;
|
|
284
|
-
}
|
|
285
|
-
function we(i, t, e, s = e) {
|
|
286
|
-
let r, a, n;
|
|
287
|
-
return t ? (k.forEach(t, (o, l, u) => {
|
|
288
|
-
let c = l ? o.slice(1, o.length - 1) : o;
|
|
289
|
-
i = i.resolve({
|
|
290
|
-
context: s,
|
|
291
|
-
parent: r,
|
|
292
|
-
value: e
|
|
293
|
-
});
|
|
294
|
-
let h = i.type === "tuple", p = u ? parseInt(c, 10) : 0;
|
|
295
|
-
if (i.innerType || h) {
|
|
296
|
-
if (h && !u) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${n}" must contain an index to the tuple element, e.g. "${n}[0]"`);
|
|
297
|
-
if (e && p >= e.length)
|
|
298
|
-
throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);
|
|
299
|
-
r = e, e = e && e[p], i = h ? i.spec.types[p] : i.innerType;
|
|
300
|
-
}
|
|
301
|
-
if (!u) {
|
|
302
|
-
if (!i.fields || !i.fields[c]) throw new Error(`The schema does not contain the path: ${t}. (failed at: ${n} which is a type: "${i.type}")`);
|
|
303
|
-
r = e, e = e && e[c], i = i.fields[c];
|
|
304
|
-
}
|
|
305
|
-
a = c, n = l ? "[" + o + "]" : "." + o;
|
|
306
|
-
}), {
|
|
307
|
-
schema: i,
|
|
308
|
-
parent: r,
|
|
309
|
-
parentPath: a
|
|
310
|
-
}) : {
|
|
311
|
-
parent: r,
|
|
312
|
-
parentPath: t,
|
|
313
|
-
schema: i
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
class z extends Set {
|
|
317
|
-
describe() {
|
|
318
|
-
const t = [];
|
|
319
|
-
for (const e of this.values())
|
|
320
|
-
t.push(T.isRef(e) ? e.describe() : e);
|
|
321
|
-
return t;
|
|
322
|
-
}
|
|
323
|
-
resolveAll(t) {
|
|
324
|
-
let e = [];
|
|
325
|
-
for (const s of this.values())
|
|
326
|
-
e.push(t(s));
|
|
327
|
-
return e;
|
|
328
|
-
}
|
|
329
|
-
clone() {
|
|
330
|
-
return new z(this.values());
|
|
331
|
-
}
|
|
332
|
-
merge(t, e) {
|
|
333
|
-
const s = this.clone();
|
|
334
|
-
return t.forEach((r) => s.add(r)), e.forEach((r) => s.delete(r)), s;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
function D(i, t = /* @__PURE__ */ new Map()) {
|
|
338
|
-
if (Z(i) || !i || typeof i != "object") return i;
|
|
339
|
-
if (t.has(i)) return t.get(i);
|
|
340
|
-
let e;
|
|
341
|
-
if (i instanceof Date)
|
|
342
|
-
e = new Date(i.getTime()), t.set(i, e);
|
|
343
|
-
else if (i instanceof RegExp)
|
|
344
|
-
e = new RegExp(i), t.set(i, e);
|
|
345
|
-
else if (Array.isArray(i)) {
|
|
346
|
-
e = new Array(i.length), t.set(i, e);
|
|
347
|
-
for (let s = 0; s < i.length; s++) e[s] = D(i[s], t);
|
|
348
|
-
} else if (i instanceof Map) {
|
|
349
|
-
e = /* @__PURE__ */ new Map(), t.set(i, e);
|
|
350
|
-
for (const [s, r] of i.entries()) e.set(s, D(r, t));
|
|
351
|
-
} else if (i instanceof Set) {
|
|
352
|
-
e = /* @__PURE__ */ new Set(), t.set(i, e);
|
|
353
|
-
for (const s of i) e.add(D(s, t));
|
|
354
|
-
} else if (i instanceof Object) {
|
|
355
|
-
e = {}, t.set(i, e);
|
|
356
|
-
for (const [s, r] of Object.entries(i)) e[s] = D(r, t);
|
|
357
|
-
} else
|
|
358
|
-
throw Error(`Unable to clone ${i}`);
|
|
359
|
-
return e;
|
|
360
|
-
}
|
|
361
|
-
class b {
|
|
362
|
-
constructor(t) {
|
|
363
|
-
this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new z(), this._blacklist = new z(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
|
|
364
|
-
this.typeError(y.notType);
|
|
365
|
-
}), this.type = t.type, this._typeCheck = t.check, this.spec = Object.assign({
|
|
366
|
-
strip: !1,
|
|
367
|
-
strict: !1,
|
|
368
|
-
abortEarly: !0,
|
|
369
|
-
recursive: !0,
|
|
370
|
-
disableStackTrace: !1,
|
|
371
|
-
nullable: !1,
|
|
372
|
-
optional: !0,
|
|
373
|
-
coerce: !0
|
|
374
|
-
}, t == null ? void 0 : t.spec), this.withMutation((e) => {
|
|
375
|
-
e.nonNullable();
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
// TODO: remove
|
|
379
|
-
get _type() {
|
|
380
|
-
return this.type;
|
|
381
|
-
}
|
|
382
|
-
clone(t) {
|
|
383
|
-
if (this._mutate)
|
|
384
|
-
return t && Object.assign(this.spec, t), this;
|
|
385
|
-
const e = Object.create(Object.getPrototypeOf(this));
|
|
386
|
-
return e.type = this.type, e._typeCheck = this._typeCheck, e._whitelist = this._whitelist.clone(), e._blacklist = this._blacklist.clone(), e.internalTests = Object.assign({}, this.internalTests), e.exclusiveTests = Object.assign({}, this.exclusiveTests), e.deps = [...this.deps], e.conditions = [...this.conditions], e.tests = [...this.tests], e.transforms = [...this.transforms], e.spec = D(Object.assign({}, this.spec, t)), e;
|
|
387
|
-
}
|
|
388
|
-
label(t) {
|
|
389
|
-
let e = this.clone();
|
|
390
|
-
return e.spec.label = t, e;
|
|
391
|
-
}
|
|
392
|
-
meta(...t) {
|
|
393
|
-
if (t.length === 0) return this.spec.meta;
|
|
394
|
-
let e = this.clone();
|
|
395
|
-
return e.spec.meta = Object.assign(e.spec.meta || {}, t[0]), e;
|
|
396
|
-
}
|
|
397
|
-
withMutation(t) {
|
|
398
|
-
let e = this._mutate;
|
|
399
|
-
this._mutate = !0;
|
|
400
|
-
let s = t(this);
|
|
401
|
-
return this._mutate = e, s;
|
|
402
|
-
}
|
|
403
|
-
concat(t) {
|
|
404
|
-
if (!t || t === this) return this;
|
|
405
|
-
if (t.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);
|
|
406
|
-
let e = this, s = t.clone();
|
|
407
|
-
const r = Object.assign({}, e.spec, s.spec);
|
|
408
|
-
return s.spec = r, s.internalTests = Object.assign({}, e.internalTests, s.internalTests), s._whitelist = e._whitelist.merge(t._whitelist, t._blacklist), s._blacklist = e._blacklist.merge(t._blacklist, t._whitelist), s.tests = e.tests, s.exclusiveTests = e.exclusiveTests, s.withMutation((a) => {
|
|
409
|
-
t.tests.forEach((n) => {
|
|
410
|
-
a.test(n.OPTIONS);
|
|
411
|
-
});
|
|
412
|
-
}), s.transforms = [...e.transforms, ...s.transforms], s;
|
|
413
|
-
}
|
|
414
|
-
isType(t) {
|
|
415
|
-
return t == null ? !!(this.spec.nullable && t === null || this.spec.optional && t === void 0) : this._typeCheck(t);
|
|
416
|
-
}
|
|
417
|
-
resolve(t) {
|
|
418
|
-
let e = this;
|
|
419
|
-
if (e.conditions.length) {
|
|
420
|
-
let s = e.conditions;
|
|
421
|
-
e = e.clone(), e.conditions = [], e = s.reduce((r, a) => a.resolve(r, t), e), e = e.resolve(t);
|
|
422
|
-
}
|
|
423
|
-
return e;
|
|
424
|
-
}
|
|
425
|
-
resolveOptions(t) {
|
|
426
|
-
var e, s, r, a;
|
|
427
|
-
return Object.assign({}, t, {
|
|
428
|
-
from: t.from || [],
|
|
429
|
-
strict: (e = t.strict) != null ? e : this.spec.strict,
|
|
430
|
-
abortEarly: (s = t.abortEarly) != null ? s : this.spec.abortEarly,
|
|
431
|
-
recursive: (r = t.recursive) != null ? r : this.spec.recursive,
|
|
432
|
-
disableStackTrace: (a = t.disableStackTrace) != null ? a : this.spec.disableStackTrace
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Run the configured transform pipeline over an input value.
|
|
437
|
-
*/
|
|
438
|
-
cast(t, e = {}) {
|
|
439
|
-
let s = this.resolve(Object.assign({
|
|
440
|
-
value: t
|
|
441
|
-
}, e)), r = e.assert === "ignore-optionality", a = s._cast(t, e);
|
|
442
|
-
if (e.assert !== !1 && !s.isType(a)) {
|
|
443
|
-
if (r && O(a))
|
|
444
|
-
return a;
|
|
445
|
-
let n = E(t), o = E(a);
|
|
446
|
-
throw new TypeError(`The value of ${e.path || "field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
447
|
-
|
|
448
|
-
attempted value: ${n}
|
|
449
|
-
` + (o !== n ? `result of cast: ${o}` : ""));
|
|
450
|
-
}
|
|
451
|
-
return a;
|
|
452
|
-
}
|
|
453
|
-
_cast(t, e) {
|
|
454
|
-
let s = t === void 0 ? t : this.transforms.reduce((r, a) => a.call(this, r, t, this), t);
|
|
455
|
-
return s === void 0 && (s = this.getDefault(e)), s;
|
|
456
|
-
}
|
|
457
|
-
_validate(t, e = {}, s, r) {
|
|
458
|
-
let {
|
|
459
|
-
path: a,
|
|
460
|
-
originalValue: n = t,
|
|
461
|
-
strict: o = this.spec.strict
|
|
462
|
-
} = e, l = t;
|
|
463
|
-
o || (l = this._cast(l, Object.assign({
|
|
464
|
-
assert: !1
|
|
465
|
-
}, e)));
|
|
466
|
-
let u = [];
|
|
467
|
-
for (let c of Object.values(this.internalTests))
|
|
468
|
-
c && u.push(c);
|
|
469
|
-
this.runTests({
|
|
470
|
-
path: a,
|
|
471
|
-
value: l,
|
|
472
|
-
originalValue: n,
|
|
473
|
-
options: e,
|
|
474
|
-
tests: u
|
|
475
|
-
}, s, (c) => {
|
|
476
|
-
if (c.length)
|
|
477
|
-
return r(c, l);
|
|
478
|
-
this.runTests({
|
|
479
|
-
path: a,
|
|
480
|
-
value: l,
|
|
481
|
-
originalValue: n,
|
|
482
|
-
options: e,
|
|
483
|
-
tests: this.tests
|
|
484
|
-
}, s, r);
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Executes a set of validations, either schema, produced Tests or a nested
|
|
489
|
-
* schema validate result.
|
|
490
|
-
*/
|
|
491
|
-
runTests(t, e, s) {
|
|
492
|
-
let r = !1, {
|
|
493
|
-
tests: a,
|
|
494
|
-
value: n,
|
|
495
|
-
originalValue: o,
|
|
496
|
-
path: l,
|
|
497
|
-
options: u
|
|
498
|
-
} = t, c = (g) => {
|
|
499
|
-
r || (r = !0, e(g, n));
|
|
500
|
-
}, h = (g) => {
|
|
501
|
-
r || (r = !0, s(g, n));
|
|
502
|
-
}, p = a.length, v = [];
|
|
503
|
-
if (!p) return h([]);
|
|
504
|
-
let w = {
|
|
505
|
-
value: n,
|
|
506
|
-
originalValue: o,
|
|
507
|
-
path: l,
|
|
508
|
-
options: u,
|
|
509
|
-
schema: this
|
|
510
|
-
};
|
|
511
|
-
for (let g = 0; g < a.length; g++) {
|
|
512
|
-
const _ = a[g];
|
|
513
|
-
_(w, c, function($) {
|
|
514
|
-
$ && (Array.isArray($) ? v.push(...$) : v.push($)), --p <= 0 && h(v);
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
asNestedTest({
|
|
519
|
-
key: t,
|
|
520
|
-
index: e,
|
|
521
|
-
parent: s,
|
|
522
|
-
parentPath: r,
|
|
523
|
-
originalParent: a,
|
|
524
|
-
options: n
|
|
525
|
-
}) {
|
|
526
|
-
const o = t ?? e;
|
|
527
|
-
if (o == null)
|
|
528
|
-
throw TypeError("Must include `key` or `index` for nested validations");
|
|
529
|
-
const l = typeof o == "number";
|
|
530
|
-
let u = s[o];
|
|
531
|
-
const c = Object.assign({}, n, {
|
|
532
|
-
// Nested validations fields are always strict:
|
|
533
|
-
// 1. parent isn't strict so the casting will also have cast inner values
|
|
534
|
-
// 2. parent is strict in which case the nested values weren't cast either
|
|
535
|
-
strict: !0,
|
|
536
|
-
parent: s,
|
|
537
|
-
value: u,
|
|
538
|
-
originalValue: a[o],
|
|
539
|
-
// FIXME: tests depend on `index` being passed around deeply,
|
|
540
|
-
// we should not let the options.key/index bleed through
|
|
541
|
-
key: void 0,
|
|
542
|
-
// index: undefined,
|
|
543
|
-
[l ? "index" : "key"]: o,
|
|
544
|
-
path: l || o.includes(".") ? `${r || ""}[${l ? o : `"${o}"`}]` : (r ? `${r}.` : "") + t
|
|
545
|
-
});
|
|
546
|
-
return (h, p, v) => this.resolve(c)._validate(u, c, p, v);
|
|
547
|
-
}
|
|
548
|
-
validate(t, e) {
|
|
549
|
-
var s;
|
|
550
|
-
let r = this.resolve(Object.assign({}, e, {
|
|
551
|
-
value: t
|
|
552
|
-
})), a = (s = e == null ? void 0 : e.disableStackTrace) != null ? s : r.spec.disableStackTrace;
|
|
553
|
-
return new Promise((n, o) => r._validate(t, e, (l, u) => {
|
|
554
|
-
m.isError(l) && (l.value = u), o(l);
|
|
555
|
-
}, (l, u) => {
|
|
556
|
-
l.length ? o(new m(l, u, void 0, void 0, a)) : n(u);
|
|
557
|
-
}));
|
|
558
|
-
}
|
|
559
|
-
validateSync(t, e) {
|
|
560
|
-
var s;
|
|
561
|
-
let r = this.resolve(Object.assign({}, e, {
|
|
562
|
-
value: t
|
|
563
|
-
})), a, n = (s = e == null ? void 0 : e.disableStackTrace) != null ? s : r.spec.disableStackTrace;
|
|
564
|
-
return r._validate(t, Object.assign({}, e, {
|
|
565
|
-
sync: !0
|
|
566
|
-
}), (o, l) => {
|
|
567
|
-
throw m.isError(o) && (o.value = l), o;
|
|
568
|
-
}, (o, l) => {
|
|
569
|
-
if (o.length) throw new m(o, t, void 0, void 0, n);
|
|
570
|
-
a = l;
|
|
571
|
-
}), a;
|
|
572
|
-
}
|
|
573
|
-
isValid(t, e) {
|
|
574
|
-
return this.validate(t, e).then(() => !0, (s) => {
|
|
575
|
-
if (m.isError(s)) return !1;
|
|
576
|
-
throw s;
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
isValidSync(t, e) {
|
|
580
|
-
try {
|
|
581
|
-
return this.validateSync(t, e), !0;
|
|
582
|
-
} catch (s) {
|
|
583
|
-
if (m.isError(s)) return !1;
|
|
584
|
-
throw s;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
_getDefault(t) {
|
|
588
|
-
let e = this.spec.default;
|
|
589
|
-
return e == null ? e : typeof e == "function" ? e.call(this, t) : D(e);
|
|
590
|
-
}
|
|
591
|
-
getDefault(t) {
|
|
592
|
-
return this.resolve(t || {})._getDefault(t);
|
|
593
|
-
}
|
|
594
|
-
default(t) {
|
|
595
|
-
return arguments.length === 0 ? this._getDefault() : this.clone({
|
|
596
|
-
default: t
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
strict(t = !0) {
|
|
600
|
-
return this.clone({
|
|
601
|
-
strict: t
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
nullability(t, e) {
|
|
605
|
-
const s = this.clone({
|
|
606
|
-
nullable: t
|
|
607
|
-
});
|
|
608
|
-
return s.internalTests.nullable = S({
|
|
609
|
-
message: e,
|
|
610
|
-
name: "nullable",
|
|
611
|
-
test(r) {
|
|
612
|
-
return r === null ? this.schema.spec.nullable : !0;
|
|
613
|
-
}
|
|
614
|
-
}), s;
|
|
615
|
-
}
|
|
616
|
-
optionality(t, e) {
|
|
617
|
-
const s = this.clone({
|
|
618
|
-
optional: t
|
|
619
|
-
});
|
|
620
|
-
return s.internalTests.optionality = S({
|
|
621
|
-
message: e,
|
|
622
|
-
name: "optionality",
|
|
623
|
-
test(r) {
|
|
624
|
-
return r === void 0 ? this.schema.spec.optional : !0;
|
|
625
|
-
}
|
|
626
|
-
}), s;
|
|
627
|
-
}
|
|
628
|
-
optional() {
|
|
629
|
-
return this.optionality(!0);
|
|
630
|
-
}
|
|
631
|
-
defined(t = y.defined) {
|
|
632
|
-
return this.optionality(!1, t);
|
|
633
|
-
}
|
|
634
|
-
nullable() {
|
|
635
|
-
return this.nullability(!0);
|
|
636
|
-
}
|
|
637
|
-
nonNullable(t = y.notNull) {
|
|
638
|
-
return this.nullability(!1, t);
|
|
639
|
-
}
|
|
640
|
-
required(t = y.required) {
|
|
641
|
-
return this.clone().withMutation((e) => e.nonNullable(t).defined(t));
|
|
642
|
-
}
|
|
643
|
-
notRequired() {
|
|
644
|
-
return this.clone().withMutation((t) => t.nullable().optional());
|
|
645
|
-
}
|
|
646
|
-
transform(t) {
|
|
647
|
-
let e = this.clone();
|
|
648
|
-
return e.transforms.push(t), e;
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Adds a test function to the schema's queue of tests.
|
|
652
|
-
* tests can be exclusive or non-exclusive.
|
|
653
|
-
*
|
|
654
|
-
* - exclusive tests, will replace any existing tests of the same name.
|
|
655
|
-
* - non-exclusive: can be stacked
|
|
656
|
-
*
|
|
657
|
-
* If a non-exclusive test is added to a schema with an exclusive test of the same name
|
|
658
|
-
* the exclusive test is removed and further tests of the same name will be stacked.
|
|
659
|
-
*
|
|
660
|
-
* If an exclusive test is added to a schema with non-exclusive tests of the same name
|
|
661
|
-
* the previous tests are removed and further tests of the same name will replace each other.
|
|
662
|
-
*/
|
|
663
|
-
test(...t) {
|
|
664
|
-
let e;
|
|
665
|
-
if (t.length === 1 ? typeof t[0] == "function" ? e = {
|
|
666
|
-
test: t[0]
|
|
667
|
-
} : e = t[0] : t.length === 2 ? e = {
|
|
668
|
-
name: t[0],
|
|
669
|
-
test: t[1]
|
|
670
|
-
} : e = {
|
|
671
|
-
name: t[0],
|
|
672
|
-
message: t[1],
|
|
673
|
-
test: t[2]
|
|
674
|
-
}, e.message === void 0 && (e.message = y.default), typeof e.test != "function") throw new TypeError("`test` is a required parameters");
|
|
675
|
-
let s = this.clone(), r = S(e), a = e.exclusive || e.name && s.exclusiveTests[e.name] === !0;
|
|
676
|
-
if (e.exclusive && !e.name)
|
|
677
|
-
throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
|
|
678
|
-
return e.name && (s.exclusiveTests[e.name] = !!e.exclusive), s.tests = s.tests.filter((n) => !(n.OPTIONS.name === e.name && (a || n.OPTIONS.test === r.OPTIONS.test))), s.tests.push(r), s;
|
|
679
|
-
}
|
|
680
|
-
when(t, e) {
|
|
681
|
-
!Array.isArray(t) && typeof t != "string" && (e = t, t = ".");
|
|
682
|
-
let s = this.clone(), r = se(t).map((a) => new T(a));
|
|
683
|
-
return r.forEach((a) => {
|
|
684
|
-
a.isSibling && s.deps.push(a.key);
|
|
685
|
-
}), s.conditions.push(typeof e == "function" ? new N(r, e) : N.fromOptions(r, e)), s;
|
|
686
|
-
}
|
|
687
|
-
typeError(t) {
|
|
688
|
-
let e = this.clone();
|
|
689
|
-
return e.internalTests.typeError = S({
|
|
690
|
-
message: t,
|
|
691
|
-
name: "typeError",
|
|
692
|
-
skipAbsent: !0,
|
|
693
|
-
test(s) {
|
|
694
|
-
return this.schema._typeCheck(s) ? !0 : this.createError({
|
|
695
|
-
params: {
|
|
696
|
-
type: this.schema.type
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
}), e;
|
|
701
|
-
}
|
|
702
|
-
oneOf(t, e = y.oneOf) {
|
|
703
|
-
let s = this.clone();
|
|
704
|
-
return t.forEach((r) => {
|
|
705
|
-
s._whitelist.add(r), s._blacklist.delete(r);
|
|
706
|
-
}), s.internalTests.whiteList = S({
|
|
707
|
-
message: e,
|
|
708
|
-
name: "oneOf",
|
|
709
|
-
skipAbsent: !0,
|
|
710
|
-
test(r) {
|
|
711
|
-
let a = this.schema._whitelist, n = a.resolveAll(this.resolve);
|
|
712
|
-
return n.includes(r) ? !0 : this.createError({
|
|
713
|
-
params: {
|
|
714
|
-
values: Array.from(a).join(", "),
|
|
715
|
-
resolved: n
|
|
716
|
-
}
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
}), s;
|
|
720
|
-
}
|
|
721
|
-
notOneOf(t, e = y.notOneOf) {
|
|
722
|
-
let s = this.clone();
|
|
723
|
-
return t.forEach((r) => {
|
|
724
|
-
s._blacklist.add(r), s._whitelist.delete(r);
|
|
725
|
-
}), s.internalTests.blacklist = S({
|
|
726
|
-
message: e,
|
|
727
|
-
name: "notOneOf",
|
|
728
|
-
test(r) {
|
|
729
|
-
let a = this.schema._blacklist, n = a.resolveAll(this.resolve);
|
|
730
|
-
return n.includes(r) ? this.createError({
|
|
731
|
-
params: {
|
|
732
|
-
values: Array.from(a).join(", "),
|
|
733
|
-
resolved: n
|
|
734
|
-
}
|
|
735
|
-
}) : !0;
|
|
736
|
-
}
|
|
737
|
-
}), s;
|
|
738
|
-
}
|
|
739
|
-
strip(t = !0) {
|
|
740
|
-
let e = this.clone();
|
|
741
|
-
return e.spec.strip = t, e;
|
|
742
|
-
}
|
|
743
|
-
/**
|
|
744
|
-
* Return a serialized description of the schema including validations, flags, types etc.
|
|
745
|
-
*
|
|
746
|
-
* @param options Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).
|
|
747
|
-
*/
|
|
748
|
-
describe(t) {
|
|
749
|
-
const e = (t ? this.resolve(t) : this).clone(), {
|
|
750
|
-
label: s,
|
|
751
|
-
meta: r,
|
|
752
|
-
optional: a,
|
|
753
|
-
nullable: n
|
|
754
|
-
} = e.spec;
|
|
755
|
-
return {
|
|
756
|
-
meta: r,
|
|
757
|
-
label: s,
|
|
758
|
-
optional: a,
|
|
759
|
-
nullable: n,
|
|
760
|
-
default: e.getDefault(t),
|
|
761
|
-
type: e.type,
|
|
762
|
-
oneOf: e._whitelist.describe(),
|
|
763
|
-
notOneOf: e._blacklist.describe(),
|
|
764
|
-
tests: e.tests.map((o) => ({
|
|
765
|
-
name: o.OPTIONS.name,
|
|
766
|
-
params: o.OPTIONS.params
|
|
767
|
-
})).filter((o, l, u) => u.findIndex((c) => c.name === o.name) === l)
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
b.prototype.__isYupSchema__ = !0;
|
|
772
|
-
for (const i of ["validate", "validateSync"]) b.prototype[`${i}At`] = function(t, e, s = {}) {
|
|
773
|
-
const {
|
|
774
|
-
parent: r,
|
|
775
|
-
parentPath: a,
|
|
776
|
-
schema: n
|
|
777
|
-
} = we(this, t, e, s.context);
|
|
778
|
-
return n[i](r && r[a], Object.assign({}, s, {
|
|
779
|
-
parent: r,
|
|
780
|
-
path: t
|
|
781
|
-
}));
|
|
782
|
-
};
|
|
783
|
-
for (const i of ["equals", "is"]) b.prototype[i] = b.prototype.oneOf;
|
|
784
|
-
for (const i of ["not", "nope"]) b.prototype[i] = b.prototype.notOneOf;
|
|
785
|
-
const _e = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
|
|
786
|
-
function $e(i) {
|
|
787
|
-
const t = R(i);
|
|
788
|
-
if (!t) return Date.parse ? Date.parse(i) : Number.NaN;
|
|
789
|
-
if (t.z === void 0 && t.plusMinus === void 0)
|
|
790
|
-
return new Date(t.year, t.month, t.day, t.hour, t.minute, t.second, t.millisecond).valueOf();
|
|
791
|
-
let e = 0;
|
|
792
|
-
return t.z !== "Z" && t.plusMinus !== void 0 && (e = t.hourOffset * 60 + t.minuteOffset, t.plusMinus === "+" && (e = 0 - e)), Date.UTC(t.year, t.month, t.day, t.hour, t.minute + e, t.second, t.millisecond);
|
|
793
|
-
}
|
|
794
|
-
function R(i) {
|
|
795
|
-
var t, e;
|
|
796
|
-
const s = _e.exec(i);
|
|
797
|
-
return s ? {
|
|
798
|
-
year: F(s[1]),
|
|
799
|
-
month: F(s[2], 1) - 1,
|
|
800
|
-
day: F(s[3], 1),
|
|
801
|
-
hour: F(s[4]),
|
|
802
|
-
minute: F(s[5]),
|
|
803
|
-
second: F(s[6]),
|
|
804
|
-
millisecond: s[7] ? (
|
|
805
|
-
// allow arbitrary sub-second precision beyond milliseconds
|
|
806
|
-
F(s[7].substring(0, 3))
|
|
807
|
-
) : 0,
|
|
808
|
-
precision: (t = (e = s[7]) == null ? void 0 : e.length) != null ? t : void 0,
|
|
809
|
-
z: s[8] || void 0,
|
|
810
|
-
plusMinus: s[9] || void 0,
|
|
811
|
-
hourOffset: F(s[10]),
|
|
812
|
-
minuteOffset: F(s[11])
|
|
813
|
-
} : null;
|
|
814
|
-
}
|
|
815
|
-
function F(i, t = 0) {
|
|
816
|
-
return Number(i) || t;
|
|
817
|
-
}
|
|
818
|
-
let Ee = (
|
|
819
|
-
// eslint-disable-next-line
|
|
820
|
-
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
|
|
821
|
-
), xe = (
|
|
822
|
-
// eslint-disable-next-line
|
|
823
|
-
/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
|
|
824
|
-
), Oe = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, ke = "^\\d{4}-\\d{2}-\\d{2}", Te = "\\d{2}:\\d{2}:\\d{2}", Se = "(([+-]\\d{2}(:?\\d{2})?)|Z)", De = new RegExp(`${ke}T${Te}(\\.\\d+)?${Se}$`), je = (i) => O(i) || i === i.trim(), Ae = {}.toString();
|
|
825
|
-
function Ce() {
|
|
826
|
-
return new ne();
|
|
827
|
-
}
|
|
828
|
-
class ne extends b {
|
|
829
|
-
constructor() {
|
|
830
|
-
super({
|
|
831
|
-
type: "string",
|
|
832
|
-
check(t) {
|
|
833
|
-
return t instanceof String && (t = t.valueOf()), typeof t == "string";
|
|
834
|
-
}
|
|
835
|
-
}), this.withMutation(() => {
|
|
836
|
-
this.transform((t, e, s) => {
|
|
837
|
-
if (!s.spec.coerce || s.isType(t) || Array.isArray(t)) return t;
|
|
838
|
-
const r = t != null && t.toString ? t.toString() : t;
|
|
839
|
-
return r === Ae ? t : r;
|
|
840
|
-
});
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
required(t) {
|
|
844
|
-
return super.required(t).withMutation((e) => e.test({
|
|
845
|
-
message: t || y.required,
|
|
846
|
-
name: "required",
|
|
847
|
-
skipAbsent: !0,
|
|
848
|
-
test: (s) => !!s.length
|
|
849
|
-
}));
|
|
850
|
-
}
|
|
851
|
-
notRequired() {
|
|
852
|
-
return super.notRequired().withMutation((t) => (t.tests = t.tests.filter((e) => e.OPTIONS.name !== "required"), t));
|
|
853
|
-
}
|
|
854
|
-
length(t, e = d.length) {
|
|
855
|
-
return this.test({
|
|
856
|
-
message: e,
|
|
857
|
-
name: "length",
|
|
858
|
-
exclusive: !0,
|
|
859
|
-
params: {
|
|
860
|
-
length: t
|
|
861
|
-
},
|
|
862
|
-
skipAbsent: !0,
|
|
863
|
-
test(s) {
|
|
864
|
-
return s.length === this.resolve(t);
|
|
865
|
-
}
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
min(t, e = d.min) {
|
|
869
|
-
return this.test({
|
|
870
|
-
message: e,
|
|
871
|
-
name: "min",
|
|
872
|
-
exclusive: !0,
|
|
873
|
-
params: {
|
|
874
|
-
min: t
|
|
875
|
-
},
|
|
876
|
-
skipAbsent: !0,
|
|
877
|
-
test(s) {
|
|
878
|
-
return s.length >= this.resolve(t);
|
|
879
|
-
}
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
max(t, e = d.max) {
|
|
883
|
-
return this.test({
|
|
884
|
-
name: "max",
|
|
885
|
-
exclusive: !0,
|
|
886
|
-
message: e,
|
|
887
|
-
params: {
|
|
888
|
-
max: t
|
|
889
|
-
},
|
|
890
|
-
skipAbsent: !0,
|
|
891
|
-
test(s) {
|
|
892
|
-
return s.length <= this.resolve(t);
|
|
893
|
-
}
|
|
894
|
-
});
|
|
895
|
-
}
|
|
896
|
-
matches(t, e) {
|
|
897
|
-
let s = !1, r, a;
|
|
898
|
-
return e && (typeof e == "object" ? {
|
|
899
|
-
excludeEmptyString: s = !1,
|
|
900
|
-
message: r,
|
|
901
|
-
name: a
|
|
902
|
-
} = e : r = e), this.test({
|
|
903
|
-
name: a || "matches",
|
|
904
|
-
message: r || d.matches,
|
|
905
|
-
params: {
|
|
906
|
-
regex: t
|
|
907
|
-
},
|
|
908
|
-
skipAbsent: !0,
|
|
909
|
-
test: (n) => n === "" && s || n.search(t) !== -1
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
email(t = d.email) {
|
|
913
|
-
return this.matches(Ee, {
|
|
914
|
-
name: "email",
|
|
915
|
-
message: t,
|
|
916
|
-
excludeEmptyString: !0
|
|
917
|
-
});
|
|
918
|
-
}
|
|
919
|
-
url(t = d.url) {
|
|
920
|
-
return this.matches(xe, {
|
|
921
|
-
name: "url",
|
|
922
|
-
message: t,
|
|
923
|
-
excludeEmptyString: !0
|
|
924
|
-
});
|
|
925
|
-
}
|
|
926
|
-
uuid(t = d.uuid) {
|
|
927
|
-
return this.matches(Oe, {
|
|
928
|
-
name: "uuid",
|
|
929
|
-
message: t,
|
|
930
|
-
excludeEmptyString: !1
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
datetime(t) {
|
|
934
|
-
let e = "", s, r;
|
|
935
|
-
return t && (typeof t == "object" ? {
|
|
936
|
-
message: e = "",
|
|
937
|
-
allowOffset: s = !1,
|
|
938
|
-
precision: r = void 0
|
|
939
|
-
} = t : e = t), this.matches(De, {
|
|
940
|
-
name: "datetime",
|
|
941
|
-
message: e || d.datetime,
|
|
942
|
-
excludeEmptyString: !0
|
|
943
|
-
}).test({
|
|
944
|
-
name: "datetime_offset",
|
|
945
|
-
message: e || d.datetime_offset,
|
|
946
|
-
params: {
|
|
947
|
-
allowOffset: s
|
|
948
|
-
},
|
|
949
|
-
skipAbsent: !0,
|
|
950
|
-
test: (a) => {
|
|
951
|
-
if (!a || s) return !0;
|
|
952
|
-
const n = R(a);
|
|
953
|
-
return n ? !!n.z : !1;
|
|
954
|
-
}
|
|
955
|
-
}).test({
|
|
956
|
-
name: "datetime_precision",
|
|
957
|
-
message: e || d.datetime_precision,
|
|
958
|
-
params: {
|
|
959
|
-
precision: r
|
|
960
|
-
},
|
|
961
|
-
skipAbsent: !0,
|
|
962
|
-
test: (a) => {
|
|
963
|
-
if (!a || r == null) return !0;
|
|
964
|
-
const n = R(a);
|
|
965
|
-
return n ? n.precision === r : !1;
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
}
|
|
969
|
-
//-- transforms --
|
|
970
|
-
ensure() {
|
|
971
|
-
return this.default("").transform((t) => t === null ? "" : t);
|
|
972
|
-
}
|
|
973
|
-
trim(t = d.trim) {
|
|
974
|
-
return this.transform((e) => e != null ? e.trim() : e).test({
|
|
975
|
-
message: t,
|
|
976
|
-
name: "trim",
|
|
977
|
-
test: je
|
|
978
|
-
});
|
|
979
|
-
}
|
|
980
|
-
lowercase(t = d.lowercase) {
|
|
981
|
-
return this.transform((e) => O(e) ? e : e.toLowerCase()).test({
|
|
982
|
-
message: t,
|
|
983
|
-
name: "string_case",
|
|
984
|
-
exclusive: !0,
|
|
985
|
-
skipAbsent: !0,
|
|
986
|
-
test: (e) => O(e) || e === e.toLowerCase()
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
uppercase(t = d.uppercase) {
|
|
990
|
-
return this.transform((e) => O(e) ? e : e.toUpperCase()).test({
|
|
991
|
-
message: t,
|
|
992
|
-
name: "string_case",
|
|
993
|
-
exclusive: !0,
|
|
994
|
-
skipAbsent: !0,
|
|
995
|
-
test: (e) => O(e) || e === e.toUpperCase()
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
Ce.prototype = ne.prototype;
|
|
1000
|
-
let Ve = /* @__PURE__ */ new Date(""), Ne = (i) => Object.prototype.toString.call(i) === "[object Date]";
|
|
1001
|
-
class L extends b {
|
|
1002
|
-
constructor() {
|
|
1003
|
-
super({
|
|
1004
|
-
type: "date",
|
|
1005
|
-
check(t) {
|
|
1006
|
-
return Ne(t) && !isNaN(t.getTime());
|
|
1007
|
-
}
|
|
1008
|
-
}), this.withMutation(() => {
|
|
1009
|
-
this.transform((t, e, s) => !s.spec.coerce || s.isType(t) || t === null ? t : (t = $e(t), isNaN(t) ? L.INVALID_DATE : new Date(t)));
|
|
1010
|
-
});
|
|
1011
|
-
}
|
|
1012
|
-
prepareParam(t, e) {
|
|
1013
|
-
let s;
|
|
1014
|
-
if (T.isRef(t))
|
|
1015
|
-
s = t;
|
|
1016
|
-
else {
|
|
1017
|
-
let r = this.cast(t);
|
|
1018
|
-
if (!this._typeCheck(r)) throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);
|
|
1019
|
-
s = r;
|
|
1020
|
-
}
|
|
1021
|
-
return s;
|
|
1022
|
-
}
|
|
1023
|
-
min(t, e = U.min) {
|
|
1024
|
-
let s = this.prepareParam(t, "min");
|
|
1025
|
-
return this.test({
|
|
1026
|
-
message: e,
|
|
1027
|
-
name: "min",
|
|
1028
|
-
exclusive: !0,
|
|
1029
|
-
params: {
|
|
1030
|
-
min: t
|
|
1031
|
-
},
|
|
1032
|
-
skipAbsent: !0,
|
|
1033
|
-
test(r) {
|
|
1034
|
-
return r >= this.resolve(s);
|
|
1035
|
-
}
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
max(t, e = U.max) {
|
|
1039
|
-
let s = this.prepareParam(t, "max");
|
|
1040
|
-
return this.test({
|
|
1041
|
-
message: e,
|
|
1042
|
-
name: "max",
|
|
1043
|
-
exclusive: !0,
|
|
1044
|
-
params: {
|
|
1045
|
-
max: t
|
|
1046
|
-
},
|
|
1047
|
-
skipAbsent: !0,
|
|
1048
|
-
test(r) {
|
|
1049
|
-
return r <= this.resolve(s);
|
|
1050
|
-
}
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
L.INVALID_DATE = Ve;
|
|
1055
|
-
function ze(i, t = []) {
|
|
1056
|
-
let e = [], s = /* @__PURE__ */ new Set(), r = new Set(t.map(([n, o]) => `${n}-${o}`));
|
|
1057
|
-
function a(n, o) {
|
|
1058
|
-
let l = k.split(n)[0];
|
|
1059
|
-
s.add(l), r.has(`${o}-${l}`) || e.push([o, l]);
|
|
1060
|
-
}
|
|
1061
|
-
for (const n of Object.keys(i)) {
|
|
1062
|
-
let o = i[n];
|
|
1063
|
-
s.add(n), T.isRef(o) && o.isSibling ? a(o.path, n) : Z(o) && "deps" in o && o.deps.forEach((l) => a(l, n));
|
|
1064
|
-
}
|
|
1065
|
-
return ue.array(Array.from(s), e).reverse();
|
|
1066
|
-
}
|
|
1067
|
-
function G(i, t) {
|
|
1068
|
-
let e = 1 / 0;
|
|
1069
|
-
return i.some((s, r) => {
|
|
1070
|
-
var a;
|
|
1071
|
-
if ((a = t.path) != null && a.includes(s))
|
|
1072
|
-
return e = r, !0;
|
|
1073
|
-
}), e;
|
|
1074
|
-
}
|
|
1075
|
-
function oe(i) {
|
|
1076
|
-
return (t, e) => G(i, t) - G(i, e);
|
|
1077
|
-
}
|
|
1078
|
-
const Pe = (i, t, e) => {
|
|
1079
|
-
if (typeof i != "string")
|
|
1080
|
-
return i;
|
|
1081
|
-
let s = i;
|
|
1082
|
-
try {
|
|
1083
|
-
s = JSON.parse(i);
|
|
1084
|
-
} catch {
|
|
1085
|
-
}
|
|
1086
|
-
return e.isType(s) ? s : i;
|
|
1087
|
-
};
|
|
1088
|
-
function V(i) {
|
|
1089
|
-
if ("fields" in i) {
|
|
1090
|
-
const t = {};
|
|
1091
|
-
for (const [e, s] of Object.entries(i.fields))
|
|
1092
|
-
t[e] = V(s);
|
|
1093
|
-
return i.setFields(t);
|
|
1094
|
-
}
|
|
1095
|
-
if (i.type === "array") {
|
|
1096
|
-
const t = i.optional();
|
|
1097
|
-
return t.innerType && (t.innerType = V(t.innerType)), t;
|
|
1098
|
-
}
|
|
1099
|
-
return i.type === "tuple" ? i.optional().clone({
|
|
1100
|
-
types: i.spec.types.map(V)
|
|
1101
|
-
}) : "optional" in i ? i.optional() : i;
|
|
1102
|
-
}
|
|
1103
|
-
const Ie = (i, t) => {
|
|
1104
|
-
const e = [...k.normalizePath(t)];
|
|
1105
|
-
if (e.length === 1) return e[0] in i;
|
|
1106
|
-
let s = e.pop(), r = k.getter(k.join(e), !0)(i);
|
|
1107
|
-
return !!(r && s in r);
|
|
1108
|
-
};
|
|
1109
|
-
let ee = (i) => Object.prototype.toString.call(i) === "[object Object]";
|
|
1110
|
-
function te(i, t) {
|
|
1111
|
-
let e = Object.keys(i.fields);
|
|
1112
|
-
return Object.keys(t).filter((s) => e.indexOf(s) === -1);
|
|
1113
|
-
}
|
|
1114
|
-
const Me = oe([]);
|
|
1115
|
-
function qe(i) {
|
|
1116
|
-
return new le(i);
|
|
1117
|
-
}
|
|
1118
|
-
class le extends b {
|
|
1119
|
-
constructor(t) {
|
|
1120
|
-
super({
|
|
1121
|
-
type: "object",
|
|
1122
|
-
check(e) {
|
|
1123
|
-
return ee(e) || typeof e == "function";
|
|
1124
|
-
}
|
|
1125
|
-
}), this.fields = /* @__PURE__ */ Object.create(null), this._sortErrors = Me, this._nodes = [], this._excludedEdges = [], this.withMutation(() => {
|
|
1126
|
-
t && this.shape(t);
|
|
1127
|
-
});
|
|
1128
|
-
}
|
|
1129
|
-
_cast(t, e = {}) {
|
|
1130
|
-
var s;
|
|
1131
|
-
let r = super._cast(t, e);
|
|
1132
|
-
if (r === void 0) return this.getDefault(e);
|
|
1133
|
-
if (!this._typeCheck(r)) return r;
|
|
1134
|
-
let a = this.fields, n = (s = e.stripUnknown) != null ? s : this.spec.noUnknown, o = [].concat(this._nodes, Object.keys(r).filter((h) => !this._nodes.includes(h))), l = {}, u = Object.assign({}, e, {
|
|
1135
|
-
parent: l,
|
|
1136
|
-
__validating: e.__validating || !1
|
|
1137
|
-
}), c = !1;
|
|
1138
|
-
for (const h of o) {
|
|
1139
|
-
let p = a[h], v = h in r;
|
|
1140
|
-
if (p) {
|
|
1141
|
-
let w, g = r[h];
|
|
1142
|
-
u.path = (e.path ? `${e.path}.` : "") + h, p = p.resolve({
|
|
1143
|
-
value: g,
|
|
1144
|
-
context: e.context,
|
|
1145
|
-
parent: l
|
|
1146
|
-
});
|
|
1147
|
-
let _ = p instanceof b ? p.spec : void 0, $ = _ == null ? void 0 : _.strict;
|
|
1148
|
-
if (_ != null && _.strip) {
|
|
1149
|
-
c = c || h in r;
|
|
1150
|
-
continue;
|
|
1151
|
-
}
|
|
1152
|
-
w = !e.__validating || !$ ? (
|
|
1153
|
-
// TODO: use _cast, this is double resolving
|
|
1154
|
-
p.cast(r[h], u)
|
|
1155
|
-
) : r[h], w !== void 0 && (l[h] = w);
|
|
1156
|
-
} else v && !n && (l[h] = r[h]);
|
|
1157
|
-
(v !== h in l || l[h] !== r[h]) && (c = !0);
|
|
1158
|
-
}
|
|
1159
|
-
return c ? l : r;
|
|
1160
|
-
}
|
|
1161
|
-
_validate(t, e = {}, s, r) {
|
|
1162
|
-
let {
|
|
1163
|
-
from: a = [],
|
|
1164
|
-
originalValue: n = t,
|
|
1165
|
-
recursive: o = this.spec.recursive
|
|
1166
|
-
} = e;
|
|
1167
|
-
e.from = [{
|
|
1168
|
-
schema: this,
|
|
1169
|
-
value: n
|
|
1170
|
-
}, ...a], e.__validating = !0, e.originalValue = n, super._validate(t, e, s, (l, u) => {
|
|
1171
|
-
if (!o || !ee(u)) {
|
|
1172
|
-
r(l, u);
|
|
1173
|
-
return;
|
|
1174
|
-
}
|
|
1175
|
-
n = n || u;
|
|
1176
|
-
let c = [];
|
|
1177
|
-
for (let h of this._nodes) {
|
|
1178
|
-
let p = this.fields[h];
|
|
1179
|
-
!p || T.isRef(p) || c.push(p.asNestedTest({
|
|
1180
|
-
options: e,
|
|
1181
|
-
key: h,
|
|
1182
|
-
parent: u,
|
|
1183
|
-
parentPath: e.path,
|
|
1184
|
-
originalParent: n
|
|
1185
|
-
}));
|
|
1186
|
-
}
|
|
1187
|
-
this.runTests({
|
|
1188
|
-
tests: c,
|
|
1189
|
-
value: u,
|
|
1190
|
-
originalValue: n,
|
|
1191
|
-
options: e
|
|
1192
|
-
}, s, (h) => {
|
|
1193
|
-
r(h.sort(this._sortErrors).concat(l), u);
|
|
1194
|
-
});
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1197
|
-
clone(t) {
|
|
1198
|
-
const e = super.clone(t);
|
|
1199
|
-
return e.fields = Object.assign({}, this.fields), e._nodes = this._nodes, e._excludedEdges = this._excludedEdges, e._sortErrors = this._sortErrors, e;
|
|
1200
|
-
}
|
|
1201
|
-
concat(t) {
|
|
1202
|
-
let e = super.concat(t), s = e.fields;
|
|
1203
|
-
for (let [r, a] of Object.entries(this.fields)) {
|
|
1204
|
-
const n = s[r];
|
|
1205
|
-
s[r] = n === void 0 ? a : n;
|
|
1206
|
-
}
|
|
1207
|
-
return e.withMutation((r) => (
|
|
1208
|
-
// XXX: excludes here is wrong
|
|
1209
|
-
r.setFields(s, [...this._excludedEdges, ...t._excludedEdges])
|
|
1210
|
-
));
|
|
1211
|
-
}
|
|
1212
|
-
_getDefault(t) {
|
|
1213
|
-
if ("default" in this.spec)
|
|
1214
|
-
return super._getDefault(t);
|
|
1215
|
-
if (!this._nodes.length)
|
|
1216
|
-
return;
|
|
1217
|
-
let e = {};
|
|
1218
|
-
return this._nodes.forEach((s) => {
|
|
1219
|
-
var r;
|
|
1220
|
-
const a = this.fields[s];
|
|
1221
|
-
let n = t;
|
|
1222
|
-
(r = n) != null && r.value && (n = Object.assign({}, n, {
|
|
1223
|
-
parent: n.value,
|
|
1224
|
-
value: n.value[s]
|
|
1225
|
-
})), e[s] = a && "getDefault" in a ? a.getDefault(n) : void 0;
|
|
1226
|
-
}), e;
|
|
1227
|
-
}
|
|
1228
|
-
setFields(t, e) {
|
|
1229
|
-
let s = this.clone();
|
|
1230
|
-
return s.fields = t, s._nodes = ze(t, e), s._sortErrors = oe(Object.keys(t)), e && (s._excludedEdges = e), s;
|
|
1231
|
-
}
|
|
1232
|
-
shape(t, e = []) {
|
|
1233
|
-
return this.clone().withMutation((s) => {
|
|
1234
|
-
let r = s._excludedEdges;
|
|
1235
|
-
return e.length && (Array.isArray(e[0]) || (e = [e]), r = [...s._excludedEdges, ...e]), s.setFields(Object.assign(s.fields, t), r);
|
|
1236
|
-
});
|
|
1237
|
-
}
|
|
1238
|
-
partial() {
|
|
1239
|
-
const t = {};
|
|
1240
|
-
for (const [e, s] of Object.entries(this.fields))
|
|
1241
|
-
t[e] = "optional" in s && s.optional instanceof Function ? s.optional() : s;
|
|
1242
|
-
return this.setFields(t);
|
|
1243
|
-
}
|
|
1244
|
-
deepPartial() {
|
|
1245
|
-
return V(this);
|
|
1246
|
-
}
|
|
1247
|
-
pick(t) {
|
|
1248
|
-
const e = {};
|
|
1249
|
-
for (const s of t)
|
|
1250
|
-
this.fields[s] && (e[s] = this.fields[s]);
|
|
1251
|
-
return this.setFields(e, this._excludedEdges.filter(([s, r]) => t.includes(s) && t.includes(r)));
|
|
1252
|
-
}
|
|
1253
|
-
omit(t) {
|
|
1254
|
-
const e = [];
|
|
1255
|
-
for (const s of Object.keys(this.fields))
|
|
1256
|
-
t.includes(s) || e.push(s);
|
|
1257
|
-
return this.pick(e);
|
|
1258
|
-
}
|
|
1259
|
-
from(t, e, s) {
|
|
1260
|
-
let r = k.getter(t, !0);
|
|
1261
|
-
return this.transform((a) => {
|
|
1262
|
-
if (!a) return a;
|
|
1263
|
-
let n = a;
|
|
1264
|
-
return Ie(a, t) && (n = Object.assign({}, a), s || delete n[t], n[e] = r(a)), n;
|
|
1265
|
-
});
|
|
1266
|
-
}
|
|
1267
|
-
/** Parse an input JSON string to an object */
|
|
1268
|
-
json() {
|
|
1269
|
-
return this.transform(Pe);
|
|
1270
|
-
}
|
|
1271
|
-
/**
|
|
1272
|
-
* Similar to `noUnknown` but only validates that an object is the right shape without stripping the unknown keys
|
|
1273
|
-
*/
|
|
1274
|
-
exact(t) {
|
|
1275
|
-
return this.test({
|
|
1276
|
-
name: "exact",
|
|
1277
|
-
exclusive: !0,
|
|
1278
|
-
message: t || C.exact,
|
|
1279
|
-
test(e) {
|
|
1280
|
-
if (e == null) return !0;
|
|
1281
|
-
const s = te(this.schema, e);
|
|
1282
|
-
return s.length === 0 || this.createError({
|
|
1283
|
-
params: {
|
|
1284
|
-
properties: s.join(", ")
|
|
1285
|
-
}
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
});
|
|
1289
|
-
}
|
|
1290
|
-
stripUnknown() {
|
|
1291
|
-
return this.clone({
|
|
1292
|
-
noUnknown: !0
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
noUnknown(t = !0, e = C.noUnknown) {
|
|
1296
|
-
typeof t != "boolean" && (e = t, t = !0);
|
|
1297
|
-
let s = this.test({
|
|
1298
|
-
name: "noUnknown",
|
|
1299
|
-
exclusive: !0,
|
|
1300
|
-
message: e,
|
|
1301
|
-
test(r) {
|
|
1302
|
-
if (r == null) return !0;
|
|
1303
|
-
const a = te(this.schema, r);
|
|
1304
|
-
return !t || a.length === 0 || this.createError({
|
|
1305
|
-
params: {
|
|
1306
|
-
unknown: a.join(", ")
|
|
1307
|
-
}
|
|
1308
|
-
});
|
|
1309
|
-
}
|
|
1310
|
-
});
|
|
1311
|
-
return s.spec.noUnknown = t, s;
|
|
1312
|
-
}
|
|
1313
|
-
unknown(t = !0, e = C.noUnknown) {
|
|
1314
|
-
return this.noUnknown(!t, e);
|
|
1315
|
-
}
|
|
1316
|
-
transformKeys(t) {
|
|
1317
|
-
return this.transform((e) => {
|
|
1318
|
-
if (!e) return e;
|
|
1319
|
-
const s = {};
|
|
1320
|
-
for (const r of Object.keys(e)) s[t(r)] = e[r];
|
|
1321
|
-
return s;
|
|
1322
|
-
});
|
|
1323
|
-
}
|
|
1324
|
-
camelCase() {
|
|
1325
|
-
return this.transformKeys(q.camelCase);
|
|
1326
|
-
}
|
|
1327
|
-
snakeCase() {
|
|
1328
|
-
return this.transformKeys(q.snakeCase);
|
|
1329
|
-
}
|
|
1330
|
-
constantCase() {
|
|
1331
|
-
return this.transformKeys((t) => q.snakeCase(t).toUpperCase());
|
|
1332
|
-
}
|
|
1333
|
-
describe(t) {
|
|
1334
|
-
const e = (t ? this.resolve(t) : this).clone(), s = super.describe(t);
|
|
1335
|
-
s.fields = {};
|
|
1336
|
-
for (const [a, n] of Object.entries(e.fields)) {
|
|
1337
|
-
var r;
|
|
1338
|
-
let o = t;
|
|
1339
|
-
(r = o) != null && r.value && (o = Object.assign({}, o, {
|
|
1340
|
-
parent: o.value,
|
|
1341
|
-
value: o.value[a]
|
|
1342
|
-
})), s.fields[a] = n.describe(o);
|
|
1343
|
-
}
|
|
1344
|
-
return s;
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
qe.prototype = le.prototype;
|
|
1348
|
-
export {
|
|
1349
|
-
L as DateSchema,
|
|
1350
|
-
le as ObjectSchema,
|
|
1351
|
-
b as Schema,
|
|
1352
|
-
ne as StringSchema,
|
|
1353
|
-
m as ValidationError,
|
|
1354
|
-
we as getIn,
|
|
1355
|
-
Z as isSchema,
|
|
1356
|
-
qe as object,
|
|
1357
|
-
E as printValue,
|
|
1358
|
-
Ce as string
|
|
1359
|
-
};
|