import "lodash-es";
import "dayjs";
import { defineAsyncComponent as L, createVNode as k } from "vue";
import { Spin as C } from "ant-design-vue";
const V = typeof window < "u", ye = "G";
for (let e = 0; e <= 15; e++)
  e.toString(16);
const F = () => {
};
function Y(e, n = {}) {
  const {
    size: t = "small",
    delay: r = 100,
    timeout: o = 3e4,
    loading: i = !1,
    retry: u = !0
  } = n;
  return L({
    loader: e,
    loadingComponent: i ? k(C, {
      spinning: !0,
      size: t
    }, null) : void 0,
    // The error component will be displayed if a timeout is
    // provided and exceeded. Default: Infinity.
    // TODO
    timeout: o,
    // errorComponent
    // Defining if component is suspensible. Default: true.
    // suspensible: false,
    delay: r,
    /**
     *
     * @param {*} error Error message object
     * @param {*} retry A function that indicating whether the async component should retry when the loader promise rejects
     * @param {*} fail  End of failure
     * @param {*} attempts Maximum allowed retries number
     */
    onError: u ? (a, s, l, p) => {
      a.message.match(/fetch/) && p <= 3 ? s() : l();
    } : F
  });
}
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function $(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function z(e) {
  var n, t;
  return $(e) === !1 ? !1 : (n = e.constructor, n === void 0 ? !0 : (t = n.prototype, !($(t) === !1 || t.hasOwnProperty("isPrototypeOf") === !1)));
}
function m() {
  return m = Object.assign ? Object.assign.bind() : function(e) {
    for (var n = 1; n < arguments.length; n++) {
      var t = arguments[n];
      for (var r in t)
        Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
    }
    return e;
  }, m.apply(this, arguments);
}
function N(e, n) {
  if (e == null)
    return {};
  var t, r, o = {}, i = Object.keys(e);
  for (r = 0; r < i.length; r++)
    n.indexOf(t = i[r]) >= 0 || (o[t] = e[t]);
  return o;
}
const _ = { silent: !1, logLevel: "warn" }, G = ["validator"], S = Object.prototype, A = S.toString, I = S.hasOwnProperty, E = /^\s*function (\w+)/;
function x(e) {
  var n;
  const t = (n = e == null ? void 0 : e.type) !== null && n !== void 0 ? n : e;
  if (t) {
    const r = t.toString().match(E);
    return r ? r[1] : "";
  }
  return "";
}
const y = z, B = (e) => e;
let c = B;
process.env.NODE_ENV !== "production" && (c = typeof console < "u" ? function(n, t = _.logLevel) {
  _.silent === !1 && console[t](`[VueTypes warn]: ${n}`);
} : B);
const g = (e, n) => I.call(e, n), J = Number.isInteger || function(e) {
  return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
}, h = Array.isArray || function(e) {
  return A.call(e) === "[object Array]";
}, b = (e) => A.call(e) === "[object Function]", O = (e) => y(e) && g(e, "_vueTypes_name"), q = (e) => y(e) && (g(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some((n) => g(e, n)));
function w(e, n) {
  return Object.defineProperty(e.bind(n), "__original", { value: e });
}
function v(e, n, t = !1) {
  let r, o = !0, i = "";
  r = y(e) ? e : { type: e };
  const u = O(r) ? r._vueTypes_name + " - " : "";
  if (q(r) && r.type !== null) {
    if (r.type === void 0 || r.type === !0 || !r.required && n === void 0)
      return o;
    h(r.type) ? (o = r.type.some((a) => v(a, n, !0) === !0), i = r.type.map((a) => x(a)).join(" or ")) : (i = x(r), o = i === "Array" ? h(n) : i === "Object" ? y(n) : i === "String" || i === "Number" || i === "Boolean" || i === "Function" ? function(a) {
      if (a == null)
        return "";
      const s = a.constructor.toString().match(E);
      return s ? s[1] : "";
    }(n) === i : n instanceof r.type);
  }
  if (!o) {
    const a = `${u}value "${n}" should be of type "${i}"`;
    return t === !1 ? (c(a), !1) : a;
  }
  if (g(r, "validator") && b(r.validator)) {
    const a = c, s = [];
    if (c = (l) => {
      s.push(l);
    }, o = r.validator(n), c = a, !o) {
      const l = (s.length > 1 ? "* " : "") + s.join(`
* `);
      return s.length = 0, t === !1 ? (c(l), o) : l;
    }
  }
  return o;
}
function f(e, n) {
  const t = Object.defineProperties(n, { _vueTypes_name: { value: e, writable: !0 }, isRequired: { get() {
    return this.required = !0, this;
  } }, def: { value(o) {
    return o === void 0 ? (g(this, "default") && delete this.default, this) : b(o) || v(this, o, !0) === !0 ? (this.default = h(o) ? () => [...o] : y(o) ? () => Object.assign({}, o) : o, this) : (c(`${this._vueTypes_name} - invalid default value: "${o}"`), this);
  } } }), { validator: r } = t;
  return b(r) && (t.validator = w(r, t)), t;
}
function d(e, n) {
  const t = f(e, n);
  return Object.defineProperty(t, "validate", { value(r) {
    return b(this.validator) && c(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`), this.validator = w(r, this), this;
  } });
}
function P(e, n, t) {
  const r = function(s) {
    const l = {};
    return Object.getOwnPropertyNames(s).forEach((p) => {
      l[p] = Object.getOwnPropertyDescriptor(s, p);
    }), Object.defineProperties({}, l);
  }(n);
  if (r._vueTypes_name = e, !y(t))
    return r;
  const { validator: o } = t, i = N(t, G);
  if (b(o)) {
    let { validator: s } = r;
    s && (s = (a = (u = s).__original) !== null && a !== void 0 ? a : u), r.validator = w(s ? function(l) {
      return s.call(this, l) && o.call(this, l);
    } : o, r);
  }
  var u, a;
  return Object.assign(r, i);
}
function j(e) {
  return e.replace(/^(?!\s*$)/gm, "  ");
}
const M = () => d("any", {}), R = () => d("function", { type: Function }), H = () => d("boolean", { type: Boolean }), K = () => d("string", { type: String }), Q = () => d("number", { type: Number }), U = () => d("array", { type: Array }), W = () => d("object", { type: Object }), X = () => f("integer", { type: Number, validator: (e) => J(e) }), Z = () => f("symbol", { validator: (e) => typeof e == "symbol" });
function ee(e, n = "custom validation failed") {
  if (typeof e != "function")
    throw new TypeError("[VueTypes error]: You must provide a function as argument");
  return f(e.name || "<<anonymous function>>", { type: null, validator(t) {
    const r = e(t);
    return r || c(`${this._vueTypes_name} - ${n}`), r;
  } });
}
function te(e) {
  if (!h(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((r, o) => {
    if (o != null) {
      const i = o.constructor;
      r.indexOf(i) === -1 && r.push(i);
    }
    return r;
  }, []);
  return f("oneOf", { type: t.length > 0 ? t : void 0, validator(r) {
    const o = e.indexOf(r) !== -1;
    return o || c(n), o;
  } });
}
function ne(e) {
  if (!h(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument");
  let n = !1, t = [];
  for (let o = 0; o < e.length; o += 1) {
    const i = e[o];
    if (q(i)) {
      if (O(i) && i._vueTypes_name === "oneOf" && i.type) {
        t = t.concat(i.type);
        continue;
      }
      if (b(i.validator) && (n = !0), i.type === !0 || !i.type) {
        c('oneOfType - invalid usage of "true" or "null" as types.');
        continue;
      }
      t = t.concat(i.type);
    } else
      t.push(i);
  }
  t = t.filter((o, i) => t.indexOf(o) === i);
  const r = t.length > 0 ? t : null;
  return f("oneOfType", n ? { type: r, validator(o) {
    const i = [], u = e.some((a) => {
      const s = v(O(a) && a._vueTypes_name === "oneOf" ? a.type || null : a, o, !0);
      return typeof s == "string" && i.push(s), s === !0;
    });
    return u || c(`oneOfType - provided value does not match any of the ${i.length} passed-in validators:
${j(i.join(`
`))}`), u;
  } } : { type: r });
}
function re(e) {
  return f("arrayOf", { type: Array, validator(n) {
    let t = "";
    const r = n.every((o) => (t = v(e, o, !0), t === !0));
    return r || c(`arrayOf - value validation error:
${j(t)}`), r;
  } });
}
function oe(e) {
  return f("instanceOf", { type: e });
}
function ie(e) {
  return f("objectOf", { type: Object, validator(n) {
    let t = "";
    const r = Object.keys(n).every((o) => (t = v(e, n[o], !0), t === !0));
    return r || c(`objectOf - value validation error:
${j(t)}`), r;
  } });
}
function ae(e) {
  const n = Object.keys(e), t = n.filter((o) => {
    var i;
    return !((i = e[o]) === null || i === void 0 || !i.required);
  }), r = f("shape", { type: Object, validator(o) {
    if (!y(o))
      return !1;
    const i = Object.keys(o);
    if (t.length > 0 && t.some((u) => i.indexOf(u) === -1)) {
      const u = t.filter((a) => i.indexOf(a) === -1);
      return c(u.length === 1 ? `shape - required property "${u[0]}" is not defined.` : `shape - required properties "${u.join('", "')}" are not defined.`), !1;
    }
    return i.every((u) => {
      if (n.indexOf(u) === -1)
        return this._vueTypes_isLoose === !0 || (c(`shape - shape definition does not include a "${u}" property. Allowed keys: "${n.join('", "')}".`), !1);
      const a = v(e[u], o[u], !0);
      return typeof a == "string" && c(`shape - "${u}" property validation error:
 ${j(a)}`), a === !0;
    });
  } });
  return Object.defineProperty(r, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(r, "loose", { get() {
    return this._vueTypes_isLoose = !0, this;
  } }), r;
}
const se = ["name", "validate", "getter"], ue = /* @__PURE__ */ (() => {
  var e;
  return (e = class {
    static get any() {
      return M();
    }
    static get func() {
      return R().def(this.defaults.func);
    }
    static get bool() {
      return H().def(this.defaults.bool);
    }
    static get string() {
      return K().def(this.defaults.string);
    }
    static get number() {
      return Q().def(this.defaults.number);
    }
    static get array() {
      return U().def(this.defaults.array);
    }
    static get object() {
      return W().def(this.defaults.object);
    }
    static get integer() {
      return X().def(this.defaults.integer);
    }
    static get symbol() {
      return Z();
    }
    static get nullable() {
      return { type: null };
    }
    static extend(n) {
      if (h(n))
        return n.forEach((s) => this.extend(s)), this;
      const { name: t, validate: r = !1, getter: o = !1 } = n, i = N(n, se);
      if (g(this, t))
        throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);
      const { type: u } = i;
      if (O(u))
        return delete i.type, Object.defineProperty(this, t, o ? { get: () => P(t, u, i) } : { value(...s) {
          const l = P(t, u, i);
          return l.validator && (l.validator = l.validator.bind(l, ...s)), l;
        } });
      let a;
      return a = o ? { get() {
        const s = Object.assign({}, i);
        return r ? d(t, s) : f(t, s);
      }, enumerable: !0 } : { value(...s) {
        const l = Object.assign({}, i);
        let p;
        return p = r ? d(t, l) : f(t, l), l.validator && (p.validator = l.validator.bind(p, ...s)), p;
      }, enumerable: !0 }, Object.defineProperty(this, t, a);
    }
  }).defaults = {}, e.sensibleDefaults = void 0, e.config = _, e.custom = ee, e.oneOf = te, e.instanceOf = oe, e.oneOfType = ne, e.arrayOf = re, e.objectOf = ie, e.shape = ae, e.utils = { validate: (n, t) => v(t, n, !0) === !0, toType: (n, t, r = !1) => r ? d(n, t) : f(n, t) }, e;
})();
function D(e = { func: () => {
}, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
  var n;
  return (n = class extends ue {
    static get sensibleDefaults() {
      return m({}, this.defaults);
    }
    static set sensibleDefaults(t) {
      this.defaults = t !== !1 ? m({}, t !== !0 ? t : e) : {};
    }
  }).defaults = m({}, e), n;
}
class ve extends D() {
}
const le = D({
  func: void 0,
  bool: void 0,
  string: void 0,
  number: void 0,
  object: void 0,
  integer: void 0
});
le.extend([
  {
    name: "style",
    getter: !0,
    type: [String, Object],
    default: void 0
  },
  {
    name: "VNodeChild",
    getter: !0,
    type: void 0
  }
]);
const T = () => Y(() => import("./index-7b265206.mjs"));
T.install = function(e, n) {
  V && e.component(n || "GBpmnViewer", T());
};
const ge = {
  title: "BpmnViewer 流程图",
  category: "高级组件",
  status: "100%",
  install(e) {
    V && e.component("GBpmnViewer", T());
  }
};
export {
  T as B,
  ge as i,
  ye as p
};
