@voplus/morpho-workspace 6.0.37 → 6.0.38
Sign up to get free protection for your applications and to get access to all the features.
- package/es/modules/tasks/components/TaskCheckActiveTab/index.less +3 -0
- package/es/modules/tasks/components/TaskCheckActiveTab/state.js +37 -35
- package/es/modules/tasks/components/TaskCheckActiveTab/state.js.map +1 -1
- package/es/modules/tasks/components/TaskCheckItem/index.less +1 -1
- package/es/modules/tasks/components/TaskCheckList/index.js +9 -4
- package/es/modules/tasks/components/TaskCheckList/index.js.map +1 -1
- package/es/modules/tasks/components/TaskCheckList/index.less +5 -0
- package/es/modules/tasks/components/TaskCheckList/state.d.ts +1 -0
- package/es/modules/tasks/components/TaskCheckList/state.js +2 -0
- package/es/modules/tasks/components/TaskCheckList/state.js.map +1 -1
- package/es/modules/tasks/components/TaskCheckNewForm/index.js +15 -25
- package/es/modules/tasks/components/TaskCheckNewForm/index.js.map +1 -1
- package/es/modules/tasks/components/TaskCheckNewForm/index.less +25 -7
- package/es/modules/tasks/components/TaskCheckNewForm/state.d.ts +3 -1
- package/es/modules/tasks/components/TaskCheckNewForm/state.js +13 -4
- package/es/modules/tasks/components/TaskCheckNewForm/state.js.map +1 -1
- package/package.json +1 -1
@@ -44,35 +44,43 @@ export class State {
|
|
44
44
|
}
|
45
45
|
update(list, type) {
|
46
46
|
list.map((i) => {
|
47
|
-
if (i.
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
if (
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
if (
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
if (
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
if (
|
73
|
-
|
74
|
-
|
75
|
-
|
47
|
+
if (i.taskStatus !== "Done") {
|
48
|
+
if (i.dueDate) {
|
49
|
+
const dueDate = dayjs(i.dueDate);
|
50
|
+
// 获取当前日期
|
51
|
+
const today = dayjs();
|
52
|
+
/** 获取明天的日期 */
|
53
|
+
const tomorrow = today.add(1, "day");
|
54
|
+
if (dueDate.isSame(today, "day")) {
|
55
|
+
if (type === "new")
|
56
|
+
this.todayList.push(i);
|
57
|
+
else
|
58
|
+
this.todayList = this.todayList.filter((item) => item.id !== i.id);
|
59
|
+
}
|
60
|
+
else if (dueDate.isSame(tomorrow, "day")) {
|
61
|
+
if (type === "new")
|
62
|
+
this.tomorrowList.push(i);
|
63
|
+
else
|
64
|
+
this.tomorrowList = this.tomorrowList.filter((item) => item.id !== i.id);
|
65
|
+
}
|
66
|
+
else if (dueDate.isBefore(today)) {
|
67
|
+
if (type === "new")
|
68
|
+
this.dueList.push(i);
|
69
|
+
else
|
70
|
+
this.dueList = this.dueList.filter((item) => item.id !== i.id);
|
71
|
+
}
|
72
|
+
else if (this.isDateInThisWeek(dueDate)) {
|
73
|
+
if (type === "new")
|
74
|
+
this.thisWeekList.push(i);
|
75
|
+
else
|
76
|
+
this.thisWeekList = this.thisWeekList.filter((item) => item.id !== i.id);
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
if (type === "new")
|
80
|
+
this.upcomingList.push(i);
|
81
|
+
else
|
82
|
+
this.upcomingList = this.upcomingList.filter((item) => item.id !== i.id);
|
83
|
+
}
|
76
84
|
}
|
77
85
|
else {
|
78
86
|
if (type === "new")
|
@@ -81,12 +89,6 @@ export class State {
|
|
81
89
|
this.upcomingList = this.upcomingList.filter((item) => item.id !== i.id);
|
82
90
|
}
|
83
91
|
}
|
84
|
-
else {
|
85
|
-
if (type === "new")
|
86
|
-
this.upcomingList.push(i);
|
87
|
-
else
|
88
|
-
this.upcomingList = this.upcomingList.filter((item) => item.id !== i.id);
|
89
|
-
}
|
90
92
|
});
|
91
93
|
}
|
92
94
|
/** 检查特定日期是否在本周内 */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckActiveTab/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,MAAM,OAAO,KAAK;IACjB;QAImB;;;;mBAAgB,CAAC;WAAC;QACrC,gDAAgD;QAC7B;;;;mBAAmB,EAAE;WAAC;QACtB;;;;mBAAqB,EAAE;WAAC;QACxB;;;;mBAAwB,EAAE;WAAC;QAC3B;;;;mBAAwB,EAAE;WAAC;QAC3B;;;;mBAAwB,EAAE;WAAC;QAT7C,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAUc,MAAM,CAAC,IAAa,EAAE,IAAoB;QACxD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACd,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckActiveTab/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,MAAM,OAAO,KAAK;IACjB;QAImB;;;;mBAAgB,CAAC;WAAC;QACrC,gDAAgD;QAC7B;;;;mBAAmB,EAAE;WAAC;QACtB;;;;mBAAqB,EAAE;WAAC;QACxB;;;;mBAAwB,EAAE;WAAC;QAC3B;;;;mBAAwB,EAAE;WAAC;QAC3B;;;;mBAAwB,EAAE;WAAC;QAT7C,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAUc,MAAM,CAAC,IAAa,EAAE,IAAoB;QACxD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACd,IAAI,CAAC,CAAC,UAAU,KAAK,MAAM,EAAE,CAAC;gBAC7B,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;oBACf,MAAM,OAAO,GAAG,KAAK,CAAC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AAW,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CACrE,CAAC;IACH,CAAC;CACD;AAvDmB;IAAlB,UAAU;oCAA0B;AAElB;IAAlB,UAAU;sCAA8B;AACtB;IAAlB,UAAU;wCAAgC;AACxB;IAAlB,UAAU;2CAAmC;AAC3B;IAAlB,UAAU;2CAAmC;AAC3B;IAAlB,UAAU;2CAAmC;AAE/B;IAAd,MAAM;mCAgCN;AAGc;IAAd,MAAM;6CAWN"}
|
@@ -2,12 +2,14 @@ import React, { useState, useMemo } from "react";
|
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
3
3
|
import TaskCheckActiveTab from "../TaskCheckActiveTab";
|
4
4
|
import TaskCheckDoneTab from "../TaskCheckDoneTab";
|
5
|
-
import { Button, Tabs, Badge } from "antd";
|
5
|
+
import { Button, Tabs, Badge, Popover } from "antd";
|
6
6
|
import { Scrollbars } from "react-custom-scrollbars-2";
|
7
7
|
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
8
8
|
import { faEllipsis } from "@fortawesome/pro-solid-svg-icons";
|
9
|
+
import { faEllipsis as faEllipsisLight } from "@fortawesome/pro-light-svg-icons";
|
9
10
|
import TaskCheckNewForm from "../TaskCheckNewForm";
|
10
11
|
import { State } from "./state";
|
12
|
+
import { PlusOutlined } from "@ant-design/icons";
|
11
13
|
import classnames from "classnames";
|
12
14
|
import { useTaskListEffect } from "@voplus/morpho-document-core";
|
13
15
|
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
@@ -37,9 +39,12 @@ const TaskCheckList = (props) => {
|
|
37
39
|
React.createElement("div", { className: "task-check-header" },
|
38
40
|
React.createElement("h3", { className: "text-lg font-medium leading-6 text-gray-900" }, "Tasks"),
|
39
41
|
React.createElement("div", null,
|
40
|
-
React.createElement(
|
41
|
-
React.createElement(
|
42
|
-
|
42
|
+
React.createElement(Popover, { content: React.createElement(React.Fragment, null, "Show Done Tasts") },
|
43
|
+
React.createElement(Button, { type: "primary", onClick: onMore },
|
44
|
+
React.createElement(FAIcon, { icon: state.showTabbar ? faEllipsis : faEllipsisLight }))),
|
45
|
+
React.createElement(Button, { onClick: onCreate, className: "task-check-add" },
|
46
|
+
React.createElement(PlusOutlined, null)))),
|
47
|
+
React.createElement(Tabs, { className: classnames("task-check-tabs", { "show-tabbar": state.showTabbar }), activeKey: state.activeKey, onChange: (activeKey) => (state.activeKey = activeKey), items: [
|
43
48
|
{
|
44
49
|
key: "Active",
|
45
50
|
label: (React.createElement(React.Fragment, null,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAA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export class State {
|
|
8
8
|
writable: true,
|
9
9
|
value: false
|
10
10
|
});
|
11
|
+
/** 如果 Active / Done 都有内容 應該default 顯示 tabbar */
|
11
12
|
Object.defineProperty(this, "showTabbar", {
|
12
13
|
enumerable: true,
|
13
14
|
configurable: true,
|
@@ -39,6 +40,7 @@ export class State {
|
|
39
40
|
}
|
40
41
|
updateDoneTotals(total) {
|
41
42
|
this.doneTotals = total;
|
43
|
+
this.showTabbar = true;
|
42
44
|
}
|
43
45
|
}
|
44
46
|
__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckList/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,OAAO,KAAK;IACjB;QAImB;;;;mBAAU,KAAK;WAAC;
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckList/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,OAAO,KAAK;IACjB;QAImB;;;;mBAAU,KAAK;WAAC;QACnC,gDAAgD;QAC7B;;;;mBAAa,KAAK;WAAC;QACnB;;;;mBAAY,QAAQ;WAAC;QACrB;;;;;WAAsB;QACtB;;;;;WAAoB;QARtC,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IASc,kBAAkB,CAAC,KAAa;QAC9C,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC3B,CAAC;IAEc,gBAAgB,CAAC,KAAa;QAC5C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;CACD;AAfmB;IAAlB,UAAU;sCAAwB;AAEhB;IAAlB,UAAU;yCAA2B;AACnB;IAAlB,UAAU;wCAA6B;AACrB;IAAlB,UAAU;2CAA8B;AACtB;IAAlB,UAAU;yCAA4B;AAExB;IAAd,MAAM;+CAEN;AAEc;IAAd,MAAM;6CAGN"}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
|
-
import { Col, Spin, Form, Input, Row, message } from "antd";
|
2
|
+
import { Col, Spin, Form, Input, Row, message, Button } from "antd";
|
3
3
|
import { State } from "./state";
|
4
4
|
import { observe } from "@voplus/morpho-ui";
|
5
5
|
import PresetDatePicker from "@voplus/morpho-ui/es/controls/PresetDatePicker";
|
6
6
|
import { runInAction } from "mobx";
|
7
7
|
import { useTaskStore } from "@voplus/morpho-document-core";
|
8
|
-
import {
|
8
|
+
import { faCalendar } from "@fortawesome/pro-light-svg-icons";
|
9
9
|
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
10
10
|
import classnames from "classnames";
|
11
11
|
import "./index.less";
|
@@ -21,34 +21,24 @@ const TaskCheckNewForm = (props) => {
|
|
21
21
|
React.createElement(Col, { flex: 1 },
|
22
22
|
React.createElement(Input, { autoFocus: true, value: state.params.Name, className: "task-name-input", placeholder: `Enter a title for this task`, onChange: (e) => runInAction(() => (state.params.Name = e.target.value)), onPressEnter: onSubmit, onKeyDown: onKeyDown })),
|
23
23
|
React.createElement(Col, null,
|
24
|
-
React.createElement("
|
25
|
-
React.createElement(
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
if (inputlement) {
|
39
|
-
inputlement.focus();
|
40
|
-
}
|
41
|
-
}, style: { width: "100%" } })),
|
42
|
-
React.createElement(Col, null,
|
43
|
-
React.createElement("span", { className: "dueDate" }, "Due Dtae"))))))))));
|
24
|
+
React.createElement("div", { className: "task-due-date-content" },
|
25
|
+
state.dueDateString ? (React.createElement("div", { className: "due-val-content", onClick: () => (state.openDate = true) },
|
26
|
+
React.createElement("div", { className: "dueDate" }, "Due"),
|
27
|
+
React.createElement(React.Fragment, null, state.dueDateString))) : (React.createElement(Button, { type: "primary", className: "task-due-date-bnt", icon: React.createElement(FAIcon, { icon: faCalendar }), onClick: () => (state.openDate = true) })),
|
28
|
+
React.createElement(PresetDatePicker, { className: "task-preset-date-picker", open: state.openDate, onChange: (preset, date) => {
|
29
|
+
state.params.DueDate = dayjs(date).format("YYYY-MM-DD");
|
30
|
+
state.dueDateString = preset ? preset : dayjs(date).format("YYYY-MM-DD");
|
31
|
+
state.openDate = false;
|
32
|
+
const inputlement = document.querySelector(".task-name-input");
|
33
|
+
if (inputlement) {
|
34
|
+
inputlement.focus();
|
35
|
+
}
|
36
|
+
}, style: { width: "100%" } }))))))))));
|
44
37
|
function onKeyDown(e) {
|
45
38
|
if (e.keyCode !== 27)
|
46
39
|
return;
|
47
40
|
onCancel();
|
48
41
|
}
|
49
|
-
function onShowMore() {
|
50
|
-
state.showMore = !state.showMore;
|
51
|
-
}
|
52
42
|
async function onSubmit() {
|
53
43
|
var _a;
|
54
44
|
if (!state.params.Name)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckNewForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckNewForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,M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relative;
|
11
|
+
.task-preset-date-picker {
|
12
|
+
position: absolute;
|
13
|
+
left: 0;
|
14
|
+
top: 0;
|
15
|
+
z-index: -1;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
.task-due-date-bnt {
|
19
|
+
width: 40px;
|
20
|
+
font-size: 18px;
|
11
21
|
cursor: pointer;
|
22
|
+
display: inline-flex;
|
23
|
+
align-items: center;
|
24
|
+
justify-content: center;
|
12
25
|
}
|
13
|
-
.
|
14
|
-
|
15
|
-
line-height:
|
16
|
-
color:
|
17
|
-
|
26
|
+
.due-val-content {
|
27
|
+
min-width: 30px;
|
28
|
+
line-height: 18px;
|
29
|
+
background-color: #fff;
|
30
|
+
cursor: pointer;
|
31
|
+
.dueDate {
|
32
|
+
font-size: 12px;
|
33
|
+
line-height: 14px;
|
34
|
+
color: @heading-subtitle-color;
|
35
|
+
}
|
18
36
|
}
|
19
37
|
}
|
20
38
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Dayjs } from "dayjs";
|
1
2
|
export declare class State {
|
2
3
|
constructor();
|
3
4
|
Params: {
|
@@ -10,6 +11,7 @@ export declare class State {
|
|
10
11
|
DueDate: string;
|
11
12
|
InheritMembers: boolean;
|
12
13
|
};
|
13
|
-
showMore: boolean;
|
14
14
|
loading: boolean;
|
15
|
+
openDate: boolean;
|
16
|
+
dueDateString?: string | Dayjs;
|
15
17
|
}
|
@@ -18,18 +18,24 @@ export class State {
|
|
18
18
|
writable: true,
|
19
19
|
value: this.Params
|
20
20
|
});
|
21
|
-
Object.defineProperty(this, "
|
21
|
+
Object.defineProperty(this, "loading", {
|
22
22
|
enumerable: true,
|
23
23
|
configurable: true,
|
24
24
|
writable: true,
|
25
25
|
value: false
|
26
26
|
});
|
27
|
-
Object.defineProperty(this, "
|
27
|
+
Object.defineProperty(this, "openDate", {
|
28
28
|
enumerable: true,
|
29
29
|
configurable: true,
|
30
30
|
writable: true,
|
31
31
|
value: false
|
32
32
|
});
|
33
|
+
Object.defineProperty(this, "dueDateString", {
|
34
|
+
enumerable: true,
|
35
|
+
configurable: true,
|
36
|
+
writable: true,
|
37
|
+
value: void 0
|
38
|
+
});
|
33
39
|
makeObservable(this);
|
34
40
|
}
|
35
41
|
}
|
@@ -38,8 +44,11 @@ __decorate([
|
|
38
44
|
], State.prototype, "params", void 0);
|
39
45
|
__decorate([
|
40
46
|
observable
|
41
|
-
], State.prototype, "
|
47
|
+
], State.prototype, "loading", void 0);
|
42
48
|
__decorate([
|
43
49
|
observable
|
44
|
-
], State.prototype, "
|
50
|
+
], State.prototype, "openDate", void 0);
|
51
|
+
__decorate([
|
52
|
+
observable
|
53
|
+
], State.prototype, "dueDateString", void 0);
|
45
54
|
//# sourceMappingURL=state.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckNewForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,OAAO,KAAK;IACjB;QAGO;;;;mBAAS;gBACf,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,EAAE;gBACX,cAAc,EAAE,KAAK;aACrB;WAAC;QACiB;;;;mBAAS,IAAI,CAAC,MAAM;WAAC;QACrB;;;;
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/TaskCheckNewForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,OAAO,KAAK;IACjB;QAGO;;;;mBAAS;gBACf,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,EAAE;gBACX,cAAc,EAAE,KAAK;aACrB;WAAC;QACiB;;;;mBAAS,IAAI,CAAC,MAAM;WAAC;QACrB;;;;mBAAU,KAAK;WAAC;QAChB;;;;mBAAW,KAAK;WAAC;QACjB;;;;;WAA+B;QAVjD,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CAUD;AAJmB;IAAlB,UAAU;qCAA6B;AACrB;IAAlB,UAAU;sCAAwB;AAChB;IAAlB,UAAU;uCAAyB;AACjB;IAAlB,UAAU;4CAAuC"}
|