import { defineComponent as E, useCssVars as re, ref as C, computed as de, resolveComponent as z, createElementBlock as k, openBlock as c, unref as t, createElementVNode as i, normalizeClass as B, createCommentVNode as u, withDirectives as P, createVNode as g, withCtx as p, withModifiers as r, createTextVNode as $, toDisplayString as H, vShow as M, createBlock as m, Fragment as pe } from "vue";
import ue from "moment";
import { Loading as ge, Refresh as T, CaretTop as fe, CaretLeft as ve, CaretRight as ke, CaretBottom as me, Aim as ye, Back as be } from "@element-plus/icons-vue";
const Ce = ["data-status"], Se = {
  key: 0,
  class: "tip-text"
}, xe = {
  key: 1,
  class: "tip-text"
}, Ie = { class: "event_text" }, De = {
  key: 3,
  class: "tip-text"
}, we = {
  key: 1,
  class: "event_text"
}, Pe = {
  key: 4,
  class: "tip-text"
}, $e = { class: "event_text" }, He = { class: "control_box control_btns" }, Me = ["width", "height"], Oe = {
  key: 5,
  class: "control_box"
}, Ve = { class: "record_text" }, Fe = {
  key: 6,
  class: "tool_top"
}, Re = { class: "video_name" }, _e = { class: "tool_bottom" }, Ue = E({ name: "zv-hj-video-operate" }), Ee = /* @__PURE__ */ E({
  ...Ue,
  props: {
    videoList: {},
    index: {},
    spanStyle: {},
    playType: {},
    fIndex: {},
    sourcePage: {},
    modelIdsSupport: {},
    ctxStyle: {},
    playBackIndexInRealPlay: {},
    basicOption: {}
  },
  emits: ["changeScreen", "recordStart", "recordStop", "stopVideoPlay", "openSound", "closeSound", "talkStop", "talkStart", "enlargeClose", "enlarge", "resetVideoUrl", "resetVideoUrl1", "capture", "changeControl", "changePositionDownHandle", "changePositionUpHandle", "chooseDevice", "changeScale", "scaleDownHandle", "scaleMoveHandle", "scaleUpHandle", "openVideoPlayback", "backRealplay", "collect"],
  setup(L, { expose: N, emit: Y }) {
    re((o) => ({
      "05c0eb2e": s.basicOption.videoConfig.headerConfig.closeConfig.width + "px",
      "06365182": s.basicOption.videoConfig.headerConfig.closeConfig.height + "px",
      "0f1e9400": "url(" + s.basicOption.videoConfig.headerConfig.closeConfig.backgroundImage + ")",
      "3471d14a": s.basicOption.videoConfig.operateConfig.width + "px",
      "1da430b2": s.basicOption.videoConfig.operateConfig.height + "px",
      "0e64c906": "url(" + s.basicOption.videoConfig.operateConfig.mute.backgroundImage + ")",
      "27dc80a0": "url(" + s.basicOption.videoConfig.operateConfig.cancelMute.backgroundImage + ")",
      "15b05d3c": "url(" + s.basicOption.videoConfig.operateConfig.recording.backgroundImage + ")",
      a3038040: "url(" + s.basicOption.videoConfig.operateConfig.stopRecord.backgroundImage + ")",
      "19f22129": "url(" + s.basicOption.videoConfig.operateConfig.cancelSpeak.backgroundImage + ")",
      "0472e583": "url(" + s.basicOption.videoConfig.operateConfig.speak.backgroundImage + ")",
      "37e22285": "url(" + s.basicOption.videoConfig.operateConfig.zoomIn.backgroundImage + ")",
      "03beceec": "url(" + s.basicOption.videoConfig.operateConfig.zoomOut.backgroundImage + ")",
      "175a46b0": "url(" + s.basicOption.videoConfig.operateConfig.playBack.backgroundImage + ")",
      "5e2ae233": "url(" + s.basicOption.videoConfig.operateConfig.screenShot.backgroundImage + ")",
      "43cf545b": "url(" + s.basicOption.videoConfig.operateConfig.collect.backgroundImage + ")",
      b2e3707c: "url(" + s.basicOption.videoConfig.operateConfig.unCollect.backgroundImage + ")"
    }));
    const d = Y, s = L;
    s.videoList;
    const l = s.videoList[s.index], a = s.index;
    s.spanStyle;
    const O = s.playType;
    s.fIndex;
    const S = s.sourcePage;
    s.modelIdsSupport;
    const V = s.ctxStyle, F = C(!1), y = C(null), b = C(0), W = s.playBackIndexInRealPlay, j = de(() => {
      let o = ue("2020-01-01 00:00:00").add(b.value, "s").format("YYYY-MM-DD HH:mm:ss");
      return o = o.split(" ")[1], "REC " + o;
    }), D = C(null), R = C(!1), A = (o) => {
      d("changeScreen", o);
    }, G = (o, e) => {
      d("recordStart", o, e, () => {
        F.value = !0, y.value && (clearInterval(y.value), y.value = null), b.value = 0, y.value = setInterval(() => {
          b.value++;
        }, 1e3);
      });
    }, J = (o) => {
      d("recordStop", o, () => {
        F.value = !1, y.value && (clearInterval(y.value), y.value = null), b.value = 0;
      });
    }, q = (o) => {
      d("stopVideoPlay", o);
    }, K = (o) => {
      d("openSound", o);
    }, Q = (o) => {
      d("closeSound", o);
    }, X = (o) => {
      d("talkStop", o);
    }, Z = (o) => {
      d("talkStart", o);
    }, h = (o) => {
      d("enlargeClose", o);
    }, ee = (o) => {
      d("enlarge", o);
    }, te = (o) => {
      d("resetVideoUrl", o);
    }, _ = (o) => {
      d("resetVideoUrl1", o);
    }, oe = (o, e) => {
      d("capture", o, e);
    }, x = (o, e, v) => {
      d("changePositionDownHandle", o, e, v);
    }, I = (o, e, v) => {
      d("changePositionUpHandle", o, e, v);
    }, w = (o) => {
      d("chooseDevice", o);
    }, ne = (o) => {
      d("changeScale", o);
    }, le = (o, e) => {
      const v = D.value.clientWidth, f = D.value.clientHeight;
      d("scaleDownHandle", v, f, e);
    }, se = (o, e) => {
      d("scaleMoveHandle", o, e);
    }, ae = (o, e) => {
      d("scaleUpHandle", o, e);
    }, ie = (o) => {
      d("openVideoPlayback", o, l.width, l.height);
    }, ce = (o) => {
      d("backRealplay", o);
    }, U = (o, e) => {
      d("collect", o, e);
    };
    return N({
      resetVideoUrl: te
    }), (o, e) => {
      const v = z("el-icon"), f = z("el-tooltip");
      return c(), k("div", {
        ref_key: "containerRef",
        ref: D,
        class: "tool_container"
      }, [
        (c(), k("div", {
          key: t(a),
          class: "tool_item",
          "data-status": t(l).playStatus,
          style: { width: "100%", height: "100%" }
        }, [
          i("div", {
            class: B(["tool_item_content", t(l).zoomFlag ? "active_tool_content" : ""]),
            onDblclick: e[37] || (e[37] = (n) => A(t(a)))
          }, [
            t(l).playStatus == "loading" ? (c(), k("div", Se, [
              g(v, null, {
                default: p(() => [
                  g(t(ge))
                ]),
                _: 1
              })
            ])) : t(l).playStatus == "error" ? (c(), k("div", xe, [
              t(S) == "chart" ? (c(), k("span", {
                key: 0,
                style: { "margin-right": "16px" },
                class: "event_text",
                onClick: e[0] || (e[0] = r((n) => w(t(l).index), ["stop"]))
              }, e[38] || (e[38] = [
                i("i", { class: "el-icon-plus" }, null, -1),
                $(" 添加 ")
              ]))) : u("", !0),
              i("span", {
                class: "event_text",
                onClick: e[1] || (e[1] = r((n) => _(t(a)), ["stop"]))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(T))
                  ]),
                  _: 1
                }),
                $(" " + H(t(l).tipText || "取流失败"), 1)
              ])
            ])) : t(l).playStatus == "playbackEnd" ? (c(), k("div", {
              key: 2,
              class: "tip-text",
              onClick: e[2] || (e[2] = r((n) => _(t(a)), ["stop"]))
            }, [
              i("span", Ie, [
                g(v, null, {
                  default: p(() => [
                    g(t(T))
                  ]),
                  _: 1
                }),
                e[39] || (e[39] = $(" 回放结束"))
              ])
            ])) : t(l).playStatus == "offline" || t(S) == "onepage" && t(l).playStatus == "" ? (c(), k("div", De, [
              t(S) == "chart" ? (c(), k("span", {
                key: 0,
                style: { "margin-right": "16px", opacity: "0.6" },
                class: "event_text",
                onClick: e[3] || (e[3] = r((n) => w(t(l).index), ["stop"]))
              }, e[40] || (e[40] = [
                i("i", { class: "el-icon-plus" }, null, -1)
              ]))) : R.value ? u("", !0) : (c(), k("span", we))
            ])) : t(l).playStatus === "" && t(S) == "chart" ? (c(), k("div", Pe, [
              i("span", $e, [
                i("i", {
                  class: "el-icon-plus",
                  onClick: e[4] || (e[4] = r((n) => w(t(l).index), ["stop"]))
                })
              ])
            ])) : u("", !0),
            P(i("div", He, [
              i("span", {
                class: "btn1",
                onDblclick: e[5] || (e[5] = r(() => {
                }, ["stop"])),
                onMousedown: e[6] || (e[6] = (n) => x(n, t(a), 2)),
                onMouseup: e[7] || (e[7] = (n) => I(n, t(a), 2))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(fe))
                  ]),
                  _: 1
                })
              ], 32),
              i("span", {
                class: "btn2",
                onDblclick: e[8] || (e[8] = r(() => {
                }, ["stop"])),
                onMousedown: e[9] || (e[9] = (n) => x(n, t(a), 0)),
                onMouseup: e[10] || (e[10] = (n) => I(n, t(a), 0))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(ve))
                  ]),
                  _: 1
                })
              ], 32),
              i("span", {
                class: "btn3",
                onDblclick: e[11] || (e[11] = r(() => {
                }, ["stop"])),
                onMousedown: e[12] || (e[12] = (n) => x(n, t(a), 1)),
                onMouseup: e[13] || (e[13] = (n) => I(n, t(a), 1))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(ke))
                  ]),
                  _: 1
                })
              ], 32),
              i("span", {
                class: "btn4",
                onDblclick: e[14] || (e[14] = r(() => {
                }, ["stop"])),
                onMousedown: e[15] || (e[15] = (n) => x(n, t(a), 3)),
                onMouseup: e[16] || (e[16] = (n) => I(n, t(a), 3))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(me))
                  ]),
                  _: 1
                })
              ], 32)
            ], 512), [
              [M, !t(l).playbackInRealplay && t(l).controlFlag && t(l).playStatus == "success"]
            ]),
            P(i("div", {
              class: "control_box",
              onMousedown: e[17] || (e[17] = (n) => le(n, t(a))),
              onMousemove: e[18] || (e[18] = (n) => se(n, t(a))),
              onMouseup: e[19] || (e[19] = (n) => ae(n, t(a))),
              onDblclick: e[20] || (e[20] = r(() => {
              }, ["stop"]))
            }, [
              i("canvas", {
                id: "scale_canvas_box",
                width: t(V).w,
                height: t(V).h
              }, null, 8, Me)
            ], 544), [
              [M, t(l).scale3DFlag && t(l).playStatus == "success"]
            ]),
            t(l).recordFlag && b.value ? (c(), k("div", Oe, [
              i("div", Ve, H(j.value), 1)
            ])) : u("", !0),
            !R.value && (t(l).playStatus == "success" || t(l).playStatus == "error") ? (c(), k("div", Fe, [
              i("span", Re, H(t(l).resourceName), 1),
              s.sourcePage === "onepage" ? (c(), k("span", {
                key: 0,
                id: "closeVideoSpan",
                class: "close_btn",
                onClick: e[21] || (e[21] = r((n) => q(t(a)), ["stop"]))
              })) : u("", !0)
            ])) : u("", !0),
            P(i("div", _e, [
              t(l).collectId && s.sourcePage === "onepage" ? (c(), m(f, {
                key: 0,
                effect: "dark",
                content: "取消收藏",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon collect",
                    onClick: e[22] || (e[22] = r((n) => U(t(a), 0), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              !t(l).collectId && s.sourcePage === "onepage" ? (c(), m(f, {
                key: 1,
                effect: "dark",
                content: "收藏",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon cancel-collect",
                    onClick: e[23] || (e[23] = r((n) => U(t(a), 1), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              t(l).voiceFlag ? (c(), m(f, {
                key: 2,
                effect: "dark",
                content: "关闭声音",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon close-sound",
                    onClick: e[24] || (e[24] = r((n) => Q(t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              t(l).voiceFlag ? u("", !0) : (c(), m(f, {
                key: 3,
                effect: "dark",
                content: "开启声音",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon open-sound",
                    onClick: e[25] || (e[25] = r((n) => K(t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })),
              g(f, {
                effect: "dark",
                content: "抓图",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon screenshot",
                    onClick: e[26] || (e[26] = r((n) => oe("JPEG", t(a)), ["stop"]))
                  })
                ]),
                _: 1
              }),
              t(l).recordFlag ? u("", !0) : (c(), m(f, {
                key: 4,
                effect: "dark",
                content: "开始录像",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon record-start",
                    onClick: e[27] || (e[27] = r((n) => G("MP4", t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })),
              t(l).recordFlag ? (c(), m(f, {
                key: 5,
                effect: "dark",
                content: "结束录像",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon record-stop",
                    onClick: e[28] || (e[28] = r((n) => J(t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              t(O) == "realplay" ? (c(), k(pe, { key: 6 }, [
                u("", !0),
                t(l).talkFlag ? (c(), m(f, {
                  key: 1,
                  effect: "dark",
                  content: "结束对讲",
                  placement: "bottom"
                }, {
                  default: p(() => [
                    i("div", {
                      class: "icon talk-stop",
                      onClick: e[30] || (e[30] = r((n) => X(t(a)), ["stop"]))
                    })
                  ]),
                  _: 1
                })) : u("", !0),
                t(l).talkFlag ? u("", !0) : (c(), m(f, {
                  key: 2,
                  effect: "dark",
                  content: "开始对讲",
                  placement: "bottom"
                }, {
                  default: p(() => [
                    i("div", {
                      class: "icon talk-start",
                      onClick: e[31] || (e[31] = r((n) => Z(t(a)), ["stop"]))
                    })
                  ]),
                  _: 1
                }))
              ], 64)) : u("", !0),
              t(l).zoomFlag ? (c(), m(f, {
                key: 7,
                effect: "dark",
                content: "关闭电子放大",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon zoom-out",
                    onClick: e[32] || (e[32] = r((n) => h(t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              t(l).zoomFlag ? u("", !0) : (c(), m(f, {
                key: 8,
                effect: "dark",
                content: "电子放大",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon zoom-in",
                    onClick: e[33] || (e[33] = r((n) => ee(t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })),
              t(l).controlFlag && t(l).playStatus == "success" ? (c(), m(f, {
                key: 9,
                effect: "dark",
                content: t(l).scale3DFlag ? "关闭3D放大" : "开启3D放大",
                placement: "bottom"
              }, {
                default: p(() => [
                  g(v, {
                    class: B(["el-icon-aim", t(l).scale3DFlag ? "active_btn" : ""]),
                    onClick: e[34] || (e[34] = r((n) => ne(t(a)), ["stop"]))
                  }, {
                    default: p(() => [
                      g(t(ye))
                    ]),
                    _: 1
                  }, 8, ["class"])
                ]),
                _: 1
              }, 8, ["content"])) : u("", !0),
              !t(l).playbackInRealplay && t(O) == "realplay" ? (c(), m(f, {
                key: 10,
                effect: "dark",
                content: "打开录像回放",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon play-back",
                    onClick: e[35] || (e[35] = r((n) => ie(t(a)), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              t(l).playbackInRealplay ? (c(), m(f, {
                key: 11,
                effect: "dark",
                content: "返回",
                placement: "bottom"
              }, {
                default: p(() => [
                  g(v, {
                    onClick: e[36] || (e[36] = r((n) => ce(t(W)), ["stop"]))
                  }, {
                    default: p(() => [
                      g(t(be))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })) : u("", !0)
            ], 512), [
              [M, t(l).playStatus == "success"]
            ])
          ], 34)
        ], 8, Ce))
      ], 512);
    };
  }
});
export {
  Ee as default
};
