import { a3 as i, am as d, H as a, cC as h, cS as r, c5 as m, cj as o, ck as c, fr as s, fq as f } from "./56c67d3b.js";
import { getStyle as x, disabledDate as D } from "./85fb0bcf.js";
import { useUIView as u } from "./4cac7a5d.js";
import S, { useContext as g } from "react";
import { timeZoneOptions as y } from "./381f866e.js";
import "react-dom";
const {
  RangePicker: C
} = f, w = i(C)`
  width: 100%;
  box-shadow: ${(e) => `${e.$style.boxShadow} ${e.$style.boxShadowColor}`};
  ${(e) => e.$style && x(e.$style)}
`, I = i(s)`
  width: 400px; 
  margin: 10px 0px;
  .ant-select-selector {
    font-size: 14px;
    line-height: 1.5;
  }
`, R = i.div`
  text-align: center;
`, b = S.lazy(() => import("./ee976bb7.js").then((e) => ({
  default: e.DateRangeMobileUIView
}))), A = (e) => {
  const n = g(d);
  let l;
  return Array.isArray(e.placeholder) ? l = e.placeholder : l = [e.placeholder || "Start Date", e.placeholder || "End Date"], u(/* @__PURE__ */ a(b, {
    ...e
  }), /* @__PURE__ */ a(w, {
    ...h.omit(e, "onChange", "format"),
    ref: e.viewRef,
    value: [e.start, e.end],
    disabledDate: (t) => D(t, e.minDate, e.maxDate),
    onCalendarChange: (t) => {
      e.onChange(t == null ? void 0 : t[0], t == null ? void 0 : t[1]);
    },
    inputReadOnly: r(n == null ? void 0 : n.getAppSettings().maxWidth),
    suffixIcon: m(e.suffixIcon) && e.suffixIcon,
    placeholder: l,
    minDate: e.minDate ? o(e.minDate, c) : void 0,
    maxDate: e.maxDate ? o(e.maxDate, c) : void 0,
    hourStep: e.hourStep,
    minuteStep: e.minuteStep,
    secondStep: e.secondStep,
    renderExtraFooter: () => e.timeZone === "UserChoice" && /* @__PURE__ */ a(R, {
      children: /* @__PURE__ */ a(I, {
        options: y.filter((t) => t.value !== "UserChoice"),
        placeholder: "Select Time Zone",
        defaultValue: Intl.DateTimeFormat().resolvedOptions().timeZone,
        onChange: e == null ? void 0 : e.onClickDateRangeTimeZone
      })
    })
  }));
};
export {
  A as DateRangeUIView
};
