import { ref as _, reactive as Te, defineComponent as Y, computed as z, openBlock as $, createElementBlock as H, normalizeClass as Z, normalizeStyle as ue, createElementVNode as v, watch as se, onMounted as Oe, unref as f, nextTick as je, resolveComponent as K, createBlock as Q, onUnmounted as Je, withCtx as y, createVNode as m, toDisplayString as S, Fragment as Ke, renderList as He, createTextVNode as P, TransitionGroup as Ze, pushScopeId as Qe, popScopeId as et, createCommentVNode as tt } from "vue";
import { Spin as nt, Row as at, Col as me, Button as k, InputNumber as ot, message as re, Drawer as it } from "ant-design-vue";
import * as ve from "pdfjs-dist";
import { fabric as le } from "fabric";
import rt from "vuedraggable";
import "lodash-es";
import "dayjs";
import lt from "@purge-icons/generated";
const st = {
  pagination: {
    totalItemText: "Total",
    goToText: "Go to"
  },
  accordion: {
    loading: "loading",
    noData: "No Data"
  },
  autoCompleteDropdown: {
    latestInput: "Latest input"
  },
  cascaderList: {
    noData: "No data"
  },
  colorPicker: {
    foundationPanel: "Foundation panel",
    advancedPanel: "Advanced panel"
  },
  datePickerPro: {
    ok: "OK",
    placeholder: "select date",
    month1: "Jan",
    month2: "Feb",
    month3: "Mar",
    month4: "Apr",
    month5: "May",
    month6: "June",
    month7: "July",
    month8: "Aug",
    month9: "Sep",
    month10: "Oct",
    month11: "Nov",
    month12: "Dec",
    year: "年",
    startPlaceholder: "select start date",
    endPlaceholder: "select end date",
    getWeekDays() {
      return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
    },
    getTimeArr() {
      return ["Hr", "Min", "Sec"];
    },
    getYearMonthStr(e, n) {
      return `${e} - ${n}`;
    }
  },
  editableSelect: {
    noRelatedRecords: "No related records found",
    noData: "No data"
  },
  input: {
    placeholder: "Please enter"
  },
  splitterBar: {
    collapse: "Collapse",
    expand: "Expand"
  },
  stepsGuide: {
    previous: "Previous",
    continue: "Continue",
    ok: "OK"
  },
  table: {
    selectAll: "Select all",
    ok: "OK"
  },
  timePopup: {
    ok: "OK"
  },
  transfer: {
    unit: "",
    panelUnit: "",
    headerUnit: "",
    noData: "No Data",
    placeholder: "Please enter keywords"
  },
  tree: {
    loading: "Loading",
    newNode: "New node",
    selectPlaceholder: "Please select"
  },
  upload: {
    save: "Save",
    upload: "Upload",
    imgUpload: "ImageUpload",
    uploaded: "Uploaded",
    operating: "Operating",
    del: "Delete",
    download: "download",
    saveWarn: "Please wait for the file to upload and save!",
    saveError: "There is no file successfully uploaded and cannot be saved!",
    preview: "Preview",
    choose: "Select the file",
    accept: "Support {0} format",
    acceptUpload: "Only upload files in {0} format",
    maxSize: "A single file does not exceed {0}MB ",
    maxSizeMultiple: "Only upload files up to {0}MB!",
    maxNumber: "Only upload up to {0} files",
    legend: "Legend",
    fileName: "File name",
    fileSize: "File size",
    fileStatue: "File status",
    startUpload: "Start upload",
    uploadSuccess: "Upload successfully",
    uploadError: "Upload failed",
    uploading: "Uploading",
    uploadWait: "Please wait for the file upload to finish",
    reUploadFailed: "Re-upload failed files",
    noFile: "The file does not exist!"
  },
  search: {
    placeholder: "Enter a keyword"
  },
  select: {
    placeholder: "Please select",
    noDataText: "No data",
    noMatchText: "No related records found",
    loadingText: "Loading..."
  },
  tagInput: {
    maxTagsText: "Maximum number reached: "
  },
  timeSelect: {
    placeholder: "Please select time"
  },
  modal: {
    cancelText: "Close",
    okText: "Confirm",
    close: "Close",
    maximize: "Maximize",
    restore: "Restore"
  },
  excel: {
    exportModalTitle: "Export data",
    fileType: "File type",
    fileName: "File name"
  },
  form: {
    putAway: "Put away",
    unfold: "Unfold",
    maxTip: "The number of characters should be less than {0}",
    apiSelectNotFound: "Wait for data loading to complete..."
  },
  previewFile: {
    notSupport: "The file does not support preview",
    download: "download"
  },
  signature: {
    deleteSelectedSignature: "Delete selected signature",
    deleteAllSignature: "Delete all signatures",
    page: "page",
    jumpTo: "jump to",
    dragTip: "Please select the following signature and drag it to the left file",
    selectTip: "Please select the signature",
    smallTip: "The signature can't be any smaller",
    deleteTip: "Please select the signature you want to delete",
    addSignature: "Add Signature"
  },
  common: {
    preview: "Preview",
    download: "Download",
    okText: "OK",
    closeText: "Close",
    cancelText: "Cancel",
    loadingText: "Loading...",
    saveText: "Save",
    submitText: "Submit",
    delText: "Delete",
    resetText: "Reset",
    searchText: "Search",
    queryText: "Search",
    inputText: "Please enter",
    chooseText: "Please choose",
    redo: "Refresh",
    back: "Back",
    light: "Light",
    dark: "Dark",
    zoomIn: "Zoom In",
    zoomOut: "Zoom Out",
    reset: "reset",
    enterFullScreen: "Full Screen",
    exitFullScreen: "Exit Full Screen"
  }
}, ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: st
}, Symbol.toStringTag, { value: "Module" })), ut = {
  pagination: {
    totalItemText: "所有条目",
    goToText: "跳至",
    perPage: "条/页"
  },
  accordion: {
    loading: "加载中",
    noData: "没有数据"
  },
  autoCompleteDropdown: {
    latestInput: "最近输入"
  },
  cascaderList: {
    noData: "没有数据"
  },
  colorPicker: {
    foundationPanel: "基础面板",
    advancedPanel: "高级面板"
  },
  datePickerPro: {
    ok: "确定",
    placeholder: "请选择日期",
    month1: "1月",
    month2: "2月",
    month3: "3月",
    month4: "4月",
    month5: "5月",
    month6: "6月",
    month7: "7月",
    month8: "8月",
    month9: "9月",
    month10: "10月",
    month11: "11月",
    month12: "12月",
    year: "年",
    startPlaceholder: "请选择开始日期",
    endPlaceholder: "请选择结束日期",
    getWeekDays() {
      return ["日", "一", "二", "三", "四", "五", "六"];
    },
    getTimeArr() {
      return ["时", "分", "秒"];
    },
    getYearMonthStr(e, n) {
      return `${e}年${n}月`;
    }
  },
  editableSelect: {
    noRelatedRecords: "找不到相关记录",
    noData: "没有数据"
  },
  input: {
    placeholder: "请输入"
  },
  splitterBar: {
    collapse: "收起",
    expand: "展开"
  },
  stepsGuide: {
    previous: "上一步",
    continue: "我知道啦，继续",
    ok: "我知道啦"
  },
  table: {
    selectAll: "全选",
    ok: "确定"
  },
  timePopup: {
    ok: "确定"
  },
  transfer: {
    unit: "项",
    panelUnit: "项",
    headerUnit: "项",
    noData: "暂无数据",
    placeholder: "请输入关键词搜索"
  },
  tree: {
    loading: "加载中",
    newNode: "新节点",
    selectPlaceholder: "请选择"
  },
  upload: {
    save: "保存",
    upload: "上传",
    imgUpload: "图片上传",
    uploaded: "已上传",
    operating: "操作",
    del: "删除",
    download: "下载",
    saveWarn: "请等待文件上传后，保存!",
    saveError: "没有上传成功的文件，无法保存!",
    preview: "预览",
    choose: "选择文件",
    accept: "支持{0}格式",
    acceptUpload: "只能上传{0}格式文件",
    maxSize: "单个文件不超过{0}MB",
    maxSizeMultiple: "只能上传不超过{0}MB的文件!",
    maxNumber: "最多只能上传{0}个文件",
    legend: "略缩图",
    fileName: "文件名",
    fileSize: "文件大小",
    fileStatue: "状态",
    startUpload: "开始上传",
    uploadSuccess: "上传成功",
    uploadError: "上传失败",
    uploading: "上传中",
    uploadWait: "请等待文件上传结束后操作",
    reUploadFailed: "重新上传失败文件",
    import: "导入",
    startImport: "开始导入",
    importing: "导入中",
    reImportFailed: "重新导入失败文件",
    noFile: "文件不存在！"
  },
  search: {
    placeholder: "请输入关键字"
  },
  select: {
    placeholder: "请选择",
    noDataText: "无数据",
    noMatchText: "找不到相关记录",
    loadingText: "加载中..."
  },
  tagInput: {
    maxTagsText: "已达到最大个数："
  },
  timeSelect: {
    placeholder: "请选择时间"
  },
  modal: {
    cancelText: "关闭",
    okText: "确认",
    close: "关闭",
    maximize: "最大化",
    restore: "还原"
  },
  excel: {
    exportModalTitle: "导出数据",
    fileType: "文件类型",
    fileName: "文件名"
  },
  form: {
    putAway: "收起",
    unfold: "展开",
    maxTip: "字符数应小于{0}位",
    apiSelectNotFound: "请等待数据加载完成..."
  },
  previewFile: {
    notSupport: "该文件不支持预览",
    download: "下载"
  },
  signature: {
    deleteSelectedSignature: "删除选中签名",
    deleteAllSignature: "删除全部签名",
    page: "页",
    jumpTo: "跳至",
    dragTip: "请选择以下签名并将其拖到左侧文件",
    selectTip: "请选择签名",
    smallTip: "已经最小了",
    deleteTip: "请选中你要删除的签名",
    addSignature: "新建电子签章"
  },
  common: {
    preview: "预览",
    download: "下载",
    okText: "确认",
    closeText: "关闭",
    cancelText: "取消",
    loadingText: "加载中...",
    saveText: "保存",
    submitText: "提交",
    delText: "删除",
    resetText: "重置",
    searchText: "搜索",
    queryText: "查询",
    inputText: "请输入",
    chooseText: "请选择",
    redo: "刷新",
    back: "返回",
    light: "亮色主题",
    dark: "黑暗主题",
    zoomIn: "放大",
    zoomOut: "缩小",
    reset: "还原",
    enterFullScreen: "全屏",
    exitFullScreen: "退出全屏"
  }
}, dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: ut
}, Symbol.toStringTag, { value: "Module" })), he = /* @__PURE__ */ Object.assign({ "./lang/en.ts": ct, "./lang/zh_cn.ts": dt }), ke = {};
Object.keys(he).forEach((e) => {
  const n = he[e].default || {};
  ke[e] = n;
});
const ye = _("zh_cn"), pt = () => {
  const e = Te({
    langMessages: ke
  }), n = () => ye.value.toLocaleLowerCase();
  return {
    getLang: n,
    setLang: (i) => {
      ye.value = i;
    },
    getMessages: () => {
      const i = `./lang/${n()}.ts`;
      return e.langMessages[i];
    }
  };
};
function gt(e, n) {
  const t = n.split(".");
  let a = e;
  return t.forEach((i) => {
    a = a[i] ?? "";
  }), a;
}
function Pe() {
  return (e) => {
    const n = pt().getMessages();
    return gt(n, e);
  };
}
const be = "g";
function J(e, n, t) {
  let a = e;
  return n && (a += `__${n}`), t && (a += `--${t}`), a;
}
function ft(e, n = !1) {
  const t = n ? `.${be}-${e}` : `${be}-${e}`;
  return {
    b: () => J(t),
    e: (s) => s ? J(t, s) : "",
    m: (s) => s ? J(t, "", s) : "",
    em: (s, d) => s && d ? J(t, s, d) : ""
  };
}
const $e = "G", mt = Object.prototype.toString;
function vt(e, n) {
  return mt.call(e) === `[object ${n}]`;
}
function ht(e) {
  return vt(e, "String");
}
for (let e = 0; e <= 15; e++)
  e.toString(16);
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function xe(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function yt(e) {
  var n, t;
  return xe(e) === !1 ? !1 : (n = e.constructor, n === void 0 ? !0 : (t = n.prototype, !(xe(t) === !1 || t.hasOwnProperty("isPrototypeOf") === !1)));
}
function L() {
  return L = Object.assign ? Object.assign.bind() : function(e) {
    for (var n = 1; n < arguments.length; n++) {
      var t = arguments[n];
      for (var a in t)
        Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
    }
    return e;
  }, L.apply(this, arguments);
}
function Ce(e, n) {
  if (e == null)
    return {};
  var t, a, i = {}, r = Object.keys(e);
  for (a = 0; a < r.length; a++)
    n.indexOf(t = r[a]) >= 0 || (i[t] = e[t]);
  return i;
}
const ce = { silent: !1, logLevel: "warn" }, bt = ["validator"], Ie = Object.prototype, Ne = Ie.toString, xt = Ie.hasOwnProperty, De = /^\s*function (\w+)/;
function _e(e) {
  var n;
  const t = (n = e == null ? void 0 : e.type) !== null && n !== void 0 ? n : e;
  if (t) {
    const a = t.toString().match(De);
    return a ? a[1] : "";
  }
  return "";
}
const I = yt, ze = (e) => e;
let b = ze;
process.env.NODE_ENV !== "production" && (b = typeof console < "u" ? function(n, t = ce.logLevel) {
  ce.silent === !1 && console[t](`[VueTypes warn]: ${n}`);
} : ze);
const E = (e, n) => xt.call(e, n), _t = Number.isInteger || function(e) {
  return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
}, R = Array.isArray || function(e) {
  return Ne.call(e) === "[object Array]";
}, U = (e) => Ne.call(e) === "[object Function]", ee = (e) => I(e) && E(e, "_vueTypes_name"), Be = (e) => I(e) && (E(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some((n) => E(e, n)));
function de(e, n) {
  return Object.defineProperty(e.bind(n), "__original", { value: e });
}
function N(e, n, t = !1) {
  let a, i = !0, r = "";
  a = I(e) ? e : { type: e };
  const u = ee(a) ? a._vueTypes_name + " - " : "";
  if (Be(a) && a.type !== null) {
    if (a.type === void 0 || a.type === !0 || !a.required && n === void 0)
      return i;
    R(a.type) ? (i = a.type.some((s) => N(s, n, !0) === !0), r = a.type.map((s) => _e(s)).join(" or ")) : (r = _e(a), i = r === "Array" ? R(n) : r === "Object" ? I(n) : r === "String" || r === "Number" || r === "Boolean" || r === "Function" ? function(s) {
      if (s == null)
        return "";
      const d = s.constructor.toString().match(De);
      return d ? d[1] : "";
    }(n) === r : n instanceof a.type);
  }
  if (!i) {
    const s = `${u}value "${n}" should be of type "${r}"`;
    return t === !1 ? (b(s), !1) : s;
  }
  if (E(a, "validator") && U(a.validator)) {
    const s = b, d = [];
    if (b = (p) => {
      d.push(p);
    }, i = a.validator(n), b = s, !i) {
      const p = (d.length > 1 ? "* " : "") + d.join(`
* `);
      return d.length = 0, t === !1 ? (b(p), i) : p;
    }
  }
  return i;
}
function w(e, n) {
  const t = Object.defineProperties(n, { _vueTypes_name: { value: e, writable: !0 }, isRequired: { get() {
    return this.required = !0, this;
  } }, def: { value(i) {
    return i === void 0 ? (E(this, "default") && delete this.default, this) : U(i) || N(this, i, !0) === !0 ? (this.default = R(i) ? () => [...i] : I(i) ? () => Object.assign({}, i) : i, this) : (b(`${this._vueTypes_name} - invalid default value: "${i}"`), this);
  } } }), { validator: a } = t;
  return U(a) && (t.validator = de(a, t)), t;
}
function O(e, n) {
  const t = w(e, n);
  return Object.defineProperty(t, "validate", { value(a) {
    return U(this.validator) && b(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`), this.validator = de(a, this), this;
  } });
}
function Se(e, n, t) {
  const a = function(d) {
    const p = {};
    return Object.getOwnPropertyNames(d).forEach((x) => {
      p[x] = Object.getOwnPropertyDescriptor(d, x);
    }), Object.defineProperties({}, p);
  }(n);
  if (a._vueTypes_name = e, !I(t))
    return a;
  const { validator: i } = t, r = Ce(t, bt);
  if (U(i)) {
    let { validator: d } = a;
    d && (d = (s = (u = d).__original) !== null && s !== void 0 ? s : u), a.validator = de(d ? function(p) {
      return d.call(this, p) && i.call(this, p);
    } : i, a);
  }
  var u, s;
  return Object.assign(a, r);
}
function te(e) {
  return e.replace(/^(?!\s*$)/gm, "  ");
}
const St = () => O("any", {}), wt = () => O("function", { type: Function }), Tt = () => O("boolean", { type: Boolean }), Ot = () => O("string", { type: String }), jt = () => O("number", { type: Number }), kt = () => O("array", { type: Array }), Pt = () => O("object", { type: Object }), $t = () => w("integer", { type: Number, validator: (e) => _t(e) }), Ct = () => w("symbol", { validator: (e) => typeof e == "symbol" });
function It(e, n = "custom validation failed") {
  if (typeof e != "function")
    throw new TypeError("[VueTypes error]: You must provide a function as argument");
  return w(e.name || "<<anonymous function>>", { type: null, validator(t) {
    const a = e(t);
    return a || b(`${this._vueTypes_name} - ${n}`), a;
  } });
}
function Nt(e) {
  if (!R(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument.");
  const n = `oneOf - value should be one of "${e.join('", "')}".`, t = e.reduce((a, i) => {
    if (i != null) {
      const r = i.constructor;
      a.indexOf(r) === -1 && a.push(r);
    }
    return a;
  }, []);
  return w("oneOf", { type: t.length > 0 ? t : void 0, validator(a) {
    const i = e.indexOf(a) !== -1;
    return i || b(n), i;
  } });
}
function Dt(e) {
  if (!R(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument");
  let n = !1, t = [];
  for (let i = 0; i < e.length; i += 1) {
    const r = e[i];
    if (Be(r)) {
      if (ee(r) && r._vueTypes_name === "oneOf" && r.type) {
        t = t.concat(r.type);
        continue;
      }
      if (U(r.validator) && (n = !0), r.type === !0 || !r.type) {
        b('oneOfType - invalid usage of "true" or "null" as types.');
        continue;
      }
      t = t.concat(r.type);
    } else
      t.push(r);
  }
  t = t.filter((i, r) => t.indexOf(i) === r);
  const a = t.length > 0 ? t : null;
  return w("oneOfType", n ? { type: a, validator(i) {
    const r = [], u = e.some((s) => {
      const d = N(ee(s) && s._vueTypes_name === "oneOf" ? s.type || null : s, i, !0);
      return typeof d == "string" && r.push(d), d === !0;
    });
    return u || b(`oneOfType - provided value does not match any of the ${r.length} passed-in validators:
${te(r.join(`
`))}`), u;
  } } : { type: a });
}
function zt(e) {
  return w("arrayOf", { type: Array, validator(n) {
    let t = "";
    const a = n.every((i) => (t = N(e, i, !0), t === !0));
    return a || b(`arrayOf - value validation error:
${te(t)}`), a;
  } });
}
function Bt(e) {
  return w("instanceOf", { type: e });
}
function Et(e) {
  return w("objectOf", { type: Object, validator(n) {
    let t = "";
    const a = Object.keys(n).every((i) => (t = N(e, n[i], !0), t === !0));
    return a || b(`objectOf - value validation error:
${te(t)}`), a;
  } });
}
function Rt(e) {
  const n = Object.keys(e), t = n.filter((i) => {
    var r;
    return !((r = e[i]) === null || r === void 0 || !r.required);
  }), a = w("shape", { type: Object, validator(i) {
    if (!I(i))
      return !1;
    const r = Object.keys(i);
    if (t.length > 0 && t.some((u) => r.indexOf(u) === -1)) {
      const u = t.filter((s) => r.indexOf(s) === -1);
      return b(u.length === 1 ? `shape - required property "${u[0]}" is not defined.` : `shape - required properties "${u.join('", "')}" are not defined.`), !1;
    }
    return r.every((u) => {
      if (n.indexOf(u) === -1)
        return this._vueTypes_isLoose === !0 || (b(`shape - shape definition does not include a "${u}" property. Allowed keys: "${n.join('", "')}".`), !1);
      const s = N(e[u], i[u], !0);
      return typeof s == "string" && b(`shape - "${u}" property validation error:
 ${te(s)}`), s === !0;
    });
  } });
  return Object.defineProperty(a, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(a, "loose", { get() {
    return this._vueTypes_isLoose = !0, this;
  } }), a;
}
const Ut = ["name", "validate", "getter"], Mt = /* @__PURE__ */ (() => {
  var e;
  return (e = class {
    static get any() {
      return St();
    }
    static get func() {
      return wt().def(this.defaults.func);
    }
    static get bool() {
      return Tt().def(this.defaults.bool);
    }
    static get string() {
      return Ot().def(this.defaults.string);
    }
    static get number() {
      return jt().def(this.defaults.number);
    }
    static get array() {
      return kt().def(this.defaults.array);
    }
    static get object() {
      return Pt().def(this.defaults.object);
    }
    static get integer() {
      return $t().def(this.defaults.integer);
    }
    static get symbol() {
      return Ct();
    }
    static get nullable() {
      return { type: null };
    }
    static extend(n) {
      if (R(n))
        return n.forEach((d) => this.extend(d)), this;
      const { name: t, validate: a = !1, getter: i = !1 } = n, r = Ce(n, Ut);
      if (E(this, t))
        throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);
      const { type: u } = r;
      if (ee(u))
        return delete r.type, Object.defineProperty(this, t, i ? { get: () => Se(t, u, r) } : { value(...d) {
          const p = Se(t, u, r);
          return p.validator && (p.validator = p.validator.bind(p, ...d)), p;
        } });
      let s;
      return s = i ? { get() {
        const d = Object.assign({}, r);
        return a ? O(t, d) : w(t, d);
      }, enumerable: !0 } : { value(...d) {
        const p = Object.assign({}, r);
        let x;
        return x = a ? O(t, p) : w(t, p), p.validator && (x.validator = p.validator.bind(x, ...d)), x;
      }, enumerable: !0 }, Object.defineProperty(this, t, s);
    }
  }).defaults = {}, e.sensibleDefaults = void 0, e.config = ce, e.custom = It, e.oneOf = Nt, e.instanceOf = Bt, e.oneOfType = Dt, e.arrayOf = zt, e.objectOf = Et, e.shape = Rt, e.utils = { validate: (n, t) => N(t, n, !0) === !0, toType: (n, t, a = !1) => a ? O(n, t) : w(n, t) }, e;
})();
function Ee(e = { func: () => {
}, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
  var n;
  return (n = class extends Mt {
    static get sensibleDefaults() {
      return L({}, this.defaults);
    }
    static set sensibleDefaults(t) {
      this.defaults = t !== !1 ? L({}, t !== !0 ? t : e) : {};
    }
  }).defaults = L({}, e), n;
}
class wn extends Ee() {
}
const Ft = Ee({
  func: void 0,
  bool: void 0,
  string: void 0,
  number: void 0,
  object: void 0,
  integer: void 0
});
Ft.extend([
  {
    name: "style",
    getter: !0,
    type: [String, Object],
    default: void 0
  },
  {
    name: "VNodeChild",
    getter: !0,
    type: void 0
  }
]);
const At = Y({
  name: `${$e}SvgIcon`,
  props: {
    prefix: {
      type: String,
      default: "icon"
    },
    name: {
      type: String,
      required: !0
    },
    size: {
      type: [Number, String],
      default: 16
    },
    spin: {
      type: Boolean,
      default: !1
    }
  },
  setup(e) {
    const t = ft("svg-icon").b(), a = z(() => `#${e.prefix}-${e.name}`), i = z(() => {
      const { size: r } = e;
      let u = `${r}`;
      return u = `${u.replace("px", "")}px`, {
        width: u,
        height: u
      };
    });
    return { symbolId: a, prefixCls: t, getStyle: i };
  }
});
const ne = (e, n) => {
  const t = e.__vccOpts || e;
  for (const [a, i] of n)
    t[a] = i;
  return t;
}, Lt = ["xlink:href"];
function Vt(e, n, t, a, i, r) {
  return $(), H("svg", {
    class: Z([e.prefixCls, e.$attrs.class, e.spin && "svg-icon-spin"]),
    style: ue(e.getStyle),
    "aria-hidden": "true"
  }, [
    v("use", { "xlink:href": e.symbolId }, null, 8, Lt)
  ], 6);
}
const Yt = /* @__PURE__ */ ne(At, [["render", Vt]]), we = "|svg", qt = Y({
  name: `${$e}Icon`,
  components: { SvgIcon: Yt },
  props: {
    // icon name
    icon: String,
    // icon color
    color: String,
    // icon size
    size: {
      type: [String, Number],
      default: 16
    },
    spin: {
      type: Boolean,
      default: !1
    },
    prefix: {
      type: String,
      default: ""
    }
  },
  setup(e) {
    const n = _(null), t = z(() => {
      var s;
      return (s = e.icon) == null ? void 0 : s.endsWith(we);
    }), a = z(
      () => e.icon.replace(we, "")
    ), i = z(
      () => `${e.prefix ? e.prefix + ":" : ""}${e.icon}`
    ), r = async () => {
      if (f(t))
        return;
      const s = f(n);
      if (!s)
        return;
      await je();
      const d = f(i);
      if (!d)
        return;
      const p = lt.renderSVG(d, {});
      if (p)
        s.textContent = "", s.appendChild(p);
      else {
        const x = document.createElement("span");
        x.className = "iconify", x.dataset.icon = d, s.textContent = "", s.appendChild(x);
      }
    }, u = z(() => {
      const { size: s, color: d } = e;
      let p = s;
      return ht(s) && (p = parseInt(s, 10)), {
        fontSize: `${p}px`,
        color: d,
        display: "inline-flex"
      };
    });
    return se(() => e.icon, r, { flush: "post" }), Oe(r), { elRef: n, getWrapStyle: u, isSvgIcon: t, getSvgIcon: a };
  }
});
function Wt(e, n, t, a, i, r) {
  const u = K("SvgIcon");
  return e.isSvgIcon ? ($(), Q(u, {
    key: 0,
    size: e.size,
    name: e.getSvgIcon,
    class: Z([e.$attrs.class, "anticon"]),
    spin: e.spin
  }, null, 8, ["size", "name", "class", "spin"])) : ($(), H("span", {
    key: 1,
    ref: "elRef",
    class: Z([e.$attrs.class, "app-iconify anticon", e.spin && "app-iconify-spin"]),
    style: ue(e.getWrapStyle)
  }, null, 6));
}
const j = /* @__PURE__ */ ne(qt, [["render", Wt]]);
j.install = function(e, n) {
  e.component(n || j.name, j);
};
const Xt = (e) => (Qe("data-v-e7f77e6d"), e = e(), et(), e), Gt = {
  class: "main-content",
  style: { "min-width": "960px" }
}, Jt = { style: { "margin-bottom": "20px" } }, Kt = { class: "section-title" }, Ht = { class: "sign-container" }, Zt = { class: "preview-pdf" }, Qt = {
  class: "interviewVideo_main",
  id: "videoContainer"
}, en = ["onClick"], tn = ["id"], nn = { style: { "text-align": "center" } }, an = { class: "signature-pdf" }, on = { style: { margin: "20px 0", "text-align": "center" } }, rn = /* @__PURE__ */ Xt(() => /* @__PURE__ */ v("div", { class: "pdf-out-container" }, [
  /* @__PURE__ */ v("div", { class: "pdf-container" }, [
    /* @__PURE__ */ v("canvas", { id: "the-canvas" }),
    /* @__PURE__ */ v("canvas", { id: "ele-canvas" })
  ])
], -1)), ln = { style: { margin: "20px 0", "text-align": "center" } }, sn = { class: "mb-2 tip" }, cn = { class: "imgstyle text-center" }, un = ["src"], dn = Y({
  name: "Signature"
}), pn = /* @__PURE__ */ Y({
  ...dn,
  props: {
    mainImagelist: {
      type: Array,
      default: () => []
    },
    pdfUrl: {
      type: String,
      default: ""
    },
    fileName: {
      type: String,
      default: ""
    }
  },
  setup(e, { expose: n }) {
    const t = e, a = Pe();
    let i = Te({});
    const r = _(0), u = _(1), s = _(1), d = _(), p = _(), x = _(), M = _(!0), F = _(!1), q = _(null), D = _({}), T = _({}), C = (l, o = 2) => {
      if (typeof l != "number" || isNaN(l))
        return null;
      const c = Math.pow(10, o);
      return Math.round(l * c) / c;
    };
    Oe(() => {
      Re(t.pdfUrl);
    }), Je(() => {
      var l;
      (l = p.value) == null || l.dispose();
    });
    const Re = async (l) => {
      ve.GlobalWorkerOptions.workerSrc = await import("./pdf.worker.entry-1c55d8c5.mjs").then((c) => c.p), d.value = document.getElementById("the-canvas"), x.value = d.value.getContext("2d"), ve.getDocument(l).promise.then((c) => {
        i = c, r.value = c.numPages, je(() => {
          ge(1), ae(u.value).then(() => {
            Ue({
              width: d.value.width,
              height: d.value.height
            });
            const g = T.value[u.value];
            if (g != null && g != null)
              for (const h in g)
                oe(
                  g[h].sealUrl,
                  g[h].left,
                  g[h].top,
                  g[h].index,
                  g[h].scaleX,
                  g[h].scaleY
                );
            pe(u.value, !0);
          });
        });
      }).catch((c) => {
        console.log("🚀 ~ loadingTask.promise.then ~ err:", c);
      });
    }, pe = (l, o = !1) => {
      o == !1 && p.value.remove(p.value.clear());
      const c = T.value[l];
      if (c != null && c != null)
        for (const g in c)
          oe(
            c[g].sealUrl,
            c[g].left,
            c[g].top,
            c[g].index,
            c[g].scaleX,
            c[g].scaleY
          );
    }, Ue = (l) => {
      D.value = l;
    }, ae = (l) => (F.value = !0, i.getPage(l).then((o) => {
      const c = o.getViewport({ scale: s.value });
      d.value.height = c.height, d.value.width = c.width;
      const g = {
        canvasContext: x.value,
        viewport: c
      };
      o.render(g).promise.then(() => {
        F.value = !1, q.value !== null && (ae(q.value), q.value = null);
      }).catch(() => {
        F.value = !1;
      });
    }).catch(() => {
      F.value = !1;
    })), Me = () => {
      W(), !(u.value <= 1) && u.value--;
    }, Fe = () => {
      W(), !(u.value >= r.value) && u.value++;
    }, Ae = (l) => {
      F.value ? q.value = l : ae(l);
    };
    se(
      () => u.value,
      (l) => {
        l && (pe(l), Ae(l));
      }
    ), se(
      () => D.value,
      (l) => {
        if (l && Object.keys(l).length > 0) {
          Le(), Ve();
          const o = document.querySelector("#ele-canvas");
          o.style = "box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)", o.width = D.value.width, o.height = D.value.height;
        }
      }
    );
    const ge = (l) => {
      M.value || (M.value = !0), i.getPage(l).then((o) => {
        const c = "pdf-canvas-" + l, g = document.getElementById(c), h = g.getContext("2d"), ie = window.devicePixelRatio || 1, X = h.webkitBackingStorePixelRatio || h.mozBackingStorePixelRatio || h.msBackingStorePixelRatio || h.oBackingStorePixelRatio || h.backingStorePixelRatio || 1, G = ie / X, A = o.getViewport({ scale: 0.5 });
        g.width = A.width * G, g.height = A.height * G, g.style.width = A.width + "px", g.style.height = A.height + "px", h.setTransform(G, 0, 0, G, 0, 0);
        const Ge = {
          canvasContext: h,
          viewport: A
        };
        o.render(Ge), l < r.value ? ge(l + 1) : M.value = !1;
      }).catch(() => {
        M.value = !1;
      });
    }, Le = () => {
      const l = document.querySelector("#ele-canvas");
      l.width = D.value.width, l.height = D.value.height, p.value = new le.Canvas(l);
      const o = document.querySelector(".canvas-container");
      o.style.position = "absolute", o.style.top = "0px";
    }, Ve = () => {
      p.value.on("object:moving", function(l) {
        var o = l.target;
        o.currentHeight > o.canvas.height || o.currentWidth > o.canvas.width || (o.setCoords(), (o.getBoundingRect().top < 0 || o.getBoundingRect().left < 0) && (o.top = Math.max(o.top, o.top - o.getBoundingRect().top), o.left = Math.max(o.left, o.left - o.getBoundingRect().left)), (o.getBoundingRect().top + o.getBoundingRect().height > o.canvas.height || o.getBoundingRect().left + o.getBoundingRect().width > o.canvas.width) && (o.top = Math.min(
          o.top,
          o.canvas.height - o.getBoundingRect().height + o.top - o.getBoundingRect().top
        ), o.left = Math.min(
          o.left,
          o.canvas.width - o.getBoundingRect().width + o.left - o.getBoundingRect().left
        )));
      });
    }, oe = (l, o, c, g, h = 1, ie = 1) => {
      le.Image.fromURL(l, (X) => {
        X.set({
          left: o,
          top: c,
          // angle: 10,
          scaleX: h,
          scaleY: ie,
          index: g,
          sealUrl: l
        }), p.value.add(X);
      });
    }, fe = (l) => {
      if (!p.value.getActiveObject())
        return re.warning(a("signature.selectTip"));
      const o = p.value.getActiveObject();
      if (l === "small" && o.scaleX - 0.05 < 0.05)
        return re.warning(a("signature.smallTip"));
      le.Image.fromURL(o.sealUrl, (c) => {
        c.set({
          left: o.left,
          top: o.top,
          // angle: 10,
          scaleX: C(l === "big" ? o.scaleX + 0.05 : o.scaleX - 0.05, 2),
          scaleY: C(l === "big" ? o.scaleY + 0.05 : o.scaleY - 0.05, 2),
          index: o.index,
          sealUrl: o.sealUrl
        }), p.value.add(c), p.value.remove(p.value.getActiveObject()), p.value.setActiveObject(c);
      });
    }, Ye = () => {
      if (!p.value.getActiveObject())
        return re.warning(a("signature.deleteTip"));
      p.value.remove(p.value.getActiveObject());
    }, qe = (l) => {
      W(), u.value = l;
    }, W = () => {
      const l = p.value.getObjects(), o = {};
      let c = 0;
      for (var g of l)
        o[c] = {
          width: C(g.width * g.scaleX, 0),
          height: C(g.height * g.scaleY, 0),
          top: g.top,
          bottom: d.value.height - C(g.height * g.scaleY, 0) - g.top,
          left: g.left,
          angle: g.angle,
          translateX: g.translateX,
          translateY: g.translateY,
          scaleX: g.scaleX,
          scaleY: g.scaleY,
          pageNum: u.value,
          sealUrl: t.mainImagelist[g.index].url,
          index: g.index,
          type: t.mainImagelist[g.index].type,
          text: t.mainImagelist[g.index].text
        }, c++;
      T.value[u.value] = o;
    }, We = () => {
      p.value.remove(p.value.clear()), localStorage.removeItem("signs");
    };
    function Xe(l) {
      if (l.originalEvent.layerX < 0 && l.originalEvent.layerX > d.value.width && l.originalEvent.layerY < 0 && l.originalEvent.layerY > d.value.height)
        return !1;
      oe(
        t.mainImagelist[l.newDraggableIndex].url,
        l.originalEvent.layerX,
        l.originalEvent.layerY,
        l.newDraggableIndex,
        t.mainImagelist[l.newDraggableIndex].scale || 1,
        t.mainImagelist[l.newDraggableIndex].scale || 1
      );
    }
    return n({
      submitSignature: () => {
        W();
        const l = [];
        return Object.keys(T.value).forEach((o) => {
          Object.keys(T.value[o]).length > 0 && Object.keys(T.value[o]).forEach((c) => {
            l.push({
              page: o,
              absoluteX: T.value[o][c].left,
              absoluteY: T.value[o][c].bottom,
              imageWidth: T.value[o][c].width,
              imageHeight: T.value[o][c].height,
              type: T.value[o][c].type,
              text: T.value[o][c].text
            });
          });
        }), l;
      }
    }), (l, o) => ($(), Q(f(nt), { spinning: M.value }, {
      default: y(() => [
        v("div", Gt, [
          m(f(at), { style: { height: "100%" } }, {
            default: y(() => [
              m(f(me), {
                span: 20,
                style: { padding: "20px" }
              }, {
                default: y(() => [
                  v("div", Jt, [
                    v("div", Kt, S(e.fileName), 1)
                  ]),
                  v("div", Ht, [
                    v("div", Zt, [
                      v("div", Qt, [
                        ($(!0), H(Ke, null, He(r.value, (c) => ($(), H("div", {
                          key: c,
                          class: "text-center item-canvas-container",
                          style: ue({
                            marginBottom: c !== r.value ? "10px" : 0
                          }),
                          onClick: (g) => qe(c)
                        }, [
                          v("canvas", {
                            id: "pdf-canvas-" + c,
                            style: { display: "block", margin: "0 auto" },
                            class: Z(["pdf-canvas", { highLight: c === u.value }])
                          }, null, 10, tn),
                          v("div", nn, S(c), 1)
                        ], 12, en))), 128))
                      ])
                    ]),
                    v("div", an, [
                      v("div", on, [
                        m(f(k), {
                          class: "btn-outline-dark",
                          onClick: Me
                        }, {
                          default: y(() => [
                            m(f(j), {
                              size: "14",
                              icon: "ant-design:left-outlined"
                            })
                          ]),
                          _: 1
                        }),
                        m(f(k), { class: "btn-outline-dark" }, {
                          default: y(() => [
                            P(S(u.value) + "/" + S(r.value) + S(f(a)("signature.page")), 1)
                          ]),
                          _: 1
                        }),
                        m(f(k), {
                          class: "btn-outline-dark",
                          onClick: Fe
                        }, {
                          default: y(() => [
                            m(f(j), {
                              size: "14",
                              icon: "ant-design:right-outlined"
                            })
                          ]),
                          _: 1
                        }),
                        P(" " + S(f(a)("signature.jumpTo")) + " ", 1),
                        m(f(ot), {
                          value: u.value,
                          "onUpdate:value": o[0] || (o[0] = (c) => u.value = c),
                          style: { margin: "0 5px", "border-radius": "5px" },
                          class: "btn-outline-dark",
                          min: 1,
                          max: r.value,
                          precision: 0
                        }, null, 8, ["value", "max"])
                      ]),
                      rn,
                      v("div", ln, [
                        m(f(k), {
                          class: "btn-outline-dark",
                          onClick: o[1] || (o[1] = (c) => fe("big"))
                        }, {
                          default: y(() => [
                            m(f(j), {
                              size: "14",
                              icon: "ant-design:zoom-in-outlined"
                            }),
                            P(" " + S(f(a)("common.zoomIn")), 1)
                          ]),
                          _: 1
                        }),
                        m(f(k), {
                          class: "btn-outline-dark",
                          onClick: o[2] || (o[2] = (c) => fe("small"))
                        }, {
                          default: y(() => [
                            m(f(j), {
                              size: "14",
                              icon: "ant-design:zoom-out-outlined"
                            }),
                            P(" " + S(f(a)("common.zoomOut")), 1)
                          ]),
                          _: 1
                        }),
                        m(f(k), {
                          class: "btn-outline-dark",
                          onClick: Ye
                        }, {
                          default: y(() => [
                            m(f(j), {
                              size: "14",
                              icon: "ant-design:delete-outlined"
                            }),
                            P(" " + S(f(a)("signature.deleteSelectedSignature")), 1)
                          ]),
                          _: 1
                        }),
                        m(f(k), {
                          class: "btn-outline-dark",
                          onClick: We
                        }, {
                          default: y(() => [
                            m(f(j), {
                              size: "14",
                              icon: "ant-design:delete-outlined"
                            }),
                            P(" " + S(f(a)("signature.deleteAllSignature")), 1)
                          ]),
                          _: 1
                        })
                      ])
                    ])
                  ])
                ]),
                _: 1
              }),
              m(f(me), {
                span: 4,
                class: "names-container"
              }, {
                default: y(() => [
                  v("div", sn, S(f(a)("signature.dragTip")), 1),
                  m(Ze, { type: "transition" }, {
                    default: y(() => [
                      m(f(rt), {
                        list: e.mainImagelist,
                        group: { name: "list", pull: "clone" },
                        sort: !1,
                        onEnd: Xe
                      }, {
                        item: y(({ element: c, index: g }) => [
                          v("div", cn, [
                            v("img", {
                              src: c.url,
                              ref: "signerName" + g,
                              style: { width: "100%" }
                            }, null, 8, un)
                          ])
                        ]),
                        _: 1
                      }, 8, ["list"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ])
      ]),
      _: 1
    }, 8, ["spinning"]));
  }
});
const B = /* @__PURE__ */ ne(pn, [["__scopeId", "data-v-e7f77e6d"]]), gn = Y({
  name: "SignatureDrawer",
  components: {
    Signature: B,
    Drawer: it,
    Button: k
  },
  props: {
    drawerVisible: {
      type: Boolean,
      default: !1
    },
    submitting: {
      type: Boolean,
      default: !1
    },
    mainImagelist: {
      type: Array,
      default: () => []
    },
    pdfUrl: {
      type: String,
      default: ""
    },
    fileName: {
      type: String,
      default: ""
    }
  },
  emits: ["submit", "update:drawerVisible"],
  setup(e, { emit: n }) {
    const t = _();
    return {
      t: Pe(),
      signatureRef: t,
      onClose: () => {
        n("update:drawerVisible", !1);
      },
      onSubmit: () => {
        n("submit", t.value.submitSignature());
      }
    };
  }
});
function fn(e, n, t, a, i, r) {
  const u = K("Button"), s = K("Signature"), d = K("Drawer");
  return $(), Q(d, {
    title: e.t("signature.addSignature"),
    visible: e.drawerVisible,
    "onUpdate:visible": n[0] || (n[0] = (p) => e.drawerVisible = p),
    maskClosable: !1,
    width: "90%",
    onClose: e.onClose,
    bodyStyle: "padding: 0"
  }, {
    extra: y(() => [
      m(u, {
        style: { "margin-right": "8px" },
        onClick: e.onClose
      }, {
        default: y(() => [
          P(S(e.t("common.cancelText")), 1)
        ]),
        _: 1
      }, 8, ["onClick"]),
      m(u, {
        type: "primary",
        loading: e.submitting,
        onClick: e.onSubmit
      }, {
        default: y(() => [
          P(S(e.t("common.submitText")), 1)
        ]),
        _: 1
      }, 8, ["loading", "onClick"])
    ]),
    default: y(() => [
      e.drawerVisible ? ($(), Q(s, {
        key: 0,
        ref: "signatureRef",
        mainImagelist: e.mainImagelist,
        pdfUrl: e.pdfUrl,
        fileName: e.fileName
      }, null, 8, ["mainImagelist", "pdfUrl", "fileName"])) : tt("", !0)
    ]),
    _: 1
  }, 8, ["title", "visible", "onClose"]);
}
const V = /* @__PURE__ */ ne(gn, [["render", fn]]);
B.install = function(e, n) {
  e.component(n || B.name, B);
};
V.install = function(e, n) {
  e.component(n || V.name, V);
};
const Tn = {
  title: "Signature 电子签章",
  parts: "功能组件",
  category: "",
  status: "100%",
  install(e) {
    e.component(B.name, B), e.component(V.name, V);
  }
};
export {
  B as Signature,
  V as SignatureDrawer,
  Tn as default
};
