import { defineComponent as V, useCssVars as S, ref as c, onMounted as T, createElementBlock as f, openBlock as b, createVNode as D, unref as C, normalizeStyle as B, withCtx as N, createElementVNode as i, createCommentVNode as w, Fragment as g } from "vue";
import R from "@vuepic/vue-datepicker";
import { nanoid as O } from "nanoid";
import e from "dayjs";
import "dayjs/locale/zh-cn";
import H from "dayjs/plugin/relativeTime";
import { useDatePickerWatch as I } from "./hooks/useDatePickerWatch.mjs";
import "../../../../text-text-basic/index.mjs";
import "../../../../text-table-basic/index.mjs";
import "../../../../chart-other-gauge/index.mjs";
import "../../../../chart-other-gauge-stage/index.mjs";
import "../../../../chart-other-gauge-grade/index.mjs";
import "../../../../chart-other-word-cloud/index.mjs";
import "../../../../chart-other-liquidfill/index.mjs";
import "../../../../chart-other-funnel/index.mjs";
import "../../../../chart-other-force/index.mjs";
import "../../../../chart-other-radar/index.mjs";
import "../../../../chart-other-funnel-split/index.mjs";
import "../../../../chart-other-funnel-contrast/index.mjs";
import "../../../../chart-other-candlestick-basic/index.mjs";
import "../../../../chart-other-candlestick-shanghai/index.mjs";
import "../../../../chart-other-candlestick-demo/index.mjs";
import "../../../../chart-other-heatmap/index.mjs";
import "../../../../chart-other-force2/index.mjs";
import "../../../../chart-other-graph-basic/index.mjs";
import "../../../../chart-other-graph-basic2/index.mjs";
import "../../../../chart-other-graph-calendar/index.mjs";
import "../../../../chart-other-tree-line/index.mjs";
import "../../../../chart-other-treemap-basic/index.mjs";
import "../../../../chart-other-sunburst-basic/index.mjs";
import "../../../../chart-other-sunburst-basic2/index.mjs";
import "../../../../chart-other-sunburst-basic3/index.mjs";
import "../../../../chart-other-sunburst-basic4/index.mjs";
import "../../../../chart-other-sunburst-book/index.mjs";
import "../../../../chart-other-sunburst-radius/index.mjs";
import "../../../../chart-other-sunburst-flavors/index.mjs";
import "../../../../chart-other-parallel-basic/index.mjs";
import "../../../../chart-other-parallel-mul/index.mjs";
import "../../../../chart-other-circular-graph/index.mjs";
import "../../../../map-earth-basic/index.mjs";
import "../../../../map-earth-cool-tech/index.mjs";
import "../../../../map-earth-particle/index.mjs";
import "../../../../map-earth-hacker/index.mjs";
import "../../../../map-earth-fly-line/index.mjs";
import "../../../../chart-other-grid-percentage/index.mjs";
import "../../../../chart-other-radar-stack/index.mjs";
import "../../../../chart-other-funnel2/index.mjs";
import "../../../../chart-other-label-gauge/index.mjs";
import "../../../../chart-other-theme-river/index.mjs";
import "../../../../chart-other-tree/index.mjs";
import "../../../../chart-other-treemap/index.mjs";
import "../../../../commons-product-model/index.mjs";
import "../../../../commons-vr-photo/index.mjs";
import "../../../../commons-vr-video/index.mjs";
import "../../../../commons-three-loader/index.mjs";
import "../../../../commons-three-loader3/index.mjs";
import "../../../../commons-loop-iterator/index.mjs";
import "../../../../commons-gaussian-splatting-view/index.mjs";
import "../../../../commons-babylon/index.mjs";
import "../../../../commons-svg/index.mjs";
import "../../../../commons-weather/index.mjs";
import "../../../../commons-weather-dynamic/index.mjs";
import "../../../../media-wavesurfer/index.mjs";
import "../../../../interaction-tabs/index.mjs";
import "../../../../interaction-tabs2/index.mjs";
import "../../../../interaction-button/index.mjs";
import "../../../../interaction-button-image/index.mjs";
import "../../../../interaction-select/index.mjs";
import "../../../../interaction-input/index.mjs";
import "../../../../interaction-radio/index.mjs";
import "../../../../interaction-slider/index.mjs";
import "../../../../interaction-switch/index.mjs";
import "../../../../interaction-data-picker/index.mjs";
import "../../../../interaction-button-refresh/index.mjs";
import "../../../../media-image/index.mjs";
import "../../../../text-title/index.mjs";
import "../../../../commons-qrcode/index.mjs";
import "../../../../media-video/index.mjs";
import "../../../../media-audio/index.mjs";
import "../../../../text-real-time/index.mjs";
import "../../../../media-carousel/index.mjs";
import "../../../../media-carousel-slides/index.mjs";
import "../../../../media-iframe-carousel/index.mjs";
import "../../../../media-iframe/index.mjs";
import "../../../../media-m3u8/index.mjs";
import "../../../../media-m3u8-dynamic/index.mjs";
import "../../../../media-audio-dynamic/index.mjs";
import "../../../../media-video-dynamic/index.mjs";
import "../../../../media-image-dynamic/index.mjs";
import "../../../../media-iframe-dynamic/index.mjs";
import "../../../../media-flv/index.mjs";
import "../../../../commons-echarts/index.mjs";
import "../../../../text-over-number/index.mjs";
import "../../../../text-table-scroll/index.mjs";
import "../../../../text-carousel/index.mjs";
import "../../../../text-row-scroll/index.mjs";
import "../../../../text-text-dynamic/index.mjs";
import "../../../../text-count-down/index.mjs";
import "../../../../graphical-circle/index.mjs";
import "../../../../graphical-diamond/index.mjs";
import "../../../../graphical-hexagon/index.mjs";
import "../../../../graphical-isosceles-triangle/index.mjs";
import "../../../../graphical-pentagon/index.mjs";
import "../../../../graphical-rect/index.mjs";
import "../../../../graphical-right-triangle/index.mjs";
import "../../../../scene-map3d/index.mjs";
import "../../../../scene-amap2d/index.mjs";
import "../../../../scene-amap3d/index.mjs";
import "../../../../scene-vr/index.mjs";
import "../../../../scene-unity-iframe/index.mjs";
import "../../../../scene-unity-webgl/index.mjs";
import "../../../../scene-ue-iframe/index.mjs";
import "../../../../scene-ue-shj/index.mjs";
import "../../../../scene-default/index.mjs";
import "../../../tabs/index.mjs";
import "../../../tabs-icon/index.mjs";
import "../../../button/index.mjs";
import "../../src/date-picker/index.mjs";
import "../../src/date-picker-range/index.mjs";
import "../../../../text/list/index.mjs";
import "../../../../chart/src/bar/basic/index.mjs";
import "../../../../chart/src/bar/animation/index.mjs";
import "../../../../chart/src/bar/contrast/index.mjs";
import "../../../../chart/src/bar/contrast2/index.mjs";
import "../../../../chart/src/bar/contrast3/index.mjs";
import "../../../../chart/src/bar/gradient-column-chart/index.mjs";
import "../../../../chart/src/bar/horizontal/index.mjs";
import "../../../../chart/src/bar/horizontal-stack/index.mjs";
import "../../../../chart/src/bar/line-bar/index.mjs";
import "../../../../chart/src/bar/line-bar2/index.mjs";
import "../../../../chart/src/bar/loop/index.mjs";
import "../../../../chart/src/bar/mini/index.mjs";
import "../../../../chart/src/bar/polar/index.mjs";
import "../../../../chart/src/bar/polar-stack/index.mjs";
import "../../../../chart/src/bar/polar2/index.mjs";
import "../../../../chart/src/bar/radius-circle/index.mjs";
import "../../../../chart/src/bar/rank/index.mjs";
import "../../../../chart/src/bar/segmented-progress/index.mjs";
import "../../../../chart/src/bar/spire/index.mjs";
import "../../../../chart/src/bar/stack/index.mjs";
import "../../../../chart/src/bar/stack-line/index.mjs";
import "../../../../chart/src/bar/stack2/index.mjs";
import "../../../../chart/src/bar/stack3/index.mjs";
import "../../../../chart/src/bar/staggered/index.mjs";
import "../../../../chart/src/bar/three/index.mjs";
import "../../../../chart/src/bar/waterfall/index.mjs";
import "../../../../chart/src/bar/zebra/index.mjs";
import "../../../../chart/src/line/area-gradient/index.mjs";
import "../../../../chart/src/line/area-highlight/index.mjs";
import "../../../../chart/src/line/area-highlight2/index.mjs";
import "../../../../chart/src/line/basic/index.mjs";
import "../../../../chart/src/line/bump/index.mjs";
import "../../../../chart/src/line/dashed/index.mjs";
import "../../../../chart/src/line/ladder/index.mjs";
import "../../../../chart/src/line/logarithm/index.mjs";
import "../../../../chart/src/line/multix/index.mjs";
import "../../../../chart/src/line/polar-double/index.mjs";
import "../../../../chart/src/line/rain-flow/index.mjs";
import "../../../../chart/src/line/scale/index.mjs";
import "../../../../chart/src/line/smooth/index.mjs";
import "../../../../chart/src/line/smooth-area/index.mjs";
import "../../../../chart/src/line/stack/index.mjs";
import "../../../../chart/src/line/stack-area/index.mjs";
import "../../../../chart/src/line/temp/index.mjs";
import "../../../../chart/src/line/vertical/index.mjs";
import "../../../../chart/src/map/basic/index.mjs";
import "../../../../chart/src/map/bmap-basic/index.mjs";
import "../../../../chart/src/map/bmap-heatmap/index.mjs";
import "../../../../chart/src/map/bmap-rich/index.mjs";
import "../../../../chart/src/map/customize/index.mjs";
import "../../../../chart/src/map/lines/index.mjs";
import "../../../../chart/src/map/scatter/index.mjs";
import "../../../../chart/src/pie/3d/index.mjs";
import "../../../../chart/src/pie/basic/index.mjs";
import "../../../../chart/src/pie/basic2/index.mjs";
import "../../../../chart/src/pie/customized/index.mjs";
import "../../../../chart/src/pie/index/index.mjs";
import "../../../../chart/src/pie/interval/index.mjs";
import "../../../../chart/src/pie/legend-scroll/index.mjs";
import "../../../../chart/src/pie/radius/index.mjs";
import "../../../../chart/src/pie/rose/index.mjs";
import "../../../../chart/src/pie/round/index.mjs";
import "../../../../chart/src/pie/sunburst/index.mjs";
import "../../../../chart/src/scatter/basic/index.mjs";
import "../../../../chart/src/scatter/basic2/index.mjs";
import "../../../../chart/src/scatter/bubble/index.mjs";
import "../../../../chart/src/scatter/ripples/index.mjs";
import "../../../../commons/custom-component-render/index.mjs";
import "../../../../hj-componets/zv-hj-tree-list/index.mjs";
import "../../../../hj-componets/zv-hj-model-resource/index.mjs";
import "../../../../hj-componets/zv-hj-one-map-config/index.mjs";
import "../../../../hj-componets/zv-hj-video-control/index.mjs";
import "../../../../hj-componets/zv-hj-video-page/index.mjs";
import "../../../../hj-componets/zv-hj-password-input/index.mjs";
import "../../../../hj-componets/zv-hj-carousel/index.mjs";
import "../../../../hj-componets/zv-hj-video-monitor/index.mjs";
import "../../../../hj-componets/zv-hj-scene-amap2d/index.mjs";
import "../../../../hj-componets/zv-hj-scene-amap3d/index.mjs";
import "../../../../hj-componets/zv-hj-person-face/index.mjs";
import "../../../../hj-componets/zv-hj-resource-type-phone/index.mjs";
import "../../../../hj-componets/zv-hj-tree-list-phone/index.mjs";
import "../../../../hj-componets/zv-hj-video-page-phone/index.mjs";
import "../../../../hj-componets/zv-hj-model-resource-phone/index.mjs";
import "../../../../hj-componets/zv-hj-bottom-suspend/index.mjs";
import "../../../../hj-componets/zv-hj-pagination/index.mjs";
import "../../../../hj-componets/zv-hj-password-input-phone/index.mjs";
/* empty css                                 */
/* empty css                                        */
import { SHJDatasourceV2 as j } from "../../../../../plugins/datasource/index.mjs";
import { SHJParseEvent as d } from "../../../../../plugins/event/index.mjs";
import "lodash";
import { Utils as q } from "../../../../../commons/utils/utils.mjs";
import "@vuepic/vue-datepicker/dist/main.css";
const z = { class: "left-sidebar" }, qr = /* @__PURE__ */ V({
  __name: "index",
  props: {
    option: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  emits: ["on-change", "on-complete"],
  setup($, { expose: E, emit: P }) {
    S((o) => ({
      "681ba034": o.option.css.dp.backgroundColor,
      "61f5c807": o.option.css.dp.textColor,
      cef10854: o.option.css.dp.hoverColor,
      "18ca0929": o.option.css.dp.hoverTextColor,
      ab4929e0: o.option.css.dp.primaryColor,
      de991e18: o.option.css.dp.primaryDisabledColor,
      "343fcb63": o.option.css.dp.primaryTextColor,
      "59b2771e": o.option.css.dp.secondaryColor,
      "3f9e1fb0": o.option.css.dp.borderColor,
      "6d2390c9": o.option.css.dp.menuBorderColor,
      dd5c7c18: o.option.css.dp.borderColorHover,
      dd9564e0: o.option.css.dp.borderColorFocus,
      "77db08d0": o.option.css.dp.disabledColor,
      b08e8f36: o.option.css.dp.scrollBarBackground,
      f3b53468: o.option.css.dp.scrollBarColor,
      "74315ca2": o.option.css.dp.successColor,
      "04ced14b": o.option.css.dp.successColorDisabled,
      d6f01ede: o.option.css.dp.dangerColor,
      "38e2a8e5": o.option.css.dp.disabledColorText,
      "837f3844": o.option.css.dp.highlightColor,
      c45f603c: o.option.css.dp.loader,
      "12bd08ff": o.option.css.dp.fontSize,
      "4899598c": o.option.css.dp.inputBackgroundColor,
      e17c81bc: o.option.css.dp.inputHeight
    })), e.extend(H), e.locale("zh-cn");
    const s = $, l = P, r = c(), v = c(O()), y = () => v.value = O(), a = () => {
      j.parse({
        tId: s.uuid,
        sources: s.sources,
        callback: ({ data: o }) => {
          try {
            if (r.value = o[0].data[0].date, s.option.range) {
              const t = {
                data: r.value,
                startTime: r.value[0],
                endTime: r.value[1]
              };
              l("on-complete", t), d.parseEvents(s.useEvents, "on-complete", t);
            } else {
              const t = { data: r.value };
              l("on-complete", t), d.parseEvents(s.useEvents, "on-complete", t);
            }
          } catch {
          }
        }
      });
    };
    T(() => a()), I(s, a, y), E({
      refresh: () => a(),
      refreshView: () => y(),
      refreshData: () => a()
    });
    const k = (o) => {
      if (r.value = o, s.option.range) {
        const n = {
          data: r.value,
          startTime: r.value[0],
          endTime: r.value[1]
        };
        l("on-change", n), d.parseEvents(s.useEvents, "on-change", n);
        return;
      }
      const t = { data: r.value };
      l("on-change", t), d.parseEvents(s.useEvents, "on-change", t);
    }, u = (o) => {
      o === "today" ? r.value = e() : o === "yesterday" ? r.value = e().subtract(1, "day") : o === "before-yesterday" && (r.value = e().subtract(2, "day"));
    }, m = (o) => {
      o === "today" ? r.value = [e().startOf("day"), e().endOf("day")] : o === "yesterday" ? r.value = [e().subtract(1, "day").startOf("day"), e().subtract(1, "day").endOf("day")] : o === "before-yesterday" ? r.value = [e().subtract(2, "day").startOf("day"), e().subtract(2, "day").endOf("day")] : o === "week" ? r.value = [e().startOf("week"), e().endOf("week")] : o === "last-month" ? r.value = [e().subtract(1, "month").startOf("month"), e().subtract(1, "month").endOf("month")] : o === "month" ? r.value = [e().startOf("month"), e().endOf("month")] : o === "last-7" ? r.value = [e().subtract(7, "day").startOf("day"), e().endOf("day")] : o === "last-15" ? r.value = [e().subtract(15, "day").startOf("day"), e().endOf("day")] : o === "last-30" ? r.value = [e().subtract(30, "day").startOf("day"), e().endOf("day")] : o === "last-365" && (r.value = [e().subtract(365, "day").startOf("day"), e().endOf("day")]), k(r.value);
    };
    return (o, t) => (b(), f("div", {
      key: v.value,
      class: "date-picker"
    }, [
      D(C(R), {
        modelValue: r.value,
        "onUpdate:modelValue": [
          t[13] || (t[13] = (n) => r.value = n),
          k
        ],
        range: o.option.range,
        "multi-calendars": o.option.multiCalendars,
        "month-picker": o.option.monthPicker,
        "time-picker": o.option.timePicker,
        "year-picker": o.option.yearPicker,
        "week-picker": o.option.weekPicker,
        "quarter-picker": o.option.quarterPicker,
        inline: o.option.inline,
        "auto-apply": o.option.autoApply,
        clearable: o.option.clearable,
        placeholder: o.option.placeholder,
        disabled: o.option.disabled,
        readonly: o.option.readonly,
        "action-row": {
          showNow: o.option.actionRow.showNow,
          showPreview: o.option.actionRow.showPreview,
          showSelect: o.option.actionRow.showSelect,
          showCancel: o.option.actionRow.showCancel
        },
        "disable-year-select": o.option.disableYearSelect,
        "enable-time-picker": o.option.enableTimePicker,
        "enable-seconds": o.option.enableSeconds,
        "time-picker-inline": o.option.timePickerInline,
        "now-button-label": o.option.nowButtonLabel,
        "cancel-text": o.option.cancelText,
        "select-text": o.option.selectText,
        "hide-input-icon": o.option.hideInputIcon,
        class: "date-picker-container",
        style: B(C(q).json2cssObject(o.option.css.dp, "dp"))
      }, {
        "left-sidebar": N((n) => [
          i("div", z, [
            o.option.range ? w("", !0) : (b(), f(g, { key: 0 }, [
              i("div", {
                class: "left-sidebar-item",
                onClick: t[0] || (t[0] = (p) => u("today"))
              }, t[14] || (t[14] = [
                i("span", null, "今天", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[1] || (t[1] = (p) => u("yesterday"))
              }, t[15] || (t[15] = [
                i("span", null, "昨天", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[2] || (t[2] = (p) => u("before-yesterday"))
              }, t[16] || (t[16] = [
                i("span", null, "前天", -1)
              ]))
            ], 64)),
            o.option.range ? (b(), f(g, { key: 1 }, [
              i("div", {
                class: "left-sidebar-item",
                onClick: t[3] || (t[3] = (p) => m("today"))
              }, t[17] || (t[17] = [
                i("span", null, "今日", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[4] || (t[4] = (p) => m("yesterday"))
              }, t[18] || (t[18] = [
                i("span", null, "昨日", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[5] || (t[5] = (p) => m("before-yesterday"))
              }, t[19] || (t[19] = [
                i("span", null, "前天", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[6] || (t[6] = (p) => m("week"))
              }, t[20] || (t[20] = [
                i("span", null, "本周", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[7] || (t[7] = (p) => m("last-month"))
              }, t[21] || (t[21] = [
                i("span", null, "上一月", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[8] || (t[8] = (p) => m("month"))
              }, t[22] || (t[22] = [
                i("span", null, "本月", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[9] || (t[9] = (p) => m("last-7"))
              }, t[23] || (t[23] = [
                i("span", null, "近7天", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[10] || (t[10] = (p) => m("last-15"))
              }, t[24] || (t[24] = [
                i("span", null, "近15天", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[11] || (t[11] = (p) => m("last-30"))
              }, t[25] || (t[25] = [
                i("span", null, "近30天", -1)
              ])),
              i("div", {
                class: "left-sidebar-item",
                onClick: t[12] || (t[12] = (p) => m("last-365"))
              }, t[26] || (t[26] = [
                i("span", null, "近365天", -1)
              ]))
            ], 64)) : w("", !0)
          ])
        ]),
        _: 1
      }, 8, ["modelValue", "range", "multi-calendars", "month-picker", "time-picker", "year-picker", "week-picker", "quarter-picker", "inline", "auto-apply", "clearable", "placeholder", "disabled", "readonly", "action-row", "disable-year-select", "enable-time-picker", "enable-seconds", "time-picker-inline", "now-button-label", "cancel-text", "select-text", "hide-input-icon", "style"])
    ]));
  }
});
export {
  qr as default
};
