import { b9 as C, P as g, V as a, dx as u, a0 as s, gp as w, bQ as f, dw as b, ho as M, c9 as d } from "./684d2f28.js";
import { getMobileStyle as T } from "./f2000b8a.js";
import { a as k } from "./6a1a7a3c.js";
import "react";
import "react-dom";
import "./d6402597.js";
const I = (e = 1) => [...d.range(0, 24, e).map((t) => {
  const n = (t < 10 ? "0" : "") + t;
  return {
    label: n,
    value: n
  };
})], $ = (e = 1) => [...d.range(0, 12, e).map((t) => {
  const n = (t < 10 ? "0" : "") + t;
  return {
    label: n,
    value: n
  };
})], h = (e = 1) => d.range(0, 60, e).map((t) => {
  const n = (t < 10 ? "0" : "") + t;
  return {
    label: n,
    value: n
  };
}), j = [{
  label: "AM",
  value: "am"
}, {
  label: "PM",
  value: "pm"
}], r = async (e) => {
  const t = (await import("./5933aeef.js").then((l) => l.i)).default, {
    disabledHours: n,
    disabledMinutes: y,
    disabledSeconds: x
  } = e.disabledTime();
  t.prompt({
    getContainer: () => document.querySelector(`#${w}`) || document.body,
    mouseWheel: !0,
    destroyOnClose: !0,
    closeOnMaskClick: !0,
    columns: (l) => {
      const i = f(l.join(":"), b);
      return [(e.use12Hours ? $ : I)(e.hourStep).filter(({
        label: m,
        value: o
      }) => !n().includes(Number(o) + (l[3] === "pm" ? 12 : 0))), h(e.minuteStep).filter(({
        label: m,
        value: o
      }) => !y(i.hour()).includes(Number(o))), h(e.secondStep).filter(({
        label: m,
        value: o
      }) => !x(i.hour(), i.minute()).includes(Number(o))), ...e.use12Hours ? [j] : []];
    },
    defaultValue: e.value ? e.value.format(e.use12Hours ? M : u).split(":") : void 0,
    onConfirm: (l) => {
      const i = f(l.join(":"), b);
      e.onChange(i);
    },
    onClose: e.onBlur
  }), e.onFocus();
}, v = C.div`
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background-color: #ffffff;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #d7d9e0;

  ${(e) => e.$style && T(e.$style)}
`, c = C.div`
  overflow: hidden;
  white-space: nowrap;
  flex-grow: 1;
  display: flex;
  justify-content: center;
`, A = (e) => /* @__PURE__ */ g(v, {
  ref: e.viewRef,
  $style: e.$style,
  onClick: () => {
    r(e);
  },
  children: [/* @__PURE__ */ a(c, {
    children: e.value ? e.value.format(e.format || u) : s("time.placeholder")
  }), e.suffixIcon]
}), E = (e) => /* @__PURE__ */ g(v, {
  ref: e.viewRef,
  $style: e.$style,
  children: [/* @__PURE__ */ a(c, {
    onClick: () => r({
      ...e,
      value: e.start,
      onChange: (t) => e.onChange(t, e.end)
    }),
    children: e.start ? e.start.format(e.format || u) : s("time.startTime")
  }), /* @__PURE__ */ a(k, {}), /* @__PURE__ */ a(c, {
    onClick: () => r({
      ...e,
      value: e.end,
      onChange: (t) => e.onChange(e.start, t)
    }),
    children: e.end ? e.end.format(e.format || u) : s("time.endTime")
  }), e.suffixIcon]
});
export {
  A as TimeMobileUIView,
  E as TimeRangeMobileUIView
};
