import { defineComponent as L, useCssVars as re, ref as S, computed as pe, resolveComponent as B, createElementBlock as k, openBlock as c, unref as t, createElementVNode as i, normalizeClass as T, createCommentVNode as u, withDirectives as P, createVNode as g, withCtx as p, withModifiers as d, createTextVNode as $, toDisplayString as H, vShow as M, createBlock as m, Fragment as ue, pushScopeId as ge, popScopeId as fe } from "vue";
import ve from "moment";
import { Loading as ke, Refresh as E, CaretTop as me, CaretLeft as be, CaretRight as ye, CaretBottom as Ce, Aim as Se, Back as xe } from "@element-plus/icons-vue";
const N = (y) => (ge("data-v-d22fa3bf"), y = y(), fe(), y), Ie = ["data-status"], _e = {
  key: 0,
  class: "tip-text"
}, we = {
  key: 1,
  class: "tip-text"
}, De = /* @__PURE__ */ N(() => /* @__PURE__ */ i("i", { class: "el-icon-plus" }, null, -1)), Pe = { class: "event_text" }, $e = {
  key: 3,
  class: "tip-text"
}, He = /* @__PURE__ */ N(() => /* @__PURE__ */ i("i", { class: "el-icon-plus" }, null, -1)), Me = [
  He
], Oe = {
  key: 1,
  class: "event_text"
}, Ve = {
  key: 4,
  class: "tip-text"
}, Fe = { class: "event_text" }, Re = { class: "control_box control_btns" }, Ue = ["width", "height"], ze = {
  key: 5,
  class: "control_box"
}, Be = { class: "record_text" }, Te = {
  key: 6,
  class: "tool_top"
}, Ee = { class: "video_name" }, Le = { class: "tool_bottom" }, Ne = L({ name: "zv-hj-video-operate" }), je = /* @__PURE__ */ L({
  ...Ne,
  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(y, { expose: Y, emit: h }) {
    re((o) => ({
      "218817d2": a.basicOption.videoConfig.headerConfig.closeConfig.width + "px",
      "5a033f1b": a.basicOption.videoConfig.headerConfig.closeConfig.height + "px",
      "71195fa4": "url(" + a.basicOption.videoConfig.headerConfig.closeConfig.backgroundImage + ")",
      "53852d92": a.basicOption.videoConfig.operateConfig.width + "px",
      "3bf81a56": a.basicOption.videoConfig.operateConfig.height + "px",
      "08ba1faa": "url(" + a.basicOption.videoConfig.operateConfig.mute.backgroundImage + ")",
      ec516778: "url(" + a.basicOption.videoConfig.operateConfig.cancelMute.backgroundImage + ")",
      "0093013e": "url(" + a.basicOption.videoConfig.operateConfig.recording.backgroundImage + ")",
      "10790b84": "url(" + a.basicOption.videoConfig.operateConfig.stopRecord.backgroundImage + ")",
      "115e6bf6": "url(" + a.basicOption.videoConfig.operateConfig.cancelSpeak.backgroundImage + ")",
      "54c8635f": "url(" + a.basicOption.videoConfig.operateConfig.speak.backgroundImage + ")",
      "1b873fae": "url(" + a.basicOption.videoConfig.operateConfig.zoomIn.backgroundImage + ")",
      d6a77470: "url(" + a.basicOption.videoConfig.operateConfig.zoomOut.backgroundImage + ")",
      fdd77d68: "url(" + a.basicOption.videoConfig.operateConfig.playBack.backgroundImage + ")",
      "7fb4a452": "url(" + a.basicOption.videoConfig.operateConfig.screenShot.backgroundImage + ")",
      56866992: "url(" + a.basicOption.videoConfig.operateConfig.collect.backgroundImage + ")",
      "9c0d10c4": "url(" + a.basicOption.videoConfig.operateConfig.unCollect.backgroundImage + ")"
    }));
    const r = h, a = y;
    a.videoList;
    const l = a.videoList[a.index], s = a.index;
    a.spanStyle;
    const O = a.playType;
    a.fIndex;
    const x = a.sourcePage;
    a.modelIdsSupport;
    const V = a.ctxStyle, F = S(!1), b = S(null), C = S(0), W = a.playBackIndexInRealPlay, j = pe(() => {
      let o = ve("2020-01-01 00:00:00").add(C.value, "s").format("YYYY-MM-DD HH:mm:ss");
      return o = o.split(" ")[1], "REC " + o;
    }), w = S(null), R = S(!1), A = (o) => {
      r("changeScreen", o);
    }, G = (o, e) => {
      r("recordStart", o, e, () => {
        F.value = !0, b.value && (clearInterval(b.value), b.value = null), C.value = 0, b.value = setInterval(() => {
          C.value++;
        }, 1e3);
      });
    }, J = (o) => {
      r("recordStop", o, () => {
        F.value = !1, b.value && (clearInterval(b.value), b.value = null), C.value = 0;
      });
    }, q = (o) => {
      r("stopVideoPlay", o);
    }, K = (o) => {
      r("openSound", o);
    }, Q = (o) => {
      r("closeSound", o);
    }, X = (o) => {
      r("talkStop", o);
    }, Z = (o) => {
      r("talkStart", o);
    }, ee = (o) => {
      r("enlargeClose", o);
    }, te = (o) => {
      r("enlarge", o);
    }, oe = (o) => {
      r("resetVideoUrl", o);
    }, U = (o) => {
      r("resetVideoUrl1", o);
    }, ne = (o, e) => {
      r("capture", o, e);
    }, I = (o, e, v) => {
      r("changePositionDownHandle", o, e, v);
    }, _ = (o, e, v) => {
      r("changePositionUpHandle", o, e, v);
    }, D = (o) => {
      r("chooseDevice", o);
    }, le = (o) => {
      r("changeScale", o);
    }, ae = (o, e) => {
      const v = w.value.clientWidth, f = w.value.clientHeight;
      r("scaleDownHandle", v, f, e);
    }, se = (o, e) => {
      r("scaleMoveHandle", o, e);
    }, ie = (o, e) => {
      r("scaleUpHandle", o, e);
    }, ce = (o) => {
      r("openVideoPlayback", o, l.width, l.height);
    }, de = (o) => {
      r("backRealplay", o);
    }, z = (o, e) => {
      r("collect", o, e);
    };
    return Y({
      resetVideoUrl: oe
    }), (o, e) => {
      const v = B("el-icon"), f = B("el-tooltip");
      return c(), k("div", {
        ref_key: "containerRef",
        ref: w,
        class: "tool_container"
      }, [
        (c(), k("div", {
          key: t(s),
          class: "tool_item",
          "data-status": t(l).playStatus,
          style: { width: "100%", height: "100%" }
        }, [
          i("div", {
            class: T(["tool_item_content", t(l).zoomFlag ? "active_tool_content" : ""]),
            onDblclick: e[37] || (e[37] = (n) => A(t(s)))
          }, [
            t(l).playStatus == "loading" ? (c(), k("div", _e, [
              g(v, null, {
                default: p(() => [
                  g(t(ke))
                ]),
                _: 1
              })
            ])) : t(l).playStatus == "error" ? (c(), k("div", we, [
              t(x) == "chart" ? (c(), k("span", {
                key: 0,
                style: { "margin-right": "16px" },
                class: "event_text",
                onClick: e[0] || (e[0] = d((n) => D(t(l).index), ["stop"]))
              }, [
                De,
                $(" 添加 ")
              ])) : u("", !0),
              i("span", {
                class: "event_text",
                onClick: e[1] || (e[1] = d((n) => U(t(s)), ["stop"]))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(E))
                  ]),
                  _: 1
                }),
                $(" " + H(t(l).tipText || "取流失败"), 1)
              ])
            ])) : t(l).playStatus == "playbackEnd" ? (c(), k("div", {
              key: 2,
              class: "tip-text",
              onClick: e[2] || (e[2] = d((n) => U(t(s)), ["stop"]))
            }, [
              i("span", Pe, [
                g(v, null, {
                  default: p(() => [
                    g(t(E))
                  ]),
                  _: 1
                }),
                $(" 回放结束")
              ])
            ])) : t(l).playStatus == "offline" || t(x) == "onepage" && t(l).playStatus == "" ? (c(), k("div", $e, [
              t(x) == "chart" ? (c(), k("span", {
                key: 0,
                style: { "margin-right": "16px", opacity: "0.6" },
                class: "event_text",
                onClick: e[3] || (e[3] = d((n) => D(t(l).index), ["stop"]))
              }, Me)) : R.value ? u("", !0) : (c(), k("span", Oe))
            ])) : t(l).playStatus === "" && t(x) == "chart" ? (c(), k("div", Ve, [
              i("span", Fe, [
                i("i", {
                  class: "el-icon-plus",
                  onClick: e[4] || (e[4] = d((n) => D(t(l).index), ["stop"]))
                })
              ])
            ])) : u("", !0),
            P(i("div", Re, [
              i("span", {
                class: "btn1",
                onDblclick: e[5] || (e[5] = d(() => {
                }, ["stop"])),
                onMousedown: e[6] || (e[6] = (n) => I(n, t(s), 2)),
                onMouseup: e[7] || (e[7] = (n) => _(n, t(s), 2))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(me))
                  ]),
                  _: 1
                })
              ], 32),
              i("span", {
                class: "btn2",
                onDblclick: e[8] || (e[8] = d(() => {
                }, ["stop"])),
                onMousedown: e[9] || (e[9] = (n) => I(n, t(s), 0)),
                onMouseup: e[10] || (e[10] = (n) => _(n, t(s), 0))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(be))
                  ]),
                  _: 1
                })
              ], 32),
              i("span", {
                class: "btn3",
                onDblclick: e[11] || (e[11] = d(() => {
                }, ["stop"])),
                onMousedown: e[12] || (e[12] = (n) => I(n, t(s), 1)),
                onMouseup: e[13] || (e[13] = (n) => _(n, t(s), 1))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(ye))
                  ]),
                  _: 1
                })
              ], 32),
              i("span", {
                class: "btn4",
                onDblclick: e[14] || (e[14] = d(() => {
                }, ["stop"])),
                onMousedown: e[15] || (e[15] = (n) => I(n, t(s), 3)),
                onMouseup: e[16] || (e[16] = (n) => _(n, t(s), 3))
              }, [
                g(v, null, {
                  default: p(() => [
                    g(t(Ce))
                  ]),
                  _: 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) => ae(n, t(s))),
              onMousemove: e[18] || (e[18] = (n) => se(n, t(s))),
              onMouseup: e[19] || (e[19] = (n) => ie(n, t(s))),
              onDblclick: e[20] || (e[20] = d(() => {
              }, ["stop"]))
            }, [
              i("canvas", {
                id: "scale_canvas_box",
                width: t(V).w,
                height: t(V).h
              }, null, 8, Ue)
            ], 544), [
              [M, t(l).scale3DFlag && t(l).playStatus == "success"]
            ]),
            t(l).recordFlag && C.value ? (c(), k("div", ze, [
              i("div", Be, H(j.value), 1)
            ])) : u("", !0),
            !R.value && (t(l).playStatus == "success" || t(l).playStatus == "error") ? (c(), k("div", Te, [
              i("span", Ee, H(t(l).resourceName), 1),
              a.sourcePage === "onepage" ? (c(), k("span", {
                key: 0,
                id: "closeVideoSpan",
                class: "close_btn",
                onClick: e[21] || (e[21] = d((n) => q(t(s)), ["stop"]))
              })) : u("", !0)
            ])) : u("", !0),
            P(i("div", Le, [
              t(l).collectId && a.sourcePage === "onepage" ? (c(), m(f, {
                key: 0,
                effect: "dark",
                content: "取消收藏",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon collect",
                    onClick: e[22] || (e[22] = d((n) => z(t(s), 0), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              !t(l).collectId && a.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] = d((n) => z(t(s), 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] = d((n) => Q(t(s)), ["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] = d((n) => K(t(s)), ["stop"]))
                  })
                ]),
                _: 1
              })),
              g(f, {
                effect: "dark",
                content: "抓图",
                placement: "bottom"
              }, {
                default: p(() => [
                  i("div", {
                    class: "icon screenshot",
                    onClick: e[26] || (e[26] = d((n) => ne("JPEG", t(s)), ["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] = d((n) => G("MP4", t(s)), ["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] = d((n) => J(t(s)), ["stop"]))
                  })
                ]),
                _: 1
              })) : u("", !0),
              t(O) == "realplay" ? (c(), k(ue, { 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] = d((n) => X(t(s)), ["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] = d((n) => Z(t(s)), ["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] = d((n) => ee(t(s)), ["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] = d((n) => te(t(s)), ["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: T(["el-icon-aim", t(l).scale3DFlag ? "active_btn" : ""]),
                    onClick: e[34] || (e[34] = d((n) => le(t(s)), ["stop"]))
                  }, {
                    default: p(() => [
                      g(t(Se))
                    ]),
                    _: 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] = d((n) => ce(t(s)), ["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] = d((n) => de(t(W)), ["stop"]))
                  }, {
                    default: p(() => [
                      g(t(xe))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })) : u("", !0)
            ], 512), [
              [M, t(l).playStatus == "success"]
            ])
          ], 34)
        ], 8, Ie))
      ], 512);
    };
  }
});
export {
  je as default
};
