import JSEncrypt from "jsencrypt"; let EncryptHandler = new JSEncrypt(), TimeOfList = 6, TimeOfPay = 300, Socket = null, SockEventMap = {}, ThresholdOfWarn = 3000, ThresholdOfDanger = 1000, WaitCountDown = 3, PathPrefix = "/"; const KeepStatusKey = "StatusKeepNeed", ServerPrefix = "wss://wine.ifarmcloud.com/api/seller/socket"; export const Android = (func, ...args) => { let handler = window.android; if (handler === undefined) return console.warn("no android handler"); if (handler[func] === undefined) return console.warn(`there is no func named: <${func}>`); handler[func](...args); }, Register = (name, func) => window[name] = func, Matrix = (row, col, val = 0) => new Array(row).fill(0).map(() => new Array(col).fill(val)), StatusNeedKeep = () => window.localStorage.setItem(KeepStatusKey, "true"), StatusDontKeep = () => window.localStorage.setItem(KeepStatusKey, "false"), IsStatusKept = () => window.localStorage.getItem(KeepStatusKey) === "true", Volume2Weight = (v, d) => Math.floor(v * d / 50), Weight2Volume = (w, d) => (50 * w / d).toFixed(2); export default { EncryptHandler, TimeOfList, TimeOfPay, ThresholdOfWarn, ThresholdOfDanger, WaitCountDown, PathPrefix, ServerPrefix, Socket, SockEventMap, Android, Register, Matrix, StatusNeedKeep, StatusDontKeep, IsStatusKept, Volume2Weight, Weight2Volume }