@uozi-admin/curd
Version:
Easy to implement curd.
1,231 lines • 188 kB
JavaScript
import { readonly as kn, watch as xe, getCurrentScope as wo, onScopeDispose as So, toRef as Co, customRef as $n, ref as B, toValue as Nt, nextTick as ut, inject as In, toRaw as Eo, reactive as Pe, computed as W, watchEffect as ea, defineComponent as ie, useModel as pe, openBlock as w, createBlock as U, unref as f, mergeProps as me, mergeModels as ve, createElementBlock as le, createVNode as T, withCtx as I, createTextVNode as ne, toDisplayString as V, createCommentVNode as ce, createElementVNode as re, withKeys as Do, Fragment as Oe, renderList as dt, withDirectives as Mn, vShow as Rn, renderSlot as fe, onMounted as ca, withModifiers as xo, h as ta, onUnmounted as To, normalizeClass as aa, onBeforeUnmount as ko, normalizeProps as An, guardReactiveProps as Pn, getCurrentInstance as $o, useSlots as Io, createSlots as ln, provide as Mo } from "vue";
import { useRoute as Ro, useRouter as Ao } from "vue-router";
import { AutoComplete as Po, Cascader as Oo, CheckboxGroup as Fo, DatePicker as _o, Input as _a, InputNumber as Bo, InputGroup as No, InputPassword as Uo, Button as Se, RadioGroup as On, RangePicker as Lo, Rate as zo, Select as Fn, Modal as At, Flex as yt, Form as Ot, FormItem as Ba, Dropdown as Yo, Checkbox as Ra, Table as _n, Popconfirm as ha, Slider as jo, Switch as Ko, TimePicker as Wo, FormItemRest as Bn, RadioButton as sn, UploadDragger as Ho, Progress as Vo, Textarea as qo, Row as Go, Col as Xo, message as We, Descriptions as un, DescriptionsItem as dn, Card as Qo, Spin as Jo, Divider as Zo, Pagination as er, Image as tr } from "ant-design-vue";
import { cloneDeep as Le, get as Ie, set as na, merge as Na, isNumber as Ua, isEqual as cn, debounce as ar, isNil as ga, isArray as nr, assign as or } from "lodash-es";
import { utils as ya, writeFile as rr } from "xlsx";
import { useConfigContextInject as lr } from "ant-design-vue/es/config-provider/context";
import { useI18n as Nn, createI18n as Un } from "vue-i18n";
import { UpOutlined as ir, DownOutlined as sr, SettingOutlined as ur, HolderOutlined as Ln, ReloadOutlined as dr, FileOutlined as fn, FolderOutlined as cr, InboxOutlined as fr, DeleteOutlined as pr } from "@ant-design/icons-vue";
function vr(e, t) {
return wo() ? (So(e, t), !0) : !1;
}
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const mr = () => {
};
function hr(...e) {
if (e.length !== 1) return Co(...e);
const t = e[0];
return typeof t == "function" ? kn($n(() => ({
get: t,
set: mr
}))) : B(t);
}
function gr(e, t) {
function n(...a) {
return new Promise((o, r) => {
Promise.resolve(e(() => t.apply(this, a), {
fn: t,
thisArg: this,
args: a
})).then(o).catch(r);
});
}
return n;
}
const zn = (e) => e();
function yr(e = zn, t = {}) {
const { initialState: n = "active" } = t, a = hr(n === "active");
function o() {
a.value = !1;
}
function r() {
a.value = !0;
}
const l = (...i) => {
a.value && e(...i);
};
return {
isActive: kn(a),
pause: o,
resume: r,
eventFilter: l
};
}
function br(e, t, n = {}) {
const { eventFilter: a = zn, ...o } = n;
return xe(e, gr(a, t), o);
}
function Yn(e, t, n = {}) {
const { eventFilter: a, initialState: o = "active", ...r } = n, { eventFilter: l, pause: i, resume: u, isActive: d } = yr(a, { initialState: o });
return {
stop: br(e, t, {
...r,
eventFilter: l
}),
pause: i,
resume: u,
isActive: d
};
}
const ba = /* @__PURE__ */ new WeakMap();
function mt(e, t, n = {}) {
const { mode: a = "replace", route: o = Ro(), router: r = Ao(), transform: l } = n;
let i = (m) => m, u = (m) => m;
typeof l == "function" ? i = l : l && (l.get && (i = l.get), l.set && (u = l.set)), ba.has(r) || ba.set(r, /* @__PURE__ */ new Map());
const d = ba.get(r);
let c = o.query[e];
vr(() => {
c = void 0;
});
let s;
const p = $n((m, h) => (s = h, {
get() {
return m(), i(c !== void 0 ? c : Nt(t));
},
set(g) {
g = u(g), c !== g && (c = g === Nt(t) ? void 0 : g, d.set(e, g === Nt(t) ? void 0 : g), h(), ut(() => {
if (d.size === 0) return;
const k = Object.fromEntries(d.entries());
d.clear();
const { params: v, query: C, hash: $ } = o;
r[Nt(a)]({
params: v,
query: {
...C,
...k
},
hash: $
});
}));
}
}));
return xe(() => o.query[e], (m) => {
c !== i(m) && (c = m, s());
}, { flush: "sync" }), p;
}
const La = "YYYY-MM-DD", za = "YYYY-MM-DD HH:mm:ss", Ya = "HH:mm:ss", ja = "YYYY", Ka = "YYYY-MM", Wa = "YYYY-wo", ec = La, tc = za, ac = Ya, nc = ja, oc = Ka, rc = Wa;
let Pt = {
date: La,
datetime: za,
time: Ya,
year: ja,
month: Ka,
week: Wa
};
function jn(e) {
Pt = { ...Pt, ...e };
}
function lc() {
return { ...Pt };
}
function ic(e) {
return Pt[e];
}
const Ge = new Proxy({}, {
get(e, t) {
return Pt[t];
}
}), wr = "Total", Sr = "View", Cr = "Edit", Er = "Restore", Dr = "Delete Permanently", xr = "Search", Tr = "Reset", kr = "Close", $r = "OK", Ir = "Selector", Mr = "Generate", Rr = "Save", Ar = "Add", Pr = "Trash", Or = "Back to List", Fr = "Export Excel", _r = "List", Br = "Please fill all fields correctly", Nr = "Are you sure you want to delete?", Ur = "Are you sure you want to restore?", Lr = "Are you sure you want to delete permanently?", zr = "Saved successfully", Yr = "Deleted successfully", jr = "Restored successfully", Kr = "Select all", Wr = "Batch Edit", Hr = "Please select at least one item", Vr = "Batch Modify", qr = "Save successfully", Gr = "Save successful", Xr = "Cancel", Qr = "Belows are selected items that you want to batch modify", Jr = "Leave blank if do not want to modify", Zr = "No", el = { required: "This field should not be empty", email: "This field should be a valid email address", db_unique: "This value is already taken", hostname: "This field should be a valid hostname", safety_text: "This field should only contain letters, unicode characters, numbers, and -_./:" }, tl = { uploadFiles: "Upload Files", uploadFolders: "Upload Folders", clickOrDragFilesToThisAreaToUpload: "Click or drag files to this area to upload", clickOrDragFoldersToThisAreaToUpload: "Click or drag folders to this area to upload", supportForSingleOrBatchUploadOfFiles: "Support single or batch upload of files", supportForUploadingEntireFolders: "Support uploading entire folders", mainTipsForFiles: "Click or drag files to this area to upload", mainTipsForFolders: "Click or drag folders to this area to upload", subTipsForFiles: "Support single or batch upload of files", subTipsForFolders: "Support uploading entire folders", selectedFiles: "Selected {count} files", processing: "Processing {count}/{total}", path: "Path", size: "Size" }, al = "Apply", nl = "Refresh", ol = "Collapse", rl = "Expand", ll = {
total: wr,
"item(s)": "item(s)",
view: Sr,
edit: Cr,
delete: "Delete",
restore: Er,
deletePermanently: Dr,
search: xr,
reset: Tr,
close: kr,
ok: $r,
selectorTitle: Ir,
generate: Mr,
save: Rr,
add: Ar,
trash: Pr,
backToList: Or,
exportExcel: Fr,
list: _r,
formValidateError: Br,
deleteConfirm: Nr,
restoreConfirm: Ur,
deletePermanentlyConfirm: Lr,
savedSuccessfully: zr,
deletedSuccessfully: Yr,
restoredSuccessfully: jr,
selectAll: Kr,
batchEdit: Wr,
pleaseSelectAtLeastOneItem: Hr,
batchModify: Vr,
saveSuccessfully: qr,
saveSuccess: Gr,
cancel: Xr,
belowsAreSelectedItems: Qr,
leaveBlankIfDoNotWantToModify: Jr,
no: Zr,
validate: el,
upload: tl,
"Column Settings": "Column Settings",
Apply: al,
"Confirm Delete": "Confirm Delete",
"Please Input": "Please enter",
"to comfirm delete": "to confirm deletion",
"to confirm deletion": "to confirm deletion",
refresh: nl,
collapse: ol,
expand: rl
}, il = "总计", sl = "查看", ul = "编辑", dl = "恢复", cl = "永久删除", fl = "搜索", pl = "重置", vl = "关闭", ml = "确定", hl = "选择器", gl = "生成", yl = "保存", bl = "添加", wl = "回收站", Sl = "返回列表", Cl = "导出 Excel", El = "列表", Dl = "请正确填写所有字段", xl = "确定要删除吗?", Tl = "确定要恢复吗?", kl = "确定要永久删除吗?", $l = "保存成功", Il = "删除成功", Ml = "恢复成功", Rl = "全选", Al = "批量编辑", Pl = "请至少选择一项", Ol = "批量修改", Fl = "保存成功", _l = "保存成功", Bl = "取消", Nl = "以下是您要批量修改的选中项", Ul = "如不想修改请留空", Ll = "取消", zl = { required: "此字段不能为空", email: "此字段应该是有效的电子邮件地址", db_unique: "此值已被占用", hostname: "此字段应该是有效的主机名", safety_text: "此字段应该只包含字母、Unicode字符、数字和-_./:" }, Yl = { uploadFiles: "上传文件", uploadFolders: "上传文件夹", clickOrDragFilesToThisAreaToUpload: "点击或拖拽文件到此区域上传", clickOrDragFoldersToThisAreaToUpload: "点击或拖拽文件夹到此区域上传", supportForSingleOrBatchUploadOfFiles: "支持单个或批量上传文件", supportForUploadingEntireFolders: "支持上传整个文件夹", mainTipsForFiles: "点击或拖拽文件到此区域上传", mainTipsForFolders: "点击或拖拽文件夹到此区域上传", subTipsForFiles: "支持单个或批量上传文件", subTipsForFolders: "支持上传整个文件夹", selectedFiles: "已选择 {count} 个文件", processing: "处理中 {count}/{total}", path: "路径", size: "大小" }, jl = "应用", Kl = "刷新", Wl = "折叠", Hl = "展开", Vl = {
total: il,
"item(s)": "项",
view: sl,
edit: ul,
delete: "删除",
restore: dl,
deletePermanently: cl,
search: fl,
reset: pl,
close: vl,
ok: ml,
selectorTitle: hl,
generate: gl,
save: yl,
add: bl,
trash: wl,
backToList: Sl,
exportExcel: Cl,
list: El,
formValidateError: Dl,
deleteConfirm: xl,
restoreConfirm: Tl,
deletePermanentlyConfirm: kl,
savedSuccessfully: $l,
deletedSuccessfully: Il,
restoredSuccessfully: Ml,
selectAll: Rl,
batchEdit: Al,
pleaseSelectAtLeastOneItem: Pl,
batchModify: Ol,
saveSuccessfully: Fl,
saveSuccess: _l,
cancel: Bl,
belowsAreSelectedItems: Nl,
leaveBlankIfDoNotWantToModify: Ul,
no: Ll,
validate: zl,
upload: Yl,
"Column Settings": "列设置",
Apply: jl,
"Confirm Delete": "确认删除",
"Please Input": "请输入",
"to comfirm delete": "确认删除",
"to confirm deletion": "确认删除",
refresh: Kl,
collapse: Wl,
expand: Hl
}, ql = "總計", Gl = "查看", Xl = "編輯", Ql = "恢復", Jl = "永久刪除", Zl = "搜索", ei = "重設", ti = "關閉", ai = "確定", ni = "選擇器", oi = "生成", ri = "保存", li = "新增", ii = "回收站", si = "返回列表", ui = "導出 Excel", di = "列表", ci = "請正確填寫所有欄位", fi = "確定要刪除嗎?", pi = "確定要恢復嗎?", vi = "確定要永久刪除嗎?", mi = "保存成功", hi = "刪除成功", gi = "恢復成功", yi = "全選", bi = "批量編輯", wi = "請至少選擇一項", Si = "批量修改", Ci = "保存成功", Ei = "保存成功", Di = "取消", xi = "以下是您要批量修改的選中項", Ti = "如不想修改請留空", ki = "取消", $i = { required: "此欄位不能為空", email: "此欄位應該是有效的電子郵件地址", db_unique: "此值已被佔用", hostname: "此欄位應該是有效的主機名", safety_text: "此欄位應該只包含字母、Unicode字符、數字和-_./:" }, Ii = { uploadFiles: "上傳文件", uploadFolders: "上傳文件夾", clickOrDragFilesToThisAreaToUpload: "點擊或拖拽文件到此區域上傳", clickOrDragFoldersToThisAreaToUpload: "點擊或拖拽文件夾到此區域上傳", supportForSingleOrBatchUploadOfFiles: "支持單個或批量上傳文件", supportForUploadingEntireFolders: "支持上傳整個文件夾", mainTipsForFiles: "點擊或拖拽文件到此區域上傳", mainTipsForFolders: "點擊或拖拽文件夾到此區域上傳", subTipsForFiles: "支持單個或批量上傳文件", subTipsForFolders: "支持上傳整個文件夾", selectedFiles: "已選擇 {count} 個文件", processing: "處理中 {count}/{total}", path: "路徑", size: "大小" }, Mi = "應用", Ri = "刷新", Ai = "折疊", Pi = "展開", Oi = {
total: ql,
"item(s)": "項",
view: Gl,
edit: Xl,
delete: "刪除",
restore: Ql,
deletePermanently: Jl,
search: Zl,
reset: ei,
close: ti,
ok: ai,
selectorTitle: ni,
generate: oi,
save: ri,
add: li,
trash: ii,
backToList: si,
exportExcel: ui,
list: di,
formValidateError: ci,
deleteConfirm: fi,
restoreConfirm: pi,
deletePermanentlyConfirm: vi,
savedSuccessfully: mi,
deletedSuccessfully: hi,
restoredSuccessfully: gi,
selectAll: yi,
batchEdit: bi,
pleaseSelectAtLeastOneItem: wi,
batchModify: Si,
saveSuccessfully: Ci,
saveSuccess: Ei,
cancel: Di,
belowsAreSelectedItems: xi,
leaveBlankIfDoNotWantToModify: Ti,
no: ki,
validate: $i,
upload: Ii,
"Column Settings": "列設置",
Apply: Mi,
"Confirm Delete": "確認刪除",
"Please Input": "請輸入",
"to comfirm delete": "確認刪除",
"to confirm deletion": "確認刪除",
refresh: Ri,
collapse: Ai,
expand: Pi
}, Fi = "總計", _i = "檢視", Bi = "編輯", Ni = "復原", Ui = "永久刪除", Li = "搜尋", zi = "重設", Yi = "關閉", ji = "確定", Ki = "選擇器", Wi = "產生", Hi = "儲存", Vi = "新增", qi = "資源回收桶", Gi = "返回列表", Xi = "匯出 Excel", Qi = "列表", Ji = "請正確填寫所有欄位", Zi = "確定要刪除嗎?", es = "確定要復原嗎?", ts = "確定要永久刪除嗎?", as = "儲存成功", ns = "刪除成功", os = "復原成功", rs = "全選", ls = "批量編輯", is = "請至少選擇一項", ss = "批量修改", us = "儲存成功", ds = "儲存成功", cs = "取消", fs = "以下是您要批量修改的選中項", ps = "如不想修改請留空", vs = "取消", ms = { required: "此欄位不能為空", email: "此欄位應該是有效的電子郵件地址", db_unique: "此值已被佔用", hostname: "此欄位應該是有效的主機名", safety_text: "此欄位應該只包含字母、Unicode字元、數字和-_./:" }, hs = { uploadFiles: "上傳文件", uploadFolders: "上傳文件夾", clickOrDragFilesToThisAreaToUpload: "點擊或拖拽文件到此區域上傳", clickOrDragFoldersToThisAreaToUpload: "點擊或拖拽文件夾到此區域上傳", supportForSingleOrBatchUploadOfFiles: "支持單個或批量上傳文件", supportForUploadingEntireFolders: "支持上傳整個文件夾", mainTipsForFiles: "點擊或拖拽文件到此區域上傳", mainTipsForFolders: "點擊或拖拽文件夾到此區域上傳", subTipsForFiles: "支持單個或批量上傳文件", subTipsForFolders: "支持上傳整個文件夾", selectedFiles: "已選擇 {count} 個文件", processing: "處理中 {count}/{total}", path: "路徑", size: "大小" }, gs = "應用", ys = "刷新", bs = "折疊", ws = "展開", Ss = {
total: Fi,
"item(s)": "項",
view: _i,
edit: Bi,
delete: "刪除",
restore: Ni,
deletePermanently: Ui,
search: Li,
reset: zi,
close: Yi,
ok: ji,
selectorTitle: Ki,
generate: Wi,
save: Hi,
add: Vi,
trash: qi,
backToList: Gi,
exportExcel: Xi,
list: Qi,
formValidateError: Ji,
deleteConfirm: Zi,
restoreConfirm: es,
deletePermanentlyConfirm: ts,
savedSuccessfully: as,
deletedSuccessfully: ns,
restoredSuccessfully: os,
selectAll: rs,
batchEdit: ls,
pleaseSelectAtLeastOneItem: is,
batchModify: ss,
saveSuccessfully: us,
saveSuccess: ds,
cancel: cs,
belowsAreSelectedItems: fs,
leaveBlankIfDoNotWantToModify: ps,
no: vs,
validate: ms,
upload: hs,
"Column Settings": "列設置",
Apply: gs,
"Confirm Delete": "確認刪除",
"Please Input": "請輸入",
"to comfirm delete": "確認刪除",
"to confirm deletion": "確認刪除",
refresh: ys,
collapse: bs,
expand: ws
}, wt = {
listApi: {
paginationPath: "$.pagination",
paginationMap: {
params: {
current: "current",
pageSize: "pageSize"
},
response: {
current: "current",
pageSize: "pageSize",
total: "total",
totalPages: "totalPages"
}
}
},
i18n: {
legacy: !1,
locale: "zh-CN",
fallbackLocale: "en-US",
messages: {
"zh-CN": Vl,
"zh-HK": Oi,
"zh-TW": Ss,
"en-US": ll
}
},
dateFormat: {
date: La,
datetime: za,
time: Ya,
year: ja,
month: Ka,
week: Wa
},
time: {
timestamp: !1
},
selector: {
omitZeroString: !0
},
search: {
showSearchBtn: !1,
hideResetBtn: !0
},
deleteConfirmConfig: {
mode: "popconfirm",
valueKey: "id"
},
modal: {
width: 600
}
}, fa = /* @__PURE__ */ Symbol("curdConfig");
function ct() {
return In(fa, wt);
}
function Cs() {
try {
return In(fa, wt);
} catch {
return wt;
}
}
function pn(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
t && (a = a.filter(function(o) {
return Object.getOwnPropertyDescriptor(e, o).enumerable;
})), n.push.apply(n, a);
}
return n;
}
function Xe(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? pn(Object(n), !0).forEach(function(a) {
Es(e, a, n[a]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pn(Object(n)).forEach(function(a) {
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
});
}
return e;
}
function Kt(e) {
"@babel/helpers - typeof";
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Kt = function(t) {
return typeof t;
} : Kt = function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, Kt(e);
}
function Es(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function Je() {
return Je = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var a in n)
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
}
return e;
}, Je.apply(this, arguments);
}
function Ds(e, t) {
if (e == null) return {};
var n = {}, a = Object.keys(e), o, r;
for (r = 0; r < a.length; r++)
o = a[r], !(t.indexOf(o) >= 0) && (n[o] = e[o]);
return n;
}
function xs(e, t) {
if (e == null) return {};
var n = Ds(e, t), a, o;
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
for (o = 0; o < r.length; o++)
a = r[o], !(t.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(e, a) && (n[a] = e[a]);
}
return n;
}
var Ts = "1.15.6";
function Qe(e) {
if (typeof window < "u" && window.navigator)
return !!/* @__PURE__ */ navigator.userAgent.match(e);
}
var Ze = Qe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Ft = Qe(/Edge/i), vn = Qe(/firefox/i), Tt = Qe(/safari/i) && !Qe(/chrome/i) && !Qe(/android/i), Ha = Qe(/iP(ad|od|hone)/i), Kn = Qe(/chrome/i) && Qe(/android/i), Wn = {
capture: !1,
passive: !1
};
function ae(e, t, n) {
e.addEventListener(t, n, !Ze && Wn);
}
function ee(e, t, n) {
e.removeEventListener(t, n, !Ze && Wn);
}
function oa(e, t) {
if (t) {
if (t[0] === ">" && (t = t.substring(1)), e)
try {
if (e.matches)
return e.matches(t);
if (e.msMatchesSelector)
return e.msMatchesSelector(t);
if (e.webkitMatchesSelector)
return e.webkitMatchesSelector(t);
} catch {
return !1;
}
return !1;
}
}
function Hn(e) {
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
}
function He(e, t, n, a) {
if (e) {
n = n || document;
do {
if (t != null && (t[0] === ">" ? e.parentNode === n && oa(e, t) : oa(e, t)) || a && e === n)
return e;
if (e === n) break;
} while (e = Hn(e));
}
return null;
}
var mn = /\s+/g;
function Be(e, t, n) {
if (e && t)
if (e.classList)
e.classList[n ? "add" : "remove"](t);
else {
var a = (" " + e.className + " ").replace(mn, " ").replace(" " + t + " ", " ");
e.className = (a + (n ? " " + t : "")).replace(mn, " ");
}
}
function q(e, t, n) {
var a = e && e.style;
if (a) {
if (n === void 0)
return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
!(t in a) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), a[t] = n + (typeof n == "string" ? "" : "px");
}
}
function bt(e, t) {
var n = "";
if (typeof e == "string")
n = e;
else
do {
var a = q(e, "transform");
a && a !== "none" && (n = a + " " + n);
} while (!t && (e = e.parentNode));
var o = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
return o && new o(n);
}
function Vn(e, t, n) {
if (e) {
var a = e.getElementsByTagName(t), o = 0, r = a.length;
if (n)
for (; o < r; o++)
n(a[o], o);
return a;
}
return [];
}
function qe() {
var e = document.scrollingElement;
return e || document.documentElement;
}
function Ee(e, t, n, a, o) {
if (!(!e.getBoundingClientRect && e !== window)) {
var r, l, i, u, d, c, s;
if (e !== window && e.parentNode && e !== qe() ? (r = e.getBoundingClientRect(), l = r.top, i = r.left, u = r.bottom, d = r.right, c = r.height, s = r.width) : (l = 0, i = 0, u = window.innerHeight, d = window.innerWidth, c = window.innerHeight, s = window.innerWidth), (t || n) && e !== window && (o = o || e.parentNode, !Ze))
do
if (o && o.getBoundingClientRect && (q(o, "transform") !== "none" || n && q(o, "position") !== "static")) {
var p = o.getBoundingClientRect();
l -= p.top + parseInt(q(o, "border-top-width")), i -= p.left + parseInt(q(o, "border-left-width")), u = l + r.height, d = i + r.width;
break;
}
while (o = o.parentNode);
if (a && e !== window) {
var m = bt(o || e), h = m && m.a, g = m && m.d;
m && (l /= g, i /= h, s /= h, c /= g, u = l + c, d = i + s);
}
return {
top: l,
left: i,
bottom: u,
right: d,
width: s,
height: c
};
}
}
function hn(e, t, n) {
for (var a = ot(e, !0), o = Ee(e)[t]; a; ) {
var r = Ee(a)[n], l = void 0;
if (l = o >= r, !l) return a;
if (a === qe()) break;
a = ot(a, !1);
}
return !1;
}
function St(e, t, n, a) {
for (var o = 0, r = 0, l = e.children; r < l.length; ) {
if (l[r].style.display !== "none" && l[r] !== H.ghost && (a || l[r] !== H.dragged) && He(l[r], n.draggable, e, !1)) {
if (o === t)
return l[r];
o++;
}
r++;
}
return null;
}
function Va(e, t) {
for (var n = e.lastElementChild; n && (n === H.ghost || q(n, "display") === "none" || t && !oa(n, t)); )
n = n.previousElementSibling;
return n || null;
}
function Ue(e, t) {
var n = 0;
if (!e || !e.parentNode)
return -1;
for (; e = e.previousElementSibling; )
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== H.clone && (!t || oa(e, t)) && n++;
return n;
}
function gn(e) {
var t = 0, n = 0, a = qe();
if (e)
do {
var o = bt(e), r = o.a, l = o.d;
t += e.scrollLeft * r, n += e.scrollTop * l;
} while (e !== a && (e = e.parentNode));
return [t, n];
}
function ks(e, t) {
for (var n in e)
if (e.hasOwnProperty(n)) {
for (var a in t)
if (t.hasOwnProperty(a) && t[a] === e[n][a]) return Number(n);
}
return -1;
}
function ot(e, t) {
if (!e || !e.getBoundingClientRect) return qe();
var n = e, a = !1;
do
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
var o = q(n);
if (n.clientWidth < n.scrollWidth && (o.overflowX == "auto" || o.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (o.overflowY == "auto" || o.overflowY == "scroll")) {
if (!n.getBoundingClientRect || n === document.body) return qe();
if (a || t) return n;
a = !0;
}
}
while (n = n.parentNode);
return qe();
}
function $s(e, t) {
if (e && t)
for (var n in t)
t.hasOwnProperty(n) && (e[n] = t[n]);
return e;
}
function wa(e, t) {
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
}
var kt;
function qn(e, t) {
return function() {
if (!kt) {
var n = arguments, a = this;
n.length === 1 ? e.call(a, n[0]) : e.apply(a, n), kt = setTimeout(function() {
kt = void 0;
}, t);
}
};
}
function Is() {
clearTimeout(kt), kt = void 0;
}
function Gn(e, t, n) {
e.scrollLeft += t, e.scrollTop += n;
}
function Xn(e) {
var t = window.Polymer, n = window.jQuery || window.Zepto;
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
}
function Qn(e, t, n) {
var a = {};
return Array.from(e.children).forEach(function(o) {
var r, l, i, u;
if (!(!He(o, t.draggable, e, !1) || o.animated || o === n)) {
var d = Ee(o);
a.left = Math.min((r = a.left) !== null && r !== void 0 ? r : 1 / 0, d.left), a.top = Math.min((l = a.top) !== null && l !== void 0 ? l : 1 / 0, d.top), a.right = Math.max((i = a.right) !== null && i !== void 0 ? i : -1 / 0, d.right), a.bottom = Math.max((u = a.bottom) !== null && u !== void 0 ? u : -1 / 0, d.bottom);
}
}), a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
var _e = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function Ms() {
var e = [], t;
return {
captureAnimationState: function() {
if (e = [], !!this.options.animation) {
var a = [].slice.call(this.el.children);
a.forEach(function(o) {
if (!(q(o, "display") === "none" || o === H.ghost)) {
e.push({
target: o,
rect: Ee(o)
});
var r = Xe({}, e[e.length - 1].rect);
if (o.thisAnimationDuration) {
var l = bt(o, !0);
l && (r.top -= l.f, r.left -= l.e);
}
o.fromRect = r;
}
});
}
},
addAnimationState: function(a) {
e.push(a);
},
removeAnimationState: function(a) {
e.splice(ks(e, {
target: a
}), 1);
},
animateAll: function(a) {
var o = this;
if (!this.options.animation) {
clearTimeout(t), typeof a == "function" && a();
return;
}
var r = !1, l = 0;
e.forEach(function(i) {
var u = 0, d = i.target, c = d.fromRect, s = Ee(d), p = d.prevFromRect, m = d.prevToRect, h = i.rect, g = bt(d, !0);
g && (s.top -= g.f, s.left -= g.e), d.toRect = s, d.thisAnimationDuration && wa(p, s) && !wa(c, s) && // Make sure animatingRect is on line between toRect & fromRect
(h.top - s.top) / (h.left - s.left) === (c.top - s.top) / (c.left - s.left) && (u = As(h, p, m, o.options)), wa(s, c) || (d.prevFromRect = c, d.prevToRect = s, u || (u = o.options.animation), o.animate(d, h, s, u)), u && (r = !0, l = Math.max(l, u), clearTimeout(d.animationResetTimer), d.animationResetTimer = setTimeout(function() {
d.animationTime = 0, d.prevFromRect = null, d.fromRect = null, d.prevToRect = null, d.thisAnimationDuration = null;
}, u), d.thisAnimationDuration = u);
}), clearTimeout(t), r ? t = setTimeout(function() {
typeof a == "function" && a();
}, l) : typeof a == "function" && a(), e = [];
},
animate: function(a, o, r, l) {
if (l) {
q(a, "transition", ""), q(a, "transform", "");
var i = bt(this.el), u = i && i.a, d = i && i.d, c = (o.left - r.left) / (u || 1), s = (o.top - r.top) / (d || 1);
a.animatingX = !!c, a.animatingY = !!s, q(a, "transform", "translate3d(" + c + "px," + s + "px,0)"), this.forRepaintDummy = Rs(a), q(a, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), q(a, "transform", "translate3d(0,0,0)"), typeof a.animated == "number" && clearTimeout(a.animated), a.animated = setTimeout(function() {
q(a, "transition", ""), q(a, "transform", ""), a.animated = !1, a.animatingX = !1, a.animatingY = !1;
}, l);
}
}
};
}
function Rs(e) {
return e.offsetWidth;
}
function As(e, t, n, a) {
return Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) / Math.sqrt(Math.pow(t.top - n.top, 2) + Math.pow(t.left - n.left, 2)) * a.animation;
}
var pt = [], Sa = {
initializeByDefault: !0
}, _t = {
mount: function(t) {
for (var n in Sa)
Sa.hasOwnProperty(n) && !(n in t) && (t[n] = Sa[n]);
pt.forEach(function(a) {
if (a.pluginName === t.pluginName)
throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
}), pt.push(t);
},
pluginEvent: function(t, n, a) {
var o = this;
this.eventCanceled = !1, a.cancel = function() {
o.eventCanceled = !0;
};
var r = t + "Global";
pt.forEach(function(l) {
n[l.pluginName] && (n[l.pluginName][r] && n[l.pluginName][r](Xe({
sortable: n
}, a)), n.options[l.pluginName] && n[l.pluginName][t] && n[l.pluginName][t](Xe({
sortable: n
}, a)));
});
},
initializePlugins: function(t, n, a, o) {
pt.forEach(function(i) {
var u = i.pluginName;
if (!(!t.options[u] && !i.initializeByDefault)) {
var d = new i(t, n, t.options);
d.sortable = t, d.options = t.options, t[u] = d, Je(a, d.defaults);
}
});
for (var r in t.options)
if (t.options.hasOwnProperty(r)) {
var l = this.modifyOption(t, r, t.options[r]);
typeof l < "u" && (t.options[r] = l);
}
},
getEventProperties: function(t, n) {
var a = {};
return pt.forEach(function(o) {
typeof o.eventProperties == "function" && Je(a, o.eventProperties.call(n[o.pluginName], t));
}), a;
},
modifyOption: function(t, n, a) {
var o;
return pt.forEach(function(r) {
t[r.pluginName] && r.optionListeners && typeof r.optionListeners[n] == "function" && (o = r.optionListeners[n].call(t[r.pluginName], a));
}), o;
}
};
function Ps(e) {
var t = e.sortable, n = e.rootEl, a = e.name, o = e.targetEl, r = e.cloneEl, l = e.toEl, i = e.fromEl, u = e.oldIndex, d = e.newIndex, c = e.oldDraggableIndex, s = e.newDraggableIndex, p = e.originalEvent, m = e.putSortable, h = e.extraEventProperties;
if (t = t || n && n[_e], !!t) {
var g, k = t.options, v = "on" + a.charAt(0).toUpperCase() + a.substr(1);
window.CustomEvent && !Ze && !Ft ? g = new CustomEvent(a, {
bubbles: !0,
cancelable: !0
}) : (g = document.createEvent("Event"), g.initEvent(a, !0, !0)), g.to = l || n, g.from = i || n, g.item = o || n, g.clone = r, g.oldIndex = u, g.newIndex = d, g.oldDraggableIndex = c, g.newDraggableIndex = s, g.originalEvent = p, g.pullMode = m ? m.lastPutMode : void 0;
var C = Xe(Xe({}, h), _t.getEventProperties(a, t));
for (var $ in C)
g[$] = C[$];
n && n.dispatchEvent(g), k[v] && k[v].call(t, g);
}
}
var Os = ["evt"], Fe = function(t, n) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = a.evt, r = xs(a, Os);
_t.pluginEvent.bind(H)(t, n, Xe({
dragEl: S,
parentEl: we,
ghostEl: X,
rootEl: ge,
nextEl: st,
lastDownEl: Wt,
cloneEl: be,
cloneHidden: nt,
dragStarted: Et,
putSortable: Te,
activeSortable: H.active,
originalEvent: o,
oldIndex: gt,
oldDraggableIndex: $t,
newIndex: Ne,
newDraggableIndex: at,
hideGhostForTarget: to,
unhideGhostForTarget: ao,
cloneNowHidden: function() {
nt = !0;
},
cloneNowShown: function() {
nt = !1;
},
dispatchSortableEvent: function(i) {
Ae({
sortable: n,
name: i,
originalEvent: o
});
}
}, r));
};
function Ae(e) {
Ps(Xe({
putSortable: Te,
cloneEl: be,
targetEl: S,
rootEl: ge,
oldIndex: gt,
oldDraggableIndex: $t,
newIndex: Ne,
newDraggableIndex: at
}, e));
}
var S, we, X, ge, st, Wt, be, nt, gt, Ne, $t, at, Ut, Te, ht = !1, ra = !1, la = [], lt, Ke, Ca, Ea, yn, bn, Et, vt, It, Mt = !1, Lt = !1, Ht, $e, Da = [], Aa = !1, ia = [], pa = typeof document < "u", zt = Ha, wn = Ft || Ze ? "cssFloat" : "float", Fs = pa && !Kn && !Ha && "draggable" in document.createElement("div"), Jn = (function() {
if (pa) {
if (Ze)
return !1;
var e = document.createElement("x");
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
}
})(), Zn = function(t, n) {
var a = q(t), o = parseInt(a.width) - parseInt(a.paddingLeft) - parseInt(a.paddingRight) - parseInt(a.borderLeftWidth) - parseInt(a.borderRightWidth), r = St(t, 0, n), l = St(t, 1, n), i = r && q(r), u = l && q(l), d = i && parseInt(i.marginLeft) + parseInt(i.marginRight) + Ee(r).width, c = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + Ee(l).width;
if (a.display === "flex")
return a.flexDirection === "column" || a.flexDirection === "column-reverse" ? "vertical" : "horizontal";
if (a.display === "grid")
return a.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
if (r && i.float && i.float !== "none") {
var s = i.float === "left" ? "left" : "right";
return l && (u.clear === "both" || u.clear === s) ? "vertical" : "horizontal";
}
return r && (i.display === "block" || i.display === "flex" || i.display === "table" || i.display === "grid" || d >= o && a[wn] === "none" || l && a[wn] === "none" && d + c > o) ? "vertical" : "horizontal";
}, _s = function(t, n, a) {
var o = a ? t.left : t.top, r = a ? t.right : t.bottom, l = a ? t.width : t.height, i = a ? n.left : n.top, u = a ? n.right : n.bottom, d = a ? n.width : n.height;
return o === i || r === u || o + l / 2 === i + d / 2;
}, Bs = function(t, n) {
var a;
return la.some(function(o) {
var r = o[_e].options.emptyInsertThreshold;
if (!(!r || Va(o))) {
var l = Ee(o), i = t >= l.left - r && t <= l.right + r, u = n >= l.top - r && n <= l.bottom + r;
if (i && u)
return a = o;
}
}), a;
}, eo = function(t) {
function n(r, l) {
return function(i, u, d, c) {
var s = i.options.group.name && u.options.group.name && i.options.group.name === u.options.group.name;
if (r == null && (l || s))
return !0;
if (r == null || r === !1)
return !1;
if (l && r === "clone")
return r;
if (typeof r == "function")
return n(r(i, u, d, c), l)(i, u, d, c);
var p = (l ? i : u).options.group.name;
return r === !0 || typeof r == "string" && r === p || r.join && r.indexOf(p) > -1;
};
}
var a = {}, o = t.group;
(!o || Kt(o) != "object") && (o = {
name: o
}), a.name = o.name, a.checkPull = n(o.pull, !0), a.checkPut = n(o.put), a.revertClone = o.revertClone, t.group = a;
}, to = function() {
!Jn && X && q(X, "display", "none");
}, ao = function() {
!Jn && X && q(X, "display", "");
};
pa && !Kn && document.addEventListener("click", function(e) {
if (ra)
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), ra = !1, !1;
}, !0);
var it = function(t) {
if (S) {
t = t.touches ? t.touches[0] : t;
var n = Bs(t.clientX, t.clientY);
if (n) {
var a = {};
for (var o in t)
t.hasOwnProperty(o) && (a[o] = t[o]);
a.target = a.rootEl = n, a.preventDefault = void 0, a.stopPropagation = void 0, n[_e]._onDragOver(a);
}
}
}, Ns = function(t) {
S && S.parentNode[_e]._isOutsideThisEl(t.target);
};
function H(e, t) {
if (!(e && e.nodeType && e.nodeType === 1))
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
this.el = e, this.options = t = Je({}, t), e[_e] = this;
var n = {
group: null,
sort: !0,
disabled: !1,
store: null,
handle: null,
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
swapThreshold: 1,
// percentage; 0 <= x <= 1
invertSwap: !1,
// invert always
invertedSwapThreshold: null,
// will be set to same as swapThreshold if default
removeCloneOnHide: !0,
direction: function() {
return Zn(e, this.options);
},
ghostClass: "sortable-ghost",
chosenClass: "sortable-chosen",
dragClass: "sortable-drag",
ignore: "a, img",
filter: null,
preventOnFilter: !0,
animation: 0,
easing: null,
setData: function(l, i) {
l.setData("Text", i.textContent);
},
dropBubble: !1,
dragoverBubble: !1,
dataIdAttr: "data-id",
delay: 0,
delayOnTouchOnly: !1,
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
forceFallback: !1,
fallbackClass: "sortable-fallback",
fallbackOnBody: !1,
fallbackTolerance: 0,
fallbackOffset: {
x: 0,
y: 0
},
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
supportPointer: H.supportPointer !== !1 && "PointerEvent" in window && (!Tt || Ha),
emptyInsertThreshold: 5
};
_t.initializePlugins(this, e, n);
for (var a in n)
!(a in t) && (t[a] = n[a]);
eo(t);
for (var o in this)
o.charAt(0) === "_" && typeof this[o] == "function" && (this[o] = this[o].bind(this));
this.nativeDraggable = t.forceFallback ? !1 : Fs, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? ae(e, "pointerdown", this._onTapStart) : (ae(e, "mousedown", this._onTapStart), ae(e, "touchstart", this._onTapStart)), this.nativeDraggable && (ae(e, "dragover", this), ae(e, "dragenter", this)), la.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), Je(this, Ms());
}
H.prototype = /** @lends Sortable.prototype */
{
constructor: H,
_isOutsideThisEl: function(t) {
!this.el.contains(t) && t !== this.el && (vt = null);
},
_getDirection: function(t, n) {
return typeof this.options.direction == "function" ? this.options.direction.call(this, t, n, S) : this.options.direction;
},
_onTapStart: function(t) {
if (t.cancelable) {
var n = this, a = this.el, o = this.options, r = o.preventOnFilter, l = t.type, i = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, u = (i || t).target, d = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || u, c = o.filter;
if (Hs(a), !S && !(/mousedown|pointerdown/.test(l) && t.button !== 0 || o.disabled) && !d.isContentEditable && !(!this.nativeDraggable && Tt && u && u.tagName.toUpperCase() === "SELECT") && (u = He(u, o.draggable, a, !1), !(u && u.animated) && Wt !== u)) {
if (gt = Ue(u), $t = Ue(u, o.draggable), typeof c == "function") {
if (c.call(this, t, u, this)) {
Ae({
sortable: n,
rootEl: d,
name: "filter",
targetEl: u,
toEl: a,
fromEl: a
}), Fe("filter", n, {
evt: t
}), r && t.preventDefault();
return;
}
} else if (c && (c = c.split(",").some(function(s) {
if (s = He(d, s.trim(), a, !1), s)
return Ae({
sortable: n,
rootEl: s,
name: "filter",
targetEl: u,
fromEl: a,
toEl: a
}), Fe("filter", n, {
evt: t
}), !0;
}), c)) {
r && t.preventDefault();
return;
}
o.handle && !He(d, o.handle, a, !1) || this._prepareDragStart(t, i, u);
}
}
},
_prepareDragStart: function(t, n, a) {
var o = this, r = o.el, l = o.options, i = r.ownerDocument, u;
if (a && !S && a.parentNode === r) {
var d = Ee(a);
if (ge = r, S = a, we = S.parentNode, st = S.nextSibling, Wt = a, Ut = l.group, H.dragged = S, lt = {
target: S,
clientX: (n || t).clientX,
clientY: (n || t).clientY
}, yn = lt.clientX - d.left, bn = lt.clientY - d.top, this._lastX = (n || t).clientX, this._lastY = (n || t).clientY, S.style["will-change"] = "all", u = function() {
if (Fe("delayEnded", o, {
evt: t
}), H.eventCanceled) {
o._onDrop();
return;
}
o._disableDelayedDragEvents(), !vn && o.nativeDraggable && (S.draggable = !0), o._triggerDragStart(t, n), Ae({
sortable: o,
name: "choose",
originalEvent: t
}), Be(S, l.chosenClass, !0);
}, l.ignore.split(",").forEach(function(c) {
Vn(S, c.trim(), xa);
}), ae(i, "dragover", it), ae(i, "mousemove", it), ae(i, "touchmove", it), l.supportPointer ? (ae(i, "pointerup", o._onDrop), !this.nativeDraggable && ae(i, "pointercancel", o._onDrop)) : (ae(i, "mouseup", o._onDrop), ae(i, "touchend", o._onDrop), ae(i, "touchcancel", o._onDrop)), vn && this.nativeDraggable && (this.options.touchStartThreshold = 4, S.draggable = !0), Fe("delayStart", this, {
evt: t
}), l.delay && (!l.delayOnTouchOnly || n) && (!this.nativeDraggable || !(Ft || Ze))) {
if (H.eventCanceled) {
this._onDrop();
return;
}
l.supportPointer ? (ae(i, "pointerup", o._disableDelayedDrag), ae(i, "pointercancel", o._disableDelayedDrag)) : (ae(i, "mouseup", o._disableDelayedDrag), ae(i, "touchend", o._disableDelayedDrag), ae(i, "touchcancel", o._disableDelayedDrag)), ae(i, "mousemove", o._delayedDragTouchMoveHandler), ae(i, "touchmove", o._delayedDragTouchMoveHandler), l.supportPointer && ae(i, "pointermove", o._delayedDragTouchMoveHandler), o._dragStartTimer = setTimeout(u, l.delay);
} else
u();
}
},
_delayedDragTouchMoveHandler: function(t) {
var n = t.touches ? t.touches[0] : t;
Math.max(Math.abs(n.clientX - this._lastX), Math.abs(n.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
},
_disableDelayedDrag: function() {
S && xa(S), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
},
_disableDelayedDragEvents: function() {
var t = this.el.ownerDocument;
ee(t, "mouseup", this._disableDelayedDrag), ee(t, "touchend", this._disableDelayedDrag), ee(t, "touchcancel", this._disableDelayedDrag), ee(t, "pointerup", this._disableDelayedDrag), ee(t, "pointercancel", this._disableDelayedDrag), ee(t, "mousemove", this._delayedDragTouchMoveHandler), ee(t, "touchmove", this._delayedDragTouchMoveHandler), ee(t, "pointermove", this._delayedDragTouchMoveHandler);
},
_triggerDragStart: function(t, n) {
n = n || t.pointerType == "touch" && t, !this.nativeDraggable || n ? this.options.supportPointer ? ae(document, "pointermove", this._onTouchMove) : n ? ae(document, "touchmove", this._onTouchMove) : ae(document, "mousemove", this._onTouchMove) : (ae(S, "dragend", this), ae(ge, "dragstart", this._onDragStart));
try {
document.selection ? Vt(function() {
document.selection.empty();
}) : window.getSelection().removeAllRanges();
} catch {
}
},
_dragStarted: function(t, n) {
if (ht = !1, ge && S) {
Fe("dragStarted", this, {
evt: n
}), this.nativeDraggable && ae(document, "dragover", Ns);
var a = this.options;
!t && Be(S, a.dragClass, !1), Be(S, a.ghostClass, !0), H.active = this, t && this._appendGhost(), Ae({
sortable: this,
name: "start",
originalEvent: n
});
} else
this._nulling();
},
_emulateDragOver: function() {
if (Ke) {
this._lastX = Ke.clientX, this._lastY = Ke.clientY, to();
for (var t = document.elementFromPoint(Ke.clientX, Ke.clientY), n = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(Ke.clientX, Ke.clientY), t !== n); )
n = t;
if (S.parentNode[_e]._isOutsideThisEl(t), n)
do {
if (n[_e]) {
var a = void 0;
if (a = n[_e]._onDragOver({
clientX: Ke.clientX,
clientY: Ke.clientY,
target: t,
rootEl: n
}), a && !this.options.dragoverBubble)
break;
}
t = n;
} while (n = Hn(n));
ao();
}
},
_onTouchMove: function(t) {
if (lt) {
var n = this.options, a = n.fallbackTolerance, o = n.fallbackOffset, r = t.touches ? t.touches[0] : t, l = X && bt(X, !0), i = X && l && l.a, u = X && l && l.d, d = zt && $e && gn($e), c = (r.clientX - lt.clientX + o.x) / (i || 1) + (d ? d[0] - Da[0] : 0) / (i || 1), s = (r.clientY - lt.clientY + o.y) / (u || 1) + (d ? d[1] - Da[1] : 0) / (u || 1);
if (!H.active && !ht) {
if (a && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < a)
return;
this._onDragStart(t, !0);
}
if (X) {
l ? (l.e += c - (Ca || 0), l.f += s - (Ea || 0)) : l = {
a: 1,
b: 0,
c: 0,
d: 1,
e: c,
f: s
};
var p = "matrix(".concat(l.a, ",").concat(l.b, ",").concat(l.c, ",").concat(l.d, ",").concat(l.e, ",").concat(l.f, ")");
q(X, "webkitTransform", p), q(X, "mozTransform", p), q(X, "msTransform", p), q(X, "transform", p), Ca = c, Ea = s, Ke = r;
}
t.cancelable && t.preventDefault();
}
},
_appendGhost: function() {
if (!X) {
var t = this.options.fallbackOnBody ? document.body : ge, n = Ee(S, !0, zt, !0, t), a = this.options;
if (zt) {
for ($e = t; q($e, "position") === "static" && q($e, "transform") === "none" && $e !== document; )
$e = $e.parentNode;
$e !== document.body && $e !== document.documentElement ? ($e === document && ($e = qe()), n.top += $e.scrollTop, n.left += $e.scrollLeft) : $e = qe(), Da = gn($e);
}
X = S.cloneNode(!0), Be(X, a.ghostClass, !1), Be(X, a.fallbackClass, !0), Be(X, a.dragClass, !0), q(X, "transition", ""), q(X, "transform", ""), q(X, "box-sizing", "border-box"), q(X, "margin", 0), q(X, "top", n.top), q(X, "left", n.left), q(X, "width", n.width), q(X, "height", n.height), q(X, "opacity", "0.8"), q(X, "position", zt ? "absolute" : "fixed"), q(X, "zIndex", "100000"), q(X, "pointerEvents", "none"), H.ghost = X, t.appendChild(X), q(X, "transform-origin", yn / parseInt(X.style.width) * 100 + "% " + bn / parseInt(X.style.height) * 100 + "%");
}
},
_onDragStart: function(t, n) {
var a = this, o = t.dataTransfer, r = a.options;
if (Fe("dragStart", this, {
evt: t
}), H.eventCanceled) {
this._onDrop();
return;
}
Fe("setupClone", this), H.eventCanceled || (be = Xn(S), be.removeAttribute("id"), be.draggable = !1, be.style["will-change"] = "", this._hideClone(), Be(be, this.options.chosenClass, !1), H.clone = be), a.cloneId = Vt(function() {
Fe("clone", a), !H.eventCanceled && (a.options.removeCloneOnHide || ge.insertBefore(be, S), a._hideClone(), Ae({
sortable: a,
name: "clone"
}));
}), !n && Be(S, r.dragClass, !0), n ? (ra = !0, a._loopId = setInterval(a._emulateDragOver, 50)) : (ee(document, "mouseup", a._onDrop), ee(document, "touchend", a._onDrop), ee(document, "touchcancel", a._onDrop), o && (o.effectAllowed = "move", r.setData && r.setData.call(a, o, S)), ae(document, "drop", a), q(S, "transform", "translateZ(0)")), ht = !0, a._dragStartId = Vt(a._dragStarted.bind(a, n, t)), ae(document, "selectstart", a), Et = !0, window.getSelection().removeAllRanges(), Tt && q(document.body, "user-select", "none");
},
// Returns true - if no further action is needed (either inserted or another condition)
_onDragOver: function(t) {
var n = this.el, a = t.target, o, r, l, i = this.options, u = i.group, d = H.active, c = Ut === u, s = i.sort, p = Te || d, m, h = this, g = !1;
if (Aa) return;
function k(y, N) {
Fe(y, h, Xe({
evt: t,
isOwner: c,
axis: m ? "vertical" : "horizontal",
revert: l,
dragRect: o,
targetRect: r,
canSort: s,
fromSortable: p,
target: a,
completed: C,
onMove: function(Z, oe) {
return Yt(ge, n, S, o, Z, Ee(Z), t, oe);
},
changed: $
}, N));
}
function v() {
k("dragOverAnimationCapture"), h.captureAnimationState(), h !== p && p.captureAnimationState();
}
function C(y) {
return k("dragOverCompleted", {
insertion: y
}), y && (c ? d._hideClone() : d._showClone(h), h !== p && (Be(S, Te ? Te.options.ghostClass : d.options.ghostClass, !1), Be(S, i.ghostClass, !0)), Te !== h && h !== H.active ? Te = h : h === H.active && Te && (Te = null), p === h && (h._ignoreWhileAnimating = a), h.animateAll(function() {
k("dragOverAnimationComplete"), h._ignoreWhileAnimating = null;
}), h !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (a === S && !S.animated || a === n && !a.animated) && (vt = null), !i.dragoverBubble && !t.rootEl && a !== document && (S.parentNode[_e]._isOutsideThisEl(t.target), !y && it(t)), !i.dragoverBubble && t.stopPropagation && t.stopPropagation(), g = !0;
}
function $() {
Ne = Ue(S), at = Ue(S, i.draggable), Ae({
sortable: h,
name: "change",
toEl: n,
newIndex: Ne,
newDraggableIndex: at,
originalEvent: t
});
}
if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), a = He(a, i.draggable, n, !0), k("dragOver"), H.eventCanceled) return g;
if (S.contains(t.target) || a.animated && a.animatingX && a.animatingY || h._ignoreWhileAnimating === a)
return C(!1);
if (ra = !1, d && !i.disabled && (c ? s || (l = we !== ge) : Te === this || (this.lastPutMode = Ut.checkPull(this, d, S, t)) && u.checkPut(this, d, S, t))) {
if (m = this._getDirection(t, a) === "vertical", o = Ee(S), k("dragOverValid"), H.eventCanceled) return g;
if (l)
return we = ge, v(), this._hideClone(), k("revert"), H.eventCanceled || (st ? ge.insertBefore(S, st) : ge.appendChild(S)), C(!0);
var Y = Va(n, i.draggable);
if (!Y || Ys(t, m, this) && !Y.animated) {
if (Y === S)
return C(!1);
if (Y && n === t.target && (a = Y), a && (r = Ee(a)), Yt(ge, n, S, o, a, r, t, !!a) !== !1)
return v(), Y && Y.nextSibling ? n.insertBefore(S, Y.nextSibling) : n.appendChild(S), we = n, $(), C(!0);
} else if (Y && zs(t, m, this)) {
var G = St(n, 0, i, !0);
if (G === S)
return C(!1);
if (a = G, r = Ee(a), Yt(ge, n, S, o, a, r, t, !1) !== !1)
return v(), n.insertBefore(S, G), we = n, $(), C(!0);
} else if (a.parentNode === n) {
r = Ee(a);
var A = 0, D, P = S.parentNode !== n, F = !_s(S.animated && S.toRect || o, a.animated && a.toRect || r, m), Q = m ? "top" : "left", L = hn(a, "top", "top") || hn(S, "top", "top"), J = L ? L.scrollTop : void 0;
vt !== a && (D = r[Q], Mt = !1, Lt = !F && i.invertSwap || P), A = js(t, a, r, m, F ? 1 : i.swapThreshold, i.invertedSwapThreshold == null ? i.swapThreshold : i.invertedSwapThreshold, Lt, vt === a);
var ue;
if (A !== 0) {
var O = Ue(S);
d