|
|<\\/br>|
)/g, \" \")\r\n}\r\n\r\nexport function getTimeSpent() {\r\n const re = /^(d[g|h]?)?(d{1}?[05][m|p])?$/\r\n return re\r\n}\r\n\r\nexport function formatUserName(fullName, userName, deptName) {\r\n if (!userName) return `${fullName} - ${deptName}`\r\n if (!deptName) return ` ${userName} - ${fullName} `\r\n return `${fullName} - (${userName}) - ${deptName}`\r\n}\r\n","import { useLayoutEffect, useState } from \"react\"\r\n\r\nexport const useWindowReSize = () => {\r\n const [dimensions, setDimensions] = useState({\r\n height: global.window.innerHeight,\r\n width: global.window.innerWidth,\r\n })\r\n useLayoutEffect(() => {\r\n function handleResize() {\r\n setDimensions({\r\n height: global.window.innerHeight,\r\n width: global.window.innerWidth,\r\n })\r\n }\r\n\r\n window.addEventListener(\"resize\", handleResize)\r\n return () => window.removeEventListener(\"resize\", handleResize)\r\n }, [])\r\n\r\n return dimensions\r\n}\r\n","import { useLayoutEffect, useState } from \"react\"\r\n\r\nconst UseWindowSize = (width, isLess = false) => {\r\n const [size, setSize] = useState([0, 0])\r\n useLayoutEffect(() => {\r\n function updateSize() {\r\n const currentWidth = isLess\r\n ? global.window.innerWidth < width\r\n : global.window.innerWidth > width\r\n setSize(currentWidth)\r\n }\r\n window.addEventListener(\"resize\", updateSize)\r\n updateSize()\r\n return () => window.removeEventListener(\"resize\", updateSize)\r\n }, [isLess, width])\r\n return size\r\n}\r\n\r\nconst isLaptop = () => UseWindowSize(1507, true)\r\n\r\nconst isDesktop = () => UseWindowSize(1200)\r\n\r\nconst isTablet = () => UseWindowSize(991, true)\r\n\r\nconst isMobile = () => {\r\n let a = !!UseWindowSize(768, true)\r\n let b = !!UseWindowSize(991, true)\r\n return a || b\r\n}\r\nconst isMobile2 = () => UseWindowSize(768, true)\r\n\r\nconst isSmallMobile = () => UseWindowSize(320, true)\r\n\r\nexport default {\r\n isLaptop,\r\n isDesktop,\r\n isMobile,\r\n isTablet,\r\n isSmallMobile,\r\n isMobile2,\r\n}\r\n","/* eslint-disable radix */\r\nimport moment from 'moment'\r\n\r\nexport function momentDateToString(date = moment(), format = 'YYYY-MM-DD') {\r\n if (!date) return null\r\n return moment(moment(date), format).format(format)\r\n}\r\n\r\nconst parseDT = (dt, format) =>\r\n parseInt(momentDateToString(dt ? moment(dt) : moment(), format))\r\n\r\nconst sameYear = (dt1, dt2) => {\r\n const s1 = parseDT(dt1, 'YYYY')\r\n const s2 = parseDT(dt2, 'YYYY')\r\n return s1 === s2\r\n}\r\n\r\nconst addDateTime = (num = 1, time = 'd', format = 'DD/MM/YYYY') =>\r\n momentDateToString(moment().add(num, time), format)\r\n\r\nconst subtractDateTime = (num = 1, time = 'd', format = 'DD/MM/YYYY') =>\r\n momentDateToString(moment().subtract(num, time), format)\r\n\r\nconst getWeekDay = (dt = moment()) => {\r\n const getDay = moment(dt).day()\r\n return getDay === 0 ? 'Chủ nhật' : `Thứ ${getDay + 1}`\r\n}\r\n\r\nexport function dateTime(\r\n endTime = moment(),\r\n startTime = moment(),\r\n isPast = false,\r\n isAbs = false\r\n) {\r\n let timeLeft = moment(endTime || moment()).diff(moment(startTime || moment()))\r\n\r\n if (timeLeft < 0 && isPast === false) {\r\n timeLeft = 0\r\n }\r\n\r\n const seconds = moment.duration(timeLeft).seconds()\r\n const minutes = moment.duration(timeLeft).minutes()\r\n const hours = Math.trunc(moment.duration(timeLeft).hours())\r\n const days = Math.trunc(moment.duration(timeLeft).days())\r\n const weeks = Math.trunc(moment.duration(timeLeft).weeks())\r\n const months = Math.trunc(moment.duration(timeLeft).months())\r\n const years = Math.trunc(moment.duration(timeLeft).years())\r\n\r\n if (isAbs)\r\n return {\r\n timeLeft: Math.abs(timeLeft),\r\n years: Math.abs(years),\r\n months: Math.abs(months),\r\n weeks: Math.abs(weeks),\r\n days: Math.abs(days),\r\n hours: Math.abs(hours),\r\n minutes: Math.abs(minutes),\r\n seconds: Math.abs(seconds)\r\n }\r\n return { timeLeft, years, months, weeks, days, hours, minutes, seconds }\r\n}\r\n\r\nfunction getDayMonth(dt1, dt2) {\r\n const date1 = parseDT(dt1, 'YYYYMMDDHHmmss')\r\n const date2 = parseDT(dt2, 'YYYYMMDDHHmmss')\r\n let t1\r\n let t2\r\n let days\r\n if (date1 <= date2) {\r\n t1 = dt1\r\n t2 = dt2\r\n } else {\r\n t1 = dt2\r\n t2 = dt1\r\n }\r\n\r\n const y1 = parseDT(t1, 'YYYY')\r\n const y2 = parseDT(t2, 'YYYY')\r\n const m1 = parseDT(t1, 'MM')\r\n const m2 = parseDT(t2, 'MM')\r\n const d1 = parseDT(t1, 'DD')\r\n const d2 = parseDT(t2, 'DD')\r\n const dIM2 = moment(t2).daysInMonth()\r\n\r\n const months = (y2 - y1) * 12 + m2 - m1 + (d2 >= d1 || dIM2 === d2 ? 0 : -1)\r\n\r\n if (d2 >= d1) {\r\n days = d2 - d1\r\n } else {\r\n const dIM = moment(t1).daysInMonth()\r\n days = dIM2 === d2 ? dIM - d1 : dIM - d1 + d2\r\n }\r\n\r\n return { months, days }\r\n}\r\n\r\nexport function asDateTime(\r\n endTime = moment(),\r\n startTime = moment(),\r\n isPast = false,\r\n isAbs = false\r\n) {\r\n let timeLeft = moment(endTime).diff(moment(startTime))\r\n\r\n if (timeLeft < 0 && isPast === false) {\r\n timeLeft = 0\r\n }\r\n\r\n const asSeconds = moment.duration(timeLeft).asSeconds()\r\n const asMinutes = moment.duration(timeLeft).asMinutes()\r\n const asHours = Math.trunc(moment.duration(timeLeft).asHours())\r\n const asDays = Math.trunc(moment.duration(timeLeft).asDays())\r\n const asWeeks = Math.trunc(moment.duration(timeLeft).asWeeks())\r\n const asMonths = Math.trunc(moment.duration(timeLeft).asMonths())\r\n const asYears = Math.trunc(moment.duration(timeLeft).asYears())\r\n\r\n if (isAbs)\r\n return {\r\n timeLeft: Math.abs(timeLeft),\r\n asYears: Math.abs(asYears),\r\n asMonths: Math.abs(asMonths),\r\n asWeeks: Math.abs(asWeeks),\r\n asDays: Math.abs(asDays),\r\n asHours: Math.abs(asHours),\r\n asMinutes: Math.abs(asMinutes),\r\n asSeconds: Math.abs(asSeconds)\r\n }\r\n return {\r\n timeLeft,\r\n asYears,\r\n asMonths,\r\n asWeeks,\r\n asDays,\r\n asHours,\r\n asMinutes,\r\n asSeconds\r\n }\r\n}\r\n\r\nexport const fdtfM3Plus = (dt, format = `HH[h]mm’ss’’ DD/MM`) => {\r\n if (sameYear(dt)) return momentDateToString(dt, format)\r\n return momentDateToString(dt, `${format}/YYYY`)\r\n}\r\n\r\nexport const fdtfM1 = (dt, mx = 'm1b') => {\r\n let fm\r\n if (mx?.toLowerCase() === 'm1a') fm = `HH[h]`\r\n if (mx?.toLowerCase() === 'm1b') fm = `HH[h]mm[’]`\r\n if (mx?.toLowerCase() === 'm1c') fm = `HH[h]mm[’]ss[’’]`\r\n if (fm === `HH[h]` && moment(dt)?.hour() < 10)\r\n return momentDateToString(dt, `H[h]`)\r\n return momentDateToString(dt, `${fm}`)\r\n}\r\n\r\nexport const fdtfM2 = (dt, mx = 'm2b') => {\r\n let fm = `HH[h]mm[']`\r\n if (mx?.toLowerCase() === 'm2a') fm = `YYYY`\r\n if (mx?.toLowerCase() === 'm2b') fm = `MM/YYYY`\r\n if (mx?.toLowerCase() === 'm2c') fm = `DD/MM`\r\n if (mx?.toLowerCase() === 'm2d') fm = `DD/MM/YYYY`\r\n if (mx?.toLowerCase() === 'm2e') fm = sameYear(dt) ? `DD/MM` : `DD/MM/YYYY`\r\n\r\n return momentDateToString(dt, fm)\r\n}\r\n\r\nexport const fdtfM3 = (dt, m1, m2) => `${fdtfM1(dt, m1)} ${fdtfM2(dt, m2)}`\r\n\r\nexport const fdtfM4 = (dt, checkReturn = false) => {\r\n switch (momentDateToString(dt, 'DD/MM/YYYY')) {\r\n case subtractDateTime(3):\r\n return 'Hôm kìa'\r\n case subtractDateTime(2):\r\n return 'Hôm kia'\r\n case subtractDateTime(1):\r\n return 'Hôm qua'\r\n case momentDateToString(moment(), 'DD/MM/YYYY'):\r\n return 'Hôm nay'\r\n case addDateTime(1):\r\n return 'Ngày mai'\r\n case addDateTime(2):\r\n return 'Ngày kia'\r\n case addDateTime(3):\r\n return 'Ngày kìa'\r\n default:\r\n return checkReturn ? false : fdtfM3Plus(dt, `DD/MM`)\r\n }\r\n}\r\n\r\nexport const fdtfM5 = (dt, checkReturn = false) => {\r\n const weekInput = momentDateToString(dt, 'WW')\r\n if (sameYear(dt)) {\r\n if (weekInput === subtractDateTime(1, 'w', 'WW')) return 'Tuần trước'\r\n if (weekInput === momentDateToString(moment(), 'WW')) return 'Tuần này'\r\n if (weekInput === addDateTime(1, 'w', 'WW')) return 'Tuần sau'\r\n return checkReturn ? false : fdtfM3Plus(dt, `DD/MM`)\r\n }\r\n return checkReturn ? false : fdtfM3Plus(dt, `DD/MM`)\r\n}\r\n\r\nexport const fdtfM6 = (dt, checkReturn = false) => {\r\n const monthInput = momentDateToString(dt, 'MM/YYYY')\r\n if (monthInput === subtractDateTime(1, 'M', 'MM/YYYY')) return 'Tháng trước'\r\n if (monthInput === momentDateToString(moment(), 'MM/YYYY')) return 'Tháng này'\r\n if (monthInput === addDateTime(1, 'M', 'MM/YYYY')) return 'Tháng sau'\r\n return checkReturn ? false : fdtfM3Plus(dt, `DD/MM`)\r\n}\r\n\r\nexport const fdtfM7 = dt =>\r\n momentDateToString(dt, `[${getWeekDay(dt)}, ngày] DD [tháng] MM [năm] YYYY`)\r\n\r\nexport const fdtfM8 = dt => {\r\n const getDay = momentDateToString(dt, `DD/MM`)\r\n const date = moment(dt).date() < 11 ? 'Ngày mùng' : 'Ngày'\r\n const day = momentDateToString(dt, `[${date}] D`)\r\n if (fdtfM4(dt, true)) return `${fdtfM4(dt, true)} (${getDay})`\r\n if (fdtfM5(dt, true))\r\n return `${getWeekDay(dt)} ${fdtfM5(dt, true)} (${getDay})`\r\n if (fdtfM6(dt, true)) return `${day} ${fdtfM6(dt, true)} (${getDay})`\r\n if (sameYear(dt)) return `${getDay} (${getWeekDay(dt)})`\r\n return momentDateToString(dt, `DD/MM/YYYY [(${getWeekDay(dt)})]`)\r\n}\r\n\r\nexport const fdtfM9 = (dt, tf) => {\r\n const getTime = fdtfM1(dt, tf)\r\n return `${getTime} ${fdtfM8(dt)}`\r\n}\r\n\r\nexport const fdtfK1 = (dt1, dt2, k = 'k1b') => {\r\n const isC1 = k.toLowerCase() === 'k1a'\r\n const { timeLeft, hours, minutes, seconds } = dateTime(dt1, dt2, true, true)\r\n const { days, months } = getDayMonth(dt1, dt2)\r\n const { asHours, asDays } = asDateTime(dt1, dt2, true, true)\r\n if (timeLeft < 60000) return `${seconds} giây`\r\n if (timeLeft < 60 * 60000)\r\n return `${minutes} phút${!isC1 && seconds !== 0 ? ` ${seconds} giây` : ''}`\r\n if (timeLeft < 24 * 60 * 60000)\r\n return `${hours} giờ${!isC1 && minutes !== 0 ? ` ${minutes} phút` : ''}`\r\n if (asHours >= 24 && asDays < 7)\r\n return `${asDays} ngày${\r\n !isC1 && asHours % 24 !== 0 ? ` ${asHours % 24} giờ` : ''\r\n }`\r\n\r\n if (asDays >= 7 && months === 0)\r\n return `${Math.trunc(days / 7)} tuần${\r\n !isC1 && days % 7 !== 0 ? ` ${days % 7} ngày` : ''\r\n }`\r\n if (months > 0 && months < 12)\r\n return `${months} tháng${!isC1 && days !== 0 ? ` ${days} ngày` : ''}`\r\n return `${Math.trunc(months / 12)} năm${\r\n !isC1 && months % 12 !== 0 ? ` ${months % 12} tháng` : ''\r\n }`\r\n}\r\n\r\nexport const fdtfK2 = (dt, k = 'k21') => {\r\n const strK = ['k21a', 'k21b', 'k22a', 'k22b'].includes(k.toLowerCase())\r\n ? k.toLowerCase()\r\n : 'k21b'\r\n const strC = strK?.charAt(strK.length - 1) === 'a' ? 'k1a' : 'k1b'\r\n const { timeLeft } = asDateTime(dt, moment(), true)\r\n if (timeLeft > -6000 && timeLeft < 0) {\r\n return 'Vừa quá hạn'\r\n }\r\n if (timeLeft >= 0 && timeLeft < 6000) {\r\n return 'Vừa xong'\r\n }\r\n const dtK = fdtfK1(dt, moment(), strC)\r\n if (strK === 'k21a' || strK === 'k21b')\r\n return `${dtK} ${timeLeft < 0 ? 'trước' : 'sau'}`\r\n return `${timeLeft < 0 ? 'Quá hạn' : 'Còn lại'} ${dtK}`\r\n}\r\n\r\nconst fdtf = {\r\n m1: fdtfM1,\r\n m2: fdtfM2,\r\n m3: fdtfM3,\r\n m4: fdtfM4,\r\n m5: fdtfM5,\r\n m6: fdtfM6,\r\n m7: fdtfM7,\r\n m8: fdtfM8,\r\n m9: fdtfM9,\r\n k1: fdtfK1,\r\n k2: fdtfK2\r\n}\r\nexport default fdtf\r\n","import { flatMap, forEach, isArray, isEmpty } from \"lodash\"\r\nimport moment from \"moment\"\r\nimport ButtonCircle from \"src/components/MyButton/ButtonCircle\"\r\nimport { DATE_FORMAT, formatDate } from \"./dateFormatters\"\r\nimport { fdtfM2 } from \"./fdtf\"\r\nimport { Anchor } from \"antd\"\r\nconst { Link } = Anchor\r\n\r\nexport const removeKeyDown = () => {\r\n document.onkeydown = null\r\n}\r\n\r\nexport const getListComboByKey = (key, listSystemKey) => {\r\n const parent = listSystemKey?.find(x => x.CodeKey === key)\r\n if (parent)\r\n return listSystemKey\r\n ?.filter(x => x.ParentID === parent.ID)\r\n ?.sort((a, b) => {\r\n return a.SortOrder - b.SortOrder\r\n })\r\n return []\r\n}\r\n\r\nexport const updateTreeData = (list, key, children) => {\r\n let arr = children.map(child => {\r\n return {\r\n ...child,\r\n title: child.regionName,\r\n key: child.regionID,\r\n isLeaf: child.regionLevel === 4,\r\n }\r\n })\r\n return list.map(node => {\r\n if (node.key === key) {\r\n return {\r\n ...node,\r\n children: arr,\r\n }\r\n }\r\n\r\n if (node?.children) {\r\n return {\r\n ...node,\r\n children: updateTreeData(node.children, key, children),\r\n }\r\n }\r\n return node\r\n })\r\n}\r\n\r\nexport const hasPermission = (TabID, listTab) => {\r\n if (!TabID || TabID.length === 0) return true\r\n const IsVisitTab = listTab.some(item =>\r\n TabID.some(tab => tab === item.CategoryID && item.IsVistTab === true),\r\n )\r\n return IsVisitTab\r\n}\r\n\r\nexport const renderStringTestForm = arr => {\r\n let array = []\r\n arr.forEach(item => {\r\n if (item === 1) {\r\n array.push(\" Tại nhà\")\r\n }\r\n if (item === 2) {\r\n array.push(\" Bệnh viện/Phòng khám \")\r\n }\r\n })\r\n return array.toString()\r\n}\r\n\r\nexport const loop = (a, b) => {\r\n let result = []\r\n a.forEach(a1 => {\r\n if (b.some(item => item.accountId === a1.accountId)) return\r\n result.push(a1)\r\n })\r\n return result\r\n}\r\n\r\nexport const groupBy = (input, string) => {\r\n let result = []\r\n input.forEach(ele => {\r\n if (ele.level === 1) return\r\n if (result.find(item => item.serviceId === ele[string])) {\r\n const exitsItem = result.find(item => item.serviceId === ele[string])\r\n exitsItem.ltExamination.push(ele.key)\r\n } else {\r\n result.push({\r\n serviceId: ele[string],\r\n ltExamination: [ele.key],\r\n })\r\n }\r\n })\r\n return result\r\n}\r\n\r\nexport const convertTreeDataUser = listData => {\r\n if (!listData || !listData.length) return []\r\n const listRoot = listData.filter(i => i.DeptLevel === 1)\r\n const listOther = listData.filter(i => i.DeptLevel !== 1)\r\n const treeDataConvert = convertChildrentUser(listRoot, listOther)\r\n return treeDataConvert\r\n}\r\n\r\nconst convertChildrentUser = (listRoot, listOther) => {\r\n const newList = listRoot.map(root => {\r\n const newItem = {\r\n ...root,\r\n name: root.DeptName,\r\n label: root.DeptName,\r\n title: root.DeptName,\r\n key: root.DeptID,\r\n value: root.DeptID,\r\n id: root.DeptID,\r\n }\r\n const listChild = listOther.filter(i => i.DeptID === root.DeptID)\r\n const listOtherChild = listOther.filter(i => i.DeptID !== root.DeptID)\r\n if (listChild && listChild.length)\r\n return {\r\n ...newItem,\r\n children: convertChildrentUser(listChild, listOtherChild),\r\n }\r\n return newItem\r\n })\r\n return newList\r\n}\r\n\r\nexport const convertTreeData = (listData, withAnchor = false) => {\r\n if (!listData || !listData.length) return []\r\n const listRoot = listData.filter(x => x.Level === 1)\r\n const listOther = listData.filter(y => y.Level !== 1)\r\n const treeDataConvert = convertChildrent(listRoot, listOther, withAnchor)\r\n\r\n return treeDataConvert\r\n}\r\nconst convertChildrent = (listRoot, listOther, withAnchor) => {\r\n const newList = listRoot.map(root => {\r\n const newItem = {\r\n ...root,\r\n title: withAnchor ? (\r\n
\r\n ) : (\r\n root.DepartmentName\r\n ),\r\n key: root.DepartmentID,\r\n id: root.DepartmentID,\r\n }\r\n const listChild = listOther.filter(\r\n x => x.DepartmentParentID === root.DepartmentID,\r\n )\r\n const listOtherChild = listOther.filter(\r\n y => y.DepartmentParentID !== root.DepartmentID,\r\n )\r\n if (listChild && listChild.length)\r\n return {\r\n ...newItem,\r\n children: convertChildrent(listChild, listOtherChild, withAnchor),\r\n }\r\n return newItem\r\n })\r\n return newList\r\n}\r\n\r\nexport const convertTreeRegion = listData => {\r\n if (!listData || !listData.length) return []\r\n const listRoot = listData.filter(x => x.regionLevel === 2)\r\n const listOther = listData.filter(y => y.regionLevel !== 2)\r\n const treeDataConvert = convertChildrentRegion(listRoot, listOther)\r\n\r\n return treeDataConvert\r\n}\r\n\r\nconst convertChildrentRegion = (listRoot, listOther) => {\r\n const newList = listRoot.map(root => {\r\n const newItem = {\r\n ...root,\r\n title: root.regionName,\r\n key: root.regionID,\r\n isLeaf: root.regionLevel === 4,\r\n }\r\n const listChild = listOther.filter(x => x.parentID === root.regionID)\r\n const listOtherChild = listOther.filter(y => y.parentID !== root.regionID)\r\n if (listChild && listChild.length)\r\n return {\r\n ...newItem,\r\n children: convertChildrentRegion(listChild, listOtherChild),\r\n }\r\n return newItem\r\n })\r\n return newList\r\n}\r\n\r\nexport const convertData = listRoot => {\r\n const newList = listRoot.map(root => {\r\n const newItem = {\r\n ...root,\r\n level: root.level,\r\n title: root.serviceName,\r\n price: root.price,\r\n note: root.note,\r\n serviceType: root.serviceType,\r\n key: root.serviceId,\r\n serviceId: root.serviceId,\r\n isLeaf: root.listService && root.listService.length > 0 ? false : true,\r\n }\r\n if (root.listService && root.listService.length)\r\n return {\r\n ...newItem,\r\n children: convertData(root.listService),\r\n }\r\n return newItem\r\n })\r\n return newList\r\n}\r\n\r\nexport function submitFormWithCtrlS(formRef) {\r\n document.onkeydown = e => {\r\n if (e.ctrlKey && e.keyCode === 83) {\r\n e.preventDefault()\r\n formRef.current.submit()\r\n }\r\n }\r\n}\r\n\r\nexport function submitFormWithCtrlKey(formRef, key = \"s\") {\r\n removeKeyDown()\r\n document.onkeydown = e => {\r\n if (e.ctrlKey && e.key === key.toLowerCase()) {\r\n e.preventDefault()\r\n formRef.current.submit()\r\n }\r\n }\r\n}\r\n\r\nexport function findParent({ children = [], ...object }, key) {\r\n var result\r\n if (object.key === key) return object\r\n return (\r\n children.some(o => (result = findParent(o, key))) &&\r\n Object.assign({}, object, { children: [result] })\r\n )\r\n}\r\n\r\nexport function convertTreeToList(root) {\r\n var stack = [],\r\n array = [],\r\n hashMap = {}\r\n stack.push(root)\r\n\r\n while (stack.length !== 0) {\r\n var node = stack.pop()\r\n if (!node.children) {\r\n visitNode(node, hashMap, array)\r\n } else {\r\n for (var i = node?.children?.length - 1; i >= 0; i--) {\r\n stack.push(node.children[i])\r\n }\r\n }\r\n }\r\n\r\n return array\r\n}\r\n\r\nfunction visitNode(node, hashMap, array) {\r\n if (!hashMap[node.key]) {\r\n hashMap[node.key] = true\r\n array.push(node)\r\n }\r\n}\r\n\r\nexport function submitFormAntWithCtrlKey(form, key = 83) {\r\n document.onkeydown = e => {\r\n if (e.ctrlKey && e.keyCode === key) {\r\n e.preventDefault()\r\n form.submit()\r\n }\r\n }\r\n}\r\n\r\nexport function handleCtrlKey(onHandle, key = \"a\") {\r\n const myFunc = e => {\r\n if (e.ctrlKey && e.key === key.toLowerCase()) {\r\n e.preventDefault()\r\n onHandle()\r\n }\r\n }\r\n document.addEventListener(\"keydown\", myFunc)\r\n return myFunc\r\n}\r\n\r\nexport function handlePressKey(onHandle, key = \"a\") {\r\n const myFunc = e => {\r\n if (e.key.toLowerCase() === key.toLowerCase()) {\r\n e.preventDefault()\r\n onHandle()\r\n }\r\n }\r\n document.addEventListener(\"keydown\", myFunc)\r\n return myFunc\r\n}\r\n\r\nexport function handleCtrlD(onSubmit) {\r\n document.onkeydown = e => {\r\n if (e.ctrlKey && e.keyCode === 68) {\r\n e.preventDefault()\r\n onSubmit()\r\n }\r\n }\r\n}\r\n\r\nexport const isJsonString = str => {\r\n try {\r\n JSON.parse(str)\r\n } catch (e) {\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nexport const trimData = data => {\r\n if (!data) return data\r\n const tempData = isArray(data) ? [] : {}\r\n forEach(data, (val, keyName) => {\r\n if (typeof val === \"string\") tempData[keyName] = val.trim()\r\n else if (typeof val === \"object\") tempData[keyName] = trimData(val)\r\n else tempData[keyName] = val\r\n })\r\n return tempData\r\n}\r\n\r\nexport function submitFormUsingCtrlS(\r\n form,\r\n handleSubmit,\r\n isForm,\r\n formRef = null,\r\n) {\r\n document.onkeydown = e => {\r\n if (e.ctrlKey && e.keyCode === 83) {\r\n e.preventDefault()\r\n if (formRef && formRef.current) {\r\n formRef.current.submit()\r\n } else if (isForm) {\r\n form.validateFields().then(values => {\r\n handleSubmit(values)\r\n })\r\n } else handleSubmit()\r\n }\r\n }\r\n}\r\n\r\nexport const treeToListWithKey = (data = [], key = \"value\") => {\r\n let temVal = data\r\n forEach(data, item => {\r\n if (item.children) temVal = [...temVal, ...treeToList(item.children)]\r\n })\r\n return flatMap(temVal, item => item[key] || item)\r\n}\r\nexport const treeToList = (data = []) => {\r\n let temVal = []\r\n forEach(data, item => {\r\n if (item.children) temVal = [...temVal, ...treeToList(item.children)]\r\n temVal = [...temVal, { ...item, children: undefined }]\r\n })\r\n return temVal?.filter(i => !isEmpty(i))\r\n}\r\nexport const checkSafari = () =>\r\n /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\r\n\r\nexport const checkTotalTime = (totalTime, workingDay) => {\r\n const dayOfWeek = moment(workingDay).day()\r\n const textTooltip = {\r\n enoughTime: \"Ngày làm việc đủ thời lượng\",\r\n lackOfTime: \"Thiếu thời lượng của Ngày làm việc này\",\r\n excessiveTime: \"Thừa thời lượng của Ngày làm việc này\",\r\n }\r\n const color = {\r\n enoughTime: \"#212121\",\r\n lackOfTime: \"#BC2618\",\r\n excessiveTime: \"#18BC78\",\r\n }\r\n const fontWeight = {\r\n enoughTime: \"normal\",\r\n lackOfTime: \"bold\",\r\n excessiveTime: \"bold\",\r\n }\r\n if (dayOfWeek === 0) return { text: \"Ngày Chủ nhật\", color: color.enoughTime }\r\n if (!totalTime) return\r\n if (dayOfWeek === 6) {\r\n if (totalTime >= 3.5 && totalTime <= 4) {\r\n return {\r\n text: textTooltip.enoughTime,\r\n color: color.enoughTime,\r\n fontWeight: fontWeight.enoughTime,\r\n }\r\n }\r\n if (totalTime < 3.5) {\r\n return {\r\n text: textTooltip.lackOfTime,\r\n color: color.lackOfTime,\r\n fontWeight: fontWeight.lackOfTime,\r\n }\r\n }\r\n if (totalTime > 4) {\r\n return {\r\n text: textTooltip.excessiveTime,\r\n color: color.excessiveTime,\r\n fontWeight: fontWeight.excessiveTime,\r\n }\r\n }\r\n } else {\r\n if (totalTime >= 7 && totalTime <= 8) {\r\n return {\r\n text: textTooltip.enoughTime,\r\n color: color.enoughTime,\r\n fontWeight: fontWeight.enoughTime,\r\n }\r\n }\r\n if (totalTime < 7) {\r\n return {\r\n text: textTooltip.lackOfTime,\r\n color: color.lackOfTime,\r\n fontWeight: fontWeight.lackOfTime,\r\n }\r\n }\r\n if (totalTime > 8) {\r\n return {\r\n text: textTooltip.excessiveTime,\r\n color: color.excessiveTime,\r\n fontWeight: fontWeight.excessiveTime,\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport const checkSumFunc = checkSum => {\r\n const statusSum = checkSum?.StatusSum\r\n const woringDayExcessive = checkSum?.WorkingDay_Thua?.map(item =>\r\n fdtfM2(item, \"m2e\"),\r\n )\r\n const workingDayLack = checkSum?.WorkingDay_Thieu?.map(item =>\r\n fdtfM2(item, \"m2e\"),\r\n )\r\n const status = {\r\n enough: 0,\r\n lack: 1,\r\n excessive: 2,\r\n lackExcessive: 3,\r\n }\r\n const color = {\r\n enough: \"#212121\",\r\n lack: \"#BC2618\",\r\n excessive: \"#18BC78\",\r\n lackExcessive: \"#f2994b\",\r\n }\r\n let result = {}\r\n switch (statusSum) {\r\n case status.enough:\r\n result = {\r\n color: color.enough,\r\n tooltip: \"Đủ thời lượng\",\r\n iconName: null,\r\n showIcon: false,\r\n }\r\n break\r\n case status.lack:\r\n result = {\r\n color: color.lack,\r\n tooltip: (\r\n <>\r\n - Có {workingDayLack?.length} Ngày làm việc thiếu thời lượng:
\r\n {workingDayLack?.join(\", \")}{\" \"}\r\n >\r\n ),\r\n iconName: \"warning_red\",\r\n showIcon: true,\r\n }\r\n break\r\n case status.excessive:\r\n result = {\r\n color: color.excessive,\r\n tooltip: (\r\n <>\r\n - Có {woringDayExcessive?.length} Ngày làm việc thừa thời lượng:{\" \"}\r\n
\r\n {woringDayExcessive?.join(\", \")}\r\n >\r\n ),\r\n iconName: \"warning_green\",\r\n showIcon: true,\r\n }\r\n break\r\n case status.lackExcessive:\r\n result = {\r\n color: color.lackExcessive,\r\n tooltip: (\r\n <>\r\n - Có {workingDayLack?.length} Ngày làm việc thiếu thời lượng:
\r\n {workingDayLack.join(\", \")}
- Có {woringDayExcessive?.length}{\" \"}\r\n Ngày làm việc thừa thời lượng:
\r\n {woringDayExcessive.join(\", \")}\r\n >\r\n ),\r\n iconName: \"warning_yellow\",\r\n showIcon: true,\r\n }\r\n break\r\n default:\r\n break\r\n }\r\n return result\r\n}\r\n\r\nexport const handleWorkingDay = (date, durationDate) => {\r\n let startDate = null\r\n let endDate = null\r\n const thisWeek = moment().startOf(\"week\").toDate()\r\n const thisMonth = moment().startOf(\"months\").toDate()\r\n const thisYear = moment().startOf(\"year\").toDate()\r\n\r\n switch (date) {\r\n case 1:\r\n startDate = formatDate(thisWeek, DATE_FORMAT)\r\n endDate = formatDate(moment(), DATE_FORMAT)\r\n break\r\n case 2:\r\n startDate = formatDate(\r\n moment(thisWeek).subtract(1, \"week\").toDate(),\r\n DATE_FORMAT,\r\n )\r\n endDate = formatDate(moment(), DATE_FORMAT)\r\n break\r\n case 3:\r\n startDate = formatDate(thisMonth, DATE_FORMAT)\r\n endDate = formatDate(moment(), DATE_FORMAT)\r\n break\r\n case 4:\r\n startDate = formatDate(\r\n moment(thisMonth).subtract(1, \"months\").toDate(),\r\n DATE_FORMAT,\r\n )\r\n endDate = formatDate(moment(), DATE_FORMAT)\r\n break\r\n case 6:\r\n startDate = formatDate(moment(thisYear).toDate(), DATE_FORMAT)\r\n endDate = formatDate(moment(), DATE_FORMAT)\r\n break\r\n case 5:\r\n if (durationDate) {\r\n startDate = formatDate(durationDate[0], DATE_FORMAT)\r\n endDate = formatDate(durationDate[1], DATE_FORMAT)\r\n }\r\n break\r\n default:\r\n startDate = \"\"\r\n endDate = \"\"\r\n }\r\n\r\n return { startDate, endDate }\r\n}\r\n\r\nexport const renderButtonCircle = (\r\n title,\r\n iconName,\r\n onClick,\r\n buttonCircle,\r\n btnType,\r\n fill,\r\n style,\r\n) =>\r\n buttonCircle != null && (\r\n
\r\n )\r\n\r\nexport const extracTreeData = (data, code, name) => {\r\n if (!data) return []\r\n return [\r\n {\r\n title: \"Tất cả\",\r\n value: \"0\",\r\n key: \"0\",\r\n children: data.map(item => {\r\n let title = `${item[code]} - ${item[name]}`\r\n if (!code) title = item[name]\r\n if (!name) title = item[code]\r\n return {\r\n title,\r\n value: item.id,\r\n children: [],\r\n }\r\n }),\r\n },\r\n ]\r\n}\r\n\r\n// contact list\r\nexport const nest = (items, id, link) =>\r\n items\r\n ?.filter(item => item[link] === id)\r\n .map(item => ({\r\n ...item,\r\n title: item.DepartmentName,\r\n value: item.DepartmentID,\r\n children: nest(items, item?.DepartmentID, link),\r\n }))\r\n\r\nexport const treeValue = (items, id, link) =>\r\n items\r\n .filter(item => item[link] === id)\r\n .map(item => ({\r\n ...item,\r\n title: item.departmentName,\r\n value: item.departmentId,\r\n key: item.departmentId,\r\n children: treeValue(items, item?.departmentId, link),\r\n }))\r\n\r\nexport const checkPermission = (user, menu, action) => {\r\n const { listTab } = user\r\n const { nameFromApi } = menu\r\n return listTab\r\n ?.filter(i => i?.description === nameFromApi)\r\n ?.filter(j => j?.button?.includes(action))?.length\r\n}\r\n\r\nexport const formatMoney = money =>\r\n (Math.round(money * 100) / 100).toLocaleString()\r\nexport const getBase64 = file =>\r\n new Promise((resolve, reject) => {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(file)\r\n reader.onload = () => resolve(reader.result)\r\n reader.onerror = error => reject(error)\r\n })\r\n\r\nexport const getRegexPassword = () => {\r\n const regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*])(?=.{8,})/\r\n return regex\r\n}\r\n\r\nexport const normFile = e => {\r\n if (Array.isArray(e)) {\r\n return e\r\n }\r\n return e?.fileList\r\n}\r\nexport const arrayToTree = (items, id = null, parent = \"parent_id\", child) =>\r\n items\r\n .filter(item => item[parent] === id)\r\n .map(item => ({\r\n ...item,\r\n title: item?.DisplayName,\r\n value: item?.KeyID,\r\n children: arrayToTree(items, item[child], parent, child),\r\n }))\r\n\r\nexport const getRowSpans = (arr = [], key) => {\r\n let sameValueLength = 0\r\n const rowSpans = []\r\n for (let i = arr.length - 1; i >= 0; i--) {\r\n if (i === 0) {\r\n rowSpans[i] = sameValueLength + 1\r\n continue\r\n }\r\n if (arr[i][key] === arr[i - 1][key]) {\r\n rowSpans[i] = 0\r\n sameValueLength++\r\n } else {\r\n rowSpans[i] = sameValueLength + 1\r\n sameValueLength = 0\r\n }\r\n }\r\n return rowSpans\r\n}\r\n\r\nexport const listDataFile = data =>\r\n data?.map(item => ({\r\n name: item?.FileName,\r\n url: item?.FileUrl,\r\n uid: item?.ObjectFileID,\r\n ...item,\r\n }))\r\nexport const listUidFile = data => {\r\n if (!!Array.isArray(data) && !!data?.length)\r\n return data?.map(item => {\r\n if (!!item?.ObjectFileID) return item?.ObjectFileID\r\n else return \"\"\r\n })\r\n else {\r\n return [\"\"]\r\n }\r\n}\r\n","import styled from \"styled-components\"\r\n\r\nexport const ButtonUploadStyle = styled.div`\r\n .account-button-upload {\r\n border-radius: 4px;\r\n padding: 2px !important;\r\n height: unset !important;\r\n border: 2px dashed #e1e1e1;\r\n .account-text-upload {\r\n font-weight: 600;\r\n font-size: 12px;\r\n line-height: 120%;\r\n color: #154398;\r\n }\r\n .account-background-upload {\r\n background: #f7f7f7;\r\n border-radius: 4px;\r\n justify-content: center;\r\n align-items: center;\r\n\r\n padding: 4px 15px;\r\n }\r\n :hover {\r\n border: 1px solid #154398;\r\n background-color: #154398;\r\n\r\n .account-background-upload {\r\n background-color: transparent;\r\n border: 1px dashed transparent;\r\n }\r\n .account-text-upload {\r\n color: #fff;\r\n }\r\n }\r\n }\r\n`\r\nexport const AddRoleStyled = styled.div`\r\n .add-role-title {\r\n ::before {\r\n content: \"*\";\r\n color: #ed1117;\r\n margin-right: 3px;\r\n }\r\n color: #212529;\r\n font-weight: 600;\r\n }\r\n`\r\nexport const RoleItemStyled = styled.div`\r\n background: #f4f6fb;\r\n border-radius: 8px;\r\n padding: 16px;\r\n`\r\n\r\nexport const ListUserStyled = styled.div`\r\n .ant-anchor-wrapper {\r\n max-height: unset !important;\r\n overflow: unset;\r\n }\r\n\r\n .ant-anchor-ink {\r\n position: unset;\r\n }\r\n`\r\n\r\nexport const ImportStyled = styled.div`\r\n .ant-upload-drag {\r\n background: #edf6fc;\r\n /* main color */\r\n\r\n border: 1px dashed #154398;\r\n border-radius: 5px;\r\n }\r\n .box-note {\r\n background: #fffde7;\r\n /* cam */\r\n\r\n border: 1px solid #f88c00;\r\n border-radius: 5px;\r\n padding: 10px 20px;\r\n margin: 30px 0px;\r\n }\r\n`\r\nexport const TreeAnchorStyled = styled.div`\r\n position: sticky;\r\n top: 58px;\r\n background: #ffffff;\r\n border: 1px solid #dddddd;\r\n border-radius: 10px;\r\n overflow: hidden auto;\r\n padding: 10px;\r\n height: calc(100vh - 167px);\r\n margin-top: 10px;\r\n .ant-tree-indent-unit {\r\n width: 15px;\r\n }\r\n .block-node {\r\n color: #ed1117 !important;\r\n }\r\n .div-all {\r\n position: relative;\r\n padding-top: 6px;\r\n :hover {\r\n .float-action__wrapper {\r\n display: flex;\r\n }\r\n }\r\n .float-action__wrapper {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n display: none;\r\n }\r\n }\r\n .list-button-tree-hover {\r\n display: none;\r\n }\r\n .ant-tree-treenode {\r\n width: 100%;\r\n :hover {\r\n .list-button-tree-hover {\r\n display: flex;\r\n }\r\n }\r\n }\r\n .ant-tree-node-content-wrapper {\r\n flex: auto;\r\n width: 0px;\r\n }\r\n .ant-anchor-link {\r\n padding: 4px 0 4px 0px;\r\n width: 100%;\r\n }\r\n .ant-tree-switcher {\r\n align-self: unset;\r\n }\r\n .ant-tree-node-selected,\r\n .ant-tree-node-content-wrapper:hover {\r\n background-color: transparent !important;\r\n }\r\n .ant-tree-node-selected .ant-tree-title {\r\n color: #000;\r\n font-weight: 600;\r\n }\r\n .ant-anchor-link-active > .ant-anchor-link-title {\r\n color: #000;\r\n font-weight: 600;\r\n /* background-color: #ddd; */\r\n }\r\n .ant-tree-treenode {\r\n align-items: baseline;\r\n &:hover {\r\n .list-button {\r\n display: flex;\r\n position: absolute;\r\n background: #fff;\r\n right: -10px;\r\n height: auto;\r\n .btn-add {\r\n color: ${({ theme }) => theme.white};\r\n }\r\n .btn-edit {\r\n color: ${({ theme }) => theme.white};\r\n }\r\n .btn-delete {\r\n color: ${({ theme }) => theme.red500Color};\r\n }\r\n }\r\n }\r\n }\r\n\r\n .list-button {\r\n display: none;\r\n }\r\n`\r\n\r\nexport const SearchStyled = styled.div`\r\n background: #fff;\r\n margin-bottom: 10px;\r\n`\r\n","import { Spin, Tooltip, Tree } from \"antd\"\r\nimport _ from \"lodash\"\r\nimport { useEffect, useState } from \"react\"\r\nimport { useLocation } from \"react-router-dom\"\r\nimport CB1 from \"src/components/Modal/CB1\"\r\nimport Notice from \"src/components/Notice\"\r\nimport { GUIDE_EMPTY } from \"src/constants/constants\"\r\nimport PostService from \"src/services/PostService\"\r\nimport styled from \"styled-components\"\r\nimport { TreeAnchorStyled } from \"../../ListUser/styled\"\r\nimport InsertCategory from \"../modal/InsertCategory\"\r\nimport FlInput from \"src/components/FloatingLabel/Input\"\r\nexport const sort = items => {\r\n return _.orderBy(items, [\"Level\", \"NumericalOrder\"], [\"asc\", \"asc\"])\r\n}\r\nconst StyleTree = styled.div`\r\n .ant-tree-node-content-wrapper {\r\n width: 100% !important;\r\n }\r\n`\r\nconst TreeCategory = ({ selectedNode, setSelectedNote, reload, setTotal1 }) => {\r\n const { state } = useLocation()\r\n\r\n const [loading, setLoading] = useState(false)\r\n const [open, setOpen] = useState()\r\n\r\n const [treeData, setTreeData] = useState([])\r\n useEffect(() => {\r\n getListCategory()\r\n }, [reload])\r\n\r\n const nest = (items, id, link) =>\r\n items\r\n ?.filter(item => item[link] === id)\r\n .map(item => ({\r\n ...item,\r\n title: item.CategoryPostName,\r\n key: item.CategoryPostID,\r\n children: nest(items, item?.CategoryPostID, link),\r\n }))\r\n\r\n const getListCategory = async () => {\r\n try {\r\n setLoading(true)\r\n const res = await PostService.getListCategoryPost({\r\n TextSearch: \"\",\r\n })\r\n if (res?.isError) return\r\n // sort(res?.Object?.data)\r\n const tree = nest(\r\n sort([\r\n {\r\n CategoryCode: \"TAT_CA\",\r\n CategoryPostID: \"00000000-0000-0000-0000-000000000000\",\r\n CategoryPostName: \"Tất cả\",\r\n Description: null,\r\n IsStatic: true,\r\n Level: 0,\r\n NumericalOrder: 2,\r\n ParentID: \"-1\",\r\n Status: 1,\r\n },\r\n ...res?.Object?.data,\r\n ]),\r\n // GUIDE_EMPTY,\r\n \"-1\",\r\n \"ParentID\",\r\n )\r\n\r\n setTreeData(tree)\r\n console.log(res?.Object?.data?.filter(item => item?.Level === 1))\r\n setSelectedNote(e =>\r\n !e ? (state?.selectedNode ? state?.selectedNode : tree[0]) : e,\r\n )\r\n setTotal1(pre => res?.Object?.total)\r\n } finally {\r\n setLoading(false)\r\n }\r\n }\r\n const getListSearch = async TextSearch => {\r\n const res = await PostService.getListCategoryPost({\r\n TextSearch: TextSearch,\r\n })\r\n if (res?.isError) return\r\n const tree = nest(\r\n sort([\r\n {\r\n CategoryCode: \"TAT_CA\",\r\n CategoryPostID: \"00000000-0000-0000-0000-000000000000\",\r\n CategoryPostName: \"Tất cả\",\r\n Description: null,\r\n IsStatic: true,\r\n Level: 0,\r\n NumericalOrder: 2,\r\n ParentID: \"-1\",\r\n Status: 1,\r\n },\r\n ...res?.Object?.data,\r\n ]),\r\n \"-1\",\r\n \"ParentID\",\r\n )\r\n setTreeData(tree)\r\n setTotal1(pre => res?.Object?.total)\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n getListSearch(e?.target?.value)}\r\n />\r\n {!!treeData?.length && (\r\n {\r\n // !!(e?.node?.Status === 1) &&\r\n setSelectedNote(e?.node)\r\n }}\r\n titleRender={(nodeData, idx) => {\r\n return (\r\n \r\n
\r\n {nodeData?.title}\r\n
\r\n
\r\n )\r\n }}\r\n />\r\n )}\r\n {!!open && (\r\n setOpen(undefined)}\r\n onOk={getListCategory}\r\n />\r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default TreeCategory\r\n","import { Checkbox, Col, Form, Input, InputNumber, Row, TreeSelect } from \"antd\"\r\nimport { useEffect, useState } from \"react\"\r\nimport CustomModal from \"src/components/Modal/CustomModal\"\r\nimport Button from \"src/components/MyButton/Button\"\r\nimport Notice from \"src/components/Notice\"\r\nimport PostService from \"src/services/PostService\"\r\n\r\nconst InsertCategory = ({ open, onCancel, onOk, reload, treeData }) => {\r\n const [form] = Form.useForm()\r\n const [loading, setLoading] = useState(false)\r\n const isEdit = open?.isEdit\r\n useEffect(() => {\r\n if (!!isEdit) {\r\n form.setFieldsValue({\r\n CategoryPostName: open?.CategoryPostName,\r\n Status: !!(open?.Status === 1),\r\n IsShowHome: !!(open?.IsShowHome === 1),\r\n NumericalOrder: open?.NumericalOrder,\r\n ParentID: open?.ParentID,\r\n })\r\n } else {\r\n form.setFieldsValue({\r\n Status: true,\r\n ParentID: open?.CategoryPostID,\r\n })\r\n }\r\n }, [open])\r\n\r\n const onSubmit = async () => {\r\n try {\r\n setLoading(true)\r\n const values = await form.validateFields()\r\n let res\r\n if (isEdit) {\r\n res = await PostService.updateCategory({\r\n ...values,\r\n CategoryPostID: open?.key,\r\n type: 1,\r\n Status: !!values?.Status ? 1 : 2,\r\n IsShowHome: !!values?.IsShowHome ? 1 : 0,\r\n })\r\n } else {\r\n res = await PostService.insertCategory({\r\n ...values,\r\n ParentID: open?.key,\r\n type: 1,\r\n Status: !!values?.Status ? 1 : 2,\r\n IsShowHome: !!values?.IsShowHome ? 1 : 0,\r\n })\r\n }\r\n if (res?.isError) return\r\n Notice({ msg: `${isEdit ? \"Cập nhật\" : \"Thêm\"} danh mục thành công !` })\r\n onOk()\r\n reload()\r\n onCancel()\r\n } finally {\r\n setLoading(false)\r\n }\r\n }\r\n const renderFooter = () => (\r\n
\r\n \r\n {isEdit ? \"Cập nhật\" : \"Thêm\"}\r\n \r\n
\r\n )\r\n\r\n const convertTreeData = items =>\r\n items.map(item => ({\r\n ...item,\r\n title: item.CategoryPostName,\r\n value: item.CategoryPostID,\r\n children: convertTreeData(item?.children),\r\n }))\r\n const filterTreeNode = (inputValue, treeNode) =>\r\n treeNode.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1\r\n\r\n return (\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default InsertCategory\r\n","import styled from \"styled-components\"\r\nimport { Col } from \"antd\"\r\nexport const HomeStyled = styled.div`\r\n position: relative;\r\n .img-bgr-common {\r\n position: absolute;\r\n top: -80px;\r\n width: 100vw;\r\n height: auto;\r\n }\r\n .content-home {\r\n /* position: absolute;\r\n top: 10px; */\r\n }\r\n .time {\r\n font-size: 12px;\r\n }\r\n .matrix {\r\n position: absolute;\r\n width: 1920px;\r\n height: 1394.05px;\r\n left: -509px;\r\n top: 127.31px;\r\n\r\n background: #d9d9d9;\r\n border-radius: 200px;\r\n transform: matrix(0.8, -0.24, 0.93, 0.93, 0, 0);\r\n }\r\n\r\n .notice {\r\n font-weight: 600;\r\n font-size: 13px;\r\n text-transform: uppercase;\r\n color: #ed0101;\r\n }\r\n .notice-content {\r\n color: #1e4193;\r\n font-weight: 400;\r\n text-transform: unset;\r\n margin-left: 24px;\r\n font-size: 13px;\r\n }\r\n .date-time {\r\n color: #6a7688;\r\n font-size: 13px;\r\n text-align: right;\r\n }\r\n .news {\r\n font-weight: 600;\r\n font-size: 24px;\r\n line-height: 29px;\r\n\r\n color: #1e4193;\r\n }\r\n .wrap-img {\r\n position: relative;\r\n &::before {\r\n content: \"\";\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n /* background-color: rgba(0, 0, 0, 0.1); */\r\n /* background: linear-gradient(\r\n 89.03deg,\r\n #113475 30.25%,\r\n rgba(30, 161, 154, 0.7) 45%,\r\n rgba(30, 161, 154, 0) 60%\r\n ); */\r\n /* background: linear-gradient(\r\n 89.74deg,\r\n #2a418a 20%,\r\n #278f8b 50.25%,\r\n rgba(31, 120, 116, 0) 70%\r\n ); */\r\n }\r\n }\r\n\r\n .home-background-cover {\r\n background-repeat: no-repeat !important;\r\n position: relative;\r\n background-size: cover !important;\r\n background-position: center !important;\r\n height: 700px;\r\n }\r\n\r\n .linear-background-cover {\r\n width: 1523px;\r\n background: linear-gradient(\r\n 90.12deg,\r\n rgba(17, 52, 117, 0) 2.85%,\r\n #113475 91.44%\r\n );\r\n transform: matrix(-1, 0, 0, 1, 0, 0);\r\n opacity: 0.9;\r\n height: 100%;\r\n position: absolute;\r\n top: 0px;\r\n bottom: 0px;\r\n left: 0px;\r\n &__1 {\r\n background: linear-gradient(\r\n 90.41deg,\r\n rgba(21, 66, 151, 0) 19.84%,\r\n rgba(22, 42, 91, 0.74) 53.39%,\r\n #57050a 96.69%\r\n );\r\n right: 0px;\r\n }\r\n }\r\n .title-cover {\r\n font-weight: 700;\r\n font-size: 36px;\r\n line-height: 150%;\r\n\r\n color: #fff501;\r\n }\r\n .content-cover {\r\n font-weight: 700;\r\n font-size: 48px;\r\n line-height: 150%;\r\n\r\n color: #ffffff;\r\n @media only screen and (min-width: 800px) {\r\n font-size: 64px;\r\n }\r\n }\r\n .center-cover {\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: flex-start;\r\n position: absolute;\r\n left: 0;\r\n top: 300px;\r\n &__1 {\r\n align-items: flex-end;\r\n width: 100%;\r\n }\r\n }\r\n`\r\n\r\nexport const BoxStyled = styled.div`\r\n background: #e3f1fc;\r\n border-radius: 8px;\r\n padding: 24px;\r\n margin-bottom: 24px;\r\n .title-primary {\r\n font-weight: 600;\r\n font-size: 20px;\r\n color: #1e4193;\r\n margin-left: 74px;\r\n }\r\n .content {\r\n display: flex;\r\n position: relative;\r\n align-items: center;\r\n min-height: 50px;\r\n }\r\n\r\n .card-right {\r\n width: 50px;\r\n position: absolute;\r\n height: 50px;\r\n left: 0px;\r\n top: 0px;\r\n background: #ffffff;\r\n border-radius: 25px;\r\n justify-content: center;\r\n display: flex;\r\n align-items: center;\r\n }\r\n .card-blue {\r\n width: 50px;\r\n height: 50px;\r\n left: 2px;\r\n position: absolute;\r\n top: 2px;\r\n background: #4e9ee9;\r\n border-radius: 25px;\r\n }\r\n`\r\n\r\nexport const NewsStyled = styled.div`\r\n .title-large {\r\n font-weight: 600;\r\n font-size: 20px;\r\n color: #172b4d;\r\n -webkit-line-clamp: 3 !important; /* number of lines to show */\r\n line-clamp: 3 !important;\r\n margin-top: 24px;\r\n margin-bottom: 24px;\r\n }\r\n .content {\r\n font-size: 14px;\r\n color: #6a7688;\r\n -webkit-line-clamp: 3 !important; /* number of lines to show */\r\n line-clamp: 3 !important;\r\n }\r\n .title {\r\n font-weight: 600;\r\n font-size: 16px;\r\n color: #172b4d;\r\n -webkit-line-clamp: 2 !important; /* number of lines to show */\r\n line-clamp: 3 !important;\r\n margin-top: 24px;\r\n margin-bottom: 24px;\r\n }\r\n`\r\nexport const SliderWrapper = styled.div`\r\n position: relative;\r\n width: 100%;\r\n height: 745px;\r\n .slider-item {\r\n height: 745px;\r\n background-position: center;\r\n background-size: cover;\r\n }\r\n .swiper {\r\n /* clip-path: polygon(0 0, 100% 0%, 100% 84%, 0 100%); */\r\n }\r\n .swiper-pagination {\r\n bottom: 125px !important;\r\n }\r\n .swiper-pagination-bullet {\r\n background: var(--swiper-pagination-bullet-inactive-color, #fff);\r\n }\r\n .swiper-pagination-bullet-active {\r\n background: var(--swiper-pagination-color, var(--swiper-theme-color));\r\n }\r\n .intro {\r\n background: linear-gradient(\r\n 101.5deg,\r\n rgba(19, 40, 79, 0.7) 0.24%,\r\n rgba(255, 255, 255, 0) 106.79%\r\n );\r\n color: white;\r\n width: 100%;\r\n height: 100%;\r\n padding: 243px 142px;\r\n }\r\n h3 {\r\n font-family: \"Open sans\";\r\n font-style: normal;\r\n font-weight: 700;\r\n font-size: 64px;\r\n line-height: 87px;\r\n color: inherit;\r\n transform: scale(0.95);\r\n opacity: 0.5;\r\n transition: transform 1.5s ease, opacity 1.5s ease;\r\n }\r\n p {\r\n font-style: normal;\r\n font-family: \"Open sans\";\r\n font-weight: 600;\r\n font-size: 20px;\r\n line-height: 27px;\r\n transform: scale(0.95);\r\n opacity: 0.5;\r\n transition: transform 1.5s ease, opacity 1.5s ease;\r\n }\r\n .swiper-slide-active .icon {\r\n transform: translate(0, 0) scale(1) !important;\r\n opacity: 1;\r\n }\r\n .swiper-slide-active h3,\r\n .swiper-slide-active p {\r\n transform: scale(1) !important;\r\n opacity: 1;\r\n transform-origin: bottom;\r\n }\r\n .slide2 h3 {\r\n padding-left: 320px;\r\n }\r\n @media only screen and (max-width: 1444px) {\r\n .slide2 h3 {\r\n padding-left: 500px;\r\n position: relative;\r\n top: -120px;\r\n }\r\n }\r\n\r\n @media only screen and (max-width: 1000px) {\r\n .intro {\r\n padding: 136px 24px;\r\n }\r\n h3 {\r\n font-size: 48px;\r\n line-height: 64px;\r\n }\r\n .slide2 h3 {\r\n padding-left: 24px;\r\n top: 0;\r\n }\r\n }\r\n`\r\nexport const IconWrapper = styled.div`\r\n position: relative;\r\n .icon-group {\r\n position: relative;\r\n &::before {\r\n content: \"\";\r\n }\r\n }\r\n .icon {\r\n position: absolute;\r\n opacity: 0;\r\n transition: transform 0.5s ease, opacity 0.5s ease;\r\n }\r\n .icon:nth-child(1) {\r\n top: -125px;\r\n left: 320px;\r\n transform: translate(0, 50px) scale(0);\r\n }\r\n .icon:nth-child(2) {\r\n top: -193px;\r\n left: 174px;\r\n transform: translate(0, 50px) scale(0);\r\n transition-delay: 0.2s;\r\n }\r\n .icon:nth-child(3) {\r\n top: -118px;\r\n left: 10px;\r\n transform: translate(50px, 0) scale(0);\r\n transition-delay: 0.4s;\r\n }\r\n .icon:nth-child(4) {\r\n top: 70px;\r\n left: 44px;\r\n transform: translate(50px, -50px) scale(0);\r\n transition-delay: 0.6s;\r\n }\r\n .icon:nth-child(5) {\r\n top: 161px;\r\n left: 235px;\r\n transform: translate(0, -50px) scale(0);\r\n transition-delay: 0.8s;\r\n }\r\n .icon:nth-child(6) {\r\n top: 105px;\r\n left: 357px;\r\n transform: translate(-50px, -50px) scale(0);\r\n transition-delay: 1s;\r\n }\r\n @media only screen and (max-width: 1000px) {\r\n display: none;\r\n }\r\n`\r\n\r\nexport const ContentWrapper = styled.div`\r\n position: absolute;\r\n top: 0;\r\n left: 20px;\r\n bottom: 0px;\r\n display: flex;\r\n align-items: center;\r\n @media only screen and (min-width: 800px) {\r\n left: 130px;\r\n }\r\n`\r\n\r\nexport const SearchStyle = styled.div`\r\n background-repeat: no-repeat !important;\r\n background-size: cover !important;\r\n background-position: center !important;\r\n padding: 50px 0px 30px;\r\n margin-top: 50px;\r\n .yellow-color {\r\n font-weight: 600;\r\n font-size: 24px;\r\n line-height: 29px;\r\n /* identical to box height */\r\n\r\n color: #ffd800;\r\n margin-bottom: 24px;\r\n }\r\n`\r\n\r\nexport const PayStyled = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n .title {\r\n font-weight: 600;\r\n font-size: 24px;\r\n line-height: 29px;\r\n text-align: center;\r\n color: #154398;\r\n margin: 24px;\r\n }\r\n .box-action {\r\n background: #154398;\r\n border-radius: 8px;\r\n width: 212px;\r\n padding: 30px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n flex-direction: column;\r\n }\r\n .fs-20 {\r\n font-size: 20px;\r\n }\r\n`\r\n\r\nexport const ServicesStyled = styled(Col)`\r\n display: flex !important;\r\n flex-direction: column;\r\n align-items: center;\r\n /* height: 200px; */\r\n height: 160px;\r\n max-height: 272px;\r\n background-color: #fff;\r\n cursor: pointer;\r\n border-bottom: ${props => `${props?.borderBottom || 0}px solid #dddddd`};\r\n &::after {\r\n content: \"\";\r\n background-image: -ms-linear-gradient(0deg, #154398 0, #ee1d23 100%);\r\n display: block;\r\n height: 0;\r\n width: 100%;\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0;\r\n transition: all 0.2s ease-in-out;\r\n background-image: linear-gradient(90deg, #154398 0%, #e4353a 100%);\r\n }\r\n :hover {\r\n .title-service {\r\n color: #ed1117;\r\n margin-top: 10px;\r\n }\r\n .icon-service {\r\n background: ${props => `url(${props?.item?.iconHover})`};\r\n width: 90px !important;\r\n height: 95px !important;\r\n transition: 0.3s linear;\r\n background-repeat: no-repeat;\r\n background-size: contain;\r\n }\r\n ::after {\r\n height: 8px;\r\n }\r\n .content-service {\r\n color: #ed1117;\r\n transform: scale(1);\r\n }\r\n .content-service2 {\r\n color: #ed1117;\r\n }\r\n }\r\n .icon-service {\r\n background: ${props => `url(${props?.item?.icon})`};\r\n width: 82px;\r\n height: 82px;\r\n opacity: 1;\r\n background-repeat: no-repeat;\r\n background-size: contain;\r\n }\r\n border-right: ${props => `${props?.borderrightwidth}px solid #dddddd`};\r\n\r\n display: flex;\r\n align-items: center;\r\n flex-direction: column;\r\n padding: 45px auto;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n .title-service {\r\n color: #154398;\r\n font-weight: 600;\r\n font-size: 16px;\r\n text-align: center;\r\n margin-top: 20px;\r\n }\r\n .content-service {\r\n color: #154398;\r\n text-align: center;\r\n margin-top: 10px;\r\n font-size: 12px;\r\n padding: 0 8px;\r\n transform: scale(0);\r\n transition: all 0.3s ease-in-out;\r\n }\r\n .content-service2 {\r\n color: #154398;\r\n text-align: center;\r\n margin-top: 10px;\r\n font-size: 12px;\r\n padding: 0 8px;\r\n }\r\n`\r\n\r\nexport const TabsNewsStyled = styled.div`\r\n .hover-red {\r\n :hover {\r\n color: #f0383e;\r\n }\r\n }\r\n .ant-tabs-content-holder {\r\n padding: 0px 0px;\r\n }\r\n .bread-crumb-tab-news {\r\n margin-top: 0px;\r\n margin-bottom: 15px;\r\n .ant-breadcrumb-link,\r\n .ant-breadcrumb-separator {\r\n color: #212529;\r\n font-weight: 400;\r\n opacity: 1;\r\n font-size: 14px;\r\n }\r\n }\r\n .see-more-2 {\r\n position: absolute;\r\n top: -50px;\r\n right: 0px;\r\n cursor: pointer;\r\n }\r\n\r\n .see-more-3 {\r\n position: absolute;\r\n top: 0px;\r\n right: 0px;\r\n cursor: pointer;\r\n }\r\n .see-more {\r\n position: absolute;\r\n top: 20px;\r\n right: 0px;\r\n cursor: pointer;\r\n }\r\n .ant-tabs-nav-wrap {\r\n height: 36px;\r\n }\r\n .ant-tabs-tab-active {\r\n background: #f8f8f8;\r\n }\r\n .ant-tabs-tab {\r\n padding: 15px 25px;\r\n margin: 0px;\r\n }\r\n .ant-tabs-tab-btn {\r\n font-weight: 600;\r\n font-size: 15px;\r\n line-height: 120%;\r\n text-align: center;\r\n text-shadow: unset !important;\r\n color: #154398;\r\n @media only screen and (min-width: 600px) {\r\n font-size: 22px;\r\n }\r\n @media only screen and (min-width: 550px) {\r\n font-size: 18px;\r\n }\r\n }\r\n .ant-tabs-tab-active,\r\n .ant-tabs-ink-bar {\r\n background: ${({ PrimaryColor }) => PrimaryColor};\r\n }\r\n .ant-tabs-tab-active {\r\n .ant-tabs-tab-btn,\r\n .lib-children {\r\n color: ${({ TextHeaderColor }) => TextHeaderColor} !important;\r\n }\r\n }\r\n`\r\n\r\nexport const MobileIntroduceStyled = styled.div`\r\n background-repeat: no-repeat !important;\r\n position: relative;\r\n background-size: cover !important;\r\n background-position: center !important;\r\n .img-animation-pointer {\r\n transition: transform 30s;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n }\r\n .header1 {\r\n font-weight: 700;\r\n font-size: 32px;\r\n line-height: 150%;\r\n /* identical to box height, or 48px */\r\n color: #ffffff;\r\n }\r\n .header2 {\r\n font-size: 36px;\r\n font-weight: 700;\r\n line-height: 150%;\r\n /* identical to box height, or 48px */\r\n color: #ffffff;\r\n margin-bottom: 40px;\r\n }\r\n`\r\n\r\nexport const ListOptionStyled = styled.div`\r\n margin-top: 70px;\r\n .box-text {\r\n padding: 10px 24px;\r\n background: #f1f5ff;\r\n height: 140px;\r\n display: flex;\r\n align-items: center;\r\n color: #000000;\r\n margin-top: 4px;\r\n .name {\r\n font-size: 10px;\r\n font-style: italic;\r\n }\r\n }\r\n .title {\r\n font-weight: 600;\r\n }\r\n .content {\r\n font-weight: 600;\r\n font-size: 20px;\r\n }\r\n\r\n @media only screen and (min-width: 768px) {\r\n .title {\r\n font-size: 10px;\r\n }\r\n .content {\r\n font-size: 14px;\r\n }\r\n }\r\n\r\n @media only screen and (min-width: 1200px) {\r\n .title {\r\n font-size: 12px;\r\n }\r\n .content {\r\n font-size: 18px;\r\n }\r\n }\r\n\r\n @media only screen and (min-width: 1300px) {\r\n .box-text {\r\n top: 24px;\r\n left: 24px;\r\n }\r\n .title {\r\n font-size: 14px;\r\n }\r\n .content {\r\n font-size: 22px;\r\n }\r\n }\r\n .hoverImage:hover {\r\n .image {\r\n transform: scale(1.2);\r\n }\r\n }\r\n\r\n .image {\r\n transition: all 1s;\r\n transform: scale(1);\r\n object-fit: cover;\r\n }\r\n\r\n .hoverItem:hover {\r\n box-shadow: 0 0 35px 0 rgb(17 51 116 / 15%);\r\n\r\n transition: 0.5s linear;\r\n ::after {\r\n content: \"\";\r\n display: block;\r\n height: 3px;\r\n position: absolute;\r\n bottom: 0px;\r\n left: 10px;\r\n right: 10px;\r\n transition: 0.3s;\r\n background: linear-gradient(90deg, #154297 0%, #ed1e24 100%);\r\n }\r\n }\r\n`\r\n\r\nexport const NumberRepStyled = styled.div`\r\n .title-type-1 {\r\n font-size: 24px;\r\n color: #134197;\r\n font-family: \"Inter Bold\", sans-serif;\r\n padding: 20px 0;\r\n border-bottom: 1px solid #ebebeb;\r\n position: relative;\r\n font-weight: 700;\r\n margin-bottom: 30px;\r\n ::after {\r\n content: \"\";\r\n width: 80px;\r\n height: 4px;\r\n background-image: -webkit-linear-gradient(\r\n 0deg,\r\n rgb(21, 67, 152) 0%,\r\n rgb(238, 29, 35) 100%\r\n );\r\n position: absolute;\r\n left: 40px;\r\n bottom: -2px;\r\n margin: 0 0 0 -40px;\r\n }\r\n }\r\n .box-world {\r\n background-repeat: no-repeat !important;\r\n position: relative;\r\n background-size: cover !important;\r\n background-position: center !important;\r\n padding-bottom: 30px;\r\n padding-top: 30px;\r\n\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n .large-text {\r\n font-size: 72px;\r\n font-weight: 700;\r\n background: linear-gradient(to top right, #154398 0, #ee1d23 100%);\r\n -webkit-background-clip: text;\r\n -webkit-text-fill-color: transparent;\r\n background-clip: text;\r\n }\r\n .small-text {\r\n font-size: 30px;\r\n background: linear-gradient(to top right, #154398 0, #ee1d23 100%);\r\n -webkit-background-clip: text;\r\n -webkit-text-fill-color: transparent;\r\n background-clip: text;\r\n }\r\n .fs-18 {\r\n font-size: 22px;\r\n font-weight: 700;\r\n }\r\n`\r\n\r\nexport const ServiceContainerStyled = styled.div`\r\n .slick-track {\r\n width: 1080px !important;\r\n }\r\n .slick-slide {\r\n min-height: 100% !important;\r\n margin: 4px;\r\n }\r\n\r\n .slick-prev:before,\r\n .slick-next:before {\r\n display: block;\r\n }\r\n .capacity-box-image {\r\n border: 1px solid #dddddd;\r\n border-radius: 4px;\r\n padding: 5px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n margin: 0px 5px;\r\n }\r\n`\r\n\r\nexport const SildeStyled = styled.div`\r\n /* height: calc(100vh - 320px);\r\n.slick-slide {\r\n height: calc(100vh - 320px);\r\n}\r\n.slick-slide > div {\r\n height: calc(100vh - 320px);\r\n .relative {\r\n height: calc(100vh - 320px);\r\n img {\r\n height: calc(100vh - 320px);\r\n object-fit: cover;\r\n }\r\n }\r\n} */\r\n\r\n height: ${props =>\r\n props.isSmallMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"45px\"\r\n : \"85px\"\r\n : props.isMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"61px\"\r\n : \"102px\"\r\n : props.isTablet\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"102px\"\r\n : \"235px\"\r\n : props.isBottom\r\n ? \"252px\"\r\n : props.isService\r\n ? \"160px\"\r\n : \"350px\"};\r\n .slick-slide {\r\n height: ${props =>\r\n props.isSmallMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"45px\"\r\n : \"85px\"\r\n : props.isMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"61px\"\r\n : \"102px\"\r\n : props.isTablet\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"102px\"\r\n : \"235px\"\r\n : props.isBottom\r\n ? \"252px\"\r\n : props.isService\r\n ? \"160px\"\r\n : \"350px\"};\r\n }\r\n .slick-slide > div {\r\n height: ${props =>\r\n props.isSmallMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"45px\"\r\n : \"85px\"\r\n : props.isMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"61px\"\r\n : \"102px\"\r\n : props.isTablet\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"102px\"\r\n : \"235px\"\r\n : props.isBottom\r\n ? \"252px\"\r\n : props.isService\r\n ? \"160px\"\r\n : \"350px\"};\r\n .relative {\r\n height: ${props =>\r\n props.isSmallMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"45px\"\r\n : \"85px\"\r\n : props.isMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"61px\"\r\n : \"102px\"\r\n : props.isTablet\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"102px\"\r\n : \"235px\"\r\n : props.isBottom\r\n ? \"252px\"\r\n : props.isService\r\n ? \"160px\"\r\n : \"350px\"};\r\n img {\r\n height: ${props =>\r\n props.isSmallMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"45px\"\r\n : \"85px\"\r\n : props.isMobile\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"61px\"\r\n : \"102px\"\r\n : props.isTablet\r\n ? props.isBottom\r\n ? \"108px\"\r\n : props.isService\r\n ? \"102px\"\r\n : \"235px\"\r\n : props?.isBottom\r\n ? \"252px\"\r\n : props.isService\r\n ? \"160px\"\r\n : \"350px\"};\r\n object-fit: cover;\r\n object-position: center;\r\n }\r\n }\r\n }\r\n .relative {\r\n position: relative;\r\n }\r\n position: relative;\r\n .slick-prev:before,\r\n .slick-next:before {\r\n display: none;\r\n }\r\n .slick-prev {\r\n left: 50px;\r\n z-index: 10;\r\n width: unset !important;\r\n }\r\n .slick-next {\r\n right: 50px;\r\n z-index: 10;\r\n width: unset !important;\r\n }\r\n .layout-slider {\r\n display: flex;\r\n flex-direction: column;\r\n max-width: 1500px;\r\n margin: 0px auto;\r\n }\r\n\r\n .option-box {\r\n font-weight: 700;\r\n font-size: 14px;\r\n color: #fff;\r\n margin-left: 10px;\r\n @media only screen and (min-width: 1200px) {\r\n font-size: 22px;\r\n }\r\n }\r\n position: relative;\r\n .linear-background {\r\n width: 1523px;\r\n /* background: linear-gradient(\r\n 89.98deg,\r\n #2a418a 18.81%,\r\n #1f7874 57.87%,\r\n rgba(31, 120, 116, 0) 95.33%\r\n ); */\r\n height: 100%;\r\n position: absolute;\r\n top: 0px;\r\n bottom: 0px;\r\n }\r\n .title {\r\n font-weight: 700;\r\n font-size: 20px;\r\n line-height: 150%;\r\n color: #ffffff;\r\n transform: scale(1);\r\n opacity: 1;\r\n transition: transform 1s ease, opacity 1s ease;\r\n animation: Title-animate 1s linear;\r\n margin-left: 0;\r\n text-shadow: 0 1px #999;\r\n\r\n @media only screen and (min-width: 1200px) {\r\n font-size: 40px;\r\n }\r\n }\r\n .column {\r\n flex-direction: column !important;\r\n align-items: flex-start !important;\r\n }\r\n .box-animate {\r\n flex-direction: column;\r\n align-items: flex-start;\r\n margin-left: 0px !important;\r\n margin-top: 10px;\r\n @media only screen and (min-width: 1200px) {\r\n flex-direction: row;\r\n align-items: center;\r\n }\r\n\r\n @media only screen and (min-width: 1200px) {\r\n margin-left: 0px !important;\r\n margin-top: 40px;\r\n }\r\n }\r\n @keyframes Title-animate {\r\n 0%,\r\n 30% {\r\n margin-left: 150px;\r\n opacity: 0;\r\n }\r\n 100% {\r\n margin-left: 0;\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .layout {\r\n position: absolute;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n }\r\n .contact {\r\n /* background: linear-gradient(90deg, #ed0101 23.95%, #ff5839 97.11%); */\r\n border: 4px solid #ffe7e6;\r\n border-radius: 88px;\r\n padding: 8px 24px 8px 50px !important;\r\n font-weight: 700;\r\n font-size: 20px;\r\n line-height: 24px;\r\n color: #ffffff;\r\n position: relative;\r\n width: fit-content;\r\n }\r\n .phone-wrapper {\r\n position: absolute;\r\n left: -15px;\r\n width: 60px;\r\n height: 60px;\r\n background: #fff;\r\n border-radius: 30px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n top: -10px;\r\n }\r\n .phone-circle {\r\n width: 56px;\r\n height: 56px;\r\n border-radius: 28px;\r\n /* background: linear-gradient(90deg, #ed0101 0%, #ff5839 105.36%); */\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n .notice-wrapper {\r\n background: #ffffff;\r\n box-shadow: 0px 0px 72px rgba(0, 0, 0, 0.15);\r\n border-radius: 8px;\r\n padding: 0px !important;\r\n\r\n .header {\r\n background: #ed0101;\r\n border-radius: 8px 8px 0px 0px;\r\n height: 56px;\r\n position: relative;\r\n .icon-notice {\r\n position: absolute;\r\n bottom: -10px;\r\n right: 5px;\r\n }\r\n }\r\n .content {\r\n font-weight: 700;\r\n font-size: 24px;\r\n line-height: 150%;\r\n\r\n text-align: center;\r\n text-transform: uppercase;\r\n padding: 30px;\r\n color: #ed0101;\r\n }\r\n }\r\n\r\n .info-common {\r\n .ant-row {\r\n flex-wrap: nowrap;\r\n }\r\n svg path {\r\n fill: #154398;\r\n }\r\n .normal {\r\n color: #154398;\r\n }\r\n }\r\n .message-wrapper {\r\n width: 56px;\r\n height: 56px;\r\n border-radius: 28px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n background: #154398;\r\n }\r\n`\r\n\r\nexport const ContentStyleAnimation = styled(Col)`\r\n flex-direction: column;\r\n align-items: flex-start;\r\n margin-left: 0px !important;\r\n margin-top: 10px;\r\n text-shadow: 0 1px #999;\r\n animation: BoxAnimate ${props => 1 + props.order * 0.3}s linear;\r\n @media only screen and (min-width: 1200px) {\r\n flex-direction: row;\r\n align-items: center;\r\n }\r\n\r\n @media only screen and (min-width: 1200px) {\r\n margin-left: 0px !important;\r\n /* margin-top: 40px; */\r\n }\r\n .option-box {\r\n font-weight: 700;\r\n font-size: 14px;\r\n color: #fff;\r\n margin-left: 10px;\r\n @media only screen and (min-width: 1200px) {\r\n font-size: 22px;\r\n }\r\n }\r\n @keyframes BoxAnimate {\r\n 0%,\r\n 60% {\r\n margin-left: 100px;\r\n opacity: 0;\r\n }\r\n\r\n 100% {\r\n margin-left: 0px;\r\n opacity: 1;\r\n }\r\n }\r\n`\r\n","import padEnd from 'lodash/padEnd';\nimport * as React from 'react';\nvar StatisticNumber = function StatisticNumber(props) {\n var value = props.value,\n formatter = props.formatter,\n precision = props.precision,\n decimalSeparator = props.decimalSeparator,\n _props$groupSeparator = props.groupSeparator,\n groupSeparator = _props$groupSeparator === void 0 ? '' : _props$groupSeparator,\n prefixCls = props.prefixCls;\n var valueNode;\n if (typeof formatter === 'function') {\n // Customize formatter\n valueNode = formatter(value);\n } else {\n // Internal formatter\n var val = String(value);\n var cells = val.match(/^(-?)(\\d*)(\\.(\\d+))?$/);\n // Process if illegal number\n if (!cells || val === '-') {\n valueNode = val;\n } else {\n var negative = cells[1];\n var int = cells[2] || '0';\n var decimal = cells[4] || '';\n int = int.replace(/\\B(?=(\\d{3})+(?!\\d))/g, groupSeparator);\n if (typeof precision === 'number') {\n decimal = padEnd(decimal, precision, '0').slice(0, precision > 0 ? precision : 0);\n }\n if (decimal) {\n decimal = \"\".concat(decimalSeparator).concat(decimal);\n }\n valueNode = [/*#__PURE__*/React.createElement(\"span\", {\n key: \"int\",\n className: \"\".concat(prefixCls, \"-content-value-int\")\n }, negative, int), decimal && /*#__PURE__*/React.createElement(\"span\", {\n key: \"decimal\",\n className: \"\".concat(prefixCls, \"-content-value-decimal\")\n }, decimal)];\n }\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-value\")\n }, valueNode);\n};\nexport default StatisticNumber;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { withConfigConsumer } from '../config-provider/context';\nimport Skeleton from '../skeleton';\nimport StatisticNumber from './Number';\nvar Statistic = function Statistic(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n valueStyle = props.valueStyle,\n _props$value = props.value,\n value = _props$value === void 0 ? 0 : _props$value,\n title = props.title,\n valueRender = props.valueRender,\n prefix = props.prefix,\n suffix = props.suffix,\n _props$loading = props.loading,\n loading = _props$loading === void 0 ? false : _props$loading,\n direction = props.direction,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n _props$decimalSeparat = props.decimalSeparator,\n decimalSeparator = _props$decimalSeparat === void 0 ? '.' : _props$decimalSeparat,\n _props$groupSeparator = props.groupSeparator,\n groupSeparator = _props$groupSeparator === void 0 ? ',' : _props$groupSeparator;\n var valueNode = /*#__PURE__*/React.createElement(StatisticNumber, _extends({\n decimalSeparator: decimalSeparator,\n groupSeparator: groupSeparator\n }, props, {\n value: value\n }));\n var cls = classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: style,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-title\")\n }, title), /*#__PURE__*/React.createElement(Skeleton, {\n paragraph: false,\n loading: loading,\n className: \"\".concat(prefixCls, \"-skeleton\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n style: valueStyle,\n className: \"\".concat(prefixCls, \"-content\")\n }, prefix && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-prefix\")\n }, prefix), valueRender ? valueRender(valueNode) : valueNode, suffix && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-suffix\")\n }, suffix))));\n};\nvar WrapperStatistic = withConfigConsumer({\n prefixCls: 'statistic'\n})(Statistic);\nexport default WrapperStatistic;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport padStart from 'lodash/padStart';\n// Countdown\nvar timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1] // million seconds\n];\n\nexport function formatTimeStr(duration, format) {\n var leftDuration = duration;\n var escapeRegex = /\\[[^\\]]*]/g;\n var keepList = (format.match(escapeRegex) || []).map(function (str) {\n return str.slice(1, -1);\n });\n var templateText = format.replace(escapeRegex, '[]');\n var replacedText = timeUnits.reduce(function (current, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n name = _ref2[0],\n unit = _ref2[1];\n if (current.includes(name)) {\n var value = Math.floor(leftDuration / unit);\n leftDuration -= value * unit;\n return current.replace(new RegExp(\"\".concat(name, \"+\"), 'g'), function (match) {\n var len = match.length;\n return padStart(value.toString(), len, '0');\n });\n }\n return current;\n }, templateText);\n var index = 0;\n return replacedText.replace(escapeRegex, function () {\n var match = keepList[index];\n index += 1;\n return match;\n });\n}\nexport function formatCountdown(value, config) {\n var _config$format = config.format,\n format = _config$format === void 0 ? '' : _config$format;\n var target = new Date(value).getTime();\n var current = Date.now();\n var diff = Math.max(target - current, 0);\n return formatTimeStr(diff, format);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useForceUpdate from '../_util/hooks/useForceUpdate';\nimport { cloneElement } from '../_util/reactNode';\nimport Statistic from './Statistic';\nimport { formatCountdown } from './utils';\nvar REFRESH_INTERVAL = 1000 / 30;\nfunction getTime(value) {\n return new Date(value).getTime();\n}\nvar Countdown = function Countdown(props) {\n var value = props.value,\n _props$format = props.format,\n format = _props$format === void 0 ? 'HH:mm:ss' : _props$format,\n onChange = props.onChange,\n onFinish = props.onFinish;\n var forceUpdate = useForceUpdate();\n var countdown = React.useRef(null);\n var stopTimer = function stopTimer() {\n onFinish === null || onFinish === void 0 ? void 0 : onFinish();\n if (countdown.current) {\n clearInterval(countdown.current);\n countdown.current = null;\n }\n };\n var syncTimer = function syncTimer() {\n var timestamp = getTime(value);\n if (timestamp >= Date.now()) {\n countdown.current = setInterval(function () {\n forceUpdate();\n onChange === null || onChange === void 0 ? void 0 : onChange(timestamp - Date.now());\n if (timestamp < Date.now()) {\n stopTimer();\n }\n }, REFRESH_INTERVAL);\n }\n };\n React.useEffect(function () {\n syncTimer();\n return function () {\n if (countdown.current) {\n clearInterval(countdown.current);\n countdown.current = null;\n }\n };\n }, [value]);\n var formatter = function formatter(formatValue, config) {\n return formatCountdown(formatValue, _extends(_extends({}, config), {\n format: format\n }));\n };\n var valueRender = function valueRender(node) {\n return cloneElement(node, {\n title: undefined\n });\n };\n return /*#__PURE__*/React.createElement(Statistic, _extends({}, props, {\n valueRender: valueRender,\n formatter: formatter\n }));\n};\nexport default /*#__PURE__*/React.memo(Countdown);","import Countdown from './Countdown';\nimport Statistic from './Statistic';\nStatistic.Countdown = Countdown;\nexport default Statistic;","import React from \"react\"\r\nimport styled from \"styled-components\"\r\nimport videoBanner from \"./video/video-banner.mp4\"\r\nimport videoBannerMobile from \"./video/video-banner-mobile.mp4\"\r\nimport { Statistic } from \"antd\"\r\nimport moment from \"moment\"\r\nimport useWindowSize from \"src/lib/useWindowSize\"\r\nimport Notice from \"src/components/Notice\"\r\nconst { Countdown } = Statistic\r\nconst BannerLandingStyle = styled.div`\r\n position: relative;\r\n background: var(--color-landing-page);\r\n .box-time {\r\n background: var(--color-landing-page-box-time);\r\n /* background: linear-gradient(45deg, #3f51b5, #ffe500); */\r\n padding: 16px 24px;\r\n color: #d84315;\r\n border-radius: 8px;\r\n box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.3);\r\n font-size: 24px !important;\r\n }\r\n .box-time2 {\r\n background: var(--color-landing-page-box-time);\r\n /* background: linear-gradient(45deg, #3f51b5, #ffe500); */\r\n padding: 8px 12px;\r\n color: #d84315;\r\n border-radius: 8px;\r\n box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.3);\r\n font-size: 14px;\r\n div {\r\n font-size: 12px !important;\r\n }\r\n }\r\n .video-bg {\r\n video {\r\n width: 100%;\r\n /* height: calc(100vh - 51px); */\r\n /* object-fit: cover; */\r\n }\r\n .content-bg {\r\n position: absolute;\r\n left: 10%;\r\n top: 40%;\r\n .ant-btn {\r\n padding: 10px 15px;\r\n text-align: center;\r\n height: 50px !important;\r\n background-color: ${({ theme }) => theme.primaryColor};\r\n border-color: ${({ theme }) => theme.primaryColor};\r\n color: #fff;\r\n :hover {\r\n transform: translateY(-4px);\r\n box-shadow: 0px 5px 30px rgba(224, 128, 129, 0.692);\r\n }\r\n }\r\n .content-bg-title {\r\n font-size: 50px;\r\n font-weight: 600;\r\n color: #faad14;\r\n margin-bottom: 24px;\r\n }\r\n .content-bg-label {\r\n width: 60%;\r\n font-size: 20px;\r\n color: #faad14;\r\n margin-bottom: 24px;\r\n }\r\n }\r\n :before {\r\n content: \"\";\r\n position: absolute;\r\n top: ${({ theme }) => `${theme.headerTopHeight};`};\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n\r\n background: #0000004d;\r\n }\r\n }\r\n`\r\nexport const checkBetweenTime = () => {\r\n // Tạo các đối tượng Date cho các mốc thời gian\r\n const startDate = new Date(\"2024-07-01T00:00:00\")\r\n const endDate = new Date(\"2024-07-10T23:00:00\")\r\n\r\n // Lấy thời gian hiện tại\r\n const currentDate = new Date()\r\n // Kiểm tra nếu thời gian hiện tại nằm trong khoảng từ startDate đến endDate\r\n if (currentDate < startDate) {\r\n console.log(\"Thời gian hiện tại chưa bắt đầu\")\r\n Notice({\r\n isSuccess: false,\r\n msg: \"Sự kiện chưa bắt đầu bình chọn.\",\r\n })\r\n return false\r\n } else if (currentDate > endDate) {\r\n Notice({\r\n isSuccess: false,\r\n msg: \"Sự kiện đã kết thúc bình chọn\",\r\n })\r\n console.log(\"Thời gian hiện tại đã kết thúc\")\r\n return false\r\n } else {\r\n console.log(\"Thời gian hiện tại đang diễn ra\")\r\n return true\r\n }\r\n}\r\nconst BannerLanding = () => {\r\n const isLaptop = !!useWindowSize.isLaptop()\r\n const isMobile = !!useWindowSize.isMobile()\r\n\r\n // Tạo các đối tượng Date cho các mốc thời gian\r\n const startDate = new Date(\"2024-07-01T00:00:00\")\r\n const endDate = new Date(\"2024-07-10T23:59:00\")\r\n\r\n // Lấy thời gian hiện tại\r\n const currentDate = new Date()\r\n const boxTime =\r\n Date.now() +\r\n +moment(\"10/07/2024 23:59:00\", \"DD/MM/YYYY HH:mm:ss\").diff(\r\n moment(),\r\n \"seconds\",\r\n ) *\r\n 1000\r\n const checkTime = () => {\r\n // Kiểm tra nếu thời gian hiện tại nằm trong khoảng từ startDate đến endDate\r\n if (currentDate >= startDate && currentDate <= endDate) {\r\n console.log(\"Thời gian hiện tại nằm trong khoảng thời gian đã cho.\")\r\n return true\r\n } else {\r\n console.log(\"Thời gian hiện tại không nằm trong khoảng thời gian đã cho.\")\r\n return false\r\n }\r\n }\r\n return (\r\n
\r\n \r\n
\r\n {/*
\r\n \r\n */}\r\n {/* https://media.cdyt.vn/141,321d00a5e7689f4d */}\r\n
\r\n
\r\n
\r\n \r\n
\r\n
Bắt đầu
\r\n
Từ 00h00
\r\n
Ngày 01/07/2024
\r\n
\r\n
\r\n
Kết thúc
\r\n
Lúc 23h59
\r\n
Ngày 10/07/2024
\r\n
\r\n {!isMobile && !!checkTime() && (\r\n
\r\n )}\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default BannerLanding\r\n","import { useState } from \"react\"\r\nimport RePasswordModal from \"src/components/Layouts/component/Forget/components/RePasswordModal\"\r\nimport VerifyForgetModal from \"src/components/Layouts/component/Forget/components/VerifyForgotModal\"\r\nimport ForgetModal from \"src/components/Layouts/component/Forget/ForgetModal\"\r\nimport FormLoginSocial from \"src/components/Layouts/component/Login/FormLoginSocial\"\r\nimport LoginModal from \"src/components/Layouts/component/Login/LoginModal\"\r\nimport RegisterEnterpriseModal from \"src/components/Layouts/component/Register/components/RegisterEnterpriseModal\"\r\nimport RegisterModal from \"src/components/Layouts/component/Register/components/RegisterModal\"\r\nimport SelectRegisterModal from \"src/components/Layouts/component/Register/SelectRegisterModal\"\r\nimport { StyleLoginModal } from \"src/components/Layouts/styled\"\r\nimport CustomModal from \"src/components/Modal/CustomModal\"\r\nconst LoginFBLD = ({ openLoginModal, setOpenLoginModal }) => {\r\n return (\r\n
\r\n {!!openLoginModal && (\r\n >}\r\n footer={null}\r\n open={openLoginModal}\r\n onCancel={() => {\r\n setOpenLoginModal(false)\r\n }}\r\n style={{ top: \"40%\" }}\r\n >\r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport default LoginFBLD\r\n","import { createSlice } from \"@reduxjs/toolkit\"\r\n\r\nconst initialState = {\r\n banner: [],\r\n event: [],\r\n footer: {},\r\n colors: {\r\n PrimaryColor: \"#E06651\",\r\n SecondaryColor: \"#E06651\",\r\n BackGroundColor: \"#FFFCF5\",\r\n TextHeaderColor: \"#FFFFFF\",\r\n },\r\n}\r\n\r\nexport const bannerSlice = createSlice({\r\n name: \"banner\",\r\n initialState,\r\n reducers: {\r\n setBanner: (state, action) => {\r\n state.banner = action.payload\r\n },\r\n setFooter: (state, action) => {\r\n state.footer = action.payload\r\n },\r\n setEvent: (state, action) => {\r\n state.event = action.payload\r\n },\r\n setColors: (state, action) => {\r\n state.colors = action.payload\r\n },\r\n },\r\n})\r\n\r\nexport const { setEvent, setBanner, setFooter, setColors } = bannerSlice.actions\r\n\r\nexport default bannerSlice.reducer\r\n","import { createSlice } from \"@reduxjs/toolkit\"\r\n\r\nconst initialState = {\r\n importLoading: false,\r\n modalLoading: false,\r\n}\r\n\r\nexport const commonSlice = createSlice({\r\n name: \"appreciation\",\r\n initialState,\r\n reducers: {\r\n changeImportLoading: (state, action) => {\r\n state.importLoading = action.payload\r\n },\r\n changeModalLoading: (state, action) => {\r\n state.modalLoading = action.payload\r\n },\r\n },\r\n})\r\n\r\nexport const { changeImportLoading, changeModalLoading } = commonSlice.actions\r\n\r\nexport default commonSlice.reducer\r\n","import { createSlice } from \"@reduxjs/toolkit\"\r\n\r\nexport const counterSlice = createSlice({\r\n name: \"counter\",\r\n initialState: {\r\n value: 0,\r\n },\r\n reducers: {\r\n increment: state => {\r\n // Redux Toolkit allows us to write \"mutating\" logic in reducers. It\r\n // doesn't actually mutate the state because it uses the Immer library,\r\n // which detects changes to a \"draft state\" and produces a brand new\r\n // immutable state based off those changes\r\n state.value += 1\r\n },\r\n decrement: state => {\r\n state.value -= 1\r\n },\r\n incrementByAmount: (state, action) => {\r\n state.value += action.payload\r\n },\r\n },\r\n})\r\n\r\n// Action creators are generated for each case reducer function\r\nexport const { increment, decrement, incrementByAmount } = counterSlice.actions\r\n\r\nexport default counterSlice.reducer\r\n","import { createSlice } from \"@reduxjs/toolkit\"\r\n\r\nconst initialState = {\r\n listAddress: [],\r\n listCustomer: [],\r\n loading: false,\r\n addressSelect: {},\r\n condition: {\r\n CurrentPage: 1,\r\n PageSize: 20,\r\n SearchText: \"\",\r\n GuestType: undefined,\r\n },\r\n total: 0,\r\n listProvince: [],\r\n listWaterPrice: [],\r\n}\r\n\r\nexport const customerDirectorySlice = createSlice({\r\n name: \"customerDirectory\",\r\n initialState,\r\n reducers: {\r\n setLoading: (state, action) => {\r\n state.loading = action.payload\r\n },\r\n setAddressSelect: (state, action) => {\r\n state.addressSelect = action.payload\r\n },\r\n setListAddress: (state, action) => {\r\n state.listAddress = action.payload\r\n },\r\n setListCustomer: (state, action) => {\r\n state.listCustomer = action.payload\r\n },\r\n setTotal: (state, action) => {\r\n state.total = action.payload\r\n },\r\n setListProvince: (state, action) => {\r\n state.listProvince = action.payload\r\n },\r\n setListWaterPrice: (state, action) => {\r\n state.listWaterPrice = action.payload\r\n },\r\n changCondition: (state, action) => {\r\n state.condition = action.payload\r\n },\r\n },\r\n})\r\n\r\nexport const {\r\n setListAddress,\r\n setListCustomer,\r\n setLoading,\r\n setAddressSelect,\r\n changCondition,\r\n setListProvince,\r\n setTotal,\r\n setListWaterPrice,\r\n} = customerDirectorySlice.actions\r\n\r\nexport default customerDirectorySlice.reducer\r\n","import { createSlice } from \"@reduxjs/toolkit\"\r\n\r\nconst initialState = {\r\n menuPost: [],\r\n listPost: [],\r\n}\r\n\r\nexport const menuPostSlice = createSlice({\r\n name: \"menuPost\",\r\n initialState,\r\n reducers: {\r\n setMenuPost: (state, action) => {\r\n state.menuPost = action.payload\r\n },\r\n setListPost: (state, action) => {\r\n state.listPost = action.payload\r\n },\r\n },\r\n})\r\n\r\nexport const { setMenuPost, setListPost } = menuPostSlice.actions\r\n\r\nexport default menuPostSlice.reducer\r\n","import { createSlice } from \"@reduxjs/toolkit\"\r\nimport { GUIDE_EMPTY } from \"src/constants/constants\"\r\n\r\nconst initialState = {\r\n topicPostID: GUIDE_EMPTY,\r\n}\r\n\r\nexport const topicPostSlice = createSlice({\r\n name: \"topicPost\",\r\n initialState,\r\n reducers: {\r\n changeTopicPostID: (state, action) => {\r\n state.topicPostID = action.payload\r\n },\r\n },\r\n})\r\n\r\nexport const { changeTopicPostID } = topicPostSlice.actions\r\n\r\nexport default topicPostSlice.reducer\r\n","const BINH_CHON = \"/binh-chon\"\r\n\r\nconst ROUTER = {\r\n // LOGIN: \"/login\",\r\n HOME: \"/\",\r\n ZALO_CONFIRM: \"/zalo_verifierVTE60vJQ55bWhB43fv8mMNUmlG-RncvMDJKu.html\",\r\n LOGIN_ZALO: \"/login/zalo\",\r\n LIEN_HE: \"/lien-he\",\r\n\r\n //Giới thiệu\r\n GIOI_THIEU: \"/gioi-thieu\",\r\n\r\n //Tin tức\r\n TIM_KIEM: \"/tim-kiem\",\r\n TIM_KIEM_VAN_BAN: \"/tim-kiem-van-ban\",\r\n TIM_KIEM_TAI_LIEU: \"/tim-kiem-tai-lieu\",\r\n DANH_SACH_VIDEO: \"/danh-sach-video\",\r\n TAI_LIEU_HDNV: \"/sach,-tai-lieu-huong-dan-nghiep-vu\",\r\n\r\n //Thư viện\r\n THU_VIEN: \"/thu-vien\",\r\n THU_VIEN_HINH_ANH: \"/thu-vien-hinh-anh/:id\",\r\n //DICH_VU\r\n DICH_VU: \"/dich-vu\",\r\n CAC_GOI_DICH_VU: \"/cac-goi-dich-vu\",\r\n CHI_TIET_DICH_VU: \"/chi-tiet-dich-vu/:id\",\r\n\r\n //Dịch vụ\r\n YEU_CAU_HO_TRO: \"/yeu-cau-ho-tro\",\r\n // NEWS\r\n\r\n MEDIA: \"/media\",\r\n DANH_SACH_TIN_TUC: \"/danh-sach-tin-tuc\",\r\n DANG_BAI: \"/dang-bai\",\r\n\r\n // USER\r\n TAI_KHOAN_CUA_TOI: \"/tai-khoan-cua-toi\",\r\n\r\n // ADMIN\r\n TONG_QUAN: \"/tong-quan\",\r\n VAN_BAN: \"/van-ban\",\r\n TAI_LIEU: \"/tai-lieu\",\r\n HINH_ANH: \"/hinh-anh\",\r\n VIDEO: \"/video\",\r\n PHAN_QUYEN: \"/phan-quyen\",\r\n BANNER_FOOTER: \"/banner-footer\",\r\n PHONG_BAN_CHUC_VU: \"/phong-ban-chuc-vu\",\r\n DANH_BA_NGUOI_DUNG: \"/danh-ba-nguoi-dung\",\r\n DANH_SACH_BAI_VIET: \"/danh-sach-bai-viet\",\r\n DANH_MUC_THE: \"/danh-muc-the\",\r\n DANH_BA: \"/danh-ba\",\r\n NHOM_TIN_BAI: \"/nhom-tin-bai\",\r\n LOAI_VAN_BAN: \"/loai-van-ban\",\r\n LINH_VUC: \"/linh-vuc\",\r\n LOAI_TAI_LIEU: \"/loai-tai-lieu\",\r\n CO_QUAN_BAN_HANH: \"/co-quan-ban-hanh\",\r\n NHOM_HINH_ANH: \"/nhom-hinh-anh\",\r\n LS_HOAT_DONG: \"/ls-hoat-dong\",\r\n HE_THONG_TO_CHUC: \"/he-thong-to-chuc\",\r\n THONG_KE: \"/thong-ke\",\r\n\r\n TIN_TUC_CHI_TIET: \"/noi-dung/:id\",\r\n GIOI_THIEU_TONG_QUAN: \"/gioi-thieu-tong-quan\",\r\n NEWS: \"/noi-dung\",\r\n TIN_TUC: \"/tin-tuc\",\r\n LOGIN_GOOGLE: \"/dang-nhap-tu-mang-xa-hoi\",\r\n SVG_VIEWER: \"/svg-viewer\",\r\n\r\n //Landing Page\r\n //Bình chọn tác giả\r\n BINH_CHON: BINH_CHON,\r\n DANH_SACH_TAC_GIA: BINH_CHON + \"/danh-sach-tac-gia\",\r\n THE_LE: BINH_CHON + \"/the-le\",\r\n BANG_XEP_HANG: BINH_CHON + \"/bang-xep-hang\",\r\n GIAI_THUONG: BINH_CHON + \"/giai-thuong\",\r\n\r\n CHI_TIET_TAC_GIA: BINH_CHON + \"/chi-tiet-tac-gia\",\r\n TIN_TUC_BINH_CHON: BINH_CHON + \"/tin-tuc\",\r\n CHI_TIET_TIN_TUC_BINH_CHON: BINH_CHON + \"/chi-tiet-tin-tuc-binh-chon\",\r\n}\r\nexport default ROUTER\r\n","import http from \"./index\"\r\nimport {\r\n apiBusinessRegister,\r\n apiChangePassword,\r\n apiForgotPassword,\r\n apiLogin,\r\n apiLogout,\r\n apiRegister,\r\n apiVerifyCode,\r\n apiLoginGoole,\r\n apiCallBackLoginGoole,\r\n apiLoginFB,\r\n apiLoginFB2,\r\n apiLoginZalo,\r\n} from \"./apiRouter\"\r\n\r\nconst login = body => http.post(apiLogin, body)\r\nconst register = body => http.post(apiRegister, body)\r\nconst forgotPass = body => http.post(apiForgotPassword, body)\r\nconst verifyCode = body => http.post(apiVerifyCode, body)\r\nconst changePassword = body => http.post(apiChangePassword, body)\r\n\r\nconst logout = () => http.get(apiLogout)\r\nconst loginGG = () => http.get(apiLoginGoole)\r\nconst loginZalo = body => http.post(apiLoginZalo, body)\r\nconst loginFB = () => http.get(apiLoginFB)\r\nconst loginFB2 = () => http.get(apiLoginFB2)\r\n\r\nconst callbackGG = params => http.get(apiCallBackLoginGoole, { params })\r\n\r\nconst businessRegister = body => http.post(apiBusinessRegister, body)\r\n\r\nconst AuthService = {\r\n loginGG,\r\n callbackGG,\r\n loginFB2,\r\n login,\r\n logout,\r\n register,\r\n forgotPass,\r\n verifyCode,\r\n businessRegister,\r\n changePassword,\r\n loginFB,\r\n loginZalo,\r\n}\r\nexport default AuthService\r\n","import { apiUploadFile, apiUploadFileList } from \"./apiRouter\"\r\nimport http from \"./index\"\r\n\r\nconst uploadFile = body => http.post(apiUploadFile, body)\r\nconst uploadFileList = body => http.post(apiUploadFileList, body)\r\n\r\nconst FileService = { uploadFileList, uploadFile }\r\nexport default FileService\r\n","import QueryString from \"qs\"\r\nimport {\r\n apiAllPostCommnetByType,\r\n apiGetAllListPost,\r\n apiGetAllTopicGuest,\r\n apiGetCategoryPost,\r\n apiGetDetailByG,\r\n apiGetListPostByCategoryPostID,\r\n apiGetListPostByTags,\r\n apiGetListPostRelate,\r\n apiGetListStaticNavbar,\r\n apiGetListTopicG,\r\n apiGetPostHome,\r\n apiGetRegionId,\r\n apiGetTopicByTypeGuest,\r\n apiGuestGetAllTopicPackage,\r\n apiGuestSendContact,\r\n apiGetListTopicPostHome,\r\n apiGetListVideo,\r\n apiGetDetailTopicPostHome,\r\n apiGetListBanner,\r\n apiGetGuestListImage,\r\n apiGetListCateImgeOther,\r\n apiGetListOrganizSystem,\r\n apiGuestGetAccountComboBox,\r\n apiGuestGetAllForCombobox,\r\n apiGuestGetListPositionForCombobox,\r\n apiGetListAgencyIssued,\r\n apiGetListDocumentType,\r\n apiGetListField,\r\n} from \"./apiRouter\"\r\nimport http from \"./index\"\r\nconst guestGetAllTopicPackage = () => http.get(apiGuestGetAllTopicPackage)\r\n\r\nconst getDetail = body => {\r\n const params = QueryString.stringify(body)\r\n return http.get(`${apiGetDetailByG}?${params}`)\r\n}\r\n\r\nconst getListPost = body => http.post(apiGetListPostByCategoryPostID, body)\r\nconst getAllTopic = () => http.post(apiGetAllTopicGuest)\r\n\r\nconst getListPostByTags = body => http.post(apiGetListPostByTags, body)\r\nconst getAllListPost = body => http.post(apiGetAllListPost, body)\r\nconst getStaticNav = params =>\r\n http.get(`${apiGetListStaticNavbar}?${QueryString.stringify(params)}`)\r\nconst sendContact = body => http.post(apiGuestSendContact, body)\r\nconst getPostHome = () => http.get(apiGetPostHome)\r\nconst getRegionById = params => http.get(apiGetRegionId, { params })\r\nconst getCategoryPost = () => http.get(apiGetCategoryPost)\r\nconst getListPostRelate = params => http.get(apiGetListPostRelate, { params })\r\nconst getTopicByType = () => http.get(apiGetTopicByTypeGuest)\r\nconst getListTopicG = () => http.get(apiGetListTopicG)\r\nconst getComment = body => {\r\n const params = QueryString.stringify(body)\r\n return http.get(`${apiAllPostCommnetByType}?${params}`)\r\n}\r\nconst getPackage = body => http.post(apiGetDetailTopicPostHome, body)\r\nconst getListTopicPostHome = body => http.post(apiGetListTopicPostHome, body)\r\nconst getDetailTopicPostHome = params =>\r\n http.get(apiGetDetailTopicPostHome, { params })\r\nconst getListVideo = body => http.post(apiGetListVideo, body)\r\nconst getListBanner = params => http.get(apiGetListBanner, { params })\r\nconst getListImage = body => http.post(apiGetGuestListImage, body)\r\nconst getListCateImgeOther = body => http.post(apiGetListCateImgeOther, body)\r\nconst getListOrganizSystem = params =>\r\n http.get(apiGetListOrganizSystem, { params })\r\nconst guestGetAccountComboBox = () => http.get(apiGuestGetAccountComboBox)\r\nconst guestGetListPositionForCombobox = () =>\r\n http.get(apiGuestGetListPositionForCombobox)\r\nconst getListAgencyIssued = () => http.get(apiGetListAgencyIssued)\r\nconst getListDocumentType = () => http.get(apiGetListDocumentType)\r\nconst getListField = params => http.get(apiGetListField, { params })\r\n\r\nconst GuestServices = {\r\n getListPost,\r\n getStaticNav,\r\n getDetail,\r\n sendContact,\r\n getPostHome,\r\n getRegionById,\r\n getCategoryPost,\r\n getListPostRelate,\r\n getListPostByTags,\r\n getAllListPost,\r\n getAllTopic,\r\n getListTopicG,\r\n getTopicByType,\r\n getComment,\r\n guestGetAllTopicPackage,\r\n getPackage,\r\n getListTopicPostHome,\r\n getDetailTopicPostHome,\r\n getListVideo,\r\n getListBanner,\r\n getListImage,\r\n getListCateImgeOther,\r\n getListOrganizSystem,\r\n guestGetAccountComboBox,\r\n guestGetListPositionForCombobox,\r\n getListAgencyIssued,\r\n getListDocumentType,\r\n getListField,\r\n}\r\nexport default GuestServices\r\n","import QueryString from \"qs\"\r\nimport {\r\n apiGetListPost,\r\n apiGetListCategoryPost,\r\n apiInsertCategory,\r\n apiUpdateCategory,\r\n apiDeleteCategory,\r\n apiInsertPost,\r\n apiGetDetailPost,\r\n apiUpdatePost,\r\n apiDeletePost,\r\n apiRePost,\r\n apiCancelPost,\r\n apiGetCategoryPostCate,\r\n apiSortCategories,\r\n apiSortPost,\r\n apiKhoiPhuc,\r\n apiGetListHistory,\r\n apiGetDetailHistory,\r\n apiUpdateStatusPost,\r\n apiExportPost,\r\n} from \"./apiRouter\"\r\nimport http from \"./index\"\r\n\r\nconst getListCategoryPost = params =>\r\n http.get(`${apiGetListCategoryPost}?${QueryString.stringify(params)}`)\r\nconst insertCategory = body => http.post(apiInsertCategory, body)\r\nconst updateCategory = body => http.put(apiUpdateCategory, body)\r\nconst deleteCategory = body => http.post(apiDeleteCategory, body)\r\n\r\nconst getListPost = body => http.post(apiGetListPost, body)\r\nconst insertPost = body => http.post(apiInsertPost, body)\r\nconst updatePost = body => http.put(apiUpdatePost, body)\r\nconst getPost = params => http.get(apiGetDetailPost, { params })\r\nconst deletePost = PostID => http.patch(`${apiDeletePost}?PostID=${PostID}`)\r\nconst rePost = PostID => http.patch(`${apiRePost}?PostID=${PostID}`)\r\nconst cancelPost = PostID => http.patch(`${apiCancelPost}?PostID=${PostID}`)\r\nconst getCategoryPostCate = params =>\r\n http.get(apiGetCategoryPostCate, { params })\r\nconst sortCategories = body => http.post(apiSortCategories, body)\r\nconst sortPost = body => http.patch(apiSortPost, body)\r\nconst khoiPhuc = body =>\r\n http.patch(`${apiKhoiPhuc}?${QueryString.stringify(body)}`)\r\nconst getListHistory = body => http.patch(apiGetListHistory, body)\r\nconst getDetailHistory = body =>\r\n http.patch(`${apiGetDetailHistory}?${QueryString.stringify(body)}`)\r\nconst updateStatusPost = body => http.patch(apiUpdateStatusPost, body)\r\nconst exportPost = body =>\r\n http.post(apiExportPost, body, {\r\n responseType: \"blob\",\r\n })\r\nconst PostService = {\r\n getListPost,\r\n getListCategoryPost,\r\n insertCategory,\r\n updateCategory,\r\n deleteCategory,\r\n insertPost,\r\n updatePost,\r\n getPost,\r\n deletePost,\r\n rePost,\r\n cancelPost,\r\n getCategoryPostCate,\r\n sortCategories,\r\n sortPost,\r\n khoiPhuc,\r\n getListHistory,\r\n getDetailHistory,\r\n updateStatusPost,\r\n exportPost,\r\n}\r\nexport default PostService\r\n","import {\r\n apiGetAllChidrenByRegionId,\r\n apiInsertRegion,\r\n apiUpdateRegion,\r\n apiDeleteRegion,\r\n apigetLocationVN,\r\n apiGetByRegionId,\r\n} from \"./apiRouter\"\r\nimport http from \"./index\"\r\n\r\nconst getAllChidrenByRegionId = params =>\r\n http.get(apiGetAllChidrenByRegionId, { params })\r\nconst getLocationVN = params => http.get(apigetLocationVN, { params })\r\nconst insertRegion = body => http.post(apiInsertRegion, body)\r\nconst updateRegion = body => http.put(apiUpdateRegion, body)\r\nconst deleteRegion = params => http.patch(apiDeleteRegion + params)\r\nconst getByRegionId = params => http.get(apiGetByRegionId, { params })\r\n\r\nconst RegionService = {\r\n getAllChidrenByRegionId,\r\n insertRegion,\r\n updateRegion,\r\n deleteRegion,\r\n getLocationVN,\r\n getByRegionId,\r\n}\r\nexport default RegionService\r\n","import {\r\n apiCreateOrUpdateRole,\r\n apiGetAllForCombobox,\r\n apiGetByRoleId,\r\n apiGetListRole,\r\n apiDeleteRole,\r\n apiGetListTab,\r\n apiGetListTask,\r\n} from \"./apiRouter\"\r\nimport http from \"./index\"\r\n\r\nconst getListRole = body => http.post(apiGetListRole, body)\r\nconst getByRoleId = params => http.get(apiGetByRoleId, { params })\r\nconst createOrUpdateRole = body => http.post(apiCreateOrUpdateRole, body)\r\nconst getAllForCombobox = () => http.get(apiGetAllForCombobox)\r\nconst getListTab = () => http.get(apiGetListTab)\r\nconst getListTask = () => http.get(apiGetListTask)\r\nconst deleteRole = params => http.delete(apiDeleteRole, { params })\r\n\r\nconst RoleService = {\r\n getListRole,\r\n createOrUpdateRole,\r\n getByRoleId,\r\n getAllForCombobox,\r\n getListTab,\r\n deleteRole,\r\n getListTask,\r\n}\r\nexport default RoleService\r\n","import http from \"./index\"\r\nimport {\r\n apiInsertUser,\r\n apiDeleteUser,\r\n apiDetailUser,\r\n apiUpdateUser,\r\n apiGetListUser,\r\n apiGetListGuest,\r\n apiImportUser,\r\n apiExportUser,\r\n apiGetTemplateFileImportUser,\r\n apiGetAccount,\r\n apiUpdateAccount,\r\n apiImportGuest,\r\n apiExportGuest,\r\n apiGetTemplateFileImportGuest,\r\n apiReplacePassword,\r\n apiGetInforUser,\r\n apiChangeInfor,\r\n apiChangeImgUser,\r\n apiResetPassword,\r\n apiGetListUserInDept,\r\n} from \"./apiRouter\"\r\nimport QueryString from \"qs\"\r\n\r\nconst updateAccount = body => http.post(apiUpdateAccount, body)\r\n\r\nconst getAccount = params => http.get(apiGetAccount, { params })\r\nconst insertUser = body => http.post(apiInsertUser, body)\r\nconst deleteUser = UserID => http.patch(`${apiDeleteUser}?UserID=${UserID}`)\r\nconst detailUser = params => http.get(apiDetailUser, { params })\r\nconst updateUser = params => http.post(apiUpdateUser, params)\r\nconst importUser = body => http.post(apiImportUser, body)\r\nconst getTemplateFileImportUser = body =>\r\n http.get(apiGetTemplateFileImportUser, body)\r\nconst exportUser = params => {\r\n http.interceptors.request.use(\r\n async config => {\r\n config.responseType = \"blob\"\r\n return config\r\n },\r\n error => Promise.reject(error),\r\n )\r\n return http.get(apiExportUser, { params })\r\n}\r\nconst importGuest = body => http.post(apiImportGuest, body)\r\nconst exportGuest = params => http.get(apiExportGuest, { params })\r\nconst templateImportGuest = () => {\r\n http.interceptors.request.use(\r\n async config => {\r\n config.responseType = \"blob\"\r\n return config\r\n },\r\n error => Promise.reject(error),\r\n )\r\n return http.get(apiGetTemplateFileImportGuest)\r\n}\r\nconst getListUser = params => http.post(apiGetListUser, params)\r\nconst GetListGuest = params => http.post(apiGetListGuest, params)\r\nconst replacePassword = params => http.post(apiReplacePassword, params)\r\nconst getInforUser = () => http.get(apiGetInforUser)\r\nconst changeInfor = body => http.post(apiChangeInfor, body)\r\nconst changeAvatar = params =>\r\n http.patch(apiChangeImgUser + `?Avatar=${params}`)\r\nconst resetPassword = params =>\r\n http.patch(`${apiResetPassword}?${QueryString.stringify(params)}`)\r\nconst getListUserInDept = params => http.get(apiGetListUserInDept, { params })\r\n\r\nconst UserService = {\r\n updateAccount,\r\n insertUser,\r\n getAccount,\r\n deleteUser,\r\n detailUser,\r\n updateUser,\r\n getListUser,\r\n importUser,\r\n getTemplateFileImportUser,\r\n exportUser,\r\n importGuest,\r\n exportGuest,\r\n templateImportGuest,\r\n GetListGuest,\r\n replacePassword,\r\n getInforUser,\r\n changeInfor,\r\n changeAvatar,\r\n resetPassword,\r\n getListUserInDept,\r\n}\r\nexport default UserService\r\n","//Account\r\nexport const apiGetAccountByToken = `Account/GetAccount`\r\nexport const apiUpdateByAccountID = `Account/UpdateByAccountID`\r\n\r\nexport const apiGetUnitInformation = `Account/GetUnitInformation`\r\nexport const apiUpdateUnitInformation = `Account/UpdateUnitInformation`\r\n\r\n//Authenticate\r\nexport const apiLogin = `Authservice/Login`\r\nexport const apiLogout = `Authservice/Logout`\r\nexport const apiRegister = `Authservice/Register`\r\nexport const apiForgotPassword = `Authservice/ForgotPassword`\r\nexport const apiChangePassword = `Authservice/ChangePassword`\r\nexport const apiVerifyCode = `Authservice/VerifyCode`\r\nexport const apiBusinessRegister = `Authservice/BusinessRegister`\r\n\r\n// User\r\nexport const apiInsertUser = \"User/Insert\"\r\nexport const apiDeleteUser = \"User/Delete\"\r\nexport const apiDetailUser = \"User/GetDetail\"\r\nexport const apiUpdateUser = \"User/Update\"\r\nexport const apiGetListUser = \"User/GetList\"\r\nexport const apiImportUser = \"User/ImportUser\"\r\nexport const apiExportUser = \"User/ExportUser\"\r\nexport const apiGetTemplateFileImportUser = \"User/GetTemplateFileImportUser\"\r\nexport const apiGetListGuest = \"User/GetListGuest\"\r\nexport const apiGetAccount = \"User/GetAccount\"\r\nexport const apiExportGuest = \"User/ExportGuest\"\r\nexport const apiImportGuest = \"User/ImportGuest\"\r\nexport const apiGetTemplateFileImportGuest = \"User/GetTemplateFileImportGuest\"\r\nexport const apiUpdateAccount = \"User/UpdateAccount\"\r\nexport const apiReplacePassword = \"User/ReplacePassword\"\r\nexport const apiGetInforUser = \"User/GetInforUser\"\r\nexport const apiChangeInfor = \"User/ChangeInfor\"\r\nexport const apiChangeImgUser = \"User/ChangeImgUser\"\r\nexport const apiResetPassword = \"User/ResetPassword\"\r\nexport const apiGetListUserInDept = \"User/GetListUserInDept\"\r\n\r\n// Department\r\nexport const apiGetList = `Department/GetList`\r\nexport const apiGetListUserByDept = `Department/ListUserByDept`\r\nexport const apiDeleteDept = `Department/DeleteDept`\r\nexport const apiInsertUpdate = `Department/InsertUpdate`\r\nexport const apiGetAllDept = \"Department/GetAllForCombobox\"\r\n// Common\r\nexport const apiGetSystemKey = \"Common/GetSystemKey\"\r\n\r\n//POSITION\r\n\r\nexport const apiGetAllPosition = \"Position/GetListPositionForCombobox\"\r\nexport const apiGetListPosition = \"Position/GetList\"\r\nexport const apiCreate = \"Position/Create\"\r\nexport const apiDelete = \"Position/Delete\"\r\nexport const apiUpdate = \"Position/Update\"\r\nexport const apiGetAllTitle = \"Position/GetListTitleForCombobox\"\r\n// CATEFORY_POST\r\n\r\nexport const apiGetListCategoryPost = \"CategoryPost/GetListPostGroup\"\r\nexport const apiGetCategoryPostCate = \"CategoryPost/GetCategoryPost\"\r\nexport const apiSortCategories = \"CategoryPost/SortCategories\"\r\n\r\nexport const apiInsertCategory = \"CategoryPost/Insert\"\r\nexport const apiUpdateCategory = \"CategoryPost/Update\"\r\nexport const apiDeleteCategory = \"CategoryPost/Delete\"\r\n\r\n// POST\r\n\r\nexport const apiGetListPost = \"Post/GetList\"\r\nexport const apiInsertPost = \"Post/Insert\"\r\nexport const apiGetDetailPost = \"Post/GetDetail\"\r\nexport const apiUpdatePost = \"Post/Update\"\r\nexport const apiDeletePost = \"Post/Delete\"\r\nexport const apiRePost = \"Post/RePost\"\r\nexport const apiCancelPost = \"Post/CancelPost\"\r\nexport const apiSortPost = \"Post/SortPost\"\r\nexport const apiKhoiPhuc = \"Post/KhoiPhuc\"\r\nexport const apiGetListHistory = \"Post/GetListHistory\"\r\nexport const apiGetDetailHistory = \"Post/GetDetailHistory\"\r\nexport const apiUpdateStatusPost = \"Post/UpdateStatusPost\"\r\nexport const apiExportPost = \"Post/ExportPost\"\r\n\r\n// Role\r\nexport const apiGetByRoleId = `Role/GetByRoleId`\r\nexport const apiCreateOrUpdateRole = `Role/CreateOrUpdateRole`\r\nexport const apiGetListRole = `Role/GetList`\r\nexport const apiGetAllForCombobox = `Role/GetAllForCombobox`\r\nexport const apiDeleteRole = `Role/DeleteRole`\r\nexport const apiGetListTab = `Role/GetListTab`\r\nexport const apiGetListTask = `Role/GetListTask`\r\n\r\n// Region\r\nexport const apiGetAllChidrenByRegionId = `Region/getAllChidrenByRegionId`\r\nexport const apiInsertRegion = `Region/Insert`\r\nexport const apiUpdateRegion = `Region/Update`\r\nexport const apiDeleteRegion = `Region/Delete`\r\nexport const apigetLocationVN = `Region/GetLocationVN`\r\nexport const apiGetByRegionId = `Guest/GetByRegionId`\r\n\r\n// TAGS\r\n\r\nexport const apiGetListTags = \"Tags/GetList\"\r\nexport const apiInsertTags = \"Tags/Insert\"\r\nexport const apiUpdateTags = \"Tags/Update\"\r\nexport const apiDeleteTags = \"Tags/Delete\"\r\nexport const apiGetAllTags = \"Tags/GetAllForCombobox\"\r\n\r\n// UPLOAD\r\n\r\nexport const apiUploadFile = \"File/UploadFile\"\r\nexport const apiUploadFileList = \"File/UploadListFileSeaWeed\"\r\n\r\n//ORDER_LIST\r\nexport const apiGetListOrder = \"OrderList/GetList\"\r\nexport const apiUpdateCancellation = \"OrderList/UpdateCancellation\"\r\nexport const apiUpdateOrder = \"OrderList/Update\"\r\n\r\n// GUEST\r\n\r\nexport const apiGetListPostByCategoryPostID =\r\n \"Guest/GetListPostByCategoryPostID\"\r\nexport const apiGetListStaticNavbar = \"Guest/GetListStaticNavbar\"\r\nexport const apiGetDetailByG = \"Guest/GetPostDetail\"\r\nexport const apiGuestSendContact = \"Guest/SendContact\"\r\nexport const apiGetAllTopicGuest = \"Guest/GetAllTopic\"\r\nexport const apiGetPostHome = \"Guest/GetPostHome\"\r\nexport const apiGetRegionId = \"Guest/GetByRegionId\"\r\nexport const apiGetCategoryPost = \"Guest/GetCategoryPost\"\r\nexport const apiGetListPostRelate = \"Guest/GetListPostRelate\"\r\nexport const apiGetListPostByTags = \"Guest/GetListPostByTags\"\r\nexport const apiGetAllListPost = \"Guest/GetAllListPost\"\r\nexport const apiAllPostCommnetByType = \"Guest/GetAllPostCommnetByType\"\r\nexport const apiGetListTopicG = \"Guest/GetListTopicName\"\r\nexport const apiGetTopicByTypeGuest = \"Guest/GetTopicByType\"\r\nexport const apiGuestGetAllTopicPackage = \"Guest/GetAllTopicPackage\"\r\nexport const apiGetAllPackageGuest = \"Guest/GetAllPackage\"\r\nexport const apiGetListTopicPostHome = \"Guest/GetListTopicPostHome\"\r\nexport const apiGetDetailTopicPostHome = \"Guest/GetDetailTopicPostHome\"\r\nexport const apiGetListBanner = \"Guest/GetListBannerFooterEvent\"\r\nexport const apiGetListVideo = \"Guest/GetListVideo\"\r\nexport const apiGetGuestListImage = \"Guest/GetListImage\"\r\nexport const apiGetListCateImgeOther = \"Guest/GetListCateImgeOther\"\r\nexport const apiGetListOrganizSystem = \"Guest/GetListOrganizSystem\"\r\nexport const apiGuestGetAccountComboBox = \"Guest/GetAccountComboBox\"\r\nexport const apiGuestGetListPositionForCombobox = \"Guest/GetListChucVu\"\r\nexport const apiGetListAgencyIssued = \"Guest/GetListAgencyIssued\"\r\nexport const apiGetListDocumentType = \"Guest/GetListDocumentType\"\r\nexport const apiGetListField = \"Guest/GetList\"\r\n\r\n//Directory\r\nexport const apiGetAllUserDirectory = \"Directory/GetAllUserDirectory\"\r\nexport const apiInsertUserDirectory = \"Directory/InsertUserDirectory\"\r\nexport const apiUpdateUserDirectory = \"Directory/UpdateUserDirectory\"\r\nexport const apiDeleteUserDirectory = \"Directory/DeleteUserDirectory\"\r\nexport const apiBlockUserDirectory = \"Directory/BlockUserDirectory\"\r\nexport const apiResetPasswordByUserID = \"Directory/ResetPasswordByUserID\"\r\n\r\n//CheckRegister\r\nexport const apiApproveRegister = \"CheckRegister/ApproveRegister\"\r\nexport const apiGetAllCheckRegister = \"CheckRegister/GetAllCheckRegister\"\r\nexport const apiGetDetailCheclRegister = \"CheckRegister/GetDetailCheclRegister\"\r\n\r\n//Contact\r\nexport const apiSearchGetSupportListRequet =\r\n \"Contact/SearchGetSupportListRequet\"\r\nexport const apiStatusSupport = \"Contact/StatusSupport\"\r\nexport const apiGetDetailContact = \"Contact/GetDetailContact\"\r\nexport const apiSendContact = \"Contact/SendContact\"\r\n\r\n// GOOGLE\r\n\r\nexport const apiLoginGoole = \"Authservice/GetGoogleLoginUrl\"\r\nexport const apiCallBackLoginGoole = \"Authservice/GetTokenInfo\"\r\n//FACEBOOK\r\n//Zalo\r\nexport const apiLoginZalo = \"Authservice/ZaloLoginCallback\"\r\n\r\nexport const apiLoginFB = \"Authservice/GetFacebookLoginUrl\"\r\nexport const apiLoginFB2 = \"Authservice/GetFacebookLoginUrl\"\r\n// Topic\r\nexport const apiGetListTopic = \"Topic/GetList\"\r\nexport const apiDeleteTopicCategory = \"Topic/DeleteTopicCategory\"\r\nexport const apiCreateTopicCategory = \"Topic/CreateTopicCategory\"\r\nexport const apiUpdateTopicCategory = \"Topic/UpdateTopicCategory\"\r\n//Image\r\nexport const apiInsertImage = \"Image/InsertImage\"\r\nexport const apiUpdateImage = \"Image/UpdateImage\"\r\nexport const apiDeleteImage = \"Image/DeleteImage\"\r\nexport const apiUpdateStatusImage = \"Image/UpdateStatusImage\"\r\nexport const apiGetListImage = \"Image/GetListImage\"\r\nexport const apiGetDetailImage = \"Image/GetDetailImage\"\r\nexport const apiExportImage = \"Image/ExportImage\"\r\nexport const apiUpdateActive = \"Image/UpdateActive\"\r\n\r\n// TopicPost\r\nexport const apiGetAllOrBySearch = \"TopicPost/GetAllOrBySearch\"\r\nexport const apiGetTopicByType = \"TopicPost/GetTopicByType\"\r\nexport const apiInsertTopicPost = \"TopicPost/InsertTopicPost\"\r\nexport const apiUpdateTopicPost = \"TopicPost/UpdateTopicPost\"\r\nexport const apiDeleteTopicPostById = \"TopicPost/DeleteTopicPostById\"\r\nexport const apiExportDocumentText = \"TopicPost/ExportDocumentText\"\r\n\r\n//PostComment\r\nexport const apiPostCommentInsert = \"PostComment/PostCommentInsert\"\r\nexport const apiPostCommentUserLike = \"PostComment/PostCommentUserLike\"\r\nexport const apiPostCommentDelete = \"PostComment/PostCommentDelete\"\r\nexport const apiPostCommentUpdate = \"PostComment/PostCommentUpdate\"\r\nexport const apiGetAllPostCommnetByType = \"PostComment/GetAllPostCommnetByType\"\r\n\r\n//Notify\r\nexport const apiGetListNotify = \"Notify/GetList\"\r\nexport const apiGetNewNotification = \"Notify/GetNewNotification\"\r\nexport const apiMarkAsRead = \"Notify/MarkAsRead?NotifyId=\"\r\nexport const apiMarkAsSeen = \"Notify/MarkAsSeen?NotifyId=\"\r\nexport const apiDeleteNotifyForUser = \"Notify/DeleteNotifyForUser?NotifyId=\"\r\nexport const apiGetListByReferenceId = \"Notify/GetListByReferenceId\"\r\n\r\n//boxchat\r\n\r\nexport const apiGetByObjectId = \"CommunicationContact/GetByObjectId\"\r\nexport const apiInsertOrUpdateContact = \"CommunicationContact/InsertOrUpdate\"\r\nexport const apiDeleteContact = \"CommunicationContact/Delete\"\r\nexport const apiGetListContactByPackage =\r\n \"CommunicationContact/GetListContactByPackage\"\r\nexport const apiGetContactDetailsByAccount =\r\n \"CommunicationContact/GetContactDetailsByAccount\"\r\n\r\n//Package\r\n\r\nexport const apiGetAllPackage = \"Package/GetAllPackage\"\r\nexport const apiInsertPackage = \"Package/InsertPackage\"\r\nexport const apiUpdatePackage = \"Package/UpdatePackage\"\r\nexport const apiDeletePackage = \"Package/DeletePackage\"\r\nexport const apiGetAllTopicPackage = \"Package/GetAllTopicPackage\"\r\nexport const apiPackageInsertTopic = `Package/InsertTopic`\r\nexport const apiPackageUpdateTopic = `Package/UpdateTopic`\r\nexport const apiPackageDeletePackage = `Package/DeleteTopic`\r\n\r\nexport const apiGetAllRequestPackage = `Package/GetAllRequestPackage`\r\nexport const apiDeleteRequestPackage = `Package/DeleteRequestPackage`\r\nexport const apiInsertRequestPackage = `Package/InsertRequestPackage`\r\nexport const apiGetAllRequestPackageForUser = `Package/GetAllRequestPackageForUser`\r\nexport const apiUpdateStatusRequestPackage = `Package/UpdateStatusRequestPackage`\r\nexport const apiCreateRequestPackage = `Package/CreateRequestPackage`\r\nexport const apiEvaluateForPackage = `Package/EvaluateForPackage`\r\n\r\nexport const apiPackageCommentInsert = `Package/PackageCommentInsert`\r\nexport const apiPackageCommentUpdate = `Package/PackageCommentUpdate`\r\nexport const apiPackageCommentDelete = `Package/PackageCommentDelete`\r\nexport const apiPackageCommentUserLike = `Package/PackageCommentUserLike`\r\nexport const apiGetAllPackageCommnetByType = `Package/GetAllPackageCommnetByType`\r\nexport const apiGetDefaultPackageComment = `Package/GetDefaultPackageComment`\r\nexport const apiSortRequestService = `Package/SortRequestService`\r\n\r\n//Banner && Footer\r\nexport const apiGetListBannerFooter = `BannerFoodter/GetList`\r\nexport const apiInsertBannerFooter = `BannerFoodter/Insert`\r\nexport const apiUpdateBannerFooter = `BannerFoodter/Update`\r\nexport const apiGetListEvent = `BannerFoodter/GetListEvent`\r\nexport const apiInsertEvent = `BannerFoodter/InsertEvent`\r\nexport const apiUpdateEvent = `BannerFoodter/UpdateEvent`\r\nexport const apiDeleteEvent = `BannerFoodter/DeleteEvent`\r\nexport const apiUpdateOrderEvent = `BannerFoodter/UpdateOrderEvent`\r\nexport const apiGetAppConfig = `BannerFoodter/GetAppConfig`\r\nexport const apiUpdateAppConfig = `BannerFoodter/UpdateAppConfig`\r\n","import axios from \"axios\"\r\nimport notice from \"src/components/Notice\"\r\nimport STORAGE, { deleteStorage, getStorage } from \"src/lib/storage\"\r\nimport { getMsgClient } from \"src/lib/stringsUtils\"\r\nimport { trimData } from \"src/lib/utils\"\r\nimport ROUTER from \"src/router\"\r\n/**\r\n *\r\n * parse error response\r\n */\r\nfunction parseError(messages) {\r\n // error\r\n if (messages) {\r\n if (messages instanceof Array) {\r\n return Promise.reject({ messages })\r\n }\r\n return Promise.reject({ messages: [messages] })\r\n }\r\n return Promise.reject({ messages: [\"Server quá tải\"] })\r\n}\r\n\r\n/**\r\n * parse response\r\n */\r\n\r\nexport function parseBody(response) {\r\n const resData = response.data\r\n if (+response?.status >= 500) {\r\n return notice({\r\n msg: `Hệ thống đang tạm thời gián đoạn. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ`,\r\n isSuccess: false,\r\n })\r\n }\r\n if (+response?.status < 500 && +response?.status !== 200) {\r\n return notice({\r\n msg: `Hệ thống xảy ra lỗi. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ (SC${response?.status})`,\r\n isSuccess: false,\r\n })\r\n }\r\n\r\n if (response?.status === 200) {\r\n if (resData.StatusCode === 401) {\r\n deleteStorage(STORAGE.TOKEN)\r\n return window.location.replace(ROUTER.HOME)\r\n }\r\n if (resData.Status === -2) return resData // ma sp, ten sp ton tai\r\n if (resData.Status === 0) return resData // API tra ve success\r\n\r\n if (resData.Status !== -1 && resData.Object) {\r\n notice({ msg: getMsgClient(resData.Object), isSuccess: false })\r\n }\r\n if (resData.Status !== 1 && resData.Object) {\r\n return {\r\n ...resData,\r\n object: getMsgClient(resData.Object),\r\n }\r\n }\r\n return resData\r\n }\r\n return parseError(resData?.messages)\r\n}\r\n\r\n/**\r\n * axios instance\r\n */\r\n// const baseURL = ''\r\nconst instance = axios.create({\r\n // baseURL: '',\r\n timeout: 60000,\r\n})\r\n\r\n// request header\r\ninstance.interceptors.request.use(\r\n async config => {\r\n // Do something before request is sent\r\n if (config.data) {\r\n config.data =\r\n config.data instanceof FormData ? config.data : trimData(config.data)\r\n }\r\n config.headers = {\r\n Authorization: getStorage(STORAGE.TOKEN) || \"1tjyE+/5HUqKlhwI1IwXwg==\",\r\n }\r\n config.baseURL = process.env.REACT_APP_API_ROOT || window?.env?.API_ROOT\r\n config.onUploadProgress = progressEvent => {\r\n // let percentCompleted = Math.floor(\r\n // (progressEvent.loaded * 100) / progressEvent.total,\r\n // )\r\n // do whatever you like with the percentage complete\r\n // maybe dispatch an action that will update a progress bar or something\r\n }\r\n return config\r\n },\r\n error => Promise.reject(error),\r\n)\r\n\r\n// response parse\r\ninstance.interceptors.response.use(\r\n response => parseBody(response),\r\n error => {\r\n // can not connect API\r\n if (error.code === \"ECONNABORTED\") {\r\n notice({\r\n msg: \"Hệ thống đang tạm thời gián đoạn. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ\",\r\n isSuccess: false,\r\n })\r\n } else if (+error?.response?.status >= 500) {\r\n notice({\r\n msg: `Hệ thống đang tạm thời gián đoạn. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ`,\r\n isSuccess: false,\r\n })\r\n } else if (\r\n +error?.response?.status < 500 &&\r\n +error?.response?.status !== 200\r\n ) {\r\n notice({\r\n msg: `Hệ thống xảy ra lỗi. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ (SC${error?.response?.status})`,\r\n isSuccess: false,\r\n })\r\n } else if (!error?.status) {\r\n notice({\r\n msg: `Hệ thống đang tạm thời gián đoạn. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ`,\r\n isSuccess: false,\r\n })\r\n } else if (typeof error.response === \"undefined\") {\r\n notice({ msg: error.response, isSuccess: false })\r\n } else if (error.response) {\r\n notice({\r\n msg: `Hệ thống đang tạm thời gián đoạn. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ`,\r\n isSuccess: false,\r\n })\r\n return parseError(error.response.data)\r\n } else\r\n notice({\r\n msg: `Hệ thống đang tạm thời gián đoạn. Xin vui lòng trở lại sau hoặc thông báo với ban quản trị để được hỗ trợ`,\r\n isSuccess: false,\r\n })\r\n return Promise.reject(error)\r\n },\r\n)\r\n\r\nexport default instance\r\n\r\nexport const httpGetFile = (path = \"\", optionalHeader = {}) =>\r\n instance({\r\n method: \"GET\",\r\n url: path,\r\n headers: { ...optionalHeader },\r\n })\r\n","import { inputToRGB, rgbToHex, rgbToHsv } from '@ctrl/tinycolor';\n\nvar hueStep = 2; // 色相阶梯\n\nvar saturationStep = 0.16; // 饱和度阶梯,浅色部分\n\nvar saturationStep2 = 0.05; // 饱和度阶梯,深色部分\n\nvar brightnessStep1 = 0.05; // 亮度阶梯,浅色部分\n\nvar brightnessStep2 = 0.15; // 亮度阶梯,深色部分\n\nvar lightColorCount = 5; // 浅色数量,主色上\n\nvar darkColorCount = 4; // 深色数量,主色下\n// 暗色主题颜色映射关系表\n\nvar darkColorMap = [{\n index: 7,\n opacity: 0.15\n}, {\n index: 6,\n opacity: 0.25\n}, {\n index: 5,\n opacity: 0.3\n}, {\n index: 5,\n opacity: 0.45\n}, {\n index: 5,\n opacity: 0.65\n}, {\n index: 5,\n opacity: 0.85\n}, {\n index: 4,\n opacity: 0.9\n}, {\n index: 3,\n opacity: 0.95\n}, {\n index: 2,\n opacity: 0.97\n}, {\n index: 1,\n opacity: 0.98\n}]; // Wrapper function ported from TinyColor.prototype.toHsv\n// Keep it here because of `hsv.h * 360`\n\nfunction toHsv(_ref) {\n var r = _ref.r,\n g = _ref.g,\n b = _ref.b;\n var hsv = rgbToHsv(r, g, b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v\n };\n} // Wrapper function ported from TinyColor.prototype.toHexString\n// Keep it here because of the prefix `#`\n\n\nfunction toHex(_ref2) {\n var r = _ref2.r,\n g = _ref2.g,\n b = _ref2.b;\n return \"#\".concat(rgbToHex(r, g, b, false));\n} // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.\n// Amount in range [0, 1]\n// Assume color1 & color2 has no alpha, since the following src code did so.\n\n\nfunction mix(rgb1, rgb2, amount) {\n var p = amount / 100;\n var rgb = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b\n };\n return rgb;\n}\n\nfunction getHue(hsv, i, light) {\n var hue; // 根据色相不同,色相转向不同\n\n if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {\n hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;\n } else {\n hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;\n }\n\n if (hue < 0) {\n hue += 360;\n } else if (hue >= 360) {\n hue -= 360;\n }\n\n return hue;\n}\n\nfunction getSaturation(hsv, i, light) {\n // grey color don't change saturation\n if (hsv.h === 0 && hsv.s === 0) {\n return hsv.s;\n }\n\n var saturation;\n\n if (light) {\n saturation = hsv.s - saturationStep * i;\n } else if (i === darkColorCount) {\n saturation = hsv.s + saturationStep;\n } else {\n saturation = hsv.s + saturationStep2 * i;\n } // 边界值修正\n\n\n if (saturation > 1) {\n saturation = 1;\n } // 第一格的 s 限制在 0.06-0.1 之间\n\n\n if (light && i === lightColorCount && saturation > 0.1) {\n saturation = 0.1;\n }\n\n if (saturation < 0.06) {\n saturation = 0.06;\n }\n\n return Number(saturation.toFixed(2));\n}\n\nfunction getValue(hsv, i, light) {\n var value;\n\n if (light) {\n value = hsv.v + brightnessStep1 * i;\n } else {\n value = hsv.v - brightnessStep2 * i;\n }\n\n if (value > 1) {\n value = 1;\n }\n\n return Number(value.toFixed(2));\n}\n\nfunction generate(color) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var patterns = [];\n var pColor = inputToRGB(color);\n\n for (var i = lightColorCount; i > 0; i -= 1) {\n var hsv = toHsv(pColor);\n var colorString = toHex(inputToRGB({\n h: getHue(hsv, i, true),\n s: getSaturation(hsv, i, true),\n v: getValue(hsv, i, true)\n }));\n patterns.push(colorString);\n }\n\n patterns.push(toHex(pColor));\n\n for (var _i = 1; _i <= darkColorCount; _i += 1) {\n var _hsv = toHsv(pColor);\n\n var _colorString = toHex(inputToRGB({\n h: getHue(_hsv, _i),\n s: getSaturation(_hsv, _i),\n v: getValue(_hsv, _i)\n }));\n\n patterns.push(_colorString);\n } // dark theme patterns\n\n\n if (opts.theme === 'dark') {\n return darkColorMap.map(function (_ref3) {\n var index = _ref3.index,\n opacity = _ref3.opacity;\n var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));\n return darkColorString;\n });\n }\n\n return patterns;\n}\n\nvar presetPrimaryColors = {\n red: '#F5222D',\n volcano: '#FA541C',\n orange: '#FA8C16',\n gold: '#FAAD14',\n yellow: '#FADB14',\n lime: '#A0D911',\n green: '#52C41A',\n cyan: '#13C2C2',\n blue: '#1890FF',\n geekblue: '#2F54EB',\n purple: '#722ED1',\n magenta: '#EB2F96',\n grey: '#666666'\n};\nvar presetPalettes = {};\nvar presetDarkPalettes = {};\nObject.keys(presetPrimaryColors).forEach(function (key) {\n presetPalettes[key] = generate(presetPrimaryColors[key]);\n presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes\n\n presetDarkPalettes[key] = generate(presetPrimaryColors[key], {\n theme: 'dark',\n backgroundColor: '#141414'\n });\n presetDarkPalettes[key].primary = presetDarkPalettes[key][5];\n});\nvar red = presetPalettes.red;\nvar volcano = presetPalettes.volcano;\nvar gold = presetPalettes.gold;\nvar orange = presetPalettes.orange;\nvar yellow = presetPalettes.yellow;\nvar lime = presetPalettes.lime;\nvar green = presetPalettes.green;\nvar cyan = presetPalettes.cyan;\nvar blue = presetPalettes.blue;\nvar geekblue = presetPalettes.geekblue;\nvar purple = presetPalettes.purple;\nvar magenta = presetPalettes.magenta;\nvar grey = presetPalettes.grey;\n\nexport { blue, cyan, geekblue, generate, gold, green, grey, lime, magenta, orange, presetDarkPalettes, presetPalettes, presetPrimaryColors, purple, red, volcano, yellow };\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CheckCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z\" } }] }, \"name\": \"check-circle\", \"theme\": \"filled\" };\nexports.default = CheckCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CheckCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }] }, \"name\": \"check-circle\", \"theme\": \"outlined\" };\nexports.default = CheckCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CloseCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z\" } }] }, \"name\": \"close-circle\", \"theme\": \"filled\" };\nexports.default = CloseCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CloseCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z\" } }] }, \"name\": \"close-circle\", \"theme\": \"outlined\" };\nexports.default = CloseCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CloseOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z\" } }] }, \"name\": \"close\", \"theme\": \"outlined\" };\nexports.default = CloseOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DotChartOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z\" } }] }, \"name\": \"dot-chart\", \"theme\": \"outlined\" };\nexports.default = DotChartOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExclamationCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"filled\" };\nexports.default = ExclamationCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExclamationCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"outlined\" };\nexports.default = ExclamationCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InfoCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"info-circle\", \"theme\": \"filled\" };\nexports.default = InfoCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InfoCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"info-circle\", \"theme\": \"outlined\" };\nexports.default = InfoCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LoadingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\" } }] }, \"name\": \"loading\", \"theme\": \"outlined\" };\nexports.default = LoadingOutlined;\n","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CheckCircleFilled = _interopRequireDefault(require('./lib/icons/CheckCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CheckCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CheckCircleOutlined = _interopRequireDefault(require('./lib/icons/CheckCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CheckCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CloseCircleFilled = _interopRequireDefault(require('./lib/icons/CloseCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CloseCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CloseCircleOutlined = _interopRequireDefault(require('./lib/icons/CloseCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CloseCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CloseOutlined = _interopRequireDefault(require('./lib/icons/CloseOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CloseOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _DotChartOutlined = _interopRequireDefault(require('./lib/icons/DotChartOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _DotChartOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _ExclamationCircleFilled = _interopRequireDefault(require('./lib/icons/ExclamationCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _ExclamationCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _ExclamationCircleOutlined = _interopRequireDefault(require('./lib/icons/ExclamationCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _ExclamationCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _InfoCircleFilled = _interopRequireDefault(require('./lib/icons/InfoCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _InfoCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _InfoCircleOutlined = _interopRequireDefault(require('./lib/icons/InfoCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _InfoCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _LoadingOutlined = _interopRequireDefault(require('./lib/icons/LoadingOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _LoadingOutlined;\n exports.default = _default;\n module.exports = _default;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { generate as generateColor } from '@ant-design/colors';\nimport React, { useContext, useEffect } from 'react';\nimport warn from \"rc-util/es/warning\";\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport IconContext from './components/Context';\nimport camelCase from 'lodash/camelCase';\nexport function warning(valid, message) {\n warn(valid, \"[@ant-design/icons] \".concat(message));\n}\nexport function isIconDefinition(target) {\n return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function');\n}\nexport function normalizeAttrs() {\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Object.keys(attrs).reduce(function (acc, key) {\n var val = attrs[key];\n switch (key) {\n case 'class':\n acc.className = val;\n delete acc.class;\n break;\n default:\n delete acc[key];\n acc[camelCase(key)] = val;\n }\n return acc;\n }, {});\n}\nexport function generate(node, key, rootProps) {\n if (!rootProps) {\n return /*#__PURE__*/React.createElement(node.tag, _objectSpread({\n key: key\n }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n }\n return /*#__PURE__*/React.createElement(node.tag, _objectSpread(_objectSpread({\n key: key\n }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n}\nexport function getSecondaryColor(primaryColor) {\n // choose the second color\n return generateColor(primaryColor)[0];\n}\nexport function normalizeTwoToneColors(twoToneColor) {\n if (!twoToneColor) {\n return [];\n }\n return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];\n}\n// These props make sure that the SVG behaviours like general text.\n// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4\nexport var svgBaseProps = {\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n focusable: 'false'\n};\nexport var iconStyles = \"\\n.anticon {\\n display: inline-block;\\n color: inherit;\\n font-style: normal;\\n line-height: 0;\\n text-align: center;\\n text-transform: none;\\n vertical-align: -0.125em;\\n text-rendering: optimizeLegibility;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n}\\n\\n.anticon > * {\\n line-height: 1;\\n}\\n\\n.anticon svg {\\n display: inline-block;\\n}\\n\\n.anticon::before {\\n display: none;\\n}\\n\\n.anticon .anticon-icon {\\n display: block;\\n}\\n\\n.anticon[tabindex] {\\n cursor: pointer;\\n}\\n\\n.anticon-spin::before,\\n.anticon-spin {\\n display: inline-block;\\n -webkit-animation: loadingCircle 1s infinite linear;\\n animation: loadingCircle 1s infinite linear;\\n}\\n\\n@-webkit-keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\";\nexport var useInsertStyles = function useInsertStyles() {\n var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;\n var _useContext = useContext(IconContext),\n csp = _useContext.csp;\n useEffect(function () {\n updateCSS(styleStr, '@ant-design-icons', {\n prepend: true,\n csp: csp\n });\n }, []);\n};","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nvar _excluded = [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"];\nimport { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from '../utils';\nvar twoToneColorPalette = {\n primaryColor: '#333',\n secondaryColor: '#E6E6E6',\n calculated: false\n};\nfunction setTwoToneColors(_ref) {\n var primaryColor = _ref.primaryColor,\n secondaryColor = _ref.secondaryColor;\n twoToneColorPalette.primaryColor = primaryColor;\n twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\nfunction getTwoToneColors() {\n return _objectSpread({}, twoToneColorPalette);\n}\nvar IconBase = function IconBase(props) {\n var icon = props.icon,\n className = props.className,\n onClick = props.onClick,\n style = props.style,\n primaryColor = props.primaryColor,\n secondaryColor = props.secondaryColor,\n restProps = _objectWithoutProperties(props, _excluded);\n var colors = twoToneColorPalette;\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n };\n }\n useInsertStyles();\n warning(isIconDefinition(icon), \"icon should be icon definiton, but got \".concat(icon));\n if (!isIconDefinition(icon)) {\n return null;\n }\n var target = icon;\n if (target && typeof target.icon === 'function') {\n target = _objectSpread(_objectSpread({}, target), {}, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n return generate(target.icon, \"svg-\".concat(target.name), _objectSpread({\n className: className,\n onClick: onClick,\n style: style,\n 'data-icon': target.name,\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true'\n }, restProps));\n};\nIconBase.displayName = 'IconReact';\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nexport default IconBase;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport ReactIcon from './IconBase';\nimport { normalizeTwoToneColors } from '../utils';\nexport function setTwoToneColor(twoToneColor) {\n var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),\n _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return ReactIcon.setTwoToneColors({\n primaryColor: primaryColor,\n secondaryColor: secondaryColor\n });\n}\nexport function getTwoToneColor() {\n var colors = ReactIcon.getTwoToneColors();\n if (!colors.calculated) {\n return colors.primaryColor;\n }\n return [colors.primaryColor, colors.secondaryColor];\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"icon\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"twoToneColor\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Context from './Context';\nimport ReactIcon from './IconBase';\nimport { getTwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';\nimport { normalizeTwoToneColors } from '../utils';\n// Initial setting\n// should move it to antd main repo?\nsetTwoToneColor('#1890ff');\nvar Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _classNames;\n var className = props.className,\n icon = props.icon,\n spin = props.spin,\n rotate = props.rotate,\n tabIndex = props.tabIndex,\n onClick = props.onClick,\n twoToneColor = props.twoToneColor,\n restProps = _objectWithoutProperties(props, _excluded);\n var _React$useContext = React.useContext(Context),\n _React$useContext$pre = _React$useContext.prefixCls,\n prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,\n rootClassName = _React$useContext.rootClassName;\n var classString = classNames(rootClassName, prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(icon.name), !!icon.name), _defineProperty(_classNames, \"\".concat(prefixCls, \"-spin\"), !!spin || icon.name === 'loading'), _classNames), className);\n var iconTabIndex = tabIndex;\n if (iconTabIndex === undefined && onClick) {\n iconTabIndex = -1;\n }\n var svgStyle = rotate ? {\n msTransform: \"rotate(\".concat(rotate, \"deg)\"),\n transform: \"rotate(\".concat(rotate, \"deg)\")\n } : undefined;\n var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),\n _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return /*#__PURE__*/React.createElement(\"span\", _objectSpread(_objectSpread({\n role: \"img\",\n \"aria-label\": icon.name\n }, restProps), {}, {\n ref: ref,\n tabIndex: iconTabIndex,\n onClick: onClick,\n className: classString\n }), /*#__PURE__*/React.createElement(ReactIcon, {\n icon: icon,\n primaryColor: primaryColor,\n secondaryColor: secondaryColor,\n style: svgStyle\n }));\n});\nIcon.displayName = 'AntdIcon';\nIcon.getTwoToneColor = getTwoToneColor;\nIcon.setTwoToneColor = setTwoToneColor;\nexport default Icon;","import { createContext } from 'react';\nvar IconContext = /*#__PURE__*/createContext({});\nexport default IconContext;","// This icon file is generated automatically.\nvar CheckCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z\" } }] }, \"name\": \"check-circle\", \"theme\": \"filled\" };\nexport default CheckCircleFilled;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CheckCircleFilledSvg from \"@ant-design/icons-svg/es/asn/CheckCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar CheckCircleFilled = function CheckCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CheckCircleFilledSvg\n }));\n};\nCheckCircleFilled.displayName = 'CheckCircleFilled';\nexport default /*#__PURE__*/React.forwardRef(CheckCircleFilled);","// This icon file is generated automatically.\nvar CheckCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }] }, \"name\": \"check-circle\", \"theme\": \"outlined\" };\nexport default CheckCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CheckCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/CheckCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CheckCircleOutlined = function CheckCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CheckCircleOutlinedSvg\n }));\n};\nCheckCircleOutlined.displayName = 'CheckCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(CheckCircleOutlined);","// This icon file is generated automatically.\nvar CheckOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z\" } }] }, \"name\": \"check\", \"theme\": \"outlined\" };\nexport default CheckOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CheckOutlinedSvg from \"@ant-design/icons-svg/es/asn/CheckOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CheckOutlined = function CheckOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CheckOutlinedSvg\n }));\n};\nCheckOutlined.displayName = 'CheckOutlined';\nexport default /*#__PURE__*/React.forwardRef(CheckOutlined);","// This icon file is generated automatically.\nvar CloseCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z\" } }] }, \"name\": \"close-circle\", \"theme\": \"filled\" };\nexport default CloseCircleFilled;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CloseCircleFilledSvg from \"@ant-design/icons-svg/es/asn/CloseCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseCircleFilled = function CloseCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseCircleFilledSvg\n }));\n};\nCloseCircleFilled.displayName = 'CloseCircleFilled';\nexport default /*#__PURE__*/React.forwardRef(CloseCircleFilled);","// This icon file is generated automatically.\nvar CloseCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z\" } }] }, \"name\": \"close-circle\", \"theme\": \"outlined\" };\nexport default CloseCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CloseCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/CloseCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseCircleOutlined = function CloseCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseCircleOutlinedSvg\n }));\n};\nCloseCircleOutlined.displayName = 'CloseCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(CloseCircleOutlined);","// This icon file is generated automatically.\nvar CloseOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z\" } }] }, \"name\": \"close\", \"theme\": \"outlined\" };\nexport default CloseOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport CloseOutlinedSvg from \"@ant-design/icons-svg/es/asn/CloseOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseOutlined = function CloseOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseOutlinedSvg\n }));\n};\nCloseOutlined.displayName = 'CloseOutlined';\nexport default /*#__PURE__*/React.forwardRef(CloseOutlined);","// This icon file is generated automatically.\nvar DownOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\" } }] }, \"name\": \"down\", \"theme\": \"outlined\" };\nexport default DownOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport DownOutlinedSvg from \"@ant-design/icons-svg/es/asn/DownOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DownOutlined = function DownOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DownOutlinedSvg\n }));\n};\nDownOutlined.displayName = 'DownOutlined';\nexport default /*#__PURE__*/React.forwardRef(DownOutlined);","// This icon file is generated automatically.\nvar EllipsisOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z\" } }] }, \"name\": \"ellipsis\", \"theme\": \"outlined\" };\nexport default EllipsisOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport EllipsisOutlinedSvg from \"@ant-design/icons-svg/es/asn/EllipsisOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EllipsisOutlined = function EllipsisOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EllipsisOutlinedSvg\n }));\n};\nEllipsisOutlined.displayName = 'EllipsisOutlined';\nexport default /*#__PURE__*/React.forwardRef(EllipsisOutlined);","// This icon file is generated automatically.\nvar ExclamationCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"filled\" };\nexport default ExclamationCircleFilled;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport ExclamationCircleFilledSvg from \"@ant-design/icons-svg/es/asn/ExclamationCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar ExclamationCircleFilled = function ExclamationCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ExclamationCircleFilledSvg\n }));\n};\nExclamationCircleFilled.displayName = 'ExclamationCircleFilled';\nexport default /*#__PURE__*/React.forwardRef(ExclamationCircleFilled);","// This icon file is generated automatically.\nvar ExclamationCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"outlined\" };\nexport default ExclamationCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport ExclamationCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/ExclamationCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ExclamationCircleOutlinedSvg\n }));\n};\nExclamationCircleOutlined.displayName = 'ExclamationCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(ExclamationCircleOutlined);","// This icon file is generated automatically.\nvar EyeOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z\" } }] }, \"name\": \"eye\", \"theme\": \"outlined\" };\nexport default EyeOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport EyeOutlinedSvg from \"@ant-design/icons-svg/es/asn/EyeOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EyeOutlined = function EyeOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EyeOutlinedSvg\n }));\n};\nEyeOutlined.displayName = 'EyeOutlined';\nexport default /*#__PURE__*/React.forwardRef(EyeOutlined);","// This icon file is generated automatically.\nvar FileOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z\" } }] }, \"name\": \"file\", \"theme\": \"outlined\" };\nexport default FileOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport FileOutlinedSvg from \"@ant-design/icons-svg/es/asn/FileOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar FileOutlined = function FileOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FileOutlinedSvg\n }));\n};\nFileOutlined.displayName = 'FileOutlined';\nexport default /*#__PURE__*/React.forwardRef(FileOutlined);","// This icon file is generated automatically.\nvar InfoCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"info-circle\", \"theme\": \"outlined\" };\nexport default InfoCircleOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport InfoCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/InfoCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar InfoCircleOutlined = function InfoCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: InfoCircleOutlinedSvg\n }));\n};\nInfoCircleOutlined.displayName = 'InfoCircleOutlined';\nexport default /*#__PURE__*/React.forwardRef(InfoCircleOutlined);","// This icon file is generated automatically.\nvar LeftOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z\" } }] }, \"name\": \"left\", \"theme\": \"outlined\" };\nexport default LeftOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport LeftOutlinedSvg from \"@ant-design/icons-svg/es/asn/LeftOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LeftOutlined = function LeftOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LeftOutlinedSvg\n }));\n};\nLeftOutlined.displayName = 'LeftOutlined';\nexport default /*#__PURE__*/React.forwardRef(LeftOutlined);","// This icon file is generated automatically.\nvar LoadingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\" } }] }, \"name\": \"loading\", \"theme\": \"outlined\" };\nexport default LoadingOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport LoadingOutlinedSvg from \"@ant-design/icons-svg/es/asn/LoadingOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LoadingOutlined = function LoadingOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LoadingOutlinedSvg\n }));\n};\nLoadingOutlined.displayName = 'LoadingOutlined';\nexport default /*#__PURE__*/React.forwardRef(LoadingOutlined);","// This icon file is generated automatically.\nvar MenuFoldOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z\" } }] }, \"name\": \"menu-fold\", \"theme\": \"outlined\" };\nexport default MenuFoldOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport MenuFoldOutlinedSvg from \"@ant-design/icons-svg/es/asn/MenuFoldOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MenuFoldOutlined = function MenuFoldOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MenuFoldOutlinedSvg\n }));\n};\nMenuFoldOutlined.displayName = 'MenuFoldOutlined';\nexport default /*#__PURE__*/React.forwardRef(MenuFoldOutlined);","// This icon file is generated automatically.\nvar RightOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\" } }] }, \"name\": \"right\", \"theme\": \"outlined\" };\nexport default RightOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport RightOutlinedSvg from \"@ant-design/icons-svg/es/asn/RightOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RightOutlined = function RightOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RightOutlinedSvg\n }));\n};\nRightOutlined.displayName = 'RightOutlined';\nexport default /*#__PURE__*/React.forwardRef(RightOutlined);","// This icon file is generated automatically.\nvar SearchOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z\" } }] }, \"name\": \"search\", \"theme\": \"outlined\" };\nexport default SearchOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport SearchOutlinedSvg from \"@ant-design/icons-svg/es/asn/SearchOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SearchOutlined = function SearchOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SearchOutlinedSvg\n }));\n};\nSearchOutlined.displayName = 'SearchOutlined';\nexport default /*#__PURE__*/React.forwardRef(SearchOutlined);","// This icon file is generated automatically.\nvar UserOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z\" } }] }, \"name\": \"user\", \"theme\": \"outlined\" };\nexport default UserOutlined;\n","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport * as React from 'react';\nimport UserOutlinedSvg from \"@ant-design/icons-svg/es/asn/UserOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar UserOutlined = function UserOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: UserOutlinedSvg\n }));\n};\nUserOutlined.displayName = 'UserOutlined';\nexport default /*#__PURE__*/React.forwardRef(UserOutlined);","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\nvar _Context = _interopRequireDefault(require(\"./Context\"));\nvar _IconBase = _interopRequireDefault(require(\"./IconBase\"));\nvar _twoTonePrimaryColor = require(\"./twoTonePrimaryColor\");\nvar _utils = require(\"../utils\");\nvar _excluded = [\"className\", \"icon\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"twoToneColor\"];\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// Initial setting\n// should move it to antd main repo?\n(0, _twoTonePrimaryColor.setTwoToneColor)('#1890ff');\nvar Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _classNames;\n var className = props.className,\n icon = props.icon,\n spin = props.spin,\n rotate = props.rotate,\n tabIndex = props.tabIndex,\n onClick = props.onClick,\n twoToneColor = props.twoToneColor,\n restProps = (0, _objectWithoutProperties2.default)(props, _excluded);\n var _React$useContext = React.useContext(_Context.default),\n _React$useContext$pre = _React$useContext.prefixCls,\n prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,\n rootClassName = _React$useContext.rootClassName;\n var classString = (0, _classnames.default)(rootClassName, prefixCls, (_classNames = {}, (0, _defineProperty2.default)(_classNames, \"\".concat(prefixCls, \"-\").concat(icon.name), !!icon.name), (0, _defineProperty2.default)(_classNames, \"\".concat(prefixCls, \"-spin\"), !!spin || icon.name === 'loading'), _classNames), className);\n var iconTabIndex = tabIndex;\n if (iconTabIndex === undefined && onClick) {\n iconTabIndex = -1;\n }\n var svgStyle = rotate ? {\n msTransform: \"rotate(\".concat(rotate, \"deg)\"),\n transform: \"rotate(\".concat(rotate, \"deg)\")\n } : undefined;\n var _normalizeTwoToneColo = (0, _utils.normalizeTwoToneColors)(twoToneColor),\n _normalizeTwoToneColo2 = (0, _slicedToArray2.default)(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return /*#__PURE__*/React.createElement(\"span\", (0, _objectSpread2.default)((0, _objectSpread2.default)({\n role: \"img\",\n \"aria-label\": icon.name\n }, restProps), {}, {\n ref: ref,\n tabIndex: iconTabIndex,\n onClick: onClick,\n className: classString\n }), /*#__PURE__*/React.createElement(_IconBase.default, {\n icon: icon,\n primaryColor: primaryColor,\n secondaryColor: secondaryColor,\n style: svgStyle\n }));\n});\nIcon.displayName = 'AntdIcon';\nIcon.getTwoToneColor = _twoTonePrimaryColor.getTwoToneColor;\nIcon.setTwoToneColor = _twoTonePrimaryColor.setTwoToneColor;\nvar _default = Icon;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _react = require(\"react\");\nvar IconContext = /*#__PURE__*/(0, _react.createContext)({});\nvar _default = IconContext;\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _utils = require(\"../utils\");\nvar _excluded = [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"];\nvar twoToneColorPalette = {\n primaryColor: '#333',\n secondaryColor: '#E6E6E6',\n calculated: false\n};\nfunction setTwoToneColors(_ref) {\n var primaryColor = _ref.primaryColor,\n secondaryColor = _ref.secondaryColor;\n twoToneColorPalette.primaryColor = primaryColor;\n twoToneColorPalette.secondaryColor = secondaryColor || (0, _utils.getSecondaryColor)(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\nfunction getTwoToneColors() {\n return (0, _objectSpread2.default)({}, twoToneColorPalette);\n}\nvar IconBase = function IconBase(props) {\n var icon = props.icon,\n className = props.className,\n onClick = props.onClick,\n style = props.style,\n primaryColor = props.primaryColor,\n secondaryColor = props.secondaryColor,\n restProps = (0, _objectWithoutProperties2.default)(props, _excluded);\n var colors = twoToneColorPalette;\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || (0, _utils.getSecondaryColor)(primaryColor)\n };\n }\n (0, _utils.useInsertStyles)();\n (0, _utils.warning)((0, _utils.isIconDefinition)(icon), \"icon should be icon definiton, but got \".concat(icon));\n if (!(0, _utils.isIconDefinition)(icon)) {\n return null;\n }\n var target = icon;\n if (target && typeof target.icon === 'function') {\n target = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, target), {}, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n return (0, _utils.generate)(target.icon, \"svg-\".concat(target.name), (0, _objectSpread2.default)({\n className: className,\n onClick: onClick,\n style: style,\n 'data-icon': target.name,\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true'\n }, restProps));\n};\nIconBase.displayName = 'IconReact';\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nvar _default = IconBase;\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getTwoToneColor = getTwoToneColor;\nexports.setTwoToneColor = setTwoToneColor;\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));\nvar _IconBase = _interopRequireDefault(require(\"./IconBase\"));\nvar _utils = require(\"../utils\");\nfunction setTwoToneColor(twoToneColor) {\n var _normalizeTwoToneColo = (0, _utils.normalizeTwoToneColors)(twoToneColor),\n _normalizeTwoToneColo2 = (0, _slicedToArray2.default)(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return _IconBase.default.setTwoToneColors({\n primaryColor: primaryColor,\n secondaryColor: secondaryColor\n });\n}\nfunction getTwoToneColor() {\n var colors = _IconBase.default.getTwoToneColors();\n if (!colors.calculated) {\n return colors.primaryColor;\n }\n return [colors.primaryColor, colors.secondaryColor];\n}","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CheckCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CheckCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CheckCircleFilled = function CheckCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CheckCircleFilled.default\n }));\n};\nCheckCircleFilled.displayName = 'CheckCircleFilled';\nvar _default = /*#__PURE__*/React.forwardRef(CheckCircleFilled);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CheckCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CheckCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CheckCircleOutlined = function CheckCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CheckCircleOutlined.default\n }));\n};\nCheckCircleOutlined.displayName = 'CheckCircleOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(CheckCircleOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CloseCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CloseCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CloseCircleFilled = function CloseCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CloseCircleFilled.default\n }));\n};\nCloseCircleFilled.displayName = 'CloseCircleFilled';\nvar _default = /*#__PURE__*/React.forwardRef(CloseCircleFilled);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CloseCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CloseCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CloseCircleOutlined = function CloseCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CloseCircleOutlined.default\n }));\n};\nCloseCircleOutlined.displayName = 'CloseCircleOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(CloseCircleOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CloseOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CloseOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CloseOutlined = function CloseOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CloseOutlined.default\n }));\n};\nCloseOutlined.displayName = 'CloseOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(CloseOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _DotChartOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/DotChartOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar DotChartOutlined = function DotChartOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _DotChartOutlined.default\n }));\n};\nDotChartOutlined.displayName = 'DotChartOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(DotChartOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _ExclamationCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/ExclamationCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar ExclamationCircleFilled = function ExclamationCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _ExclamationCircleFilled.default\n }));\n};\nExclamationCircleFilled.displayName = 'ExclamationCircleFilled';\nvar _default = /*#__PURE__*/React.forwardRef(ExclamationCircleFilled);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _ExclamationCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/ExclamationCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _ExclamationCircleOutlined.default\n }));\n};\nExclamationCircleOutlined.displayName = 'ExclamationCircleOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(ExclamationCircleOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _InfoCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/InfoCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar InfoCircleFilled = function InfoCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _InfoCircleFilled.default\n }));\n};\nInfoCircleFilled.displayName = 'InfoCircleFilled';\nvar _default = /*#__PURE__*/React.forwardRef(InfoCircleFilled);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _InfoCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/InfoCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar InfoCircleOutlined = function InfoCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _InfoCircleOutlined.default\n }));\n};\nInfoCircleOutlined.displayName = 'InfoCircleOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(InfoCircleOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _LoadingOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/LoadingOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar LoadingOutlined = function LoadingOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _LoadingOutlined.default\n }));\n};\nLoadingOutlined.displayName = 'LoadingOutlined';\nvar _default = /*#__PURE__*/React.forwardRef(LoadingOutlined);\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof3 = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.generate = generate;\nexports.getSecondaryColor = getSecondaryColor;\nexports.iconStyles = void 0;\nexports.isIconDefinition = isIconDefinition;\nexports.normalizeAttrs = normalizeAttrs;\nexports.normalizeTwoToneColors = normalizeTwoToneColors;\nexports.useInsertStyles = exports.svgBaseProps = void 0;\nexports.warning = warning;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime/helpers/typeof\"));\nvar _colors = require(\"@ant-design/colors\");\nvar _react = _interopRequireWildcard(require(\"react\"));\nvar _warning = _interopRequireDefault(require(\"rc-util/lib/warning\"));\nvar _dynamicCSS = require(\"rc-util/lib/Dom/dynamicCSS\");\nvar _Context = _interopRequireDefault(require(\"./components/Context\"));\nvar _camelCase = _interopRequireDefault(require(\"lodash/camelCase\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction warning(valid, message) {\n (0, _warning.default)(valid, \"[@ant-design/icons] \".concat(message));\n}\nfunction isIconDefinition(target) {\n return (0, _typeof2.default)(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && ((0, _typeof2.default)(target.icon) === 'object' || typeof target.icon === 'function');\n}\nfunction normalizeAttrs() {\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Object.keys(attrs).reduce(function (acc, key) {\n var val = attrs[key];\n switch (key) {\n case 'class':\n acc.className = val;\n delete acc.class;\n break;\n default:\n delete acc[key];\n acc[(0, _camelCase.default)(key)] = val;\n }\n return acc;\n }, {});\n}\nfunction generate(node, key, rootProps) {\n if (!rootProps) {\n return /*#__PURE__*/_react.default.createElement(node.tag, (0, _objectSpread2.default)({\n key: key\n }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n }\n return /*#__PURE__*/_react.default.createElement(node.tag, (0, _objectSpread2.default)((0, _objectSpread2.default)({\n key: key\n }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n}\nfunction getSecondaryColor(primaryColor) {\n // choose the second color\n return (0, _colors.generate)(primaryColor)[0];\n}\nfunction normalizeTwoToneColors(twoToneColor) {\n if (!twoToneColor) {\n return [];\n }\n return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];\n}\n// These props make sure that the SVG behaviours like general text.\n// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4\nvar svgBaseProps = {\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n focusable: 'false'\n};\nexports.svgBaseProps = svgBaseProps;\nvar iconStyles = \"\\n.anticon {\\n display: inline-block;\\n color: inherit;\\n font-style: normal;\\n line-height: 0;\\n text-align: center;\\n text-transform: none;\\n vertical-align: -0.125em;\\n text-rendering: optimizeLegibility;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n}\\n\\n.anticon > * {\\n line-height: 1;\\n}\\n\\n.anticon svg {\\n display: inline-block;\\n}\\n\\n.anticon::before {\\n display: none;\\n}\\n\\n.anticon .anticon-icon {\\n display: block;\\n}\\n\\n.anticon[tabindex] {\\n cursor: pointer;\\n}\\n\\n.anticon-spin::before,\\n.anticon-spin {\\n display: inline-block;\\n -webkit-animation: loadingCircle 1s infinite linear;\\n animation: loadingCircle 1s infinite linear;\\n}\\n\\n@-webkit-keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\";\nexports.iconStyles = iconStyles;\nvar useInsertStyles = function useInsertStyles() {\n var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;\n var _useContext = (0, _react.useContext)(_Context.default),\n csp = _useContext.csp;\n (0, _react.useEffect)(function () {\n (0, _dynamicCSS.updateCSS)(styleStr, '@ant-design-icons', {\n prepend: true,\n csp: csp\n });\n }, []);\n};\nexports.useInsertStyles = useInsertStyles;","import { bound01, pad2 } from './util';\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n//
\n/**\n * Handle bounds / percentage checking to conform to CSS color spec\n * \n * *Assumes:* r, g, b in [0, 255] or [0, 1]\n * *Returns:* { r, g, b } in [0, 255]\n */\nexport function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255,\n };\n}\n/**\n * Converts an RGB color value to HSL.\n * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n * *Returns:* { h, s, l } in [0,1]\n */\nexport function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var s = 0;\n var l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, l: l };\n}\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * (6 * t);\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n/**\n * Converts an HSL color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hslToRgb(h, s, l) {\n var r;\n var g;\n var b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n if (s === 0) {\n // achromatic\n g = l;\n b = l;\n r = l;\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color value to HSV\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n * *Returns:* { h, s, v } in [0,1]\n */\nexport function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var v = max;\n var d = max - min;\n var s = max === 0 ? 0 : d / max;\n if (max === min) {\n h = 0; // achromatic\n }\n else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n/**\n * Converts an HSV color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h);\n var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n var mod = i % 6;\n var r = [v, q, p, p, t, v][mod];\n var g = [t, v, v, q, p, p][mod];\n var b = [p, p, t, v, v, q][mod];\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color to hex\n *\n * Assumes r, g, and b are contained in the set [0, 255]\n * Returns a 3 or 6 character hex\n */\nexport function rgbToHex(r, g, b, allow3Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color plus alpha transparency to hex\n *\n * Assumes r, g, b are contained in the set [0, 255] and\n * a in [0, 1]. Returns a 4 or 8 character rgba hex\n */\n// eslint-disable-next-line max-params\nexport function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color to an ARGB Hex8 string\n * Rarely used, but required for \"toFilter()\"\n */\nexport function rgbaToArgbHex(r, g, b, a) {\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n return hex.join('');\n}\n/** Converts a decimal to a hex value */\nexport function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n/** Converts a hex value to a decimal */\nexport function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\n/** Parse a base-16 hex value into a base-10 integer */\nexport function parseIntFromHex(val) {\n return parseInt(val, 16);\n}\nexport function numberInputToObject(color) {\n return {\n r: color >> 16,\n g: (color & 0xff00) >> 8,\n b: color & 0xff,\n };\n}\n","// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json\n/**\n * @hidden\n */\nexport var names = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n goldenrod: '#daa520',\n gold: '#ffd700',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavenderblush: '#fff0f5',\n lavender: '#e6e6fa',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport { convertHexToDecimal, hslToRgb, hsvToRgb, parseIntFromHex, rgbToRgb } from './conversion';\nimport { names } from './css-color-names';\nimport { boundAlpha, convertToPercentage } from './util';\n/**\n * Given a string or object, convert that input to RGB\n *\n * Possible string inputs:\n * ```\n * \"red\"\n * \"#f00\" or \"f00\"\n * \"#ff0000\" or \"ff0000\"\n * \"#ff000000\" or \"ff000000\"\n * \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n * \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n * \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n * \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n * \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n * \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n * \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n * ```\n */\nexport function inputToRGB(color) {\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color === 'string') {\n color = stringInputToObject(color);\n }\n if (typeof color === 'object') {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = 'hsv';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = 'hsl';\n }\n if (Object.prototype.hasOwnProperty.call(color, 'a')) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a,\n };\n}\n// \nvar CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n// \nvar CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\nvar CSS_UNIT = \"(?:\".concat(CSS_NUMBER, \")|(?:\").concat(CSS_INTEGER, \")\");\n// Actual matching.\n// Parentheses and commas are optional, but not required.\n// Whitespace can take the place of commas or opening paren\nvar PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar matchers = {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),\n rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),\n hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),\n hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),\n hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),\n hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n};\n/**\n * Permissive string parsing. Take in a number of formats, and output an object\n * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n */\nexport function stringInputToObject(color) {\n color = color.trim().toLowerCase();\n if (color.length === 0) {\n return false;\n }\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\n }\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match = matchers.rgb.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n match = matchers.rgba.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n match = matchers.hsl.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n match = matchers.hsla.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n match = matchers.hsv.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n match = matchers.hsva.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n match = matchers.hex8.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex6.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n match = matchers.hex4.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n a: convertHexToDecimal(match[4] + match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex3.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n return false;\n}\n/**\n * Check to see if it looks like a CSS unit\n * (see `matchers` above for definition).\n */\nexport function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}\n","import { numberInputToObject, rgbaToHex, rgbToHex, rgbToHsl, rgbToHsv } from './conversion';\nimport { names } from './css-color-names';\nimport { inputToRGB } from './format-input';\nimport { bound01, boundAlpha, clamp01 } from './util';\nvar TinyColor = /** @class */ (function () {\n function TinyColor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n var _a;\n // If input is already a tinycolor, return itself\n if (color instanceof TinyColor) {\n // eslint-disable-next-line no-constructor-return\n return color;\n }\n if (typeof color === 'number') {\n color = numberInputToObject(color);\n }\n this.originalInput = color;\n var rgb = inputToRGB(color);\n this.originalInput = color;\n this.r = rgb.r;\n this.g = rgb.g;\n this.b = rgb.b;\n this.a = rgb.a;\n this.roundA = Math.round(100 * this.a) / 100;\n this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;\n this.gradientType = opts.gradientType;\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this.r < 1) {\n this.r = Math.round(this.r);\n }\n if (this.g < 1) {\n this.g = Math.round(this.g);\n }\n if (this.b < 1) {\n this.b = Math.round(this.b);\n }\n this.isValid = rgb.ok;\n }\n TinyColor.prototype.isDark = function () {\n return this.getBrightness() < 128;\n };\n TinyColor.prototype.isLight = function () {\n return !this.isDark();\n };\n /**\n * Returns the perceived brightness of the color, from 0-255.\n */\n TinyColor.prototype.getBrightness = function () {\n // http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n };\n /**\n * Returns the perceived luminance of a color, from 0-1.\n */\n TinyColor.prototype.getLuminance = function () {\n // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var R;\n var G;\n var B;\n var RsRGB = rgb.r / 255;\n var GsRGB = rgb.g / 255;\n var BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) {\n R = RsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n }\n if (GsRGB <= 0.03928) {\n G = GsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n }\n if (BsRGB <= 0.03928) {\n B = BsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n }\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n };\n /**\n * Returns the alpha value of a color, from 0-1.\n */\n TinyColor.prototype.getAlpha = function () {\n return this.a;\n };\n /**\n * Sets the alpha value on the current color.\n *\n * @param alpha - The new alpha value. The accepted range is 0-1.\n */\n TinyColor.prototype.setAlpha = function (alpha) {\n this.a = boundAlpha(alpha);\n this.roundA = Math.round(100 * this.a) / 100;\n return this;\n };\n /**\n * Returns whether the color is monochrome.\n */\n TinyColor.prototype.isMonochrome = function () {\n var s = this.toHsl().s;\n return s === 0;\n };\n /**\n * Returns the object as a HSVA object.\n */\n TinyColor.prototype.toHsv = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };\n };\n /**\n * Returns the hsva values interpolated into a string with the following format:\n * \"hsva(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHsvString = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n var h = Math.round(hsv.h * 360);\n var s = Math.round(hsv.s * 100);\n var v = Math.round(hsv.v * 100);\n return this.a === 1 ? \"hsv(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%)\") : \"hsva(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a HSLA object.\n */\n TinyColor.prototype.toHsl = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };\n };\n /**\n * Returns the hsla values interpolated into a string with the following format:\n * \"hsla(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHslString = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n var h = Math.round(hsl.h * 360);\n var s = Math.round(hsl.s * 100);\n var l = Math.round(hsl.l * 100);\n return this.a === 1 ? \"hsl(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%)\") : \"hsla(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the hex value of the color.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHex = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return rgbToHex(this.r, this.g, this.b, allow3Char);\n };\n /**\n * Returns the hex value of the color -with a # prefixed.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHexString = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return '#' + this.toHex(allow3Char);\n };\n /**\n * Returns the hex 8 value of the color.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8 = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);\n };\n /**\n * Returns the hex 8 value of the color -with a # prefixed.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8String = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return '#' + this.toHex8(allow4Char);\n };\n /**\n * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.\n * @param allowShortChar will shorten hex value to 3 or 4 char if possible\n */\n TinyColor.prototype.toHexShortString = function (allowShortChar) {\n if (allowShortChar === void 0) { allowShortChar = false; }\n return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toRgb = function () {\n return {\n r: Math.round(this.r),\n g: Math.round(this.g),\n b: Math.round(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA values interpolated into a string with the following format:\n * \"RGBA(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toRgbString = function () {\n var r = Math.round(this.r);\n var g = Math.round(this.g);\n var b = Math.round(this.b);\n return this.a === 1 ? \"rgb(\".concat(r, \", \").concat(g, \", \").concat(b, \")\") : \"rgba(\".concat(r, \", \").concat(g, \", \").concat(b, \", \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toPercentageRgb = function () {\n var fmt = function (x) { return \"\".concat(Math.round(bound01(x, 255) * 100), \"%\"); };\n return {\n r: fmt(this.r),\n g: fmt(this.g),\n b: fmt(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA relative values interpolated into a string\n */\n TinyColor.prototype.toPercentageRgbString = function () {\n var rnd = function (x) { return Math.round(bound01(x, 255) * 100); };\n return this.a === 1\n ? \"rgb(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%)\")\n : \"rgba(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%, \").concat(this.roundA, \")\");\n };\n /**\n * The 'real' name of the color -if there is one.\n */\n TinyColor.prototype.toName = function () {\n if (this.a === 0) {\n return 'transparent';\n }\n if (this.a < 1) {\n return false;\n }\n var hex = '#' + rgbToHex(this.r, this.g, this.b, false);\n for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n if (hex === value) {\n return key;\n }\n }\n return false;\n };\n TinyColor.prototype.toString = function (format) {\n var formatSet = Boolean(format);\n format = format !== null && format !== void 0 ? format : this.format;\n var formattedString = false;\n var hasAlpha = this.a < 1 && this.a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === 'name' && this.a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === 'rgb') {\n formattedString = this.toRgbString();\n }\n if (format === 'prgb') {\n formattedString = this.toPercentageRgbString();\n }\n if (format === 'hex' || format === 'hex6') {\n formattedString = this.toHexString();\n }\n if (format === 'hex3') {\n formattedString = this.toHexString(true);\n }\n if (format === 'hex4') {\n formattedString = this.toHex8String(true);\n }\n if (format === 'hex8') {\n formattedString = this.toHex8String();\n }\n if (format === 'name') {\n formattedString = this.toName();\n }\n if (format === 'hsl') {\n formattedString = this.toHslString();\n }\n if (format === 'hsv') {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n };\n TinyColor.prototype.toNumber = function () {\n return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);\n };\n TinyColor.prototype.clone = function () {\n return new TinyColor(this.toString());\n };\n /**\n * Lighten the color a given amount. Providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.lighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Brighten the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.brighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var rgb = this.toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return new TinyColor(rgb);\n };\n /**\n * Darken the color a given amount, from 0 to 100.\n * Providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.darken = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Mix the color with pure white, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.tint = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('white', amount);\n };\n /**\n * Mix the color with pure black, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.shade = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('black', amount);\n };\n /**\n * Desaturate the color a given amount, from 0 to 100.\n * Providing 100 will is the same as calling greyscale\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.desaturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Saturate the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.saturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Completely desaturates a color into greyscale.\n * Same as calling `desaturate(100)`\n */\n TinyColor.prototype.greyscale = function () {\n return this.desaturate(100);\n };\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n TinyColor.prototype.spin = function (amount) {\n var hsl = this.toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return new TinyColor(hsl);\n };\n /**\n * Mix the current color a given amount with another color, from 0 to 100.\n * 0 means no mixing (return current color).\n */\n TinyColor.prototype.mix = function (color, amount) {\n if (amount === void 0) { amount = 50; }\n var rgb1 = this.toRgb();\n var rgb2 = new TinyColor(color).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a,\n };\n return new TinyColor(rgba);\n };\n TinyColor.prototype.analogous = function (results, slices) {\n if (results === void 0) { results = 6; }\n if (slices === void 0) { slices = 30; }\n var hsl = this.toHsl();\n var part = 360 / slices;\n var ret = [this];\n for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(new TinyColor(hsl));\n }\n return ret;\n };\n /**\n * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js\n */\n TinyColor.prototype.complement = function () {\n var hsl = this.toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return new TinyColor(hsl);\n };\n TinyColor.prototype.monochromatic = function (results) {\n if (results === void 0) { results = 6; }\n var hsv = this.toHsv();\n var h = hsv.h;\n var s = hsv.s;\n var v = hsv.v;\n var res = [];\n var modification = 1 / results;\n while (results--) {\n res.push(new TinyColor({ h: h, s: s, v: v }));\n v = (v + modification) % 1;\n }\n return res;\n };\n TinyColor.prototype.splitcomplement = function () {\n var hsl = this.toHsl();\n var h = hsl.h;\n return [\n this,\n new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),\n new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),\n ];\n };\n /**\n * Compute how the color would appear on a background\n */\n TinyColor.prototype.onBackground = function (background) {\n var fg = this.toRgb();\n var bg = new TinyColor(background).toRgb();\n var alpha = fg.a + bg.a * (1 - fg.a);\n return new TinyColor({\n r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,\n g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,\n b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,\n a: alpha,\n });\n };\n /**\n * Alias for `polyad(3)`\n */\n TinyColor.prototype.triad = function () {\n return this.polyad(3);\n };\n /**\n * Alias for `polyad(4)`\n */\n TinyColor.prototype.tetrad = function () {\n return this.polyad(4);\n };\n /**\n * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)\n * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...\n */\n TinyColor.prototype.polyad = function (n) {\n var hsl = this.toHsl();\n var h = hsl.h;\n var result = [this];\n var increment = 360 / n;\n for (var i = 1; i < n; i++) {\n result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));\n }\n return result;\n };\n /**\n * compare color vs current color\n */\n TinyColor.prototype.equals = function (color) {\n return this.toRgbString() === new TinyColor(color).toRgbString();\n };\n return TinyColor;\n}());\nexport { TinyColor };\n// kept for backwards compatability with v1\nexport function tinycolor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n return new TinyColor(color, opts);\n}\n","import { TinyColor } from './index';\n// Readability Functions\n// ---------------------\n// false\n * new TinyColor().isReadable('#000', '#111', { level: 'AA', size: 'large' }) => false\n * ```\n */\nexport function isReadable(color1, color2, wcag2) {\n var _a, _b;\n if (wcag2 === void 0) { wcag2 = { level: 'AA', size: 'small' }; }\n var readabilityLevel = readability(color1, color2);\n switch (((_a = wcag2.level) !== null && _a !== void 0 ? _a : 'AA') + ((_b = wcag2.size) !== null && _b !== void 0 ? _b : 'small')) {\n case 'AAsmall':\n case 'AAAlarge':\n return readabilityLevel >= 4.5;\n case 'AAlarge':\n return readabilityLevel >= 3;\n case 'AAAsmall':\n return readabilityLevel >= 7;\n default:\n return false;\n }\n}\n/**\n * Given a base color and a list of possible foreground or background\n * colors for that base, returns the most readable color.\n * Optionally returns Black or White if the most readable color is unreadable.\n *\n * @param baseColor - the base color.\n * @param colorList - array of colors to pick the most readable one from.\n * @param args - and object with extra arguments\n *\n * Example\n * ```ts\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'], { includeFallbackColors: false }).toHexString(); // \"#112255\"\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'],{ includeFallbackColors: true }).toHexString(); // \"#ffffff\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'large' }).toHexString(); // \"#faf3f3\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'small' }).toHexString(); // \"#ffffff\"\n * ```\n */\nexport function mostReadable(baseColor, colorList, args) {\n if (args === void 0) { args = { includeFallbackColors: false, level: 'AA', size: 'small' }; }\n var bestColor = null;\n var bestScore = 0;\n var includeFallbackColors = args.includeFallbackColors, level = args.level, size = args.size;\n for (var _i = 0, colorList_1 = colorList; _i < colorList_1.length; _i++) {\n var color = colorList_1[_i];\n var score = readability(baseColor, color);\n if (score > bestScore) {\n bestScore = score;\n bestColor = new TinyColor(color);\n }\n }\n if (isReadable(baseColor, bestColor, { level: level, size: size }) || !includeFallbackColors) {\n return bestColor;\n }\n args.includeFallbackColors = false;\n return mostReadable(baseColor, ['#fff', '#000'], args);\n}\n","import { rgbaToArgbHex } from './conversion';\nimport { TinyColor } from './index';\n/**\n * Returns the color represented as a Microsoft filter for use in old versions of IE.\n */\nexport function toMsFilter(firstColor, secondColor) {\n var color = new TinyColor(firstColor);\n var hex8String = '#' + rgbaToArgbHex(color.r, color.g, color.b, color.a);\n var secondHex8String = hex8String;\n var gradientType = color.gradientType ? 'GradientType = 1, ' : '';\n if (secondColor) {\n var s = new TinyColor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s.r, s.g, s.b, s.a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\".concat(gradientType, \"startColorstr=\").concat(hex8String, \",endColorstr=\").concat(secondHex8String, \")\");\n}\n","import { TinyColor } from './index';\nimport { convertToPercentage } from './util';\n/**\n * If input is an object, force 1 into \"1.0\" to handle ratios properly\n * String input requires \"1.0\" as input, so 1 will be treated as 1\n */\nexport function fromRatio(ratio, opts) {\n var newColor = {\n r: convertToPercentage(ratio.r),\n g: convertToPercentage(ratio.g),\n b: convertToPercentage(ratio.b),\n };\n if (ratio.a !== undefined) {\n newColor.a = Number(ratio.a);\n }\n return new TinyColor(newColor, opts);\n}\n/** old random function */\nexport function legacyRandom() {\n return new TinyColor({\n r: Math.random(),\n g: Math.random(),\n b: Math.random(),\n });\n}\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// randomColor by David Merfield under the CC0 license\n// https://github.com/davidmerfield/randomColor/\nimport { TinyColor } from './index';\nexport function random(options) {\n if (options === void 0) { options = {}; }\n // Check if we need to generate multiple colors\n if (options.count !== undefined &&\n options.count !== null) {\n var totalColors = options.count;\n var colors = [];\n options.count = undefined;\n while (totalColors > colors.length) {\n // Since we're generating multiple colors,\n // incremement the seed. Otherwise we'd just\n // generate the same color each time...\n options.count = null;\n if (options.seed) {\n options.seed += 1;\n }\n colors.push(random(options));\n }\n options.count = totalColors;\n return colors;\n }\n // First we pick a hue (H)\n var h = pickHue(options.hue, options.seed);\n // Then use H to determine saturation (S)\n var s = pickSaturation(h, options);\n // Then use S and H to determine brightness (B).\n var v = pickBrightness(h, s, options);\n var res = { h: h, s: s, v: v };\n if (options.alpha !== undefined) {\n res.a = options.alpha;\n }\n // Then we return the HSB color in the desired format\n return new TinyColor(res);\n}\nfunction pickHue(hue, seed) {\n var hueRange = getHueRange(hue);\n var res = randomWithin(hueRange, seed);\n // Instead of storing red as two seperate ranges,\n // we group them, using negative numbers\n if (res < 0) {\n res = 360 + res;\n }\n return res;\n}\nfunction pickSaturation(hue, options) {\n if (options.hue === 'monochrome') {\n return 0;\n }\n if (options.luminosity === 'random') {\n return randomWithin([0, 100], options.seed);\n }\n var saturationRange = getColorInfo(hue).saturationRange;\n var sMin = saturationRange[0];\n var sMax = saturationRange[1];\n switch (options.luminosity) {\n case 'bright':\n sMin = 55;\n break;\n case 'dark':\n sMin = sMax - 10;\n break;\n case 'light':\n sMax = 55;\n break;\n default:\n break;\n }\n return randomWithin([sMin, sMax], options.seed);\n}\nfunction pickBrightness(H, S, options) {\n var bMin = getMinimumBrightness(H, S);\n var bMax = 100;\n switch (options.luminosity) {\n case 'dark':\n bMax = bMin + 20;\n break;\n case 'light':\n bMin = (bMax + bMin) / 2;\n break;\n case 'random':\n bMin = 0;\n bMax = 100;\n break;\n default:\n break;\n }\n return randomWithin([bMin, bMax], options.seed);\n}\nfunction getMinimumBrightness(H, S) {\n var lowerBounds = getColorInfo(H).lowerBounds;\n for (var i = 0; i < lowerBounds.length - 1; i++) {\n var s1 = lowerBounds[i][0];\n var v1 = lowerBounds[i][1];\n var s2 = lowerBounds[i + 1][0];\n var v2 = lowerBounds[i + 1][1];\n if (S >= s1 && S <= s2) {\n var m = (v2 - v1) / (s2 - s1);\n var b = v1 - m * s1;\n return m * S + b;\n }\n }\n return 0;\n}\nfunction getHueRange(colorInput) {\n var num = parseInt(colorInput, 10);\n if (!Number.isNaN(num) && num < 360 && num > 0) {\n return [num, num];\n }\n if (typeof colorInput === 'string') {\n var namedColor = bounds.find(function (n) { return n.name === colorInput; });\n if (namedColor) {\n var color = defineColor(namedColor);\n if (color.hueRange) {\n return color.hueRange;\n }\n }\n var parsed = new TinyColor(colorInput);\n if (parsed.isValid) {\n var hue = parsed.toHsv().h;\n return [hue, hue];\n }\n }\n return [0, 360];\n}\nfunction getColorInfo(hue) {\n // Maps red colors to make picking hue easier\n if (hue >= 334 && hue <= 360) {\n hue -= 360;\n }\n for (var _i = 0, bounds_1 = bounds; _i < bounds_1.length; _i++) {\n var bound = bounds_1[_i];\n var color = defineColor(bound);\n if (color.hueRange && hue >= color.hueRange[0] && hue <= color.hueRange[1]) {\n return color;\n }\n }\n throw Error('Color not found');\n}\nfunction randomWithin(range, seed) {\n if (seed === undefined) {\n return Math.floor(range[0] + Math.random() * (range[1] + 1 - range[0]));\n }\n // Seeded random algorithm from http://indiegamr.com/generate-repeatable-random-numbers-in-js/\n var max = range[1] || 1;\n var min = range[0] || 0;\n seed = (seed * 9301 + 49297) % 233280;\n var rnd = seed / 233280.0;\n return Math.floor(min + rnd * (max - min));\n}\nfunction defineColor(bound) {\n var sMin = bound.lowerBounds[0][0];\n var sMax = bound.lowerBounds[bound.lowerBounds.length - 1][0];\n var bMin = bound.lowerBounds[bound.lowerBounds.length - 1][1];\n var bMax = bound.lowerBounds[0][1];\n return {\n name: bound.name,\n hueRange: bound.hueRange,\n lowerBounds: bound.lowerBounds,\n saturationRange: [sMin, sMax],\n brightnessRange: [bMin, bMax],\n };\n}\n/**\n * @hidden\n */\nexport var bounds = [\n {\n name: 'monochrome',\n hueRange: null,\n lowerBounds: [\n [0, 0],\n [100, 0],\n ],\n },\n {\n name: 'red',\n hueRange: [-26, 18],\n lowerBounds: [\n [20, 100],\n [30, 92],\n [40, 89],\n [50, 85],\n [60, 78],\n [70, 70],\n [80, 60],\n [90, 55],\n [100, 50],\n ],\n },\n {\n name: 'orange',\n hueRange: [19, 46],\n lowerBounds: [\n [20, 100],\n [30, 93],\n [40, 88],\n [50, 86],\n [60, 85],\n [70, 70],\n [100, 70],\n ],\n },\n {\n name: 'yellow',\n hueRange: [47, 62],\n lowerBounds: [\n [25, 100],\n [40, 94],\n [50, 89],\n [60, 86],\n [70, 84],\n [80, 82],\n [90, 80],\n [100, 75],\n ],\n },\n {\n name: 'green',\n hueRange: [63, 178],\n lowerBounds: [\n [30, 100],\n [40, 90],\n [50, 85],\n [60, 81],\n [70, 74],\n [80, 64],\n [90, 50],\n [100, 40],\n ],\n },\n {\n name: 'blue',\n hueRange: [179, 257],\n lowerBounds: [\n [20, 100],\n [30, 86],\n [40, 80],\n [50, 74],\n [60, 60],\n [70, 52],\n [80, 44],\n [90, 39],\n [100, 35],\n ],\n },\n {\n name: 'purple',\n hueRange: [258, 282],\n lowerBounds: [\n [20, 100],\n [30, 87],\n [40, 79],\n [50, 70],\n [60, 65],\n [70, 59],\n [80, 52],\n [90, 45],\n [100, 42],\n ],\n },\n {\n name: 'pink',\n hueRange: [283, 334],\n lowerBounds: [\n [20, 100],\n [30, 90],\n [40, 86],\n [60, 84],\n [80, 80],\n [90, 75],\n [100, 73],\n ],\n },\n];\n","import { tinycolor } from './index';\nexport * from './index';\nexport * from './css-color-names';\nexport * from './readability';\nexport * from './to-ms-filter';\nexport * from './from-ratio';\nexport * from './format-input';\nexport * from './random';\nexport * from './interfaces';\nexport * from './conversion';\n// kept for backwards compatability with v1\nexport default tinycolor;\n","/**\n * Take input from [0, n] and return it as [0, 1]\n * @hidden\n */\nexport function bound01(n, max) {\n if (isOnePointZero(n)) {\n n = '100%';\n }\n var isPercent = isPercentage(n);\n n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));\n // Automatically convert percentage into number\n if (isPercent) {\n n = parseInt(String(n * max), 10) / 100;\n }\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n // Convert into [0, 1] range if it isn't already\n if (max === 360) {\n // If n is a hue given in degrees,\n // wrap around out-of-range values into [0, 360] range\n // then convert into [0, 1].\n n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));\n }\n else {\n // If n not a hue given in degrees\n // Convert into [0, 1] range if it isn't already.\n n = (n % max) / parseFloat(String(max));\n }\n return n;\n}\n/**\n * Force a number between 0 and 1\n * @hidden\n */\nexport function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n}\n/**\n * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n * \n * @hidden\n */\nexport function isOnePointZero(n) {\n return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;\n}\n/**\n * Check to see if string passed in is a percentage\n * @hidden\n */\nexport function isPercentage(n) {\n return typeof n === 'string' && n.indexOf('%') !== -1;\n}\n/**\n * Return a valid alpha value [0,1] with all invalid values being set to 1\n * @hidden\n */\nexport function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n}\n/**\n * Replace a decimal with it's percentage value\n * @hidden\n */\nexport function convertToPercentage(n) {\n if (n <= 1) {\n return \"\".concat(Number(n) * 100, \"%\");\n }\n return n;\n}\n/**\n * Force a hex value to have 2 characters\n * @hidden\n */\nexport function pad2(c) {\n return c.length === 1 ? '0' + c : String(c);\n}\n","import * as React from 'react';\nvar OrderContext = /*#__PURE__*/React.createContext(null);\nexport default OrderContext;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport OrderContext from \"./Context\";\nvar EMPTY_LIST = [];\n\n/**\n * Will add `div` to document. Nest call will keep order\n * @param render Render DOM in document\n */\nexport default function useDom(render, debug) {\n var _React$useState = React.useState(function () {\n if (!canUseDom()) {\n return null;\n }\n var defaultEle = document.createElement('div');\n if (process.env.NODE_ENV !== 'production' && debug) {\n defaultEle.setAttribute('data-debug', debug);\n }\n return defaultEle;\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n ele = _React$useState2[0];\n\n // ========================== Order ==========================\n var appendedRef = React.useRef(false);\n var queueCreate = React.useContext(OrderContext);\n var _React$useState3 = React.useState(EMPTY_LIST),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n queue = _React$useState4[0],\n setQueue = _React$useState4[1];\n var mergedQueueCreate = queueCreate || (appendedRef.current ? undefined : function (appendFn) {\n setQueue(function (origin) {\n var newQueue = [appendFn].concat(_toConsumableArray(origin));\n return newQueue;\n });\n });\n\n // =========================== DOM ===========================\n function append() {\n if (!ele.parentElement) {\n document.body.appendChild(ele);\n }\n appendedRef.current = true;\n }\n function cleanup() {\n var _ele$parentElement;\n (_ele$parentElement = ele.parentElement) === null || _ele$parentElement === void 0 ? void 0 : _ele$parentElement.removeChild(ele);\n appendedRef.current = false;\n }\n useLayoutEffect(function () {\n if (render) {\n if (queueCreate) {\n queueCreate(append);\n } else {\n append();\n }\n } else {\n cleanup();\n }\n return cleanup;\n }, [render]);\n useLayoutEffect(function () {\n if (queue.length) {\n queue.forEach(function (appendFn) {\n return appendFn();\n });\n setQueue(EMPTY_LIST);\n }\n }, [queue]);\n return [ele, mergedQueueCreate];\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { updateCSS, removeCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport { getTargetScrollBarSize } from \"rc-util/es/getScrollBarSize\";\nimport { isBodyOverflowing } from \"./util\";\nvar UNIQUE_ID = \"rc-util-locker-\".concat(Date.now());\nvar uuid = 0;\nexport default function useScrollLocker(lock) {\n var mergedLock = !!lock;\n var _React$useState = React.useState(function () {\n uuid += 1;\n return \"\".concat(UNIQUE_ID, \"_\").concat(uuid);\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n id = _React$useState2[0];\n useLayoutEffect(function () {\n if (mergedLock) {\n var scrollbarSize = getTargetScrollBarSize(document.body).width;\n var isOverflow = isBodyOverflowing();\n updateCSS(\"\\nhtml body {\\n overflow-y: hidden;\\n \".concat(isOverflow ? \"width: calc(100% - \".concat(scrollbarSize, \"px);\") : '', \"\\n}\"), id);\n } else {\n removeCSS(id);\n }\n return function () {\n removeCSS(id);\n };\n }, [mergedLock, id]);\n}","/**\n * Test usage export. Do not use in your production\n */\nexport function isBodyOverflowing() {\n return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;\n}","export var inline = false;\nexport function inlineMock(nextInline) {\n if (typeof nextInline === 'boolean') {\n inline = nextInline;\n }\n return inline;\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport warning from \"rc-util/es/warning\";\nimport { supportRef, useComposeRef } from \"rc-util/es/ref\";\nimport OrderContext from \"./Context\";\nimport useDom from \"./useDom\";\nimport useScrollLocker from \"./useScrollLocker\";\nimport { inlineMock } from \"./mock\";\nvar getPortalContainer = function getPortalContainer(getContainer) {\n if (getContainer === false) {\n return false;\n }\n if (!canUseDom() || !getContainer) {\n return null;\n }\n if (typeof getContainer === 'string') {\n return document.querySelector(getContainer);\n }\n if (typeof getContainer === 'function') {\n return getContainer();\n }\n return getContainer;\n};\nvar Portal = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var open = props.open,\n autoLock = props.autoLock,\n getContainer = props.getContainer,\n debug = props.debug,\n _props$autoDestroy = props.autoDestroy,\n autoDestroy = _props$autoDestroy === void 0 ? true : _props$autoDestroy,\n children = props.children;\n var _React$useState = React.useState(open),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n shouldRender = _React$useState2[0],\n setShouldRender = _React$useState2[1];\n var mergedRender = shouldRender || open;\n\n // ========================= Warning =========================\n if (process.env.NODE_ENV !== 'production') {\n warning(canUseDom() || !open, \"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR.\");\n }\n\n // ====================== Should Render ======================\n React.useEffect(function () {\n if (autoDestroy || open) {\n setShouldRender(open);\n }\n }, [open, autoDestroy]);\n\n // ======================== Container ========================\n var _React$useState3 = React.useState(function () {\n return getPortalContainer(getContainer);\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n innerContainer = _React$useState4[0],\n setInnerContainer = _React$useState4[1];\n React.useEffect(function () {\n var customizeContainer = getPortalContainer(getContainer);\n\n // Tell component that we check this in effect which is safe to be `null`\n setInnerContainer(customizeContainer !== null && customizeContainer !== void 0 ? customizeContainer : null);\n });\n var _useDom = useDom(mergedRender && !innerContainer, debug),\n _useDom2 = _slicedToArray(_useDom, 2),\n defaultContainer = _useDom2[0],\n queueCreate = _useDom2[1];\n var mergedContainer = innerContainer !== null && innerContainer !== void 0 ? innerContainer : defaultContainer;\n\n // ========================= Locker ==========================\n useScrollLocker(autoLock && open && canUseDom() && (mergedContainer === defaultContainer || mergedContainer === document.body));\n\n // =========================== Ref ===========================\n var childRef = null;\n if (children && supportRef(children) && ref) {\n var _ref = children;\n childRef = _ref.ref;\n }\n var mergedRef = useComposeRef(childRef, ref);\n\n // ========================= Render ==========================\n // Do not render when nothing need render\n // When innerContainer is `undefined`, it may not ready since user use ref in the same render\n if (!mergedRender || !canUseDom() || innerContainer === undefined) {\n return null;\n }\n\n // Render inline\n var renderInline = mergedContainer === false || inlineMock();\n var reffedChildren = children;\n if (ref) {\n reffedChildren = /*#__PURE__*/React.cloneElement(children, {\n ref: mergedRef\n });\n }\n return /*#__PURE__*/React.createElement(OrderContext.Provider, {\n value: queueCreate\n }, renderInline ? reffedChildren : /*#__PURE__*/createPortal(reffedChildren, mergedContainer));\n});\nif (process.env.NODE_ENV !== 'production') {\n Portal.displayName = 'Portal';\n}\nexport default Portal;","import Portal from \"./Portal\";\nimport { inlineMock } from \"./mock\";\nexport { inlineMock };\nexport default Portal;","const errors = {\n\t0: \"Illegal state\",\n\t1: \"Immer drafts cannot have computed properties\",\n\t2: \"This object has been frozen and should not be mutated\",\n\t3(data: any) {\n\t\treturn (\n\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\tdata\n\t\t)\n\t},\n\t4: \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t5: \"Immer forbids circular references\",\n\t6: \"The first or second argument to `produce` must be a function\",\n\t7: \"The third argument to `produce` must be a function or undefined\",\n\t8: \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t9: \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t10: \"The given draft is already finalized\",\n\t11: \"Object.defineProperty() cannot be used on an Immer draft\",\n\t12: \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t13: \"Immer only supports deleting array indices\",\n\t14: \"Immer only supports setting array indices and the 'length' property\",\n\t15(path: string) {\n\t\treturn \"Cannot apply patch, path doesn't resolve: \" + path\n\t},\n\t16: 'Sets cannot have \"replace\" patches.',\n\t17(op: string) {\n\t\treturn \"Unsupported patch operation: \" + op\n\t},\n\t18(plugin: string) {\n\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t},\n\t20: \"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available\",\n\t21(thing: string) {\n\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t},\n\t22(thing: string) {\n\t\treturn `'current' expects a draft, got: ${thing}`\n\t},\n\t23(thing: string) {\n\t\treturn `'original' expects a draft, got: ${thing}`\n\t},\n\t24: \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n} as const\n\nexport function die(error: keyof typeof errors, ...args: any[]): never {\n\tif (__DEV__) {\n\t\tconst e = errors[error]\n\t\tconst msg = !e\n\t\t\t? \"unknown error nr: \" + error\n\t\t\t: typeof e === \"function\"\n\t\t\t? e.apply(null, args as any)\n\t\t\t: e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}${\n\t\t\targs.length ? \" \" + args.map(s => `'${s}'`).join(\",\") : \"\"\n\t\t}. Find the full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\thasSet,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\thasMap,\n\tArchtype,\n\tdie\n} from \"../internal\"\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = Object.getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original(value: T): T | undefined\nexport function original(value: Drafted): any {\n\tif (!isDraft(value)) die(23, value)\n\treturn value[DRAFT_STATE].base_\n}\n\n/*#__PURE__*/\nexport const ownKeys: (target: AnyObject) => PropertyKey[] =\n\ttypeof Reflect !== \"undefined\" && Reflect.ownKeys\n\t\t? Reflect.ownKeys\n\t\t: typeof Object.getOwnPropertySymbols !== \"undefined\"\n\t\t? obj =>\n\t\t\t\tObject.getOwnPropertyNames(obj).concat(\n\t\t\t\t\tObject.getOwnPropertySymbols(obj) as any\n\t\t\t\t)\n\t\t: /* istanbul ignore next */ Object.getOwnPropertyNames\n\nexport const getOwnPropertyDescriptors =\n\tObject.getOwnPropertyDescriptors ||\n\tfunction getOwnPropertyDescriptors(target: any) {\n\t\t// Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n\t\tconst res: any = {}\n\t\townKeys(target).forEach(key => {\n\t\t\tres[key] = Object.getOwnPropertyDescriptor(target, key)\n\t\t})\n\t\treturn res\n\t}\n\nexport function each(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void,\n\tenumerableOnly?: boolean\n): void\nexport function each(obj: any, iter: any, enumerableOnly = false) {\n\tif (getArchtype(obj) === Archtype.Object) {\n\t\t;(enumerableOnly ? Object.keys : ownKeys)(obj).forEach(key => {\n\t\t\tif (!enumerableOnly || typeof key !== \"symbol\") iter(key, obj[key], obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): Archtype {\n\t/* istanbul ignore next */\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_ > 3\n\t\t\t? state.type_ - 4 // cause Object and Array map back from 4 and 5\n\t\t\t: (state.type_ as any) // others are the same\n\t\t: Array.isArray(thing)\n\t\t? Archtype.Array\n\t\t: isMap(thing)\n\t\t? Archtype.Map\n\t\t: isSet(thing)\n\t\t? Archtype.Set\n\t\t: Archtype.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === Archtype.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === Archtype.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === Archtype.Map) thing.set(propOrOldValue, value)\n\telse if (t === Archtype.Set) {\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn hasMap && target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn hasSet && target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any) {\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\tconst descriptors = getOwnPropertyDescriptors(base)\n\tdelete descriptors[DRAFT_STATE as any]\n\tlet keys = ownKeys(descriptors)\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key: any = keys[i]\n\t\tconst desc = descriptors[key]\n\t\tif (desc.writable === false) {\n\t\t\tdesc.writable = true\n\t\t\tdesc.configurable = true\n\t\t}\n\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t// with libraries that trap values, like mobx or vue\n\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\tif (desc.get || desc.set)\n\t\t\tdescriptors[key] = {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\tvalue: base[key]\n\t\t\t}\n\t}\n\treturn Object.create(Object.getPrototypeOf(base), descriptors)\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze(obj: T, deep?: boolean): T\nexport function freeze(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\tobj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections as any\n\t}\n\tObject.freeze(obj)\n\tif (deep) each(obj, (key, value) => freeze(value, true), true)\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\tif (obj == null || typeof obj !== \"object\") return true\n\t// See #600, IE dies on non-objects in Object.isFrozen\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tImmerScope,\n\tDrafted,\n\tAnyObject,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tProxyType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\tbase: any,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_(draft: T, patches: Patch[]): T\n\t}\n\tES5?: {\n\t\twillFinalizeES5_(scope: ImmerScope, result: any, isReplaced: boolean): void\n\t\tcreateES5Proxy_(\n\t\t\tbase: T,\n\t\t\tparent?: ImmerState\n\t\t): Drafted\n\t\thasChanges_(state: ES5ArrayState | ES5ObjectState): boolean\n\t}\n\tMapSet?: {\n\t\tproxyMap_(target: T, parent?: ImmerState): T\n\t\tproxySet_(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin(\n\tpluginKey: K\n): Exclude {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(18, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n\n/** ES5 Plugin */\n\ninterface ES5BaseState extends ImmerBaseState {\n\tassigned_: {[key: string]: any}\n\tparent_?: ImmerState\n\trevoked_: boolean\n}\n\nexport interface ES5ObjectState extends ES5BaseState {\n\ttype_: ProxyType.ES5Object\n\tdraft_: Drafted\n\tbase_: AnyObject\n\tcopy_: AnyObject | null\n}\n\nexport interface ES5ArrayState extends ES5BaseState {\n\ttype_: ProxyType.ES5Array\n\tdraft_: Drafted\n\tbase_: any\n\tcopy_: any\n}\n\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ProxyType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ProxyType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tProxyType,\n\tgetPlugin\n} from \"../internal\"\nimport {die} from \"../utils/errors\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\tif (__DEV__ && !currentScope) die(0)\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (\n\t\tstate.type_ === ProxyType.ProxyObject ||\n\t\tstate.type_ === ProxyType.ProxyArray\n\t)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tProxyType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen,\n\tshallowCopy\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (!scope.immer_.useProxies_)\n\t\tgetPlugin(\"ES5\").willFinalizeES5_(scope, result, isReplaced)\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE].base_,\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(\n\t\t\tvalue,\n\t\t\t(key, childValue) =>\n\t\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path),\n\t\t\ttrue // See #590, don't recurse into non-enumerable of non drafted objects\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result =\n\t\t\t// For ES5, create a good copy from the draft first, with added keys and without deleted keys.\n\t\t\tstate.type_ === ProxyType.ES5Object || state.type_ === ProxyType.ES5Array\n\t\t\t\t? (state.copy_ = shallowCopy(state.draft_))\n\t\t\t\t: state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// To preserve insertion order in all cases we then clear the set\n\t\t// And we let finalizeProperty know it needs to re-add non-draft children back to the target\n\t\tlet resultEach = result\n\t\tlet isSet = false\n\t\tif (state.type_ === ProxyType.Set) {\n\t\t\tresultEach = new Set(result)\n\t\t\tresult.clear()\n\t\t\tisSet = true\n\t\t}\n\t\teach(resultEach, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path, isSet)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath,\n\ttargetIsSet?: boolean\n) {\n\tif (__DEV__ && childValue === targetObject) die(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ProxyType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t} else if (targetIsSet) {\n\t\ttargetObject.add(childValue)\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\tif (!parentState || !parentState.scope_.parent_)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\t// we never freeze for a non-root scope; as it would prevent pruning for drafts inside wrapping objects\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tProxyType\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ProxyType.ProxyObject\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ProxyType.ProxyArray\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ProxyType.ProxyArray : (ProxyType.ProxyObject as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nexport const objectTraps: ProxyHandler = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\n\t\tconst source = latest(state)\n\t\tif (!has(source, prop)) {\n\t\t\t// non-existing or non-own property...\n\t\t\treturn readPropFromProto(state, source, prop)\n\t\t}\n\t\tconst value = source[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\t\t// Check for existing draft in modified state.\n\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\tif (value === peek(state.base_, prop)) {\n\t\t\tprepareCopy(state)\n\t\t\treturn (state.copy_![prop as any] = createProxy(\n\t\t\t\tstate.scope_.immer_,\n\t\t\t\tvalue,\n\t\t\t\tstate\n\t\t\t))\n\t\t}\n\t\treturn value\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(\n\t\tstate: ProxyObjectState,\n\t\tprop: string /* strictly not, but helps TS */,\n\t\tvalue\n\t) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop)\n\t\tif (desc?.set) {\n\t\t\t// special case: if this write is captured by a setter, we have\n\t\t\t// to trigger it with the correct context\n\t\t\tdesc.set.call(state.draft_, value)\n\t\t\treturn true\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\t// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)\n\t\t\t// from setting an existing property with value undefined to undefined (which is not a change)\n\t\t\tconst current = peek(latest(state), prop)\n\t\t\t// special case, if we assigning the original value to a draft, we can ignore the assignment\n\t\t\tconst currentState: ProxyObjectState = current?.[DRAFT_STATE]\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_![prop] = value\n\t\t\t\tstate.assigned_[prop] = false\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (is(value, current) && (value !== undefined || has(state.base_, prop)))\n\t\t\t\treturn true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t}\n\n\t\tif (\n\t\t\t(state.copy_![prop] === value &&\n\t\t\t\t// special case: handle new props with value 'undefined'\n\t\t\t\t(value !== undefined || prop in state.copy_)) ||\n\t\t\t// special case: NaN\n\t\t\t(Number.isNaN(value) && Number.isNaN(state.copy_![prop]))\n\t\t)\n\t\t\treturn true\n\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\tstate.assigned_[prop] = true\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\t// @ts-ignore\n\t\tif (state.copy_) delete state.copy_[prop]\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (!desc) return desc\n\t\treturn {\n\t\t\twritable: true,\n\t\t\tconfigurable: state.type_ !== ProxyType.ProxyArray || prop !== \"length\",\n\t\t\tenumerable: desc.enumerable,\n\t\t\tvalue: owner[prop]\n\t\t}\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn Object.getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (__DEV__ && isNaN(parseInt(prop as any))) die(13)\n\t// @ts-ignore\n\treturn arrayTraps.set!.call(this, state, prop, undefined)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (__DEV__ && prop !== \"length\" && isNaN(parseInt(prop as any))) die(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey) {\n\tconst state = draft[DRAFT_STATE]\n\tconst source = state ? latest(state) : draft\n\treturn source[prop]\n}\n\nfunction readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {\n\tconst desc = getDescriptorFromProto(source, prop)\n\treturn desc\n\t\t? `value` in desc\n\t\t\t? desc.value\n\t\t\t: // This is a very special case, if the prop is a getter defined by the\n\t\t\t // prototype, we should invoke it with the draft as context!\n\t\t\t desc.get?.call(state.draft_)\n\t\t: undefined\n}\n\nfunction getDescriptorFromProto(\n\tsource: any,\n\tprop: PropertyKey\n): PropertyDescriptor | undefined {\n\t// 'in' checks proto!\n\tif (!(prop in source)) return undefined\n\tlet proto = Object.getPrototypeOf(source)\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop)\n\t\tif (desc) return desc\n\t\tproto = Object.getPrototypeOf(proto)\n\t}\n\treturn undefined\n}\n\nexport function markChanged(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (state.parent_) {\n\t\t\tmarkChanged(state.parent_)\n\t\t}\n\t}\n}\n\nexport function prepareCopy(state: {base_: any; copy_: any}) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(state.base_)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tcreateProxyProxy,\n\tgetPlugin,\n\tdie,\n\thasProxies,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope,\n\tNOTHING,\n\tfreeze,\n\tcurrent\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport class Immer implements ProducersFns {\n\tuseProxies_: boolean = hasProxies\n\n\tautoFreeze_: boolean = true\n\n\tconstructor(config?: {useProxies?: boolean; autoFreeze?: boolean}) {\n\t\tif (typeof config?.useProxies === \"boolean\")\n\t\t\tthis.setUseProxies(config!.useProxies)\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce: IProduce = (base: any, recipe?: any, patchListener?: any) => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(this, base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tif (typeof Promise !== \"undefined\" && result instanceof Promise) {\n\t\t\t\treturn result.then(\n\t\t\t\t\tresult => {\n\t\t\t\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\t\t\t\treturn processResult(result, scope)\n\t\t\t\t\t},\n\t\t\t\t\terror => {\n\t\t\t\t\t\trevokeScope(scope)\n\t\t\t\t\t\tthrow error\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else if (!base || typeof base !== \"object\") {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === undefined) result = base\n\t\t\tif (result === NOTHING) result = undefined\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\tif (patchListener) {\n\t\t\t\tconst p: Patch[] = []\n\t\t\t\tconst ip: Patch[] = []\n\t\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip)\n\t\t\t\tpatchListener(p, ip)\n\t\t\t}\n\t\t\treturn result\n\t\t} else die(21, base)\n\t}\n\n\tproduceWithPatches: IProduceWithPatches = (base: any, recipe?: any): any => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => base(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst result = this.produce(base, recipe, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\n\t\tif (typeof Promise !== \"undefined\" && result instanceof Promise) {\n\t\t\treturn result.then(nextState => [nextState, patches!, inversePatches!])\n\t\t}\n\t\treturn [result, patches!, inversePatches!]\n\t}\n\n\tcreateDraft(base: T): Draft {\n\t\tif (!isDraftable(base)) die(8)\n\t\tif (isDraft(base)) base = current(base)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(this, base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft ? T : never {\n\t\tconst state: ImmerState = draft && (draft as any)[DRAFT_STATE]\n\t\tif (__DEV__) {\n\t\t\tif (!state || !state.isManual_) die(9)\n\t\t\tif (state.finalized_) die(10)\n\t\t}\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is enabled.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n\t * always faster than using ES5 proxies.\n\t *\n\t * By default, feature detection is used, so calling this is rarely necessary.\n\t */\n\tsetUseProxies(value: boolean) {\n\t\tif (value && !hasProxies) {\n\t\t\tdie(20)\n\t\t}\n\t\tthis.useProxies_ = value\n\t}\n\n\tapplyPatches(base: T, patches: Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}\n}\n\nexport function createProxy(\n\timmer: Immer,\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: immer.useProxies_\n\t\t? createProxyProxy(value, parent)\n\t\t: getPlugin(\"ES5\").createES5Proxy_(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n","import {\n\tdie,\n\tisDraft,\n\tshallowCopy,\n\teach,\n\tDRAFT_STATE,\n\tget,\n\tset,\n\tImmerState,\n\tisDraftable,\n\tArchtype,\n\tgetArchtype,\n\tgetPlugin\n} from \"../internal\"\n\n/** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */\nexport function current(value: T): T\nexport function current(value: any): any {\n\tif (!isDraft(value)) die(22, value)\n\treturn currentImpl(value)\n}\n\nfunction currentImpl(value: any): any {\n\tif (!isDraftable(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tconst archType = getArchtype(value)\n\tif (state) {\n\t\tif (\n\t\t\t!state.modified_ &&\n\t\t\t(state.type_ < 4 || !getPlugin(\"ES5\").hasChanges_(state as any))\n\t\t)\n\t\t\treturn state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = copyHelper(value, archType)\n\t\tstate.finalized_ = false\n\t} else {\n\t\tcopy = copyHelper(value, archType)\n\t}\n\n\teach(copy, (key, childValue) => {\n\t\tif (state && get(state.base_, key) === childValue) return // no need to copy or search in something that didn't change\n\t\tset(copy, key, currentImpl(childValue))\n\t})\n\t// In the future, we might consider freezing here, based on the current settings\n\treturn archType === Archtype.Set ? new Set(copy) : copy\n}\n\nfunction copyHelper(value: any, archType: number): any {\n\t// creates a shallow copy, even if it is a map or set\n\tswitch (archType) {\n\t\tcase Archtype.Map:\n\t\t\treturn new Map(value)\n\t\tcase Archtype.Set:\n\t\t\t// Set will be cloned as array temporarily, so that we can replace individual items\n\t\t\treturn Array.from(value)\n\t}\n\treturn shallowCopy(value)\n}\n","import {\n\tImmerState,\n\tDrafted,\n\tES5ArrayState,\n\tES5ObjectState,\n\teach,\n\thas,\n\tisDraft,\n\tlatest,\n\tDRAFT_STATE,\n\tis,\n\tloadPlugin,\n\tImmerScope,\n\tProxyType,\n\tgetCurrentScope,\n\tdie,\n\tmarkChanged,\n\tobjectTraps,\n\townKeys,\n\tgetOwnPropertyDescriptors\n} from \"../internal\"\n\ntype ES5State = ES5ArrayState | ES5ObjectState\n\nexport function enableES5() {\n\tfunction willFinalizeES5_(\n\t\tscope: ImmerScope,\n\t\tresult: any,\n\t\tisReplaced: boolean\n\t) {\n\t\tif (!isReplaced) {\n\t\t\tif (scope.patches_) {\n\t\t\t\tmarkChangesRecursively(scope.drafts_![0])\n\t\t\t}\n\t\t\t// This is faster when we don't care about which attributes changed.\n\t\t\tmarkChangesSweep(scope.drafts_)\n\t\t}\n\t\t// When a child draft is returned, look for changes.\n\t\telse if (\n\t\t\tisDraft(result) &&\n\t\t\t(result[DRAFT_STATE] as ES5State).scope_ === scope\n\t\t) {\n\t\t\tmarkChangesSweep(scope.drafts_)\n\t\t}\n\t}\n\n\tfunction createES5Draft(isArray: boolean, base: any) {\n\t\tif (isArray) {\n\t\t\tconst draft = new Array(base.length)\n\t\t\tfor (let i = 0; i < base.length; i++)\n\t\t\t\tObject.defineProperty(draft, \"\" + i, proxyProperty(i, true))\n\t\t\treturn draft\n\t\t} else {\n\t\t\tconst descriptors = getOwnPropertyDescriptors(base)\n\t\t\tdelete descriptors[DRAFT_STATE as any]\n\t\t\tconst keys = ownKeys(descriptors)\n\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\tconst key: any = keys[i]\n\t\t\t\tdescriptors[key] = proxyProperty(\n\t\t\t\t\tkey,\n\t\t\t\t\tisArray || !!descriptors[key].enumerable\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn Object.create(Object.getPrototypeOf(base), descriptors)\n\t\t}\n\t}\n\n\tfunction createES5Proxy_(\n\t\tbase: T,\n\t\tparent?: ImmerState\n\t): Drafted {\n\t\tconst isArray = Array.isArray(base)\n\t\tconst draft = createES5Draft(isArray, base)\n\n\t\tconst state: ES5ObjectState | ES5ArrayState = {\n\t\t\ttype_: isArray ? ProxyType.ES5Array : (ProxyType.ES5Object as any),\n\t\t\tscope_: parent ? parent.scope_ : getCurrentScope(),\n\t\t\tmodified_: false,\n\t\t\tfinalized_: false,\n\t\t\tassigned_: {},\n\t\t\tparent_: parent,\n\t\t\t// base is the object we are drafting\n\t\t\tbase_: base,\n\t\t\t// draft is the draft object itself, that traps all reads and reads from either the base (if unmodified) or copy (if modified)\n\t\t\tdraft_: draft,\n\t\t\tcopy_: null,\n\t\t\trevoked_: false,\n\t\t\tisManual_: false\n\t\t}\n\n\t\tObject.defineProperty(draft, DRAFT_STATE, {\n\t\t\tvalue: state,\n\t\t\t// enumerable: false <- the default\n\t\t\twritable: true\n\t\t})\n\t\treturn draft\n\t}\n\n\t// property descriptors are recycled to make sure we don't create a get and set closure per property,\n\t// but share them all instead\n\tconst descriptors: {[prop: string]: PropertyDescriptor} = {}\n\n\tfunction proxyProperty(\n\t\tprop: string | number,\n\t\tenumerable: boolean\n\t): PropertyDescriptor {\n\t\tlet desc = descriptors[prop]\n\t\tif (desc) {\n\t\t\tdesc.enumerable = enumerable\n\t\t} else {\n\t\t\tdescriptors[prop] = desc = {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable,\n\t\t\t\tget(this: any) {\n\t\t\t\t\tconst state = this[DRAFT_STATE]\n\t\t\t\t\tif (__DEV__) assertUnrevoked(state)\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn objectTraps.get(state, prop)\n\t\t\t\t},\n\t\t\t\tset(this: any, value) {\n\t\t\t\t\tconst state = this[DRAFT_STATE]\n\t\t\t\t\tif (__DEV__) assertUnrevoked(state)\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tobjectTraps.set(state, prop, value)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn desc\n\t}\n\n\t// This looks expensive, but only proxies are visited, and only objects without known changes are scanned.\n\tfunction markChangesSweep(drafts: Drafted[]) {\n\t\t// The natural order of drafts in the `scope` array is based on when they\n\t\t// were accessed. By processing drafts in reverse natural order, we have a\n\t\t// better chance of processing leaf nodes first. When a leaf node is known to\n\t\t// have changed, we can avoid any traversal of its ancestor nodes.\n\t\tfor (let i = drafts.length - 1; i >= 0; i--) {\n\t\t\tconst state: ES5State = drafts[i][DRAFT_STATE]\n\t\t\tif (!state.modified_) {\n\t\t\t\tswitch (state.type_) {\n\t\t\t\t\tcase ProxyType.ES5Array:\n\t\t\t\t\t\tif (hasArrayChanges(state)) markChanged(state)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase ProxyType.ES5Object:\n\t\t\t\t\t\tif (hasObjectChanges(state)) markChanged(state)\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction markChangesRecursively(object: any) {\n\t\tif (!object || typeof object !== \"object\") return\n\t\tconst state: ES5State | undefined = object[DRAFT_STATE]\n\t\tif (!state) return\n\t\tconst {base_, draft_, assigned_, type_} = state\n\t\tif (type_ === ProxyType.ES5Object) {\n\t\t\t// Look for added keys.\n\t\t\t// probably there is a faster way to detect changes, as sweep + recurse seems to do some\n\t\t\t// unnecessary work.\n\t\t\t// also: probably we can store the information we detect here, to speed up tree finalization!\n\t\t\teach(draft_, key => {\n\t\t\t\tif ((key as any) === DRAFT_STATE) return\n\t\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\t\tif ((base_ as any)[key] === undefined && !has(base_, key)) {\n\t\t\t\t\tassigned_[key] = true\n\t\t\t\t\tmarkChanged(state)\n\t\t\t\t} else if (!assigned_[key]) {\n\t\t\t\t\t// Only untouched properties trigger recursion.\n\t\t\t\t\tmarkChangesRecursively(draft_[key])\n\t\t\t\t}\n\t\t\t})\n\t\t\t// Look for removed keys.\n\t\t\teach(base_, key => {\n\t\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\t\tif (draft_[key] === undefined && !has(draft_, key)) {\n\t\t\t\t\tassigned_[key] = false\n\t\t\t\t\tmarkChanged(state)\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (type_ === ProxyType.ES5Array) {\n\t\t\tif (hasArrayChanges(state as ES5ArrayState)) {\n\t\t\t\tmarkChanged(state)\n\t\t\t\tassigned_.length = true\n\t\t\t}\n\n\t\t\tif (draft_.length < base_.length) {\n\t\t\t\tfor (let i = draft_.length; i < base_.length; i++) assigned_[i] = false\n\t\t\t} else {\n\t\t\t\tfor (let i = base_.length; i < draft_.length; i++) assigned_[i] = true\n\t\t\t}\n\n\t\t\t// Minimum count is enough, the other parts has been processed.\n\t\t\tconst min = Math.min(draft_.length, base_.length)\n\n\t\t\tfor (let i = 0; i < min; i++) {\n\t\t\t\t// Only untouched indices trigger recursion.\n\t\t\t\tif (!draft_.hasOwnProperty(i)) {\n\t\t\t\t\tassigned_[i] = true\n\t\t\t\t}\n\t\t\t\tif (assigned_[i] === undefined) markChangesRecursively(draft_[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasObjectChanges(state: ES5ObjectState) {\n\t\tconst {base_, draft_} = state\n\n\t\t// Search for added keys and changed keys. Start at the back, because\n\t\t// non-numeric keys are ordered by time of definition on the object.\n\t\tconst keys = ownKeys(draft_)\n\t\tfor (let i = keys.length - 1; i >= 0; i--) {\n\t\t\tconst key: any = keys[i]\n\t\t\tif (key === DRAFT_STATE) continue\n\t\t\tconst baseValue = base_[key]\n\t\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\t\tif (baseValue === undefined && !has(base_, key)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\t// Once a base key is deleted, future changes go undetected, because its\n\t\t\t// descriptor is erased. This branch detects any missed changes.\n\t\t\telse {\n\t\t\t\tconst value = draft_[key]\n\t\t\t\tconst state: ImmerState = value && value[DRAFT_STATE]\n\t\t\t\tif (state ? state.base_ !== baseValue : !is(value, baseValue)) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At this point, no keys were added or changed.\n\t\t// Compare key count to determine if keys were deleted.\n\t\tconst baseIsDraft = !!base_[DRAFT_STATE as any]\n\t\treturn keys.length !== ownKeys(base_).length + (baseIsDraft ? 0 : 1) // + 1 to correct for DRAFT_STATE\n\t}\n\n\tfunction hasArrayChanges(state: ES5ArrayState) {\n\t\tconst {draft_} = state\n\t\tif (draft_.length !== state.base_.length) return true\n\t\t// See #116\n\t\t// If we first shorten the length, our array interceptors will be removed.\n\t\t// If after that new items are added, result in the same original length,\n\t\t// those last items will have no intercepting property.\n\t\t// So if there is no own descriptor on the last position, we know that items were removed and added\n\t\t// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check\n\t\t// the last one\n\t\t// last descriptor can be not a trap, if the array was extended\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(\n\t\t\tdraft_,\n\t\t\tdraft_.length - 1\n\t\t)\n\t\t// descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)\n\t\tif (descriptor && !descriptor.get) return true\n\t\t// if we miss a property, it has been deleted, so array probobaly changed\n\t\tfor (let i = 0; i < draft_.length; i++) {\n\t\t\tif (!draft_.hasOwnProperty(i)) return true\n\t\t}\n\t\t// For all other cases, we don't have to compare, as they would have been picked up by the index setters\n\t\treturn false\n\t}\n\n\tfunction hasChanges_(state: ES5State) {\n\t\treturn state.type_ === ProxyType.ES5Object\n\t\t\t? hasObjectChanges(state)\n\t\t\t: hasArrayChanges(state)\n\t}\n\n\tfunction assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {\n\t\tif (state.revoked_) die(3, JSON.stringify(latest(state)))\n\t}\n\n\tloadPlugin(\"ES5\", {\n\t\tcreateES5Proxy_,\n\t\twillFinalizeES5_,\n\t\thasChanges_\n\t})\n}\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\toriginal,\n\tcurrent,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable,\n\tfreeze\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = immer.produce\nexport default produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * Always freeze by default, even in production mode\n */\nexport const setAutoFreeze = immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to use the ES2015 `Proxy` class when creating drafts, which is\n * always faster than using ES5 proxies.\n *\n * By default, feature detection is used, so calling this is rarely necessary.\n */\nexport const setUseProxies = immer.setUseProxies.bind(immer)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft(value: T): Draft {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable(value: T): Immutable {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enableES5} from \"./plugins/es5\"\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\nexport {enableAllPlugins} from \"./plugins/all\"\n","// Should be no imports here!\n\n// Some things that should be evaluated before all else...\n\n// We only want to know if non-polyfilled symbols are available\nconst hasSymbol =\n\ttypeof Symbol !== \"undefined\" && typeof Symbol(\"x\") === \"symbol\"\nexport const hasMap = typeof Map !== \"undefined\"\nexport const hasSet = typeof Set !== \"undefined\"\nexport const hasProxies =\n\ttypeof Proxy !== \"undefined\" &&\n\ttypeof Proxy.revocable !== \"undefined\" &&\n\ttypeof Reflect !== \"undefined\"\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: Nothing = hasSymbol\n\t? Symbol.for(\"immer-nothing\")\n\t: ({[\"immer-nothing\"]: true} as any)\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = hasSymbol\n\t? Symbol.for(\"immer-draftable\")\n\t: (\"__$immer_draftable\" as any)\n\nexport const DRAFT_STATE: unique symbol = hasSymbol\n\t? Symbol.for(\"immer-state\")\n\t: (\"__$immer_state\" as any)\n\n// Even a polyfilled Symbol might provide Symbol.iterator\nexport const iteratorSymbol: typeof Symbol.iterator =\n\t(typeof Symbol != \"undefined\" && Symbol.iterator) || (\"@@iterator\" as any)\n\n/** Use a class type for `nothing` so its type is unique */\nexport class Nothing {\n\t// This lets us do `Exclude`\n\t// @ts-ignore\n\tprivate _!: unique symbol\n}\n","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","import type { Action, ActionCreator, StoreEnhancer } from 'redux'\r\nimport { compose } from 'redux'\r\n\r\n/**\r\n * @public\r\n */\r\nexport interface DevToolsEnhancerOptions {\r\n /**\r\n * the instance name to be showed on the monitor page. Default value is `document.title`.\r\n * If not specified and there's no document title, it will consist of `tabId` and `instanceId`.\r\n */\r\n name?: string\r\n /**\r\n * action creators functions to be available in the Dispatcher.\r\n */\r\n actionCreators?: ActionCreator[] | { [key: string]: ActionCreator }\r\n /**\r\n * if more than one action is dispatched in the indicated interval, all new actions will be collected and sent at once.\r\n * It is the joint between performance and speed. When set to `0`, all actions will be sent instantly.\r\n * Set it to a higher value when experiencing perf issues (also `maxAge` to a lower value).\r\n *\r\n * @default 500 ms.\r\n */\r\n latency?: number\r\n /**\r\n * (> 1) - maximum allowed actions to be stored in the history tree. The oldest actions are removed once maxAge is reached. It's critical for performance.\r\n *\r\n * @default 50\r\n */\r\n maxAge?: number\r\n /**\r\n * Customizes how actions and state are serialized and deserialized. Can be a boolean or object. If given a boolean, the behavior is the same as if you\r\n * were to pass an object and specify `options` as a boolean. Giving an object allows fine-grained customization using the `replacer` and `reviver`\r\n * functions.\r\n */\r\n serialize?:\r\n | boolean\r\n | {\r\n /**\r\n * - `undefined` - will use regular `JSON.stringify` to send data (it's the fast mode).\r\n * - `false` - will handle also circular references.\r\n * - `true` - will handle also date, regex, undefined, error objects, symbols, maps, sets and functions.\r\n * - object, which contains `date`, `regex`, `undefined`, `error`, `symbol`, `map`, `set` and `function` keys.\r\n * For each of them you can indicate if to include (by setting as `true`).\r\n * For `function` key you can also specify a custom function which handles serialization.\r\n * See [`jsan`](https://github.com/kolodny/jsan) for more details.\r\n */\r\n options?:\r\n | undefined\r\n | boolean\r\n | {\r\n date?: true\r\n regex?: true\r\n undefined?: true\r\n error?: true\r\n symbol?: true\r\n map?: true\r\n set?: true\r\n function?: true | ((fn: (...args: any[]) => any) => string)\r\n }\r\n /**\r\n * [JSON replacer function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) used for both actions and states stringify.\r\n * In addition, you can specify a data type by adding a [`__serializedType__`](https://github.com/zalmoxisus/remotedev-serialize/blob/master/helpers/index.js#L4)\r\n * key. So you can deserialize it back while importing or persisting data.\r\n * Moreover, it will also [show a nice preview showing the provided custom type](https://cloud.githubusercontent.com/assets/7957859/21814330/a17d556a-d761-11e6-85ef-159dd12f36c5.png):\r\n */\r\n replacer?: (key: string, value: unknown) => any\r\n /**\r\n * [JSON `reviver` function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter)\r\n * used for parsing the imported actions and states. See [`remotedev-serialize`](https://github.com/zalmoxisus/remotedev-serialize/blob/master/immutable/serialize.js#L8-L41)\r\n * as an example on how to serialize special data types and get them back.\r\n */\r\n reviver?: (key: string, value: unknown) => any\r\n /**\r\n * Automatically serialize/deserialize immutablejs via [remotedev-serialize](https://github.com/zalmoxisus/remotedev-serialize).\r\n * Just pass the Immutable library. It will support all ImmutableJS structures. You can even export them into a file and get them back.\r\n * The only exception is `Record` class, for which you should pass this in addition the references to your classes in `refs`.\r\n */\r\n immutable?: any\r\n /**\r\n * ImmutableJS `Record` classes used to make possible restore its instances back when importing, persisting...\r\n */\r\n refs?: any\r\n }\r\n /**\r\n * function which takes `action` object and id number as arguments, and should return `action` object back.\r\n */\r\n actionSanitizer?: (action: A, id: number) => A\r\n /**\r\n * function which takes `state` object and index as arguments, and should return `state` object back.\r\n */\r\n stateSanitizer?: (state: S, index: number) => S\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.\r\n * @deprecated Use actionsDenylist instead.\r\n */\r\n actionsBlacklist?: string | string[]\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.\r\n * @deprecated Use actionsAllowlist instead.\r\n */\r\n actionsWhitelist?: string | string[]\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsAllowlist` specified, `actionsDenylist` is ignored.\r\n */\r\n actionsDenylist?: string | string[]\r\n /**\r\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\r\n * If `actionsAllowlist` specified, `actionsDenylist` is ignored.\r\n */\r\n actionsAllowlist?: string | string[]\r\n /**\r\n * called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor.\r\n * Use it as a more advanced version of `actionsDenylist`/`actionsAllowlist` parameters.\r\n */\r\n predicate?: (state: S, action: A) => boolean\r\n /**\r\n * if specified as `false`, it will not record the changes till clicking on `Start recording` button.\r\n * Available only for Redux enhancer, for others use `autoPause`.\r\n *\r\n * @default true\r\n */\r\n shouldRecordChanges?: boolean\r\n /**\r\n * if specified, whenever clicking on `Pause recording` button and there are actions in the history log, will add this action type.\r\n * If not specified, will commit when paused. Available only for Redux enhancer.\r\n *\r\n * @default \"@@PAUSED\"\"\r\n */\r\n pauseActionType?: string\r\n /**\r\n * auto pauses when the extension’s window is not opened, and so has zero impact on your app when not in use.\r\n * Not available for Redux enhancer (as it already does it but storing the data to be sent).\r\n *\r\n * @default false\r\n */\r\n autoPause?: boolean\r\n /**\r\n * if specified as `true`, it will not allow any non-monitor actions to be dispatched till clicking on `Unlock changes` button.\r\n * Available only for Redux enhancer.\r\n *\r\n * @default false\r\n */\r\n shouldStartLocked?: boolean\r\n /**\r\n * if set to `false`, will not recompute the states on hot reloading (or on replacing the reducers). Available only for Redux enhancer.\r\n *\r\n * @default true\r\n */\r\n shouldHotReload?: boolean\r\n /**\r\n * if specified as `true`, whenever there's an exception in reducers, the monitors will show the error message, and next actions will not be dispatched.\r\n *\r\n * @default false\r\n */\r\n shouldCatchErrors?: boolean\r\n /**\r\n * If you want to restrict the extension, specify the features you allow.\r\n * If not specified, all of the features are enabled. When set as an object, only those included as `true` will be allowed.\r\n * Note that except `true`/`false`, `import` and `export` can be set as `custom` (which is by default for Redux enhancer), meaning that the importing/exporting occurs on the client side.\r\n * Otherwise, you'll get/set the data right from the monitor part.\r\n */\r\n features?: {\r\n /**\r\n * start/pause recording of dispatched actions\r\n */\r\n pause?: boolean\r\n /**\r\n * lock/unlock dispatching actions and side effects\r\n */\r\n lock?: boolean\r\n /**\r\n * persist states on page reloading\r\n */\r\n persist?: boolean\r\n /**\r\n * export history of actions in a file\r\n */\r\n export?: boolean | 'custom'\r\n /**\r\n * import history of actions from a file\r\n */\r\n import?: boolean | 'custom'\r\n /**\r\n * jump back and forth (time travelling)\r\n */\r\n jump?: boolean\r\n /**\r\n * skip (cancel) actions\r\n */\r\n skip?: boolean\r\n /**\r\n * drag and drop actions in the history list\r\n */\r\n reorder?: boolean\r\n /**\r\n * dispatch custom actions or action creators\r\n */\r\n dispatch?: boolean\r\n /**\r\n * generate tests for the selected actions\r\n */\r\n test?: boolean\r\n }\r\n /**\r\n * Set to true or a stacktrace-returning function to record call stack traces for dispatched actions.\r\n * Defaults to false.\r\n */\r\n trace?: boolean | ((action: A) => string)\r\n /**\r\n * The maximum number of stack trace entries to record per action. Defaults to 10.\r\n */\r\n traceLimit?: number\r\n}\r\n\r\ntype Compose = typeof compose\r\n\r\ninterface ComposeWithDevTools {\r\n (options: DevToolsEnhancerOptions): Compose\r\n (...funcs: StoreEnhancer[]): StoreEnhancer\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport const composeWithDevTools: ComposeWithDevTools =\r\n typeof window !== 'undefined' &&\r\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n ? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n : function () {\r\n if (arguments.length === 0) return undefined\r\n if (typeof arguments[0] === 'object') return compose\r\n return compose.apply(null, arguments as any as Function[])\r\n }\r\n\r\n/**\r\n * @public\r\n */\r\nexport const devToolsEnhancer: {\r\n (options: DevToolsEnhancerOptions): StoreEnhancer\r\n} =\r\n typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION__\r\n ? (window as any).__REDUX_DEVTOOLS_EXTENSION__\r\n : function () {\r\n return function (noop) {\r\n return noop\r\n }\r\n }\r\n","/**\r\n * Returns true if the passed value is \"plain\" object, i.e. an object whose\r\n * prototype is the root `Object.prototype`. This includes objects created\r\n * using object literals, but not for instance for class instances.\r\n *\r\n * @param {any} value The value to inspect.\r\n * @returns {boolean} True if the argument appears to be a plain object.\r\n *\r\n * @public\r\n */\r\nexport default function isPlainObject(value: unknown): value is object {\r\n if (typeof value !== 'object' || value === null) return false\r\n\r\n let proto = Object.getPrototypeOf(value)\r\n if (proto === null) return true\r\n\r\n let baseProto = proto\r\n while (Object.getPrototypeOf(baseProto) !== null) {\r\n baseProto = Object.getPrototypeOf(baseProto)\r\n }\r\n\r\n return proto === baseProto\r\n}\r\n","import createNextState, { isDraftable } from 'immer'\r\nimport type { Middleware, StoreEnhancer } from 'redux'\r\n\r\nexport function getTimeMeasureUtils(maxDelay: number, fnName: string) {\r\n let elapsed = 0\r\n return {\r\n measureTime(fn: () => T): T {\r\n const started = Date.now()\r\n try {\r\n return fn()\r\n } finally {\r\n const finished = Date.now()\r\n elapsed += finished - started\r\n }\r\n },\r\n warnIfExceeded() {\r\n if (elapsed > maxDelay) {\r\n console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. \r\nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\r\nIt is disabled in production builds, so you don't need to worry about that.`)\r\n }\r\n },\r\n }\r\n}\r\n\r\nexport function delay(ms: number) {\r\n return new Promise((resolve) => setTimeout(resolve, ms))\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class MiddlewareArray<\r\n Middlewares extends Middleware[]\r\n> extends Array {\r\n constructor(...items: Middlewares)\r\n constructor(...args: any[]) {\r\n super(...args)\r\n Object.setPrototypeOf(this, MiddlewareArray.prototype)\r\n }\r\n\r\n static get [Symbol.species]() {\r\n return MiddlewareArray as any\r\n }\r\n\r\n concat>>(\r\n items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...Middlewares, ...AdditionalMiddlewares]>\r\n\r\n concat>>(\r\n ...items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...Middlewares, ...AdditionalMiddlewares]>\r\n concat(...arr: any[]) {\r\n return super.concat.apply(this, arr)\r\n }\r\n\r\n prepend>>(\r\n items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...AdditionalMiddlewares, ...Middlewares]>\r\n\r\n prepend>>(\r\n ...items: AdditionalMiddlewares\r\n ): MiddlewareArray<[...AdditionalMiddlewares, ...Middlewares]>\r\n\r\n prepend(...arr: any[]) {\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new MiddlewareArray(...arr[0].concat(this))\r\n }\r\n return new MiddlewareArray(...arr.concat(this))\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class EnhancerArray<\r\n Enhancers extends StoreEnhancer[]\r\n> extends Array {\r\n constructor(...items: Enhancers)\r\n constructor(...args: any[]) {\r\n super(...args)\r\n Object.setPrototypeOf(this, EnhancerArray.prototype)\r\n }\r\n\r\n static get [Symbol.species]() {\r\n return EnhancerArray as any\r\n }\r\n\r\n concat>>(\r\n items: AdditionalEnhancers\r\n ): EnhancerArray<[...Enhancers, ...AdditionalEnhancers]>\r\n\r\n concat>>(\r\n ...items: AdditionalEnhancers\r\n ): EnhancerArray<[...Enhancers, ...AdditionalEnhancers]>\r\n concat(...arr: any[]) {\r\n return super.concat.apply(this, arr)\r\n }\r\n\r\n prepend>>(\r\n items: AdditionalEnhancers\r\n ): EnhancerArray<[...AdditionalEnhancers, ...Enhancers]>\r\n\r\n prepend>>(\r\n ...items: AdditionalEnhancers\r\n ): EnhancerArray<[...AdditionalEnhancers, ...Enhancers]>\r\n\r\n prepend(...arr: any[]) {\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new EnhancerArray(...arr[0].concat(this))\r\n }\r\n return new EnhancerArray(...arr.concat(this))\r\n }\r\n}\r\n\r\nexport function freezeDraftable(val: T) {\r\n return isDraftable(val) ? createNextState(val, () => {}) : val\r\n}\r\n","import type { Middleware, AnyAction } from 'redux'\r\nimport type { ThunkMiddleware } from 'redux-thunk'\r\nimport thunkMiddleware from 'redux-thunk'\r\nimport type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware'\r\n/* PROD_START_REMOVE_UMD */\r\nimport { createImmutableStateInvariantMiddleware } from './immutableStateInvariantMiddleware'\r\n/* PROD_STOP_REMOVE_UMD */\r\n\r\nimport type { SerializableStateInvariantMiddlewareOptions } from './serializableStateInvariantMiddleware'\r\nimport { createSerializableStateInvariantMiddleware } from './serializableStateInvariantMiddleware'\r\nimport type { ExcludeFromTuple } from './tsHelpers'\r\nimport { MiddlewareArray } from './utils'\r\n\r\nfunction isBoolean(x: any): x is boolean {\r\n return typeof x === 'boolean'\r\n}\r\n\r\ninterface ThunkOptions {\r\n extraArgument: E\r\n}\r\n\r\ninterface GetDefaultMiddlewareOptions {\r\n thunk?: boolean | ThunkOptions\r\n immutableCheck?: boolean | ImmutableStateInvariantMiddlewareOptions\r\n serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions\r\n}\r\n\r\nexport type ThunkMiddlewareFor<\r\n S,\r\n O extends GetDefaultMiddlewareOptions = {}\r\n> = O extends {\r\n thunk: false\r\n}\r\n ? never\r\n : O extends { thunk: { extraArgument: infer E } }\r\n ? ThunkMiddleware\r\n : ThunkMiddleware\r\n\r\nexport type CurriedGetDefaultMiddleware = <\r\n O extends Partial = {\r\n thunk: true\r\n immutableCheck: true\r\n serializableCheck: true\r\n }\r\n>(\r\n options?: O\r\n) => MiddlewareArray], never>>\r\n\r\nexport function curryGetDefaultMiddleware<\r\n S = any\r\n>(): CurriedGetDefaultMiddleware {\r\n return function curriedGetDefaultMiddleware(options) {\r\n return getDefaultMiddleware(options)\r\n }\r\n}\r\n\r\n/**\r\n * Returns any array containing the default middleware installed by\r\n * `configureStore()`. Useful if you want to configure your store with a custom\r\n * `middleware` array but still keep the default set.\r\n *\r\n * @return The default middleware used by `configureStore()`.\r\n *\r\n * @public\r\n *\r\n * @deprecated Prefer to use the callback notation for the `middleware` option in `configureStore`\r\n * to access a pre-typed `getDefaultMiddleware` instead.\r\n */\r\nexport function getDefaultMiddleware<\r\n S = any,\r\n O extends Partial = {\r\n thunk: true\r\n immutableCheck: true\r\n serializableCheck: true\r\n }\r\n>(\r\n options: O = {} as O\r\n): MiddlewareArray], never>> {\r\n const {\r\n thunk = true,\r\n immutableCheck = true,\r\n serializableCheck = true,\r\n } = options\r\n\r\n let middlewareArray = new MiddlewareArray()\r\n\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware)\r\n } else {\r\n middlewareArray.push(\r\n thunkMiddleware.withExtraArgument(thunk.extraArgument)\r\n )\r\n }\r\n }\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (immutableCheck) {\r\n /* PROD_START_REMOVE_UMD */\r\n let immutableOptions: ImmutableStateInvariantMiddlewareOptions = {}\r\n\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck\r\n }\r\n\r\n middlewareArray.unshift(\r\n createImmutableStateInvariantMiddleware(immutableOptions)\r\n )\r\n /* PROD_STOP_REMOVE_UMD */\r\n }\r\n\r\n if (serializableCheck) {\r\n let serializableOptions: SerializableStateInvariantMiddlewareOptions = {}\r\n\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck\r\n }\r\n\r\n middlewareArray.push(\r\n createSerializableStateInvariantMiddleware(serializableOptions)\r\n )\r\n }\r\n }\r\n\r\n return middlewareArray as any\r\n}\r\n","import type {\r\n Reducer,\r\n ReducersMapObject,\r\n Middleware,\r\n Action,\r\n AnyAction,\r\n StoreEnhancer,\r\n Store,\r\n Dispatch,\r\n PreloadedState,\r\n CombinedState,\r\n} from 'redux'\r\nimport { createStore, compose, applyMiddleware, combineReducers } from 'redux'\r\nimport type { DevToolsEnhancerOptions as DevToolsOptions } from './devtoolsExtension'\r\nimport { composeWithDevTools } from './devtoolsExtension'\r\n\r\nimport isPlainObject from './isPlainObject'\r\nimport type {\r\n ThunkMiddlewareFor,\r\n CurriedGetDefaultMiddleware,\r\n} from './getDefaultMiddleware'\r\nimport { curryGetDefaultMiddleware } from './getDefaultMiddleware'\r\nimport type {\r\n NoInfer,\r\n ExtractDispatchExtensions,\r\n ExtractStoreExtensions,\r\n ExtractStateExtensions,\r\n} from './tsHelpers'\r\nimport { EnhancerArray } from './utils'\r\n\r\nconst IS_PRODUCTION = process.env.NODE_ENV === 'production'\r\n\r\n/**\r\n * Callback function type, to be used in `ConfigureStoreOptions.enhancers`\r\n *\r\n * @public\r\n */\r\nexport type ConfigureEnhancersCallback = (\r\n defaultEnhancers: EnhancerArray<[StoreEnhancer<{}, {}>]>\r\n) => E\r\n\r\n/**\r\n * Options for `configureStore()`.\r\n *\r\n * @public\r\n */\r\nexport interface ConfigureStoreOptions<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = Middlewares,\r\n E extends Enhancers = Enhancers\r\n> {\r\n /**\r\n * A single reducer function that will be used as the root reducer, or an\r\n * object of slice reducers that will be passed to `combineReducers()`.\r\n */\r\n reducer: Reducer | ReducersMapObject\r\n\r\n /**\r\n * An array of Redux middleware to install. If not supplied, defaults to\r\n * the set of middleware returned by `getDefaultMiddleware()`.\r\n *\r\n * @example `middleware: (gDM) => gDM().concat(logger, apiMiddleware, yourCustomMiddleware)`\r\n * @see https://redux-toolkit.js.org/api/getDefaultMiddleware#intended-usage\r\n */\r\n middleware?: ((getDefaultMiddleware: CurriedGetDefaultMiddleware) => M) | M\r\n\r\n /**\r\n * Whether to enable Redux DevTools integration. Defaults to `true`.\r\n *\r\n * Additional configuration can be done by passing Redux DevTools options\r\n */\r\n devTools?: boolean | DevToolsOptions\r\n\r\n /**\r\n * The initial state, same as Redux's createStore.\r\n * You may optionally specify it to hydrate the state\r\n * from the server in universal apps, or to restore a previously serialized\r\n * user session. If you use `combineReducers()` to produce the root reducer\r\n * function (either directly or indirectly by passing an object as `reducer`),\r\n * this must be an object with the same shape as the reducer map keys.\r\n */\r\n /*\r\n Not 100% correct but the best approximation we can get:\r\n - if S is a `CombinedState` applying a second `CombinedState` on it does not change anything.\r\n - if it is not, there could be two cases:\r\n - `ReducersMapObject` is being passed in. In this case, we will call `combineReducers` on it and `CombinedState` is correct\r\n - `Reducer` is being passed in. In this case, actually `CombinedState` is wrong and `S` would be correct.\r\n As we cannot distinguish between those two cases without adding another generic parameter,\r\n we just make the pragmatic assumption that the latter almost never happens.\r\n */\r\n preloadedState?: PreloadedState>>\r\n\r\n /**\r\n * The store enhancers to apply. See Redux's `createStore()`.\r\n * All enhancers will be included before the DevTools Extension enhancer.\r\n * If you need to customize the order of enhancers, supply a callback\r\n * function that will receive the original array (ie, `[applyMiddleware]`),\r\n * and should return a new array (such as `[applyMiddleware, offline]`).\r\n * If you only need to add middleware, you can use the `middleware` parameter instead.\r\n */\r\n enhancers?: E | ConfigureEnhancersCallback\r\n}\r\n\r\ntype Middlewares = ReadonlyArray>\r\n\r\ntype Enhancers = ReadonlyArray\r\n\r\nexport interface ToolkitStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = Middlewares\r\n> extends Store {\r\n /**\r\n * The `dispatch` method of your store, enhanced by all its middlewares.\r\n *\r\n * @inheritdoc\r\n */\r\n dispatch: ExtractDispatchExtensions & Dispatch\r\n}\r\n\r\n/**\r\n * A Redux store returned by `configureStore()`. Supports dispatching\r\n * side-effectful _thunks_ in addition to plain actions.\r\n *\r\n * @public\r\n */\r\nexport type EnhancedStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = Middlewares,\r\n E extends Enhancers = Enhancers\r\n> = ToolkitStore, A, M> &\r\n ExtractStoreExtensions\r\n\r\n/**\r\n * A friendly abstraction over the standard Redux `createStore()` function.\r\n *\r\n * @param options The store configuration.\r\n * @returns A configured Redux store.\r\n *\r\n * @public\r\n */\r\nexport function configureStore<\r\n S = any,\r\n A extends Action = AnyAction,\r\n M extends Middlewares = [ThunkMiddlewareFor],\r\n E extends Enhancers = [StoreEnhancer]\r\n>(options: ConfigureStoreOptions): EnhancedStore {\r\n const curriedGetDefaultMiddleware = curryGetDefaultMiddleware()\r\n\r\n const {\r\n reducer = undefined,\r\n middleware = curriedGetDefaultMiddleware(),\r\n devTools = true,\r\n preloadedState = undefined,\r\n enhancers = undefined,\r\n } = options || {}\r\n\r\n let rootReducer: Reducer\r\n\r\n if (typeof reducer === 'function') {\r\n rootReducer = reducer\r\n } else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer) as unknown as Reducer\r\n } else {\r\n throw new Error(\r\n '\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'\r\n )\r\n }\r\n\r\n let finalMiddleware = middleware\r\n if (typeof finalMiddleware === 'function') {\r\n finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware)\r\n\r\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\r\n throw new Error(\r\n 'when using a middleware builder function, an array of middleware must be returned'\r\n )\r\n }\r\n }\r\n if (\r\n !IS_PRODUCTION &&\r\n finalMiddleware.some((item: any) => typeof item !== 'function')\r\n ) {\r\n throw new Error(\r\n 'each middleware provided to configureStore must be a function'\r\n )\r\n }\r\n\r\n const middlewareEnhancer: StoreEnhancer = applyMiddleware(...finalMiddleware)\r\n\r\n let finalCompose = compose\r\n\r\n if (devTools) {\r\n finalCompose = composeWithDevTools({\r\n // Enable capture of stack traces for dispatched Redux actions\r\n trace: !IS_PRODUCTION,\r\n ...(typeof devTools === 'object' && devTools),\r\n })\r\n }\r\n\r\n const defaultEnhancers = new EnhancerArray(middlewareEnhancer)\r\n let storeEnhancers: Enhancers = defaultEnhancers\r\n\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = [middlewareEnhancer, ...enhancers]\r\n } else if (typeof enhancers === 'function') {\r\n storeEnhancers = enhancers(defaultEnhancers)\r\n }\r\n\r\n const composedEnhancer = finalCompose(...storeEnhancers) as StoreEnhancer\r\n\r\n return createStore(rootReducer, preloadedState, composedEnhancer)\r\n}\r\n","import type { Action } from 'redux'\r\nimport type {\r\n IsUnknownOrNonInferrable,\r\n IfMaybeUndefined,\r\n IfVoid,\r\n IsAny,\r\n} from './tsHelpers'\r\nimport isPlainObject from './isPlainObject'\r\n\r\n/**\r\n * An action with a string type and an associated payload. This is the\r\n * type of action returned by `createAction()` action creators.\r\n *\r\n * @template P The type of the action's payload.\r\n * @template T the type used for the action type.\r\n * @template M The type of the action's meta (optional)\r\n * @template E The type of the action's error (optional)\r\n *\r\n * @public\r\n */\r\nexport type PayloadAction<\r\n P = void,\r\n T extends string = string,\r\n M = never,\r\n E = never\r\n> = {\r\n payload: P\r\n type: T\r\n} & ([M] extends [never]\r\n ? {}\r\n : {\r\n meta: M\r\n }) &\r\n ([E] extends [never]\r\n ? {}\r\n : {\r\n error: E\r\n })\r\n\r\n/**\r\n * A \"prepare\" method to be used as the second parameter of `createAction`.\r\n * Takes any number of arguments and returns a Flux Standard Action without\r\n * type (will be added later) that *must* contain a payload (might be undefined).\r\n *\r\n * @public\r\n */\r\nexport type PrepareAction =\r\n | ((...args: any[]) => { payload: P })\r\n | ((...args: any[]) => { payload: P; meta: any })\r\n | ((...args: any[]) => { payload: P; error: any })\r\n | ((...args: any[]) => { payload: P; meta: any; error: any })\r\n\r\n/**\r\n * Internal version of `ActionCreatorWithPreparedPayload`. Not to be used externally.\r\n *\r\n * @internal\r\n */\r\nexport type _ActionCreatorWithPreparedPayload<\r\n PA extends PrepareAction | void,\r\n T extends string = string\r\n> = PA extends PrepareAction\r\n ? ActionCreatorWithPreparedPayload<\r\n Parameters,\r\n P,\r\n T,\r\n ReturnType extends {\r\n error: infer E\r\n }\r\n ? E\r\n : never,\r\n ReturnType extends {\r\n meta: infer M\r\n }\r\n ? M\r\n : never\r\n >\r\n : void\r\n\r\n/**\r\n * Basic type for all action creators.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n */\r\nexport interface BaseActionCreator {\r\n type: T\r\n match: (action: Action) => action is PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator that takes multiple arguments that are passed\r\n * to a `PrepareAction` method to create the final Action.\r\n * @typeParam Args arguments for the action creator function\r\n * @typeParam P `payload` type\r\n * @typeParam T `type` name\r\n * @typeParam E optional `error` type\r\n * @typeParam M optional `meta` type\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithPreparedPayload<\r\n Args extends unknown[],\r\n P,\r\n T extends string = string,\r\n E = never,\r\n M = never\r\n> extends BaseActionCreator
{\r\n /**\r\n * Calling this {@link redux#ActionCreator} with `Args` will return\r\n * an Action with a payload of type `P` and (depending on the `PrepareAction`\r\n * method used) a `meta`- and `error` property of types `M` and `E` respectively.\r\n */\r\n (...args: Args): PayloadAction
\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that takes an optional payload of type `P`.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithOptionalPayload
\r\n extends BaseActionCreator
{\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`.\r\n * Calling it without an argument will return a PayloadAction with a payload of `undefined`.\r\n */\r\n (payload?: P): PayloadAction
\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that takes no payload.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithoutPayload\r\n extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} will\r\n * return a {@link PayloadAction} of type `T` with a payload of `undefined`\r\n */\r\n (noArgument: void): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator of type `T` that requires a payload of type P.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithPayload\r\n extends BaseActionCreator
{\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload of `P`\r\n */\r\n (payload: P): PayloadAction
\r\n}\r\n\r\n/**\r\n * An action creator of type `T` whose `payload` type could not be inferred. Accepts everything as `payload`.\r\n *\r\n * @inheritdoc {redux#ActionCreator}\r\n *\r\n * @public\r\n */\r\nexport interface ActionCreatorWithNonInferrablePayload<\r\n T extends string = string\r\n> extends BaseActionCreator {\r\n /**\r\n * Calling this {@link redux#ActionCreator} with an argument will\r\n * return a {@link PayloadAction} of type `T` with a payload\r\n * of exactly the type of the argument.\r\n */\r\n (payload: PT): PayloadAction\r\n}\r\n\r\n/**\r\n * An action creator that produces actions with a `payload` attribute.\r\n *\r\n * @typeParam P the `payload` type\r\n * @typeParam T the `type` of the resulting action\r\n * @typeParam PA if the resulting action is preprocessed by a `prepare` method, the signature of said method.\r\n *\r\n * @public\r\n */\r\nexport type PayloadActionCreator<\r\n P = void,\r\n T extends string = string,\r\n PA extends PrepareAction | void = void\r\n> = IfPrepareActionMethodProvided<\r\n PA,\r\n _ActionCreatorWithPreparedPayload,\r\n // else\r\n IsAny<\r\n P,\r\n ActionCreatorWithPayload,\r\n IsUnknownOrNonInferrable<\r\n P,\r\n ActionCreatorWithNonInferrablePayload,\r\n // else\r\n IfVoid<\r\n P,\r\n ActionCreatorWithoutPayload,\r\n // else\r\n IfMaybeUndefined<\r\n P,\r\n ActionCreatorWithOptionalPayload,\r\n // else\r\n ActionCreatorWithPayload
\r\n >\r\n >\r\n >\r\n >\r\n>\r\n\r\n/**\r\n * A utility function to create an action creator for the given action type\r\n * string. The action creator accepts a single argument, which will be included\r\n * in the action object as a field called payload. The action creator function\r\n * will also have its toString() overridden so that it returns the action type,\r\n * allowing it to be used in reducer logic that is looking for that action type.\r\n *\r\n * @param type The action type to use for created actions.\r\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\r\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\r\n *\r\n * @public\r\n */\r\nexport function createAction
(\r\n type: T\r\n): PayloadActionCreator
\r\n\r\n/**\r\n * A utility function to create an action creator for the given action type\r\n * string. The action creator accepts a single argument, which will be included\r\n * in the action object as a field called payload. The action creator function\r\n * will also have its toString() overridden so that it returns the action type,\r\n * allowing it to be used in reducer logic that is looking for that action type.\r\n *\r\n * @param type The action type to use for created actions.\r\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\r\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\r\n *\r\n * @public\r\n */\r\nexport function createAction<\r\n PA extends PrepareAction,\r\n T extends string = string\r\n>(\r\n type: T,\r\n prepareAction: PA\r\n): PayloadActionCreator['payload'], T, PA>\r\n\r\nexport function createAction(type: string, prepareAction?: Function): any {\r\n function actionCreator(...args: any[]) {\r\n if (prepareAction) {\r\n let prepared = prepareAction(...args)\r\n if (!prepared) {\r\n throw new Error('prepareAction did not return an object')\r\n }\r\n\r\n return {\r\n type,\r\n payload: prepared.payload,\r\n ...('meta' in prepared && { meta: prepared.meta }),\r\n ...('error' in prepared && { error: prepared.error }),\r\n }\r\n }\r\n return { type, payload: args[0] }\r\n }\r\n\r\n actionCreator.toString = () => `${type}`\r\n\r\n actionCreator.type = type\r\n\r\n actionCreator.match = (action: Action): action is PayloadAction =>\r\n action.type === type\r\n\r\n return actionCreator\r\n}\r\n\r\n/**\r\n * Returns true if value is a plain object with a `type` property.\r\n */\r\nexport function isAction(action: unknown): action is Action {\r\n return isPlainObject(action) && 'type' in action\r\n}\r\n\r\n/**\r\n * Returns true if value is an action with a string type and valid Flux Standard Action keys.\r\n */\r\nexport function isFSA(action: unknown): action is {\r\n type: string\r\n payload?: unknown\r\n error?: unknown\r\n meta?: unknown\r\n} {\r\n return (\r\n isAction(action) &&\r\n typeof action.type === 'string' &&\r\n Object.keys(action).every(isValidKey)\r\n )\r\n}\r\n\r\nfunction isValidKey(key: string) {\r\n return ['type', 'payload', 'error', 'meta'].indexOf(key) > -1\r\n}\r\n\r\n/**\r\n * Returns the action type of the actions created by the passed\r\n * `createAction()`-generated action creator (arbitrary action creators\r\n * are not supported).\r\n *\r\n * @param action The action creator whose action type to get.\r\n * @returns The action type used by the action creator.\r\n *\r\n * @public\r\n */\r\nexport function getType(\r\n actionCreator: PayloadActionCreator\r\n): T {\r\n return `${actionCreator}` as T\r\n}\r\n\r\n// helper types for more readable typings\r\n\r\ntype IfPrepareActionMethodProvided<\r\n PA extends PrepareAction | void,\r\n True,\r\n False\r\n> = PA extends (...args: any[]) => any ? True : False\r\n","import type { Action, AnyAction } from 'redux'\r\nimport type {\r\n CaseReducer,\r\n CaseReducers,\r\n ActionMatcherDescriptionCollection,\r\n} from './createReducer'\r\nimport type { TypeGuard } from './tsHelpers'\r\n\r\nexport interface TypedActionCreator {\r\n (...args: any[]): Action\r\n type: Type\r\n}\r\n\r\n/**\r\n * A builder for an action <-> reducer map.\r\n *\r\n * @public\r\n */\r\nexport interface ActionReducerMapBuilder {\r\n /**\r\n * Adds a case reducer to handle a single exact action type.\r\n * @remarks\r\n * All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.\r\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\r\n * @param reducer - The actual case reducer function.\r\n */\r\n addCase>(\r\n actionCreator: ActionCreator,\r\n reducer: CaseReducer>\r\n ): ActionReducerMapBuilder\r\n /**\r\n * Adds a case reducer to handle a single exact action type.\r\n * @remarks\r\n * All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.\r\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\r\n * @param reducer - The actual case reducer function.\r\n */\r\n addCase>(\r\n type: Type,\r\n reducer: CaseReducer\r\n ): ActionReducerMapBuilder\r\n\r\n /**\r\n * Allows you to match your incoming actions against your own filter function instead of only the `action.type` property.\r\n * @remarks\r\n * If multiple matcher reducers match, all of them will be executed in the order\r\n * they were defined in - even if a case reducer already matched.\r\n * All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`.\r\n * @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates)\r\n * function\r\n * @param reducer - The actual case reducer function.\r\n *\r\n * @example\r\n```ts\r\nimport {\r\n createAction,\r\n createReducer,\r\n AsyncThunk,\r\n AnyAction,\r\n} from \"@reduxjs/toolkit\";\r\n\r\ntype GenericAsyncThunk = AsyncThunk;\r\n\r\ntype PendingAction = ReturnType;\r\ntype RejectedAction = ReturnType;\r\ntype FulfilledAction = ReturnType;\r\n\r\nconst initialState: Record = {};\r\nconst resetAction = createAction(\"reset-tracked-loading-state\");\r\n\r\nfunction isPendingAction(action: AnyAction): action is PendingAction {\r\n return action.type.endsWith(\"/pending\");\r\n}\r\n\r\nconst reducer = createReducer(initialState, (builder) => {\r\n builder\r\n .addCase(resetAction, () => initialState)\r\n // matcher can be defined outside as a type predicate function\r\n .addMatcher(isPendingAction, (state, action) => {\r\n state[action.meta.requestId] = \"pending\";\r\n })\r\n .addMatcher(\r\n // matcher can be defined inline as a type predicate function\r\n (action): action is RejectedAction => action.type.endsWith(\"/rejected\"),\r\n (state, action) => {\r\n state[action.meta.requestId] = \"rejected\";\r\n }\r\n )\r\n // matcher can just return boolean and the matcher can receive a generic argument\r\n .addMatcher(\r\n (action) => action.type.endsWith(\"/fulfilled\"),\r\n (state, action) => {\r\n state[action.meta.requestId] = \"fulfilled\";\r\n }\r\n );\r\n});\r\n```\r\n */\r\n addMatcher(\r\n matcher: TypeGuard | ((action: any) => boolean),\r\n reducer: CaseReducer\r\n ): Omit, 'addCase'>\r\n\r\n /**\r\n * Adds a \"default case\" reducer that is executed if no case reducer and no matcher\r\n * reducer was executed for this action.\r\n * @param reducer - The fallback \"default case\" reducer function.\r\n *\r\n * @example\r\n```ts\r\nimport { createReducer } from '@reduxjs/toolkit'\r\nconst initialState = { otherActions: 0 }\r\nconst reducer = createReducer(initialState, builder => {\r\n builder\r\n // .addCase(...)\r\n // .addMatcher(...)\r\n .addDefaultCase((state, action) => {\r\n state.otherActions++\r\n })\r\n})\r\n```\r\n */\r\n addDefaultCase(reducer: CaseReducer): {}\r\n}\r\n\r\nexport function executeReducerBuilderCallback(\r\n builderCallback: (builder: ActionReducerMapBuilder) => void\r\n): [\r\n CaseReducers,\r\n ActionMatcherDescriptionCollection,\r\n CaseReducer | undefined\r\n] {\r\n const actionsMap: CaseReducers = {}\r\n const actionMatchers: ActionMatcherDescriptionCollection = []\r\n let defaultCaseReducer: CaseReducer | undefined\r\n const builder = {\r\n addCase(\r\n typeOrActionCreator: string | TypedActionCreator,\r\n reducer: CaseReducer\r\n ) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n /*\r\n to keep the definition by the user in line with actual behavior, \r\n we enforce `addCase` to always be called before calling `addMatcher`\r\n as matching cases take precedence over matchers\r\n */\r\n if (actionMatchers.length > 0) {\r\n throw new Error(\r\n '`builder.addCase` should only be called before calling `builder.addMatcher`'\r\n )\r\n }\r\n if (defaultCaseReducer) {\r\n throw new Error(\r\n '`builder.addCase` should only be called before calling `builder.addDefaultCase`'\r\n )\r\n }\r\n }\r\n const type =\r\n typeof typeOrActionCreator === 'string'\r\n ? typeOrActionCreator\r\n : typeOrActionCreator.type\r\n if (type in actionsMap) {\r\n throw new Error(\r\n 'addCase cannot be called with two reducers for the same action type'\r\n )\r\n }\r\n actionsMap[type] = reducer\r\n return builder\r\n },\r\n addMatcher(\r\n matcher: TypeGuard ,\r\n reducer: CaseReducer\r\n ) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (defaultCaseReducer) {\r\n throw new Error(\r\n '`builder.addMatcher` should only be called before calling `builder.addDefaultCase`'\r\n )\r\n }\r\n }\r\n actionMatchers.push({ matcher, reducer })\r\n return builder\r\n },\r\n addDefaultCase(reducer: CaseReducer) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (defaultCaseReducer) {\r\n throw new Error('`builder.addDefaultCase` can only be called once')\r\n }\r\n }\r\n defaultCaseReducer = reducer\r\n return builder\r\n },\r\n }\r\n builderCallback(builder)\r\n return [actionsMap, actionMatchers, defaultCaseReducer]\r\n}\r\n","import type { AnyAction, Reducer } from 'redux'\r\nimport { createNextState } from '.'\r\nimport type {\r\n ActionCreatorWithoutPayload,\r\n PayloadAction,\r\n PayloadActionCreator,\r\n PrepareAction,\r\n _ActionCreatorWithPreparedPayload,\r\n} from './createAction'\r\nimport { createAction } from './createAction'\r\nimport type {\r\n CaseReducer,\r\n CaseReducers,\r\n ReducerWithInitialState,\r\n} from './createReducer'\r\nimport { createReducer, NotFunction } from './createReducer'\r\nimport type { ActionReducerMapBuilder } from './mapBuilders'\r\nimport { executeReducerBuilderCallback } from './mapBuilders'\r\nimport type { NoInfer } from './tsHelpers'\r\nimport { freezeDraftable } from './utils'\r\n\r\nlet hasWarnedAboutObjectNotation = false\r\n\r\n/**\r\n * An action creator attached to a slice.\r\n *\r\n * @deprecated please use PayloadActionCreator directly\r\n *\r\n * @public\r\n */\r\nexport type SliceActionCreator = PayloadActionCreator
\r\n\r\n/**\r\n * The return value of `createSlice`\r\n *\r\n * @public\r\n */\r\nexport interface Slice<\r\n State = any,\r\n CaseReducers extends SliceCaseReducers = SliceCaseReducers,\r\n Name extends string = string\r\n> {\r\n /**\r\n * The slice name.\r\n */\r\n name: Name\r\n\r\n /**\r\n * The slice's reducer.\r\n */\r\n reducer: Reducer\r\n\r\n /**\r\n * Action creators for the types of actions that are handled by the slice\r\n * reducer.\r\n */\r\n actions: CaseReducerActions\r\n\r\n /**\r\n * The individual case reducer functions that were passed in the `reducers` parameter.\r\n * This enables reuse and testing if they were defined inline when calling `createSlice`.\r\n */\r\n caseReducers: SliceDefinedCaseReducers\r\n\r\n /**\r\n * Provides access to the initial state value given to the slice.\r\n * If a lazy state initializer was provided, it will be called and a fresh value returned.\r\n */\r\n getInitialState: () => State\r\n}\r\n\r\n/**\r\n * Options for `createSlice()`.\r\n *\r\n * @public\r\n */\r\nexport interface CreateSliceOptions<\r\n State = any,\r\n CR extends SliceCaseReducers = SliceCaseReducers,\r\n Name extends string = string\r\n> {\r\n /**\r\n * The slice's name. Used to namespace the generated action types.\r\n */\r\n name: Name\r\n\r\n /**\r\n * The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\r\n */\r\n initialState: State | (() => State)\r\n\r\n /**\r\n * A mapping from action types to action-type-specific *case reducer*\r\n * functions. For every action type, a matching action creator will be\r\n * generated using `createAction()`.\r\n */\r\n reducers: ValidateSliceCaseReducers\r\n\r\n /**\r\n * A callback that receives a *builder* object to define\r\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\r\n * \r\n * Alternatively, a mapping from action types to action-type-specific *case reducer*\r\n * functions. These reducers should have existing action types used\r\n * as the keys, and action creators will _not_ be generated.\r\n * \r\n * @example\r\n```ts\r\nimport { createAction, createSlice, Action, AnyAction } from '@reduxjs/toolkit'\r\nconst incrementBy = createAction('incrementBy')\r\nconst decrement = createAction('decrement')\r\n\r\ninterface RejectedAction extends Action {\r\n error: Error\r\n}\r\n\r\nfunction isRejectedAction(action: AnyAction): action is RejectedAction {\r\n return action.type.endsWith('rejected')\r\n}\r\n\r\ncreateSlice({\r\n name: 'counter',\r\n initialState: 0,\r\n reducers: {},\r\n extraReducers: builder => {\r\n builder\r\n .addCase(incrementBy, (state, action) => {\r\n // action is inferred correctly here if using TS\r\n })\r\n // You can chain calls, or have separate `builder.addCase()` lines each time\r\n .addCase(decrement, (state, action) => {})\r\n // You can match a range of action types\r\n .addMatcher(\r\n isRejectedAction,\r\n // `action` will be inferred as a RejectedAction due to isRejectedAction being defined as a type guard\r\n (state, action) => {}\r\n )\r\n // and provide a default case if no other handlers matched\r\n .addDefaultCase((state, action) => {})\r\n }\r\n})\r\n```\r\n */\r\n extraReducers?:\r\n | CaseReducers, any>\r\n | ((builder: ActionReducerMapBuilder>) => void)\r\n}\r\n\r\n/**\r\n * A CaseReducer with a `prepare` method.\r\n *\r\n * @public\r\n */\r\nexport type CaseReducerWithPrepare = {\r\n reducer: CaseReducer\r\n prepare: PrepareAction\r\n}\r\n\r\n/**\r\n * The type describing a slice's `reducers` option.\r\n *\r\n * @public\r\n */\r\nexport type SliceCaseReducers = {\r\n [K: string]:\r\n | CaseReducer>\r\n | CaseReducerWithPrepare>\r\n}\r\n\r\ntype SliceActionType<\r\n SliceName extends string,\r\n ActionName extends keyof any\r\n> = ActionName extends string | number ? `${SliceName}/${ActionName}` : string\r\n\r\n/**\r\n * Derives the slice's `actions` property from the `reducers` options\r\n *\r\n * @public\r\n */\r\nexport type CaseReducerActions<\r\n CaseReducers extends SliceCaseReducers,\r\n SliceName extends string\r\n> = {\r\n [Type in keyof CaseReducers]: CaseReducers[Type] extends { prepare: any }\r\n ? ActionCreatorForCaseReducerWithPrepare<\r\n CaseReducers[Type],\r\n SliceActionType\r\n >\r\n : ActionCreatorForCaseReducer<\r\n CaseReducers[Type],\r\n SliceActionType\r\n >\r\n}\r\n\r\n/**\r\n * Get a `PayloadActionCreator` type for a passed `CaseReducerWithPrepare`\r\n *\r\n * @internal\r\n */\r\ntype ActionCreatorForCaseReducerWithPrepare<\r\n CR extends { prepare: any },\r\n Type extends string\r\n> = _ActionCreatorWithPreparedPayload\r\n\r\n/**\r\n * Get a `PayloadActionCreator` type for a passed `CaseReducer`\r\n *\r\n * @internal\r\n */\r\ntype ActionCreatorForCaseReducer = CR extends (\r\n state: any,\r\n action: infer Action\r\n) => any\r\n ? Action extends { payload: infer P }\r\n ? PayloadActionCreator\r\n : ActionCreatorWithoutPayload\r\n : ActionCreatorWithoutPayload\r\n\r\n/**\r\n * Extracts the CaseReducers out of a `reducers` object, even if they are\r\n * tested into a `CaseReducerWithPrepare`.\r\n *\r\n * @internal\r\n */\r\ntype SliceDefinedCaseReducers> = {\r\n [Type in keyof CaseReducers]: CaseReducers[Type] extends {\r\n reducer: infer Reducer\r\n }\r\n ? Reducer\r\n : CaseReducers[Type]\r\n}\r\n\r\n/**\r\n * Used on a SliceCaseReducers object.\r\n * Ensures that if a CaseReducer is a `CaseReducerWithPrepare`, that\r\n * the `reducer` and the `prepare` function use the same type of `payload`.\r\n *\r\n * Might do additional such checks in the future.\r\n *\r\n * This type is only ever useful if you want to write your own wrapper around\r\n * `createSlice`. Please don't use it otherwise!\r\n *\r\n * @public\r\n */\r\nexport type ValidateSliceCaseReducers<\r\n S,\r\n ACR extends SliceCaseReducers\r\n> = ACR &\r\n {\r\n [T in keyof ACR]: ACR[T] extends {\r\n reducer(s: S, action?: infer A): any\r\n }\r\n ? {\r\n prepare(...a: never[]): Omit\r\n }\r\n : {}\r\n }\r\n\r\nfunction getType(slice: string, actionKey: string): string {\r\n return `${slice}/${actionKey}`\r\n}\r\n\r\n/**\r\n * A function that accepts an initial state, an object full of reducer\r\n * functions, and a \"slice name\", and automatically generates\r\n * action creators and action types that correspond to the\r\n * reducers and state.\r\n *\r\n * The `reducer` argument is passed to `createReducer()`.\r\n *\r\n * @public\r\n */\r\nexport function createSlice<\r\n State,\r\n CaseReducers extends SliceCaseReducers,\r\n Name extends string = string\r\n>(\r\n options: CreateSliceOptions\r\n): Slice {\r\n const { name } = options\r\n if (!name) {\r\n throw new Error('`name` is a required option for createSlice')\r\n }\r\n\r\n if (\r\n typeof process !== 'undefined' &&\r\n process.env.NODE_ENV === 'development'\r\n ) {\r\n if (options.initialState === undefined) {\r\n console.error(\r\n 'You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`'\r\n )\r\n }\r\n }\r\n\r\n const initialState =\r\n typeof options.initialState == 'function'\r\n ? options.initialState\r\n : freezeDraftable(options.initialState)\r\n\r\n const reducers = options.reducers || {}\r\n\r\n const reducerNames = Object.keys(reducers)\r\n\r\n const sliceCaseReducersByName: Record = {}\r\n const sliceCaseReducersByType: Record = {}\r\n const actionCreators: Record = {}\r\n\r\n reducerNames.forEach((reducerName) => {\r\n const maybeReducerWithPrepare = reducers[reducerName]\r\n const type = getType(name, reducerName)\r\n\r\n let caseReducer: CaseReducer\r\n let prepareCallback: PrepareAction | undefined\r\n\r\n if ('reducer' in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer\r\n prepareCallback = maybeReducerWithPrepare.prepare\r\n } else {\r\n caseReducer = maybeReducerWithPrepare\r\n }\r\n\r\n sliceCaseReducersByName[reducerName] = caseReducer\r\n sliceCaseReducersByType[type] = caseReducer\r\n actionCreators[reducerName] = prepareCallback\r\n ? createAction(type, prepareCallback)\r\n : createAction(type)\r\n })\r\n\r\n function buildReducer() {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (typeof options.extraReducers === 'object') {\r\n if (!hasWarnedAboutObjectNotation) {\r\n hasWarnedAboutObjectNotation = true\r\n console.warn(\r\n \"The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\"\r\n )\r\n }\r\n }\r\n }\r\n const [\r\n extraReducers = {},\r\n actionMatchers = [],\r\n defaultCaseReducer = undefined,\r\n ] =\r\n typeof options.extraReducers === 'function'\r\n ? executeReducerBuilderCallback(options.extraReducers)\r\n : [options.extraReducers]\r\n\r\n const finalCaseReducers = { ...extraReducers, ...sliceCaseReducersByType }\r\n\r\n return createReducer(initialState, (builder) => {\r\n for (let key in finalCaseReducers) {\r\n builder.addCase(key, finalCaseReducers[key] as CaseReducer)\r\n }\r\n for (let m of actionMatchers) {\r\n builder.addMatcher(m.matcher, m.reducer)\r\n }\r\n if (defaultCaseReducer) {\r\n builder.addDefaultCase(defaultCaseReducer)\r\n }\r\n })\r\n }\r\n\r\n let _reducer: ReducerWithInitialState\r\n\r\n return {\r\n name,\r\n reducer(state, action) {\r\n if (!_reducer) _reducer = buildReducer()\r\n\r\n return _reducer(state, action)\r\n },\r\n actions: actionCreators as any,\r\n caseReducers: sliceCaseReducersByName as any,\r\n getInitialState() {\r\n if (!_reducer) _reducer = buildReducer()\r\n\r\n return _reducer.getInitialState()\r\n },\r\n }\r\n}\r\n","import type { Draft } from 'immer'\r\nimport createNextState, { isDraft, isDraftable } from 'immer'\r\nimport type { AnyAction, Action, Reducer } from 'redux'\r\nimport type { ActionReducerMapBuilder } from './mapBuilders'\r\nimport { executeReducerBuilderCallback } from './mapBuilders'\r\nimport type { NoInfer } from './tsHelpers'\r\nimport { freezeDraftable } from './utils'\r\n\r\n/**\r\n * Defines a mapping from action types to corresponding action object shapes.\r\n *\r\n * @deprecated This should not be used manually - it is only used for internal\r\n * inference purposes and should not have any further value.\r\n * It might be removed in the future.\r\n * @public\r\n */\r\nexport type Actions = Record\r\n\r\n/**\r\n * @deprecated use `TypeGuard` instead\r\n */\r\nexport interface ActionMatcher {\r\n (action: AnyAction): action is A\r\n}\r\n\r\nexport type ActionMatcherDescription = {\r\n matcher: ActionMatcher\r\n reducer: CaseReducer>\r\n}\r\n\r\nexport type ReadonlyActionMatcherDescriptionCollection = ReadonlyArray<\r\n ActionMatcherDescription\r\n>\r\n\r\nexport type ActionMatcherDescriptionCollection = Array<\r\n ActionMatcherDescription\r\n>\r\n\r\n/**\r\n * A *case reducer* is a reducer function for a specific action type. Case\r\n * reducers can be composed to full reducers using `createReducer()`.\r\n *\r\n * Unlike a normal Redux reducer, a case reducer is never called with an\r\n * `undefined` state to determine the initial state. Instead, the initial\r\n * state is explicitly specified as an argument to `createReducer()`.\r\n *\r\n * In addition, a case reducer can choose to mutate the passed-in `state`\r\n * value directly instead of returning a new state. This does not actually\r\n * cause the store state to be mutated directly; instead, thanks to\r\n * [immer](https://github.com/mweststrate/immer), the mutations are\r\n * translated to copy operations that result in a new state.\r\n *\r\n * @public\r\n */\r\nexport type CaseReducer = (\r\n state: Draft,\r\n action: A\r\n) => NoInfer | void | Draft>\r\n\r\n/**\r\n * A mapping from action types to case reducers for `createReducer()`.\r\n *\r\n * @deprecated This should not be used manually - it is only used\r\n * for internal inference purposes and using it manually\r\n * would lead to type erasure.\r\n * It might be removed in the future.\r\n * @public\r\n */\r\nexport type CaseReducers = {\r\n [T in keyof AS]: AS[T] extends Action ? CaseReducer : void\r\n}\r\n\r\nexport type NotFunction = T extends Function ? never : T\r\n\r\nfunction isStateFunction(x: unknown): x is () => S {\r\n return typeof x === 'function'\r\n}\r\n\r\nexport type ReducerWithInitialState> = Reducer & {\r\n getInitialState: () => S\r\n}\r\n\r\nlet hasWarnedAboutObjectNotation = false\r\n\r\n/**\r\n * A utility function that allows defining a reducer as a mapping from action\r\n * type to *case reducer* functions that handle these action types. The\r\n * reducer's initial state is passed as the first argument.\r\n *\r\n * @remarks\r\n * The body of every case reducer is implicitly wrapped with a call to\r\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\r\n * This means that rather than returning a new state object, you can also\r\n * mutate the passed-in state object directly; these mutations will then be\r\n * automatically and efficiently translated into copies, giving you both\r\n * convenience and immutability.\r\n *\r\n * @overloadSummary\r\n * This overload accepts a callback function that receives a `builder` object as its argument.\r\n * That builder provides `addCase`, `addMatcher` and `addDefaultCase` functions that may be\r\n * called to define what actions this reducer will handle.\r\n *\r\n * @param initialState - `State | (() => State)`: The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\r\n * @param builderCallback - `(builder: Builder) => void` A callback that receives a *builder* object to define\r\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\r\n * @example\r\n```ts\r\nimport {\r\n createAction,\r\n createReducer,\r\n AnyAction,\r\n PayloadAction,\r\n} from \"@reduxjs/toolkit\";\r\n\r\nconst increment = createAction(\"increment\");\r\nconst decrement = createAction(\"decrement\");\r\n\r\nfunction isActionWithNumberPayload(\r\n action: AnyAction\r\n): action is PayloadAction {\r\n return typeof action.payload === \"number\";\r\n}\r\n\r\nconst reducer = createReducer(\r\n {\r\n counter: 0,\r\n sumOfNumberPayloads: 0,\r\n unhandledActions: 0,\r\n },\r\n (builder) => {\r\n builder\r\n .addCase(increment, (state, action) => {\r\n // action is inferred correctly here\r\n state.counter += action.payload;\r\n })\r\n // You can chain calls, or have separate `builder.addCase()` lines each time\r\n .addCase(decrement, (state, action) => {\r\n state.counter -= action.payload;\r\n })\r\n // You can apply a \"matcher function\" to incoming actions\r\n .addMatcher(isActionWithNumberPayload, (state, action) => {})\r\n // and provide a default case if no other handlers matched\r\n .addDefaultCase((state, action) => {});\r\n }\r\n);\r\n```\r\n * @public\r\n */\r\nexport function createReducer>(\r\n initialState: S | (() => S),\r\n builderCallback: (builder: ActionReducerMapBuilder) => void\r\n): ReducerWithInitialState\r\n\r\n/**\r\n * A utility function that allows defining a reducer as a mapping from action\r\n * type to *case reducer* functions that handle these action types. The\r\n * reducer's initial state is passed as the first argument.\r\n *\r\n * The body of every case reducer is implicitly wrapped with a call to\r\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\r\n * This means that rather than returning a new state object, you can also\r\n * mutate the passed-in state object directly; these mutations will then be\r\n * automatically and efficiently translated into copies, giving you both\r\n * convenience and immutability.\r\n * \r\n * @overloadSummary\r\n * This overload accepts an object where the keys are string action types, and the values\r\n * are case reducer functions to handle those action types.\r\n *\r\n * @param initialState - `State | (() => State)`: The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\r\n * @param actionsMap - An object mapping from action types to _case reducers_, each of which handles one specific action type.\r\n * @param actionMatchers - An array of matcher definitions in the form `{matcher, reducer}`.\r\n * All matching reducers will be executed in order, independently if a case reducer matched or not.\r\n * @param defaultCaseReducer - A \"default case\" reducer that is executed if no case reducer and no matcher\r\n * reducer was executed for this action.\r\n *\r\n * @example\r\n```js\r\nconst counterReducer = createReducer(0, {\r\n increment: (state, action) => state + action.payload,\r\n decrement: (state, action) => state - action.payload\r\n})\r\n\r\n// Alternately, use a \"lazy initializer\" to provide the initial state\r\n// (works with either form of createReducer)\r\nconst initialState = () => 0\r\nconst counterReducer = createReducer(initialState, {\r\n increment: (state, action) => state + action.payload,\r\n decrement: (state, action) => state - action.payload\r\n})\r\n```\r\n \r\n * Action creators that were generated using [`createAction`](./createAction) may be used directly as the keys here, using computed property syntax:\r\n\r\n```js\r\nconst increment = createAction('increment')\r\nconst decrement = createAction('decrement')\r\n\r\nconst counterReducer = createReducer(0, {\r\n [increment]: (state, action) => state + action.payload,\r\n [decrement.type]: (state, action) => state - action.payload\r\n})\r\n```\r\n * @public\r\n */\r\nexport function createReducer<\r\n S extends NotFunction,\r\n CR extends CaseReducers = CaseReducers\r\n>(\r\n initialState: S | (() => S),\r\n actionsMap: CR,\r\n actionMatchers?: ActionMatcherDescriptionCollection,\r\n defaultCaseReducer?: CaseReducer\r\n): ReducerWithInitialState\r\n\r\nexport function createReducer>(\r\n initialState: S | (() => S),\r\n mapOrBuilderCallback:\r\n | CaseReducers\r\n | ((builder: ActionReducerMapBuilder) => void),\r\n actionMatchers: ReadonlyActionMatcherDescriptionCollection = [],\r\n defaultCaseReducer?: CaseReducer\r\n): ReducerWithInitialState {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (typeof mapOrBuilderCallback === 'object') {\r\n if (!hasWarnedAboutObjectNotation) {\r\n hasWarnedAboutObjectNotation = true\r\n console.warn(\r\n \"The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\"\r\n )\r\n }\r\n }\r\n }\r\n\r\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] =\r\n typeof mapOrBuilderCallback === 'function'\r\n ? executeReducerBuilderCallback(mapOrBuilderCallback)\r\n : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer]\r\n\r\n // Ensure the initial state gets frozen either way (if draftable)\r\n let getInitialState: () => S\r\n if (isStateFunction(initialState)) {\r\n getInitialState = () => freezeDraftable(initialState())\r\n } else {\r\n const frozenInitialState = freezeDraftable(initialState)\r\n getInitialState = () => frozenInitialState\r\n }\r\n\r\n function reducer(state = getInitialState(), action: any): S {\r\n let caseReducers = [\r\n actionsMap[action.type],\r\n ...finalActionMatchers\r\n .filter(({ matcher }) => matcher(action))\r\n .map(({ reducer }) => reducer),\r\n ]\r\n if (caseReducers.filter((cr) => !!cr).length === 0) {\r\n caseReducers = [finalDefaultCaseReducer]\r\n }\r\n\r\n return caseReducers.reduce((previousState, caseReducer): S => {\r\n if (caseReducer) {\r\n if (isDraft(previousState)) {\r\n // If it's already a draft, we must already be inside a `createNextState` call,\r\n // likely because this is being wrapped in `createReducer`, `createSlice`, or nested\r\n // inside an existing draft. It's safe to just pass the draft to the mutator.\r\n const draft = previousState as Draft // We can assume this is already a draft\r\n const result = caseReducer(draft, action)\r\n\r\n if (result === undefined) {\r\n return previousState\r\n }\r\n\r\n return result as S\r\n } else if (!isDraftable(previousState)) {\r\n // If state is not draftable (ex: a primitive, such as 0), we want to directly\r\n // return the caseReducer func and not wrap it with produce.\r\n const result = caseReducer(previousState as any, action)\r\n\r\n if (result === undefined) {\r\n if (previousState === null) {\r\n return previousState\r\n }\r\n throw Error(\r\n 'A case reducer on a non-draftable value must not return undefined'\r\n )\r\n }\r\n\r\n return result as S\r\n } else {\r\n // @ts-ignore createNextState() produces an Immutable