@blinkk/root-cms 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +5 -5
- package/dist/{chunk-2BSW7SIH.js → chunk-N4K6ICFR.js} +4 -4
- package/dist/{chunk-BGTUWIV6.js → chunk-PNLLZXVY.js} +4 -4
- package/dist/{chunk-3HARN4U6.js → chunk-RLZFZT42.js} +176 -83
- package/dist/{chunk-C245C557.js → chunk-RXWDB3K4.js} +3 -3
- package/dist/{chunk-XLX37FRL.js → chunk-TEKMLYXS.js} +3 -4
- package/dist/cli/cli.d.ts +12 -0
- package/dist/cli/docs.d.ts +49 -0
- package/dist/cli/export.d.ts +11 -0
- package/dist/cli/generate-types.d.ts +6 -0
- package/dist/cli/import.d.ts +13 -0
- package/dist/cli/init-firebase.d.ts +7 -0
- package/dist/cli/utils.d.ts +27 -0
- package/dist/cli.js +10 -10
- package/dist/client.js +1 -1
- package/dist/core/ai-tools.d.ts +156 -0
- package/dist/core/ai.d.ts +330 -0
- package/dist/core/api.d.ts +21 -0
- package/dist/core/app.d.ts +16 -0
- package/dist/core/checks-translations.d.ts +13 -0
- package/dist/core/checks.d.ts +48 -0
- package/dist/core/client.d.ts +715 -0
- package/dist/core/core.d.ts +5 -0
- package/dist/core/cron.d.ts +19 -0
- package/dist/core/csv.d.ts +5 -0
- package/dist/core/functions.d.ts +9 -0
- package/dist/core/plugin.d.ts +357 -0
- package/dist/{project.d.ts → core/project.d.ts} +8 -12
- package/dist/core/richtext.d.ts +101 -0
- package/dist/{core.d.ts → core/route.d.ts} +13 -66
- package/dist/core/runtime.d.ts +46 -0
- package/dist/{schema-Db_xODoi.d.ts → core/schema.d.ts} +47 -100
- package/dist/core/search-extract.d.ts +70 -0
- package/dist/core/search-index.d.ts +182 -0
- package/dist/core/search-query.d.ts +68 -0
- package/dist/core/security.d.ts +6 -0
- package/dist/core/server-version.d.ts +5 -0
- package/dist/core/services-notifications.d.ts +57 -0
- package/dist/core/services.d.ts +44 -0
- package/dist/core/sse.d.ts +10 -0
- package/dist/core/translations-manager.d.ts +187 -0
- package/dist/core/translations.d.ts +83 -0
- package/dist/core/url-safety.d.ts +19 -0
- package/dist/core/validation.d.ts +30 -0
- package/dist/core/values.d.ts +9 -0
- package/dist/core/versions.d.ts +48 -0
- package/dist/core.js +1 -1
- package/dist/edit-M4PN4SGX.js +7 -0
- package/dist/functions.js +4 -4
- package/dist/{generate-types-SPV7I3A5.js → generate-types-JWIG4QVI.js} +1 -1
- package/dist/plugin.js +128 -133
- package/dist/shared/marshal.d.ts +68 -0
- package/dist/shared/objects.d.ts +9 -0
- package/dist/shared/richtext.d.ts +74 -0
- package/dist/shared/safe-json.d.ts +11 -0
- package/dist/shared/sanitize.d.ts +12 -0
- package/dist/shared/slug.d.ts +19 -0
- package/dist/shared/sse.d.ts +16 -0
- package/dist/shared/strings.d.ts +23 -0
- package/dist/ui/AIPage-YI3RFK5F.js +1 -0
- package/dist/ui/AssetsPage-4JNAOFYF.js +1 -0
- package/dist/ui/CollectionPage-JWHH5G55.js +1 -0
- package/dist/ui/ComparePage-YZE3EMU4.js +1 -0
- package/dist/ui/DataPage-VRCQSZZG.js +1 -0
- package/dist/ui/DataSourcePage-WMSPBZ3W.js +1 -0
- package/dist/ui/DocTranslationsPage-RY2LOZBX.js +1 -0
- package/dist/ui/DocumentPage-EEGTJMIW.js +1 -0
- package/dist/ui/EditDataSourcePage-LLCX6K4J.js +1 -0
- package/dist/ui/EditReleasePage-WQYXXMZQ.js +1 -0
- package/dist/ui/ImageEditorDialog-4H665KK2.js +81 -0
- package/dist/ui/ImageEditorDialog-4H665KK2.js.LEGAL.txt +17 -0
- package/dist/ui/LogsPage-IP2DKEYR.js +1 -0
- package/dist/ui/NewDataSourcePage-RDYJC4DH.js +1 -0
- package/dist/ui/NewReleasePage-DGMFU2JN.js +1 -0
- package/dist/ui/NotFoundPage-WDZ2K7EF.js +1 -0
- package/dist/ui/ProjectPage-HYJOQUWR.js +1 -0
- package/dist/ui/ReleasePage-2KSF23TK.js +1 -0
- package/dist/ui/ReleasesPage-NZIBBXU4.js +1 -0
- package/dist/ui/SettingsPage-36XFWV62.js +1 -0
- package/dist/ui/SidebarToolsPage-5C6YBWJ7.js +1 -0
- package/dist/ui/TaskPage-SPIFPGPP.js +1 -0
- package/dist/ui/TasksPage-ZOXRPBQV.js +1 -0
- package/dist/ui/TranslationsArbPage-UHANA7JD.js +2 -0
- package/dist/ui/TranslationsEditPage-PQY6W5YG.js +1 -0
- package/dist/ui/TranslationsPage-V2PQFCN5.js +162 -0
- package/dist/ui/ai-tools-5E5ELLZX.js +1 -0
- package/dist/ui/chunk-3IYZCUPI.js +1 -0
- package/dist/ui/chunk-4KE2SZKH.js +1 -0
- package/dist/ui/chunk-4W73RW5I.js +1 -0
- package/dist/ui/chunk-54DVDYU6.js +1 -0
- package/dist/ui/chunk-5MV6XVGA.js +1 -0
- package/dist/ui/chunk-62UWGWON.js +1 -0
- package/dist/ui/chunk-767BAQ53.js +1 -0
- package/dist/ui/chunk-AFWBSIPL.js +1 -0
- package/dist/ui/chunk-AL3TN2KI.js +1 -0
- package/dist/ui/chunk-BZIRGB4W.js +1 -0
- package/dist/ui/chunk-C5NH23G4.js +3 -0
- package/dist/ui/chunk-CGCKJFL4.js +1 -0
- package/dist/ui/chunk-DEGMKEHP.js +1 -0
- package/dist/ui/chunk-DTMZLUNY.js +15 -0
- package/dist/ui/chunk-DTMZLUNY.js.LEGAL.txt +237 -0
- package/dist/ui/chunk-DUJYIOLE.js +5 -0
- package/dist/ui/chunk-E2RCCK2T.js +1 -0
- package/dist/ui/chunk-EGEB6N4J.js +22 -0
- package/dist/ui/chunk-EGEB6N4J.js.LEGAL.txt +1059 -0
- package/dist/ui/chunk-FBJURT7Z.js +1 -0
- package/dist/ui/chunk-GXSAEPU3.js +1 -0
- package/dist/ui/chunk-HHMG665Z.js +1 -0
- package/dist/ui/chunk-HKINZLMW.js +84 -0
- package/dist/ui/chunk-HLMBCVRX.js +1 -0
- package/dist/ui/chunk-HRGYNHZ3.js +1 -0
- package/dist/ui/chunk-I6ICVKEC.js +1 -0
- package/dist/ui/chunk-JDW4UORS.js +1 -0
- package/dist/ui/chunk-JHBAMPGB.js +1 -0
- package/dist/ui/chunk-JT5L6GPZ.js +141 -0
- package/dist/ui/chunk-JT5L6GPZ.js.LEGAL.txt +106 -0
- package/dist/ui/chunk-JYFLU7DM.js +19 -0
- package/dist/ui/chunk-JZFTZ4X4.js +87 -0
- package/dist/ui/chunk-JZFTZ4X4.js.LEGAL.txt +9 -0
- package/dist/ui/chunk-KFAZBEPV.js +1 -0
- package/dist/ui/chunk-KKEWCXVV.js +1 -0
- package/dist/ui/chunk-KUCVLANF.js +1 -0
- package/dist/ui/chunk-KYDOSLTO.js +1 -0
- package/dist/ui/chunk-L4RHGQUG.js +1 -0
- package/dist/ui/chunk-MDUBCXU2.js +1 -0
- package/dist/ui/chunk-NXQVLOTK.js +1 -0
- package/dist/ui/chunk-NZHF733K.js +7 -0
- package/dist/ui/chunk-NZHF733K.js.LEGAL.txt +146 -0
- package/dist/ui/chunk-ONTGW2VA.js +1 -0
- package/dist/ui/chunk-ORXEMIQC.js +1 -0
- package/dist/ui/chunk-P3NETZZP.js +1 -0
- package/dist/ui/chunk-PHBMVORG.js +1 -0
- package/dist/ui/chunk-PJA7YP4A.js +1 -0
- package/dist/ui/chunk-PVAE643M.js +1 -0
- package/dist/ui/chunk-PWKJDYE2.js +1 -0
- package/dist/ui/chunk-RSVO46S3.js +1 -0
- package/dist/ui/chunk-SKEP5WYH.js +10 -0
- package/dist/ui/chunk-SKEP5WYH.js.LEGAL.txt +176 -0
- package/dist/ui/chunk-SQRKKWRG.js +3 -0
- package/dist/ui/chunk-TJBVMFNQ.js +1 -0
- package/dist/ui/chunk-V7S4IAGB.js +1 -0
- package/dist/ui/chunk-VMT7JFAM.js +1 -0
- package/dist/ui/chunk-W3BJ2EZX.js +1 -0
- package/dist/ui/chunk-W3HIZQ4Z.js +1 -0
- package/dist/ui/chunk-X2WHBGTP.js +1 -0
- package/dist/ui/chunk-XOQ3KDSR.js +3 -0
- package/dist/ui/chunk-YDO2EDVY.js +1 -0
- package/dist/ui/chunk-YFA6U2CV.js +1 -0
- package/dist/ui/gcs-L33FIRZU.js +1 -0
- package/dist/ui/prerender-Q4YSDCPB.js +1 -0
- package/dist/ui/signin.js +1 -1
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +1 -630
- package/dist/ui/ui.js.LEGAL.txt +19 -732
- package/package.json +20 -20
- package/dist/client-1puwLgNx.d.ts +0 -1552
- package/dist/client.d.ts +0 -5
- package/dist/edit-MT4B37QK.js +0 -7
- package/dist/functions.d.ts +0 -13
- package/dist/plugin.d.ts +0 -5
- package/dist/richtext.d.ts +0 -104
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Bundled license information:
|
|
2
|
+
|
|
3
|
+
react-is/cjs/react-is.production.min.js:
|
|
4
|
+
/** @license React v16.13.1
|
|
5
|
+
* react-is.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@tabler/icons-preact/dist/esm/defaultAttributes.mjs:
|
|
14
|
+
@tabler/icons-preact/dist/esm/createPreactComponent.mjs:
|
|
15
|
+
@tabler/icons-preact/dist/esm/icons/IconArchive.mjs:
|
|
16
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowLeft.mjs:
|
|
17
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowUpRight.mjs:
|
|
18
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowsHorizontal.mjs:
|
|
19
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowsVertical.mjs:
|
|
20
|
+
@tabler/icons-preact/dist/esm/icons/IconBraces.mjs:
|
|
21
|
+
@tabler/icons-preact/dist/esm/icons/IconCalendar.mjs:
|
|
22
|
+
@tabler/icons-preact/dist/esm/icons/IconCheck.mjs:
|
|
23
|
+
@tabler/icons-preact/dist/esm/icons/IconCirclePlus.mjs:
|
|
24
|
+
@tabler/icons-preact/dist/esm/icons/IconCloudOff.mjs:
|
|
25
|
+
@tabler/icons-preact/dist/esm/icons/IconCopy.mjs:
|
|
26
|
+
@tabler/icons-preact/dist/esm/icons/IconCornerDownRight.mjs:
|
|
27
|
+
@tabler/icons-preact/dist/esm/icons/IconDeviceFloppy.mjs:
|
|
28
|
+
@tabler/icons-preact/dist/esm/icons/IconExternalLink.mjs:
|
|
29
|
+
@tabler/icons-preact/dist/esm/icons/IconFileDownload.mjs:
|
|
30
|
+
@tabler/icons-preact/dist/esm/icons/IconFileUpload.mjs:
|
|
31
|
+
@tabler/icons-preact/dist/esm/icons/IconFlag.mjs:
|
|
32
|
+
@tabler/icons-preact/dist/esm/icons/IconLayoutSidebarRightCollapse.mjs:
|
|
33
|
+
@tabler/icons-preact/dist/esm/icons/IconLayoutSidebarRightExpand.mjs:
|
|
34
|
+
@tabler/icons-preact/dist/esm/icons/IconMessageCircle.mjs:
|
|
35
|
+
@tabler/icons-preact/dist/esm/icons/IconMoodLookDown.mjs:
|
|
36
|
+
@tabler/icons-preact/dist/esm/icons/IconPaperclip.mjs:
|
|
37
|
+
@tabler/icons-preact/dist/esm/icons/IconPencil.mjs:
|
|
38
|
+
@tabler/icons-preact/dist/esm/icons/IconRestore.mjs:
|
|
39
|
+
@tabler/icons-preact/dist/esm/icons/IconScissors.mjs:
|
|
40
|
+
@tabler/icons-preact/dist/esm/icons/IconSettings.mjs:
|
|
41
|
+
@tabler/icons-preact/dist/esm/icons/IconTable.mjs:
|
|
42
|
+
@tabler/icons-preact/dist/esm/icons/IconTool.mjs:
|
|
43
|
+
@tabler/icons-preact/dist/esm/icons/IconTrash.mjs:
|
|
44
|
+
@tabler/icons-preact/dist/esm/icons/IconUser.mjs:
|
|
45
|
+
@tabler/icons-preact/dist/esm/icons/IconX.mjs:
|
|
46
|
+
@tabler/icons-preact/dist/esm/icons/IconTrashFilled.mjs:
|
|
47
|
+
@tabler/icons-preact/dist/esm/icons/IconAlarmOff.mjs:
|
|
48
|
+
@tabler/icons-preact/dist/esm/icons/IconAlertTriangle.mjs:
|
|
49
|
+
@tabler/icons-preact/dist/esm/icons/IconAlignJustified.mjs:
|
|
50
|
+
@tabler/icons-preact/dist/esm/icons/IconArchiveOff.mjs:
|
|
51
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowBackUp.mjs:
|
|
52
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowBack.mjs:
|
|
53
|
+
@tabler/icons-preact/dist/esm/icons/IconArrowRight.mjs:
|
|
54
|
+
@tabler/icons-preact/dist/esm/icons/IconBold.mjs:
|
|
55
|
+
@tabler/icons-preact/dist/esm/icons/IconBracketsAngle.mjs:
|
|
56
|
+
@tabler/icons-preact/dist/esm/icons/IconCapsuleHorizontal.mjs:
|
|
57
|
+
@tabler/icons-preact/dist/esm/icons/IconCarrot.mjs:
|
|
58
|
+
@tabler/icons-preact/dist/esm/icons/IconChevronDown.mjs:
|
|
59
|
+
@tabler/icons-preact/dist/esm/icons/IconChevronRight.mjs:
|
|
60
|
+
@tabler/icons-preact/dist/esm/icons/IconCircleArrowDown.mjs:
|
|
61
|
+
@tabler/icons-preact/dist/esm/icons/IconCircleArrowUp.mjs:
|
|
62
|
+
@tabler/icons-preact/dist/esm/icons/IconClearFormatting.mjs:
|
|
63
|
+
@tabler/icons-preact/dist/esm/icons/IconClipboardCopy.mjs:
|
|
64
|
+
@tabler/icons-preact/dist/esm/icons/IconClipboardList.mjs:
|
|
65
|
+
@tabler/icons-preact/dist/esm/icons/IconClipboard.mjs:
|
|
66
|
+
@tabler/icons-preact/dist/esm/icons/IconClock.mjs:
|
|
67
|
+
@tabler/icons-preact/dist/esm/icons/IconCode.mjs:
|
|
68
|
+
@tabler/icons-preact/dist/esm/icons/IconColumns3.mjs:
|
|
69
|
+
@tabler/icons-preact/dist/esm/icons/IconCrop.mjs:
|
|
70
|
+
@tabler/icons-preact/dist/esm/icons/IconDatabase.mjs:
|
|
71
|
+
@tabler/icons-preact/dist/esm/icons/IconDeviceDesktop.mjs:
|
|
72
|
+
@tabler/icons-preact/dist/esm/icons/IconDeviceIpad.mjs:
|
|
73
|
+
@tabler/icons-preact/dist/esm/icons/IconDeviceMobile.mjs:
|
|
74
|
+
@tabler/icons-preact/dist/esm/icons/IconDotsVertical.mjs:
|
|
75
|
+
@tabler/icons-preact/dist/esm/icons/IconDots.mjs:
|
|
76
|
+
@tabler/icons-preact/dist/esm/icons/IconDownload.mjs:
|
|
77
|
+
@tabler/icons-preact/dist/esm/icons/IconFileDiff.mjs:
|
|
78
|
+
@tabler/icons-preact/dist/esm/icons/IconFile.mjs:
|
|
79
|
+
@tabler/icons-preact/dist/esm/icons/IconFilter.mjs:
|
|
80
|
+
@tabler/icons-preact/dist/esm/icons/IconFolder.mjs:
|
|
81
|
+
@tabler/icons-preact/dist/esm/icons/IconGitCompare.mjs:
|
|
82
|
+
@tabler/icons-preact/dist/esm/icons/IconGripVertical.mjs:
|
|
83
|
+
@tabler/icons-preact/dist/esm/icons/IconH1.mjs:
|
|
84
|
+
@tabler/icons-preact/dist/esm/icons/IconH2.mjs:
|
|
85
|
+
@tabler/icons-preact/dist/esm/icons/IconH3.mjs:
|
|
86
|
+
@tabler/icons-preact/dist/esm/icons/IconH4.mjs:
|
|
87
|
+
@tabler/icons-preact/dist/esm/icons/IconH5.mjs:
|
|
88
|
+
@tabler/icons-preact/dist/esm/icons/IconHistory.mjs:
|
|
89
|
+
@tabler/icons-preact/dist/esm/icons/IconHome.mjs:
|
|
90
|
+
@tabler/icons-preact/dist/esm/icons/IconInfoCircle.mjs:
|
|
91
|
+
@tabler/icons-preact/dist/esm/icons/IconItalic.mjs:
|
|
92
|
+
@tabler/icons-preact/dist/esm/icons/IconJson.mjs:
|
|
93
|
+
@tabler/icons-preact/dist/esm/icons/IconLanguageOff.mjs:
|
|
94
|
+
@tabler/icons-preact/dist/esm/icons/IconLanguage.mjs:
|
|
95
|
+
@tabler/icons-preact/dist/esm/icons/IconLayoutGrid.mjs:
|
|
96
|
+
@tabler/icons-preact/dist/esm/icons/IconLayoutList.mjs:
|
|
97
|
+
@tabler/icons-preact/dist/esm/icons/IconLink.mjs:
|
|
98
|
+
@tabler/icons-preact/dist/esm/icons/IconListCheck.mjs:
|
|
99
|
+
@tabler/icons-preact/dist/esm/icons/IconListNumbers.mjs:
|
|
100
|
+
@tabler/icons-preact/dist/esm/icons/IconList.mjs:
|
|
101
|
+
@tabler/icons-preact/dist/esm/icons/IconLoader2.mjs:
|
|
102
|
+
@tabler/icons-preact/dist/esm/icons/IconLockOpen.mjs:
|
|
103
|
+
@tabler/icons-preact/dist/esm/icons/IconLock.mjs:
|
|
104
|
+
@tabler/icons-preact/dist/esm/icons/IconLogout.mjs:
|
|
105
|
+
@tabler/icons-preact/dist/esm/icons/IconMapPin.mjs:
|
|
106
|
+
@tabler/icons-preact/dist/esm/icons/IconMessageCirclePlus.mjs:
|
|
107
|
+
@tabler/icons-preact/dist/esm/icons/IconMessage.mjs:
|
|
108
|
+
@tabler/icons-preact/dist/esm/icons/IconPackage.mjs:
|
|
109
|
+
@tabler/icons-preact/dist/esm/icons/IconPhotoStar.mjs:
|
|
110
|
+
@tabler/icons-preact/dist/esm/icons/IconPhotoUp.mjs:
|
|
111
|
+
@tabler/icons-preact/dist/esm/icons/IconPhoto.mjs:
|
|
112
|
+
@tabler/icons-preact/dist/esm/icons/IconPlanet.mjs:
|
|
113
|
+
@tabler/icons-preact/dist/esm/icons/IconPlayerPlay.mjs:
|
|
114
|
+
@tabler/icons-preact/dist/esm/icons/IconPlayerStop.mjs:
|
|
115
|
+
@tabler/icons-preact/dist/esm/icons/IconPuzzle.mjs:
|
|
116
|
+
@tabler/icons-preact/dist/esm/icons/IconQuote.mjs:
|
|
117
|
+
@tabler/icons-preact/dist/esm/icons/IconReload.mjs:
|
|
118
|
+
@tabler/icons-preact/dist/esm/icons/IconRobot.mjs:
|
|
119
|
+
@tabler/icons-preact/dist/esm/icons/IconRocket.mjs:
|
|
120
|
+
@tabler/icons-preact/dist/esm/icons/IconRowInsertBottom.mjs:
|
|
121
|
+
@tabler/icons-preact/dist/esm/icons/IconRowInsertTop.mjs:
|
|
122
|
+
@tabler/icons-preact/dist/esm/icons/IconSearch.mjs:
|
|
123
|
+
@tabler/icons-preact/dist/esm/icons/IconSend2.mjs:
|
|
124
|
+
@tabler/icons-preact/dist/esm/icons/IconSeparatorHorizontal.mjs:
|
|
125
|
+
@tabler/icons-preact/dist/esm/icons/IconSparkles.mjs:
|
|
126
|
+
@tabler/icons-preact/dist/esm/icons/IconSquareCheck.mjs:
|
|
127
|
+
@tabler/icons-preact/dist/esm/icons/IconSquare.mjs:
|
|
128
|
+
@tabler/icons-preact/dist/esm/icons/IconStrikethrough.mjs:
|
|
129
|
+
@tabler/icons-preact/dist/esm/icons/IconSubscript.mjs:
|
|
130
|
+
@tabler/icons-preact/dist/esm/icons/IconSuperscript.mjs:
|
|
131
|
+
@tabler/icons-preact/dist/esm/icons/IconTagMinus.mjs:
|
|
132
|
+
@tabler/icons-preact/dist/esm/icons/IconTagPlus.mjs:
|
|
133
|
+
@tabler/icons-preact/dist/esm/icons/IconTag.mjs:
|
|
134
|
+
@tabler/icons-preact/dist/esm/icons/IconUnderline.mjs:
|
|
135
|
+
@tabler/icons-preact/dist/esm/icons/IconUserPlus.mjs:
|
|
136
|
+
@tabler/icons-preact/dist/esm/icons/IconWorld.mjs:
|
|
137
|
+
@tabler/icons-preact/dist/esm/icons/IconCircleCheckFilled.mjs:
|
|
138
|
+
@tabler/icons-preact/dist/esm/icons/IconSquareCheckFilled.mjs:
|
|
139
|
+
@tabler/icons-preact/dist/esm/icons/IconTriangleFilled.mjs:
|
|
140
|
+
@tabler/icons-preact/dist/esm/tabler-icons-preact.mjs:
|
|
141
|
+
/**
|
|
142
|
+
* @license @tabler/icons-preact v3.35.0 - MIT
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the MIT license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as a}from"./chunk-AL3TN2KI.js";import{Ga as r,Ha as i}from"./chunk-NZHF733K.js";import{d as l}from"./chunk-KUCVLANF.js";function s(o,n){if(n in o)return o[n];let e=`*@${n.split("@").at(-1)}`;return e in o?o[e]:null}function d(o,n){let t=s(o,n);return t==="ADMIN"||t==="EDITOR"}function c(o,n){let t=s(o,n);return t==="ADMIN"||t==="EDITOR"||t==="CONTRIBUTOR"}function f(o){return o.condition?i(r,{label:o.label,children:i("div",{className:a(o.className,"ConditionalTooltip"),style:o.style,children:i("div",{className:"ConditionalTooltip__content",children:o.children})})}):i(l,{children:o.children})}export{d as a,c as b,f as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g,g as d,i as l,j as p,o as h}from"./chunk-EGEB6N4J.js";var r={year:31536e6,month:2628e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3};function w(e,t){let n=Math.abs(e-new Date().getTime());if(n<r.second)return"just now";let i=t||{numeric:"auto"},o=new Intl.RelativeTimeFormat("en",i);return n<r.minute?o.format(Math.round(-n/r.second),"second"):n<r.hour?o.format(Math.round(-n/r.minute),"minute"):n<r.day?o.format(Math.round(-n/r.hour),"hour"):n<r.week?o.format(Math.round(-n/r.day),"day"):new Date(e).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric"})}function f(){return Math.floor(new Date().getTime())}function I(e){return new Date(e.toMillis()).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function M(){let e=a=>a<10?"0"+a:a,t=new Date,n=t.getFullYear(),i=e(t.getMonth()+1),o=e(t.getDate()),s=e(t.getHours()),u=e(t.getMinutes());return`${n}-${i}-${o}T${s}:${u}`}var y={};async function O(e,t){let n=t?.throttle||0,i=t?.throttleId?`${e}::${t.throttleId}`:e;if(b(i,n))return;let o=await fetch("/cms/api/actions.log",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:e,metadata:t?.metadata||{},links:t?.links})});if(o.status!==200){let s=await o.text();console.error(`failed to log action "${e}":`,s);return}y[i]=f()}async function k(e){let t=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,i=g(n,"Projects",t,"ActionLogs"),o=e?.limit,s;if(o){let c=Math.ceil(o*1.5);s=d(i,l("timestamp","desc"),p(c))}else s=d(i,l("timestamp","desc"));let u=await h(s),a=[];function T(c){if(a.length===0)return!1;let m=a.at(-1);return c.action==="doc.save"&&m.action==="doc.save"&&c.by===m.by&&c.metadata.docId===m.metadata.docId&&c.timestamp.toMillis()-m.timestamp.toMillis()<60*r.minute}for(let c of u.docs){if(o&&a.length>=o)break;let m=c.data();T(m)||a.push(m)}return a}function b(e,t){if(t===0)return!1;let n=y[e];return n?f()-n<t:!1}export{r as a,w as b,f as c,I as d,M as e,O as f,k as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunk-YDO2EDVY.js";import{g as y}from"./chunk-XOQ3KDSR.js";import{a as x}from"./chunk-5MV6XVGA.js";import{c as f,n as g}from"./chunk-EGEB6N4J.js";async function b(e){let t=window.firebase.db,r=window.__ROOT_CTX.rootConfig.projectId,[o,a]=e.split("/",2),i=await h(o),n=f(t,"Projects",r,"Collections",o,"Drafts",a),c=(await g(n)).data()||{},p=new Set;return m(p,i.fields,c.fields||{},i.types||{}),Array.from(p)}async function C(e){let t=window.firebase.db,r=window.__ROOT_CTX.rootConfig.projectId,[o,a]=e.split("/",2),i=await h(o),n=f(t,"Projects",r,"Collections",o,"Drafts",a),c=(await g(n)).data()||{},p=new Map;return d(p,i.fields,c.fields||{},i.types||{}),p}function m(e,t,r,o={}){t.forEach(a=>{if(!a.id)return;let i=r[a.id],n=`@${a.id}`,s=r[n];s?.translate===!1||s?.disableTranslations||R(e,a,i,o,s)})}function d(e,t,r,o={}){t.forEach(a=>{if(!a.id)return;let i=r[a.id],n=`@${a.id}`,s=r[n];if(s?.translate===!1||s?.disableTranslations)return;let c=s?.description;S(e,a,i,o,c,s)})}function R(e,t,r,o={},a){if(!r)return;function i(n){let s=y(n);s&&e.add(s)}if(t.type==="object")m(e,t.fields||[],r,o);else if(t.type==="array"){let n=r._array||[];for(let s of n)R(e,t.of,r[s],o)}else if(t.type==="string"||t.type==="select")t.translate&&i(r);else if(t.type==="image")t.translate&&r&&r.alt&&t.alt!==!1&&a?.alt!==!1&&i(r.alt);else if(t.type==="multiselect"){if(t.translate&&Array.isArray(r))for(let n of r)i(n)}else if(t.type==="oneof"){let n=t.types||[],s;typeof n[0]=="string"?n.includes(r._type)&&(s=o[r._type]):s=n.find(c=>c.name===r._type),s&&m(e,s.fields||[],r,o)}else t.type==="richtext"?t.translate&&T(e,r):console.log(`extract: ignoring field, id=${t.id}, type=${t.type}`)}function S(e,t,r,o={},a,i){if(!r)return;function n(s){let c=y(s);if(c){let p=e.get(c);(!p||!p.description)&&e.set(c,{description:a})}}if(t.type==="object")d(e,t.fields||[],r,o);else if(t.type==="array"){let s=r._array||[];for(let c of s)S(e,t.of,r[c],o,a)}else if(t.type==="string"||t.type==="select")t.translate&&n(r);else if(t.type==="image")t.translate&&r&&r.alt&&t.alt!==!1&&i?.alt!==!1&&n(r.alt);else if(t.type==="multiselect"){if(t.translate&&Array.isArray(r))for(let s of r)n(s)}else if(t.type==="oneof"){let s=t.types||[],c;typeof s[0]=="string"?s.includes(r._type)&&(c=o[r._type]):c=s.find(p=>p.name===r._type),c&&d(e,c.fields||[],r,o)}else if(t.type==="richtext"&&t.translate){let s=new Set;T(s,r),s.forEach(c=>n(c))}}function T(e,t){(t?.blocks||[]).forEach(o=>{l(e,o)})}function l(e,t){if(!t?.type)return;function r(n){if(!n)return;let s=y(n);s&&e.add(s)}function o(n){n&&Object.values(n).forEach(s=>{a(s)})}function a(n){if(typeof n=="string"){r(n);return}if(Array.isArray(n)){n.forEach(s=>a(s));return}x(n)&&Object.values(n).forEach(s=>a(s))}function i(n){n&&n.forEach(s=>{r(s.content),o(s.components),i(s.items)})}t.type==="heading"||t.type==="paragraph"?(r(t.data?.text),o(t.data?.components)):t.type==="orderedList"||t.type==="unorderedList"?i(t.data?.items):t.type==="html"?r(t.data?.html):t.type==="table"&&(t.data?.rows||[]).forEach(s=>{(s.cells||[]).forEach(p=>{(p.blocks||[]).forEach(w=>{l(e,w)})})})}export{b as a,C as b,R as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Q,e as z,f as N,g as Z}from"./chunk-HKINZLMW.js";import{a as ee}from"./chunk-YDO2EDVY.js";import{a as G,c as K,n as g,p as P,q as B,u as b}from"./chunk-EGEB6N4J.js";import{c as V,e as O,h as S,k as L,y as j}from"./chunk-NZHF733K.js";import{b as ie,d as ne}from"./chunk-PVAE643M.js";var re=ie((ke,te)=>{"use strict";function fe(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r,o=0;return function(...a){clearTimeout(r);let n=Date.now(),c=n-o,d=t-c;d<=0?(o=n,e.apply(this,a)):r=setTimeout(()=>{o=Date.now(),e.apply(this,a)},d)}}te.exports=fe});j();var se=ne(re(),1);j();j();var oe=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},i=(e,t,r)=>(oe(e,t,"read from private field"),r?r.call(e):t.get(e)),p=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},C=(e,t,r,o)=>(oe(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);function me(e,t){return t!=null?(0,se.default)(e,t):e}var y,U,W,$,k,R,A,J,X,Ie=class{constructor(e=[]){p(this,y,void 0),p(this,U,"ready"),p(this,W,void 0),p(this,$,new Set),p(this,k,new Set),p(this,R,new Set),this.pushMessage=t=>{C(this,y,i(this,y).concat(t)),i(this,A).call(this)},this.popMessage=()=>{C(this,y,i(this,y).slice(0,-1)),i(this,A).call(this)},this.replaceMessage=(t,r)=>{C(this,y,[...i(this,y).slice(0,t),this.snapshot(r),...i(this,y).slice(t+1)]),i(this,A).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,r)=>{let o=r?me(t,r):t;return i(this,$).add(o),()=>{i(this,$).delete(o)}},this["~registerStatusCallback"]=t=>(i(this,k).add(t),()=>{i(this,k).delete(t)}),this["~registerErrorCallback"]=t=>(i(this,R).add(t),()=>{i(this,R).delete(t)}),p(this,A,()=>{i(this,$).forEach(t=>t())}),p(this,J,()=>{i(this,k).forEach(t=>t())}),p(this,X,()=>{i(this,R).forEach(t=>t())}),C(this,y,e)}get status(){return i(this,U)}set status(e){C(this,U,e),i(this,J).call(this)}get error(){return i(this,W)}set error(e){C(this,W,e),i(this,X).call(this)}get messages(){return i(this,y)}set messages(e){C(this,y,[...e]),i(this,A).call(this)}};y=new WeakMap;U=new WeakMap;W=new WeakMap;$=new WeakMap;k=new WeakMap;R=new WeakMap;A=new WeakMap;J=new WeakMap;X=new WeakMap;var x,ae=class extends Q{constructor({messages:e,...t}){let r=new Ie(e);super({...t,state:r}),p(this,x,void 0),this["~registerMessagesCallback"]=(o,s)=>i(this,x)["~registerMessagesCallback"](o,s),this["~registerStatusCallback"]=o=>i(this,x)["~registerStatusCallback"](o),this["~registerErrorCallback"]=o=>i(this,x)["~registerErrorCallback"](o),C(this,x,r)}};x=new WeakMap;function Le({experimental_throttle:e,resume:t=!1,...r}={}){let o=O("chat"in r?{}:{onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen});"chat"in r||(o.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen});let s={...r,onToolCall:u=>{var h,m;return(m=(h=o.current).onToolCall)==null?void 0:m.call(h,u)},onData:u=>{var h,m;return(m=(h=o.current).onData)==null?void 0:m.call(h,u)},onFinish:u=>{var h,m;return(m=(h=o.current).onFinish)==null?void 0:m.call(h,u)},onError:u=>{var h,m;return(m=(h=o.current).onError)==null?void 0:m.call(h,u)},sendAutomaticallyWhen:u=>{var h,m,H;return(H=(m=(h=o.current).sendAutomaticallyWhen)==null?void 0:m.call(h,u))!=null?H:!1}},a=O("chat"in r?r.chat:new ae(s));("chat"in r&&r.chat!==a.current||"id"in r&&a.current.id!==r.id)&&(a.current="chat"in r?r.chat:new ae(s));let c=S(u=>a.current["~registerMessagesCallback"](u,e),[e,a.current.id]),d=L(c,()=>a.current.messages,()=>a.current.messages),f=L(a.current["~registerStatusCallback"],()=>a.current.status,()=>a.current.status),l=L(a.current["~registerErrorCallback"],()=>a.current.error,()=>a.current.error),I=S(u=>{typeof u=="function"&&(u=u(a.current.messages)),a.current.messages=u},[a]);return V(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:d,setMessages:I,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:l,resumeStream:a.current.resumeStream,status:f,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}var Y=null;function _(){return Y||(Y=import("./ai-tools-5E5ELLZX.js")),Y}var ge=["doc_set","doc_create","doc_updateField","doc_edit","doc_duplicate"];function ye(e){return ge.includes(e)}function E(){let e=window;return{rootConfig:e.__ROOT_CTX.rootConfig,firebase:e.firebase}}function ve(e){let{collection:t,slug:r}=D(e);return`/cms/content/${encodeURIComponent(t)}/${encodeURIComponent(r)}`}function D(e){let t=e.indexOf("/");if(t<=0||t===e.length-1)throw new Error(`invalid docId: "${e}" (expected "Collection/slug")`);return{collection:e.slice(0,t),slug:e.slice(t+1).replace(/\//g,"--")}}function w(e){let{collection:t,slug:r}=D(e),{firebase:o,rootConfig:s}=E();return K(o.db,"Projects",s.projectId,"Collections",t,"Drafts",r)}function M(e){return Z(e,{isTimestamp:t=>t instanceof G,timestampToValue:t=>t.toMillis()})}function we(e){return JSON.parse(JSON.stringify(e??null))}function q(e){if(typeof e!="string")return e;let t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch{return e}return e}function ce(e){return Array.isArray(e)?e.map(t=>{let r={op:t?.op,path:t?.path};return t&&"value"in t&&(r.value=q(t.value)),t&&t.index!==void 0&&t.index!==null&&(r.index=t.index),r}):[]}function de(e){switch(e.op){case"set":return`Set ${e.path}`;case"insert_item":return e.index===void 0?`Insert into ${e.path} (append)`:`Insert into ${e.path} at ${e.index}`;case"remove_item":return`Remove ${e.path}[${e.index}]`;default:return`${e.op} ${e.path}`}}function De(e,t,r){let o=t.split("."),s=e;for(let c=0;c<o.length-1;c++){let d=o[c],f=Array.isArray(s)?Number(d):d,l=o[c+1];(s[f]===void 0||s[f]===null)&&(s[f]=/^\d+$/.test(l)?[]:{}),s=s[f]}let a=o[o.length-1],n=Array.isArray(s)?Number(a):a;s[n]=r}async function le(e){let t=await g(w(e));if(!t.exists())return{found:!1,fields:{}};let r=t.data();return{found:!0,fields:M(r.fields||{}),raw:r}}function F(e){return{type:"cms-write-receipt",title:e.title,summary:e.summary,docId:e.docId,adminUrl:e.docId?ve(e.docId):void 0,details:[...e.details||[],{label:"Status",value:"Saved to draft"},{label:"Publishing",value:"Manual publish still required"}]}}function v(e){return{toolName:e.toolName,title:e.title,summary:e.summary,docId:e.docId,path:e.path,details:e.details||[],error:e.error,errors:e.errors,hint:e.hint}}async function Xe(e,t){if(!ye(e))throw new Error(`not a write tool: ${e}`);switch(e){case"doc_set":return pe(t);case"doc_create":return be(t);case"doc_updateField":return Ce(t);case"doc_edit":return _e(t);case"doc_duplicate":return Te(t)}}async function pe(e){let{collection:t}=D(e.docId),r=await T(t),{validateFields:o}=await _(),s=o(e.fields,r);if(s.length>0)return v({toolName:"doc_set",title:"Replace draft fields",summary:`Could not validate the replacement fields for ${e.docId}.`,docId:e.docId,error:"VALIDATION_FAILED",errors:s,hint:"The fields payload does not match the collection schema. Read the doc and schema, then retry with a valid payload."});let a=await le(e.docId);return{toolName:"doc_set",title:"Replace draft fields",summary:`Replace all draft fields for ${e.docId}.`,docId:e.docId,before:a.found?a.fields:{},after:e.fields||{},details:[{label:"Document",value:e.docId},{label:"Operation",value:a.found?"Replace draft":"Create draft"}]}}async function be(e){let{collection:t}=D(e.docId);if((await g(w(e.docId))).exists())return v({toolName:"doc_create",title:"Create draft document",summary:`${e.docId} already exists.`,docId:e.docId,error:"ALREADY_EXISTS",hint:"Use an unused slug, or use an update tool for the existing draft."});if(e.fields){let o=await T(t),{validateFields:s}=await _(),a=s(e.fields,o);if(a.length>0)return v({toolName:"doc_create",title:"Create draft document",summary:`Could not validate the initial fields for ${e.docId}.`,docId:e.docId,error:"VALIDATION_FAILED",errors:a,hint:"The fields payload does not match the collection schema."})}return{toolName:"doc_create",title:"Create draft document",summary:`Create ${e.docId} as a new draft document.`,docId:e.docId,before:{},after:e.fields||{},details:[{label:"Document",value:e.docId},{label:"Operation",value:"Create draft"}]}}async function Ce(e){let t=q(e.value),{collection:r}=D(e.docId),o=await T(r),{validateValueAtPath:s}=await _(),a=s(o,e.path,t);if(a.length>0)return v({toolName:"doc_updateField",title:"Update draft field",summary:`Could not validate ${e.path} for ${e.docId}.`,docId:e.docId,path:e.path,error:"VALIDATION_FAILED",errors:a,hint:"The value does not match the field schema. Inspect the doc and schema, then retry with a valid value."});let n=w(e.docId),c=await g(n);if(!c.exists())return v({toolName:"doc_updateField",title:"Update draft field",summary:`${e.docId} does not exist.`,docId:e.docId,path:e.path,error:"NOT_FOUND",hint:`Doc "${e.docId}" does not exist.`});let d=c.data(),f=z(d.fields||{},e.path);if(!f.ok)return v({toolName:"doc_updateField",title:"Update draft field",summary:`Could not resolve ${e.path} in ${e.docId}.`,docId:e.docId,path:e.path,error:"VALIDATION_FAILED",errors:[f.error],hint:"Use zero-based array indices for existing array items, or set the whole array field when appending or removing items."});let l=M(d.fields||{}),I=we(l);return De(I,e.path,t),{toolName:"doc_updateField",title:"Update draft field",summary:`Update ${e.path} in ${e.docId}.`,docId:e.docId,path:e.path,before:l,after:I,details:[{label:"Document",value:e.docId},{label:"Field path",value:e.path},{label:"Operation",value:"Update draft field"}]}}async function _e(e){let t=ce(e.operations),{collection:r}=D(e.docId),o=await T(r),s=await le(e.docId);if(!s.found)return v({toolName:"doc_edit",title:"Edit draft document",summary:`${e.docId} does not exist.`,docId:e.docId,error:"NOT_FOUND",hint:`Doc "${e.docId}" does not exist. Create it with \`doc_create\` first.`});let{applyDocEdits:a,validateFields:n}=await _(),c=a(s.fields,t);if(!c.ok)return v({toolName:"doc_edit",title:"Edit draft document",summary:`Operation ${c.error.opIndex+1} (${c.error.op}) could not be applied to ${e.docId}.`,docId:e.docId,error:"INVALID_OPERATION",errors:[c.error],hint:"Fix the failing operation. Use zero-based array indices, target arrays for insert_item/remove_item, and read the doc with `doc_get` to confirm the current shape."});let d=n(c.fields,o);return d.length>0?v({toolName:"doc_edit",title:"Edit draft document",summary:`The edits to ${e.docId} did not match the collection schema.`,docId:e.docId,error:"VALIDATION_FAILED",errors:d,hint:"The resulting fields do not match the collection schema. Inspect the doc and schema, then retry with valid values."}):{toolName:"doc_edit",title:"Edit draft document",summary:`Apply ${t.length} edit${t.length===1?"":"s"} to ${e.docId}.`,docId:e.docId,before:s.fields,after:c.fields,details:[{label:"Document",value:e.docId},...t.map((f,l)=>({label:`Operation ${l+1}`,value:de(f)}))]}}async function Te(e){let t=w(e.fromDocId),r=await g(t);if(!r.exists())return v({toolName:"doc_duplicate",title:"Duplicate draft document",summary:`${e.fromDocId} does not exist.`,docId:e.toDocId,error:"NOT_FOUND",hint:`Source doc "${e.fromDocId}" does not exist.`,details:[{label:"Source",value:e.fromDocId}]});let o=w(e.toDocId);if((await g(o)).exists())return v({toolName:"doc_duplicate",title:"Duplicate draft document",summary:`${e.toDocId} already exists.`,docId:e.toDocId,error:"ALREADY_EXISTS",hint:`Target doc "${e.toDocId}" already exists.`,details:[{label:"Source",value:e.fromDocId},{label:"Target",value:e.toDocId}]});let a=r.data(),n=M(a.fields||{});return{toolName:"doc_duplicate",title:"Duplicate draft document",summary:`Duplicate ${e.fromDocId} to ${e.toDocId}.`,docId:e.toDocId,before:{},after:n,details:[{label:"Source",value:e.fromDocId},{label:"Target",value:e.toDocId},{label:"Operation",value:"Create draft copy"}]}}async function T(e){return await ee(e)}async function Ae(e){let{collection:t,slug:r}=D(e.docId),o=await T(t),{validateFields:s}=await _(),a=s(e.fields,o);if(a.length>0)return{success:!1,docId:e.docId,error:"VALIDATION_FAILED",errors:a,hint:"The fields payload did not match the collection schema. Read the doc with `doc_get` for an example of the expected shape, then retry with a valid payload."};let{firebase:n}=E(),c=w(e.docId),d=await g(c),l=(d.exists()?d.data():{}).sys||{},I=n.user?.email||"root-cms-ai",u={id:e.docId,collection:t,slug:r,sys:{...l,createdAt:l.createdAt??b(),createdBy:l.createdBy??I,modifiedAt:b(),modifiedBy:I,locales:l.locales??["en"]},fields:N(e.fields)};return await P(c,u),{success:!0,docId:e.docId,receipt:F({title:"Updated draft document",summary:`Replaced all draft fields for ${e.docId}.`,docId:e.docId,details:[{label:"Document",value:e.docId},{label:"Operation",value:"Replace draft fields"}]})}}async function xe(e){let{collection:t,slug:r}=D(e.docId),o=w(e.docId);if((await g(o)).exists())return{success:!1,docId:e.docId,error:"ALREADY_EXISTS",hint:"A doc with this id already exists. Use `doc_set` to overwrite."};if(e.fields){let d=await T(t),{validateFields:f}=await _(),l=f(e.fields,d);if(l.length>0)return{success:!1,docId:e.docId,error:"VALIDATION_FAILED",errors:l,hint:"The fields payload did not match the collection schema."}}let{firebase:a}=E(),n=a.user?.email||"root-cms-ai",c={id:e.docId,collection:t,slug:r,sys:{createdAt:b(),createdBy:n,modifiedAt:b(),modifiedBy:n,locales:["en"]},fields:e.fields?N(e.fields):{}};return await P(o,c),{success:!0,docId:e.docId,receipt:F({title:"Created draft document",summary:`Created ${e.docId} as a new draft document.`,docId:e.docId,details:[{label:"Document",value:e.docId},{label:"Operation",value:"Create draft"}]})}}async function Ee(e){let t=q(e.value),{collection:r}=D(e.docId),o=await T(r),{validateValueAtPath:s}=await _(),a=s(o,e.path,t);if(a.length>0)return{success:!1,docId:e.docId,path:e.path,error:"VALIDATION_FAILED",errors:a,hint:"The value did not match the field schema. Inspect the doc with `doc_get` to see the expected shape, then retry with a valid value."};let n=w(e.docId),c=await g(n);if(!c.exists())return{success:!1,docId:e.docId,path:e.path,error:"NOT_FOUND",hint:`Doc "${e.docId}" does not exist.`};let d=c.data(),f=z(d.fields||{},e.path);if(!f.ok)return{success:!1,docId:e.docId,path:e.path,error:"VALIDATION_FAILED",errors:[f.error],hint:"The path could not be resolved against the current draft. Use zero-based array indices for existing array items, or set the whole array field when appending or removing items."};let{firebase:l}=E(),I=`fields.${f.path}`,u=N(t);return await B(n,{[I]:u,"sys.modifiedAt":b(),"sys.modifiedBy":l.user?.email||"root-cms-ai"}),{success:!0,docId:e.docId,path:e.path,receipt:F({title:"Updated draft field",summary:`Updated ${e.path} in ${e.docId}.`,docId:e.docId,details:[{label:"Document",value:e.docId},{label:"Field path",value:e.path},{label:"Operation",value:"Update draft field"}]})}}async function Oe(e){let t=ce(e.operations),{collection:r}=D(e.docId),o=await T(r),s=w(e.docId),a=await g(s);if(!a.exists())return{success:!1,docId:e.docId,error:"NOT_FOUND",hint:`Doc "${e.docId}" does not exist.`};let n=a.data(),c=M(n.fields||{}),{applyDocEdits:d,validateFields:f}=await _(),l=d(c,t);if(!l.ok)return{success:!1,docId:e.docId,error:"INVALID_OPERATION",errors:[l.error],hint:"Fix the failing operation. Use zero-based array indices, target arrays for insert_item/remove_item, and read the doc with `doc_get` to confirm the current shape."};let I=f(l.fields,o);if(I.length>0)return{success:!1,docId:e.docId,error:"VALIDATION_FAILED",errors:I,hint:"The resulting fields did not match the collection schema. Inspect the doc with `doc_get`, then retry with valid values."};let{firebase:u}=E();return await B(s,{fields:N(l.fields),"sys.modifiedAt":b(),"sys.modifiedBy":u.user?.email||"root-cms-ai"}),{success:!0,docId:e.docId,receipt:F({title:"Edited draft document",summary:`Applied ${t.length} edit${t.length===1?"":"s"} to ${e.docId}.`,docId:e.docId,details:[{label:"Document",value:e.docId},{label:"Operations",value:String(t.length)},...t.map((h,m)=>({label:`Operation ${m+1}`,value:de(h)}))]})}}async function Se(e){let t=w(e.fromDocId),r=await g(t);if(!r.exists())return{success:!1,error:"NOT_FOUND",hint:`Source doc "${e.fromDocId}" does not exist.`};let o=w(e.toDocId);if((await g(o)).exists())return{success:!1,error:"ALREADY_EXISTS",hint:`Target doc "${e.toDocId}" already exists.`};let{collection:a,slug:n}=D(e.toDocId),{firebase:c}=E(),d=c.user?.email||"root-cms-ai",f=r.data(),l={id:e.toDocId,collection:a,slug:n,sys:{createdAt:b(),createdBy:d,modifiedAt:b(),modifiedBy:d,locales:f.sys?.locales??["en"]},fields:f.fields||{}};return await P(o,l),{success:!0,fromDocId:e.fromDocId,toDocId:e.toDocId,receipt:F({title:"Duplicated draft document",summary:`Duplicated ${e.fromDocId} to ${e.toDocId}.`,docId:e.toDocId,details:[{label:"Source",value:e.fromDocId},{label:"Target",value:e.toDocId},{label:"Operation",value:"Create draft copy"}]})}}async function Ne(e){let t=await fetch("/cms/api/ai.translate",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({sourceText:e.sourceText,targetLocales:e.targetLocales,description:e.description})});if(!t.ok)throw new Error(`ai.translate failed: ${t.status}`);let r=await t.json();if(!r.success)throw new Error(r.error||"translation failed");return{translations:r.translations}}var $e={doc_set:Ae,doc_create:xe,doc_updateField:Ee,doc_edit:Oe,doc_duplicate:Se,doc_translateField:Ne};async function Ye(e,t){let r=$e[e];if(!r)return{error:"UNKNOWN_TOOL",toolName:e};try{return await r(t)}catch(o){return console.error(`tool ${e} failed:`,o),{error:"TOOL_EXECUTION_FAILED",message:o?.message||String(o)}}}export{Le as a,ye as b,Xe as c,Ye as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./chunk-AL3TN2KI.js";import{Ha as o}from"./chunk-NZHF733K.js";function n(r){return o("div",{className:e(r.className,"Surface"),children:r.children})}export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.create;var e=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a,b)=>()=>(a&&(b=a(a=0)),b);var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of j(b))!l.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=i(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a)),q=a=>g(e({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./chunk-ORXEMIQC.js";import{Ga as r,Ha as i,ca as a}from"./chunk-NZHF733K.js";var l={transition:"pop"};function g(t){let e=t.release;return n(e.archivedAt)?i(r,{...l,label:`Archived ${d(e.archivedAt)} by ${e.archivedBy}`,children:i(a,{size:"xs",color:"gray",variant:"filled",children:"Archived"})}):n(e.scheduledAt)?i(r,{...l,label:`Scheduled ${s(e.scheduledAt)} by ${e.scheduledBy}`,wrapLines:!0,width:240,children:i(a,{size:"xs",variant:"gradient",gradient:{from:"grape",to:"pink",deg:35},children:"Scheduled"})}):n(e.publishedAt)?i(r,{...l,label:`Published ${d(e.publishedAt)} by ${e.publishedBy}`,children:i(a,{size:"xs",variant:"gradient",gradient:{from:"teal",to:"lime",deg:105},children:"Published"})}):i(a,{size:"xs",variant:"gradient",gradient:{from:"indigo",to:"cyan"},children:"Unpublished"})}function n(t){return!!(t&&t.toMillis)}function d(t){return t?.toMillis?o(t.toMillis()):o(new Date().getTime())}function s(t){return new Date(t.toMillis()).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as T}from"./chunk-4KE2SZKH.js";import{f as C}from"./chunk-AFWBSIPL.js";import{f as i}from"./chunk-ORXEMIQC.js";import{a as b,b as g,c as n,g as m,i as R,n as I,o as y,q as l,s as j,t as d,u as f,w as _}from"./chunk-EGEB6N4J.js";var c="Releases";async function E(e,t){if(!e)throw new Error("missing data source id");let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,s=n(o,"Projects",r,c,e);await j(o,async a=>{if((await a.get(s)).exists())throw new Error(`release exists: ${e}`);await a.set(s,{...t,id:e,createdAt:f(),createdBy:window.firebase.user.email})}),i("release.create",{metadata:{releaseId:e}})}async function S(){let e=window.__ROOT_CTX.rootConfig.projectId,t=window.firebase.db,r=g(t,"Projects",e,c),o=m(r,R("createdAt","desc")),s=await y(o),a=[];return s.forEach(w=>{a.push(w.data())}),a}async function u(e){let t=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=n(r,"Projects",t,c,e),s=await I(o);return s.exists()?s.data():null}async function D(e,t){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,s=n(o,"Projects",r,c,e);await l(s,t),i("release.save",{metadata:{releaseId:e}})}async function X(e){let t=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=n(r,"Projects",t,c,e);await l(o,{archivedAt:f(),archivedBy:window.firebase.user.email}),i("release.archive",{metadata:{releaseId:e}})}async function M(e){let t=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=n(r,"Projects",t,c,e);await l(o,{archivedAt:d(),archivedBy:d()}),i("release.unarchive",{metadata:{releaseId:e}})}async function k(e){let t=await u(e);if(!t)throw new Error(`release not found: ${e}`);if(t.archivedAt)throw new Error(`release is archived: ${e}`);let r=t.docIds||[],o=t.dataSourceIds||[];if(r.length===0&&o.length===0)throw new Error(`no docs or data sources to publish for release: ${e}`);let s=window.__ROOT_CTX.rootConfig.projectId,a=window.firebase.db,w=n(a,"Projects",s,c,e),p=_(a);p.update(w,{publishedAt:f(),publishedBy:window.firebase.user.email,scheduledAt:d(),scheduledBy:d()}),o.length>0&&await T(o,{batch:p,commitBatch:!1}),await C(r,{batch:p,releaseId:e,publishMessage:t.description}),console.log(`published release: ${e}`);let h={releaseId:e,docIds:r,dataSourceIds:o};t.description&&(h.publishMessage=t.description),i("release.publish",{metadata:h})}async function q(e,t){let r=await u(e);if(!r)throw new Error(`release not found: ${e}`);if(r.archivedAt)throw new Error(`release is archived: ${e}`);typeof t=="number"&&(t=b.fromMillis(t));let o=window.__ROOT_CTX.rootConfig.projectId,s=window.firebase.db,a=n(s,"Projects",o,c,e);await l(a,{scheduledAt:t,scheduledBy:window.firebase.user.email}),i("release.publish",{metadata:{releaseId:e,scheduledAt:t.toMillis()}})}var O=["blue","bold","bright","calm","cool","cosmic","crisp","dark","eager","fast","fresh","gentle","golden","grand","happy","idle","jolly","keen","lively","lucky","mellow","mighty","neat","noble","proud","quiet","rapid","sharp","silver","swift","vivid","warm","wild"],v=["arrow","beacon","breeze","canyon","cedar","comet","coral","crane","dune","eagle","ember","falcon","flame","flint","forest","fox","glacier","harbor","hawk","lantern","maple","meadow","orbit","otter","peak","pine","reef","river","sage","spark","spruce","stone","summit","tide","wolf"];function N(){let e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),s=O[Math.floor(Math.random()*O.length)],a=v[Math.floor(Math.random()*v.length)];return`${t}${r}${o}-${s}-${a}`}async function F(e){if(!await u(e))throw new Error(`release not found: ${e}`);let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,s=n(o,"Projects",r,c,e);await l(s,{scheduledAt:d(),scheduledBy:d()}),i("release.unschedule",{metadata:{releaseId:e}})}export{E as a,S as b,u as c,D as d,X as e,M as f,k as g,q as h,N as i,F as j};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{B as ke,C as Ee,D as Ue,E as Ie,G as xe,H as Q,c as me,e as J,f as be,g as we,h as Re,p as Te,x as S,y as ye}from"./chunk-DTMZLUNY.js";var De="firebasestorage.googleapis.com",Le="storageBucket",st=120*1e3,rt=600*1e3,ot=1e3;var g=class t extends Te{constructor(e,n,s=0){super(ee(e),`Firebase Storage: ${n} (${ee(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,t.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return ee(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
|
|
2
|
+
${this.customData.serverResponse}`:this.message=this._baseMessage}},p;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(p||(p={}));function ee(t){return"storage/"+t}function le(){let t="An unknown error occurred, please check the error payload for server response.";return new g(p.UNKNOWN,t)}function it(t){return new g(p.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function at(t){return new g(p.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function ut(){let t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new g(p.UNAUTHENTICATED,t)}function lt(){return new g(p.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function ct(t){return new g(p.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function Fe(){return new g(p.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Be(){return new g(p.CANCELED,"User canceled the upload/download.")}function ht(t){return new g(p.INVALID_URL,"Invalid URL '"+t+"'.")}function dt(t){return new g(p.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function ft(){return new g(p.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+Le+"' property when initializing the app?")}function Me(){return new g(p.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function pt(){return new g(p.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function _t(t){return new g(p.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function ne(t){return new g(p.INVALID_ARGUMENT,t)}function qe(){return new g(p.APP_DELETED,"The Firebase app was deleted.")}function gt(t){return new g(p.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function $(t,e){return new g(p.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function q(t){throw new g(p.INTERNAL_ERROR,"Internal error: "+t)}var k=class t{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let s;try{s=t.makeFromUrl(e,n)}catch{return new t(e,"")}if(s.path==="")return s;throw dt(e)}static makeFromUrl(e,n){let s=null,r="([A-Za-z0-9.\\-_]+)";function o(b){b.path.charAt(b.path.length-1)==="/"&&(b.path_=b.path_.slice(0,-1))}let i="(/(.*))?$",u=new RegExp("^gs://"+r+i,"i"),a={bucket:1,path:3};function l(b){b.path_=decodeURIComponent(b.path)}let c="v[A-Za-z0-9_]+",d=n.replace(/[.]/g,"\\."),f="(/([^?#]*).*)?$",_=new RegExp(`^https?://${d}/${c}/b/${r}/o${f}`,"i"),h={bucket:1,path:3},T=n===De?"(?:storage.googleapis.com|storage.cloud.google.com)":n,m="([^?#]*)",U=new RegExp(`^https?://${T}/${r}/${m}`,"i"),R=[{regex:u,indices:a,postModify:o},{regex:_,indices:h,postModify:l},{regex:U,indices:{bucket:1,path:2},postModify:l}];for(let b=0;b<R.length;b++){let C=R[b],v=C.regex.exec(e);if(v){let Y=v[C.indices.bucket],M=v[C.indices.path];M||(M=""),s=new t(Y,M),C.postModify(s);break}}if(s==null)throw ht(e);return s}},se=class{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}};function mt(t,e,n){let s=1,r=null,o=null,i=!1,u=0;function a(){return u===2}let l=!1;function c(...m){l||(l=!0,e.apply(null,m))}function d(m){r=setTimeout(()=>{r=null,t(_,a())},m)}function f(){o&&clearTimeout(o)}function _(m,...U){if(l){f();return}if(m){f(),c.call(null,m,...U);return}if(a()||i){f(),c.call(null,m,...U);return}s<64&&(s*=2);let R;u===1?(u=2,R=0):R=(s+Math.random())*1e3,d(R)}let h=!1;function T(m){h||(h=!0,f(),!l&&(r!==null?(m||(u=2),clearTimeout(r),d(0)):m||(u=1)))}return d(0),o=setTimeout(()=>{i=!0,T(!0)},n),T}function bt(t){t(!1)}function wt(t){return t!==void 0}function Rt(t){return typeof t=="function"}function Tt(t){return typeof t=="object"&&!Array.isArray(t)}function ce(t){return typeof t=="string"||t instanceof String}function Ae(t){return he()&&t instanceof Blob}function he(){return typeof Blob<"u"}function Oe(t,e,n,s){if(s<e)throw ne(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw ne(`Invalid value for '${t}'. Expected ${n} or less.`)}function z(t,e,n){let s=e;return n==null&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function yt(t){let e=encodeURIComponent,n="?";for(let s in t)if(t.hasOwnProperty(s)){let r=e(s)+"="+e(t[s]);n=n+r+"&"}return n=n.slice(0,-1),n}var P;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(P||(P={}));function $e(t,e){let n=t>=500&&t<600,r=[408,429].indexOf(t)!==-1,o=e.indexOf(t)!==-1;return n||r||o}var re=class{constructor(e,n,s,r,o,i,u,a,l,c,d,f=!0,_=!1){this.url_=e,this.method_=n,this.headers_=s,this.body_=r,this.successCodes_=o,this.additionalRetryCodes_=i,this.callback_=u,this.errorCallback_=a,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=d,this.retry=f,this.isUsingEmulator=_,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((h,T)=>{this.resolve_=h,this.reject_=T,this.start_()})}start_(){let e=(s,r)=>{if(r){s(!1,new D(!1,null,!0));return}let o=this.connectionFactory_();this.pendingConnection_=o;let i=u=>{let a=u.loaded,l=u.lengthComputable?u.total:-1;this.progressCallback_!==null&&this.progressCallback_(a,l)};this.progressCallback_!==null&&o.addUploadProgressListener(i),o.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&o.removeUploadProgressListener(i),this.pendingConnection_=null;let u=o.getErrorCode()===P.NO_ERROR,a=o.getStatus();if(!u||$e(a,this.additionalRetryCodes_)&&this.retry){let c=o.getErrorCode()===P.ABORT;s(!1,new D(!1,null,c));return}let l=this.successCodes_.indexOf(a)!==-1;s(!0,new D(l,o))})},n=(s,r)=>{let o=this.resolve_,i=this.reject_,u=r.connection;if(r.wasSuccessCode)try{let a=this.callback_(u,u.getResponse());wt(a)?o(a):o()}catch(a){i(a)}else if(u!==null){let a=le();a.serverResponse=u.getErrorText(),this.errorCallback_?i(this.errorCallback_(u,a)):i(a)}else if(r.canceled){let a=this.appDelete_?qe():Be();i(a)}else{let a=Fe();i(a)}};this.canceled_?n(!1,new D(!1,null,!0)):this.backoffId_=mt(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&bt(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}},D=class{constructor(e,n,s){this.wasSuccessCode=e,this.connection=n,this.canceled=!!s}};function kt(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function Et(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function Ut(t,e){e&&(t["X-Firebase-GMPID"]=e)}function It(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function xt(t,e,n,s,r,o,i=!0,u=!1){let a=yt(t.urlParams),l=t.url+a,c=Object.assign({},t.headers);return Ut(c,e),kt(c,n),Et(c,o),It(c,s),new re(l,t.method,c,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r,i,u)}function At(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function Ot(...t){let e=At();if(e!==void 0){let n=new e;for(let s=0;s<t.length;s++)n.append(t[s]);return n.getBlob()}else{if(he())return new Blob(t);throw new g(p.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function St(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}function Pt(t){if(typeof atob>"u")throw _t("base-64");return atob(t)}var E={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},H=class{constructor(e,n){this.data=e,this.contentType=n||null}};function Ct(t,e){switch(t){case E.RAW:return new H(He(e));case E.BASE64:case E.BASE64URL:return new H(je(t,e));case E.DATA_URL:return new H(Nt(e),Dt(e))}throw le()}function He(t){let e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|s&63);else if((s&64512)===55296)if(!(n<t.length-1&&(t.charCodeAt(n+1)&64512)===56320))e.push(239,191,189);else{let o=s,i=t.charCodeAt(++n);s=65536|(o&1023)<<10|i&1023,e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}else(s&64512)===56320?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function vt(t){let e;try{e=decodeURIComponent(t)}catch{throw $(E.DATA_URL,"Malformed data URL.")}return He(e)}function je(t,e){switch(t){case E.BASE64:{let r=e.indexOf("-")!==-1,o=e.indexOf("_")!==-1;if(r||o)throw $(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case E.BASE64URL:{let r=e.indexOf("+")!==-1,o=e.indexOf("/")!==-1;if(r||o)throw $(t,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Pt(e)}catch(r){throw r.message.includes("polyfill")?r:$(t,"Invalid character found")}let s=new Uint8Array(n.length);for(let r=0;r<n.length;r++)s[r]=n.charCodeAt(r);return s}var V=class{constructor(e){this.base64=!1,this.contentType=null;let n=e.match(/^data:([^,]+)?,/);if(n===null)throw $(E.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let s=n[1]||null;s!=null&&(this.base64=Lt(s,";base64"),this.contentType=this.base64?s.substring(0,s.length-7):s),this.rest=e.substring(e.indexOf(",")+1)}};function Nt(t){let e=new V(t);return e.base64?je(E.BASE64,e.rest):vt(e.rest)}function Dt(t){return new V(t).contentType}function Lt(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}var X=class t{constructor(e,n){let s=0,r="";Ae(e)?(this.data_=e,s=e.size,r=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),s=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),s=e.length),this.size_=s,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,n){if(Ae(this.data_)){let s=this.data_,r=St(s,e,n);return r===null?null:new t(r)}else{let s=new Uint8Array(this.data_.buffer,e,n-e);return new t(s,!0)}}static getBlob(...e){if(he()){let n=e.map(s=>s instanceof t?s.data_:s);return new t(Ot.apply(null,n))}else{let n=e.map(i=>ce(i)?Ct(E.RAW,i).data:i.data_),s=0;n.forEach(i=>{s+=i.byteLength});let r=new Uint8Array(s),o=0;return n.forEach(i=>{for(let u=0;u<i.length;u++)r[o++]=i[u]}),new t(r,!0)}}uploadData(){return this.data_}};function Ft(t){let e;try{e=JSON.parse(t)}catch{return null}return Tt(e)?e:null}function Bt(t){if(t.length===0)return null;let e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function Mt(t,e){let n=e.split("/").filter(s=>s.length>0).join("/");return t.length===0?n:t+"/"+n}function ze(t){let e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}function qt(t,e){return e}var w=class{constructor(e,n,s,r){this.server=e,this.local=n||e,this.writable=!!s,this.xform=r||qt}},W=null;function $t(t){return!ce(t)||t.length<2?t:ze(t)}function de(){if(W)return W;let t=[];t.push(new w("bucket")),t.push(new w("generation")),t.push(new w("metageneration")),t.push(new w("name","fullPath",!0));function e(o,i){return $t(i)}let n=new w("name");n.xform=e,t.push(n);function s(o,i){return i!==void 0?Number(i):i}let r=new w("size");return r.xform=s,t.push(r),t.push(new w("timeCreated")),t.push(new w("updated")),t.push(new w("md5Hash",null,!0)),t.push(new w("cacheControl",null,!0)),t.push(new w("contentDisposition",null,!0)),t.push(new w("contentEncoding",null,!0)),t.push(new w("contentLanguage",null,!0)),t.push(new w("contentType",null,!0)),t.push(new w("metadata","customMetadata",!0)),W=t,W}function Ht(t,e){function n(){let s=t.bucket,r=t.fullPath,o=new k(s,r);return e._makeStorageReference(o)}Object.defineProperty(t,"ref",{get:n})}function jt(t,e,n){let s={};s.type="file";let r=n.length;for(let o=0;o<r;o++){let i=n[o];s[i.local]=i.xform(s,e[i.server])}return Ht(s,t),s}function zt(t,e,n){let s=Ft(e);return s===null?null:jt(t,s,n)}function fe(t,e){let n={},s=e.length;for(let r=0;r<s;r++){let o=e[r];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}var x=class{constructor(e,n,s,r){this.url=e,this.method=n,this.handler=s,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}};function O(t){if(!t)throw le()}function K(t,e){function n(s,r){let o=zt(t,r,e);return O(o!==null),o}return n}function G(t){function e(n,s){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=lt():r=ut():n.getStatus()===402?r=at(t.bucket):n.getStatus()===403?r=ct(t.path):r=s,r.status=n.getStatus(),r.serverResponse=s.serverResponse,r}return e}function pe(t){let e=G(t);function n(s,r){let o=e(s,r);return s.getStatus()===404&&(o=it(t.path)),o.serverResponse=r.serverResponse,o}return n}function Ge(t,e,n){let s=e.fullServerUrl(),r=z(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new x(r,o,K(t,n),i);return u.errorHandler=pe(e),u}function Gt(t,e,n,s){let r=e.fullServerUrl(),o=z(r,t.host,t._protocol),i="PATCH",u=fe(n,s),a={"Content-Type":"application/json; charset=utf-8"},l=t.maxOperationRetryTime,c=new x(o,i,K(t,s),l);return c.headers=a,c.body=u,c.errorHandler=pe(e),c}function Wt(t,e){let n=e.fullServerUrl(),s=z(n,t.host,t._protocol),r="DELETE",o=t.maxOperationRetryTime;function i(a,l){}let u=new x(s,r,i,o);return u.successCodes=[200,204],u.errorHandler=pe(e),u}function Vt(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function We(t,e,n){let s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=Vt(null,e)),s}function Xt(t,e,n,s,r){let o=e.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function u(){let R="";for(let b=0;b<2;b++)R=R+Math.random().toString().slice(2);return R}let a=u();i["Content-Type"]="multipart/related; boundary="+a;let l=We(e,s,r),c=fe(l,n),d="--"+a+`\r
|
|
3
|
+
Content-Type: application/json; charset=utf-8\r
|
|
4
|
+
\r
|
|
5
|
+
`+c+`\r
|
|
6
|
+
--`+a+`\r
|
|
7
|
+
Content-Type: `+l.contentType+`\r
|
|
8
|
+
\r
|
|
9
|
+
`,f=`\r
|
|
10
|
+
--`+a+"--",_=X.getBlob(d,s,f);if(_===null)throw Me();let h={name:l.fullPath},T=z(o,t.host,t._protocol),m="POST",U=t.maxUploadRetryTime,I=new x(T,m,K(t,n),U);return I.urlParams=h,I.headers=i,I.body=_.uploadData(),I.errorHandler=G(e),I}var L=class{constructor(e,n,s,r){this.current=e,this.total=n,this.finalized=!!s,this.metadata=r||null}};function _e(t,e){let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch{O(!1)}return O(!!n&&(e||["active"]).indexOf(n)!==-1),n}function Kt(t,e,n,s,r){let o=e.bucketOnlyServerUrl(),i=We(e,s,r),u={name:i.fullPath},a=z(o,t.host,t._protocol),l="POST",c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":i.contentType,"Content-Type":"application/json; charset=utf-8"},d=fe(i,n),f=t.maxUploadRetryTime;function _(T){_e(T);let m;try{m=T.getResponseHeader("X-Goog-Upload-URL")}catch{O(!1)}return O(ce(m)),m}let h=new x(a,l,_,f);return h.urlParams=u,h.headers=c,h.body=d,h.errorHandler=G(e),h}function Yt(t,e,n,s){let r={"X-Goog-Upload-Command":"query"};function o(l){let c=_e(l,["active","final"]),d=null;try{d=l.getResponseHeader("X-Goog-Upload-Size-Received")}catch{O(!1)}d||O(!1);let f=Number(d);return O(!isNaN(f)),new L(f,s.size(),c==="final")}let i="POST",u=t.maxUploadRetryTime,a=new x(n,i,o,u);return a.headers=r,a.errorHandler=G(e),a}var Se=256*1024;function Zt(t,e,n,s,r,o,i,u){let a=new L(0,0);if(i?(a.current=i.current,a.total=i.total):(a.current=0,a.total=s.size()),s.size()!==a.total)throw pt();let l=a.total-a.current,c=l;r>0&&(c=Math.min(c,r));let d=a.current,f=d+c,_="";c===0?_="finalize":l===c?_="upload, finalize":_="upload";let h={"X-Goog-Upload-Command":_,"X-Goog-Upload-Offset":`${a.current}`},T=s.slice(d,f);if(T===null)throw Me();function m(b,C){let v=_e(b,["active","final"]),Y=a.current+c,M=s.size(),Z;return v==="final"?Z=K(e,o)(b,C):Z=null,new L(Y,M,v==="final",Z)}let U="POST",I=e.maxUploadRetryTime,R=new x(n,U,m,I);return R.headers=h,R.body=T.uploadData(),R.progressCallback=u||null,R.errorHandler=G(t),R}var y={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function te(t){switch(t){case"running":case"pausing":case"canceling":return y.RUNNING;case"paused":return y.PAUSED;case"success":return y.SUCCESS;case"canceled":return y.CANCELED;case"error":return y.ERROR;default:return y.ERROR}}var oe=class{constructor(e,n,s){if(Rt(e)||n!=null||s!=null)this.next=e,this.error=n??void 0,this.complete=s??void 0;else{let o=e;this.next=o.next,this.error=o.error,this.complete=o.complete}}};function N(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}var Pe=null,ie=class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=P.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=P.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=P.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,n,s,r,o){if(this.sent_)throw q("cannot .send() more than once");if(J(e)&&s&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(n,e,!0),o!==void 0)for(let i in o)o.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,o[i].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw q("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw q("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw q("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw q("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}},ae=class extends ie{initXhr(){this.xhr_.responseType="text"}};function A(){return Pe?Pe():new ae}var ue=class{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(e,n,s=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=n,this._metadata=s,this._mappings=de(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=r=>{if(this._request=void 0,this._chunkMultiplier=1,r._codeEquals(p.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{let o=this.isExponentialBackoffExpired();if($e(r.status,[]))if(o)r=Fe();else{this.sleepTime=Math.max(this.sleepTime*2,ot),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=r,this._transition("error")}},this._metadataErrorHandler=r=>{this._request=void 0,r._codeEquals(p.CANCELED)?this.completeTransitions_():(this._error=r,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((r,o)=>{this._resolve=r,this._reject=o,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){let e=this._transferred;return n=>this._updateProgress(e+n)}_shouldDoResumable(e){return e.size()>256*1024}_start(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([n,s])=>{switch(this._state){case"running":e(n,s);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused");break}})}_createResumable(){this._resolveToken((e,n)=>{let s=Kt(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(s,A,e,n);this._request=r,r.getPromise().then(o=>{this._request=void 0,this._uploadUrl=o,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){let e=this._uploadUrl;this._resolveToken((n,s)=>{let r=Yt(this._ref.storage,this._ref._location,e,this._blob),o=this._ref.storage._makeRequest(r,A,n,s);this._request=o,o.getPromise().then(i=>{i=i,this._request=void 0,this._updateProgress(i.current),this._needToFetchStatus=!1,i.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){let e=Se*this._chunkMultiplier,n=new L(this._transferred,this._blob.size()),s=this._uploadUrl;this._resolveToken((r,o)=>{let i;try{i=Zt(this._ref._location,this._ref.storage,s,this._blob,e,this._mappings,n,this._makeProgressCallback())}catch(a){this._error=a,this._transition("error");return}let u=this._ref.storage._makeRequest(i,A,r,o,!1);this._request=u,u.getPromise().then(a=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(a.current),a.finalized?(this._metadata=a.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){Se*this._chunkMultiplier*2<32*1024*1024&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,n)=>{let s=Ge(this._ref.storage,this._ref._location,this._mappings),r=this._ref.storage._makeRequest(s,A,e,n);this._request=r,r.getPromise().then(o=>{this._request=void 0,this._metadata=o,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,n)=>{let s=Xt(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(s,A,e,n);this._request=r,r.getPromise().then(o=>{this._request=void 0,this._metadata=o,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){let n=this._transferred;this._transferred=e,this._transferred!==n&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,this._request!==void 0?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":let n=this._state==="paused";this._state=e,n&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=Be(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}}get snapshot(){let e=te(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,n,s,r){let o=new oe(n||void 0,s||void 0,r||void 0);return this._addObserver(o),()=>{this._removeObserver(o)}}then(e,n){return this._promise.then(e,n)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){let n=this._observers.indexOf(e);n!==-1&&this._observers.splice(n,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(n=>{this._notifyObserver(n)})}_finishPromise(){if(this._resolve!==void 0){let e=!0;switch(te(this._state)){case y.SUCCESS:N(this._resolve.bind(null,this.snapshot))();break;case y.CANCELED:case y.ERROR:let n=this._reject;N(n.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(te(this._state)){case y.RUNNING:case y.PAUSED:e.next&&N(e.next.bind(e,this.snapshot))();break;case y.SUCCESS:e.complete&&N(e.complete.bind(e))();break;case y.CANCELED:case y.ERROR:e.error&&N(e.error.bind(e,this._error))();break;default:e.error&&N(e.error.bind(e,this._error))()}}resume(){let e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e}pause(){let e=this._state==="running";return e&&this._transition("pausing"),e}cancel(){let e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e}};var F=class t{constructor(e,n){this._service=e,n instanceof k?this._location=n:this._location=k.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new t(e,n)}get root(){let e=new k(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return ze(this._location.path)}get storage(){return this._service}get parent(){let e=Bt(this._location.path);if(e===null)return null;let n=new k(this._location.bucket,e);return new t(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw gt(e)}};function Jt(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new ue(t,new X(e),n)}function Qt(t){t._throwIfRoot("getMetadata");let e=Ge(t.storage,t._location,de());return t.storage.makeRequestWithTokens(e,A)}function en(t,e){t._throwIfRoot("updateMetadata");let n=Gt(t.storage,t._location,e,de());return t.storage.makeRequestWithTokens(n,A)}function tn(t){t._throwIfRoot("deleteObject");let e=Wt(t.storage,t._location);return t.storage.makeRequestWithTokens(e,A)}function nn(t,e){let n=Mt(t._location.path,e),s=new k(t._location.bucket,n);return new F(t.storage,s)}function sn(t){return/^[A-Za-z]+:\/\//.test(t)}function rn(t,e){return new F(t,e)}function Ve(t,e){if(t instanceof j){let n=t;if(n._bucket==null)throw ft();let s=new F(n,n._bucket);return e!=null?Ve(s,e):s}else return e!==void 0?nn(t,e):t}function on(t,e){if(e&&sn(e)){if(t instanceof j)return rn(t,e);throw ne("To use ref(service, url), the first argument must be a Storage instance.")}else return Ve(t,e)}function Ce(t,e){let n=e?.[Le];return n==null?null:k.makeFromBucketSpec(n,t)}function an(t,e,n,s={}){t.host=`${e}:${n}`;let r=J(e);r&&(be(`https://${t.host}/b`),Re("Storage",!0)),t._isUsingEmulator=!0,t._protocol=r?"https":"http";let{mockUserToken:o}=s;o&&(t._overrideAuthToken=typeof o=="string"?o:we(o,t.app.options.projectId))}var j=class{constructor(e,n,s,r,o,i=!1){this.app=e,this._authProvider=n,this._appCheckProvider=s,this._url=r,this._firebaseVersion=o,this._isUsingEmulator=i,this._bucket=null,this._host=De,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=st,this._maxUploadRetryTime=rt,this._requests=new Set,r!=null?this._bucket=k.makeFromBucketSpec(r,this._host):this._bucket=Ce(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=k.makeFromBucketSpec(this._url,e):this._bucket=Ce(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){Oe("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){Oe("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(Ue(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new F(this,e)}_makeRequest(e,n,s,r,o=!0){if(this._deleted)return new se(qe());{let i=xt(e,this._appId,s,r,n,this._firebaseVersion,o,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,n){let[s,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,s,r).getPromise()}},ve="@firebase/storage",Ne="0.14.0";var Xe="storage";function Ke(t,e,n){return t=S(t),Jt(t,e,n)}function Ye(t){return t=S(t),Qt(t)}function Ze(t,e){return t=S(t),en(t,e)}function Je(t){return t=S(t),tn(t)}function B(t,e){return t=S(t),on(t,e)}function Un(t=xe(),e){t=S(t);let s=Ee(t,Xe).getImmediate({identifier:e}),r=me("storage");return r&&un(s,...r),s}function un(t,e,n,s={}){an(t,e,n,s)}function ln(t,{instanceIdentifier:e}){let n=t.getProvider("app").getImmediate(),s=t.getProvider("auth-internal"),r=t.getProvider("app-check-internal");return new j(n,s,r,e,Ie)}function cn(){ke(new ye(Xe,ln,"PUBLIC").setMultipleInstances(!0)),Q(ve,Ne,""),Q(ve,Ne,"esm2020")}cn();var Qe=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],et=[...Qe,"svg"],tt=["mp4","webm"],hn="https://lh3.googleusercontent.com/";async function Sn(t,e){let n=window.__ROOT_CTX.rootConfig.projectId,s=await wn(t),r=ge(t.name),o=dn(t,s,r,e),i=`${n}/uploads/${o}`,u=B(window.firebase.storage,i);if(e?.checkExists&&await fn(i))throw new Error(`File already exists: ${i}`);let a=Ke(u,t),l=-1,c=Date.now();return await new Promise((d,f)=>{let _=setInterval(()=>{Date.now()-c>1e4&&(clearInterval(_),f(new Error("Upload stalled: no progress for 10 seconds")))},1e3);a.on("state_changed",h=>{h.bytesTransferred>0&&clearInterval(_),console.log(`uploading ${t.name}: ${h.bytesTransferred} / ${h.totalBytes} bytes`),h.bytesTransferred!==l&&(l=h.bytesTransferred,c=Date.now())},h=>{clearInterval(_),f(h)},()=>{console.log(`uploaded ${i}`),clearInterval(_),d(a.snapshot)})}),pn(u,t,r,e)}async function Pn(t){let e=window.firebase.storage,n;t.startsWith("/")?n=B(e,`gs://${t.substring(1)}`):t.startsWith("http")?n=B(e,t):n=B(e,t),await Je(n),console.log(`deleted ${t}`)}function dn(t,e,n,s){return s?.namingMode==="clean"?t.name:s?.namingMode==="hash-path"||s?.preserveFilename?`${e}/${t.name}`:`${e}.${n}`}async function fn(t){let e=B(window.firebase.storage,t);try{return await Ye(e),!0}catch(n){if(n.code==="storage/object-not-found")return!1;throw n}}async function pn(t,e,n,s){let r={};r.filename=e.name,r.uploadedBy=window.firebase.user.email||"unknown",r.uploadedAt=String(Math.floor(new Date().getTime()));let o=`/${t.bucket}/${t.fullPath}`,i=`https://storage.googleapis.com${o}`;if(et.includes(n)){let a=await mn(e);if(r.width=a.width,r.height=a.height,!s?.disableGci&&Qe.includes(n)){let l=await gn(o);l&&(r.gcsPath=o,i=l)}r.canvasBgColor=await Tn(e)?"dark":"light"}else if(tt.includes(n)){let a=await bn(i);r.width=a.width,r.height=a.height,console.log("video dimensions:",a)}let u=s?.cacheControl||"public, max-age=31536000";return await Ze(t,{cacheControl:u,customMetadata:Rn(r)}),console.log("updated meta data: ",r),{...r,src:i}}function ge(t){return _n(t.split(".").at(-1)||"")}function _n(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function gn(t){let e=window.__ROOT_CTX.rootConfig.gci;if(!e)return"";let n=new URLSearchParams({gcs:t}),s=`${e}/_/serving_url?${n.toString()}`,r=await window.fetch(s);if(r.status!==200){let i=await r.text();throw console.error(`failed to get gci url: ${s}`),console.error(i),new Error("failed to get gci url")}return(await r.json()).servingUrl}async function mn(t){return new Promise((e,n)=>{let s=new FileReader;s.onload=()=>{let r=new Image;r.onload=()=>{e({width:r.width,height:r.height})},r.onerror=n,r.src=String(s.result)},s.onerror=n,s.readAsDataURL(t)})}async function bn(t){return new Promise((e,n)=>{let s=document.createElement("video");s.addEventListener("loadedmetadata",()=>{let r={width:s.videoWidth,height:s.videoHeight};e(r),document.body.removeChild(s)},!1),s.addEventListener("error",()=>{n(new Error("Failed to load video metadata")),document.body.removeChild(s)},!1),s.className="sr-only",s.src=t,s.preload="metadata",document.body.appendChild(s)})}async function wn(t){let e=await t.arrayBuffer(),n=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(n)).map(o=>o.toString(16).padStart(2,"0")).join("")}function Rn(t){let e={};return Object.entries(t).forEach(([n,s])=>{t[n]=String(s).trim()}),e}function Cn(t){if(!t)return!1;if(nt(t)||t.startsWith("data:image/")||t.startsWith("blob:"))return!0;let e=ge(t);return et.includes(e)}function nt(t){return t?t.startsWith(hn):!1}function vn(t){if(!t)return!1;let e=ge(t);return tt.includes(e)}function Nn(t){return nt(t)?t.split("=")[0]+"=s0-d":t}function Tn(t){return new Promise((e,n)=>{let s=new Image,r=new FileReader;r.onload=()=>{s.src=r.result},s.onload=()=>{let o=document.createElement("canvas"),i=o.getContext("2d");o.width=s.width,o.height=s.height,i.drawImage(s,0,0,o.width,o.height);let{data:u}=i.getImageData(0,0,o.width,o.height),a=0,l=0,c=0,d=0,f=Math.floor(u.length/4e4)*4;f<4&&(f=4);for(let h=0;h<u.length;h+=f)u[h+3]<128||(a+=u[h],l+=u[h+1],c+=u[h+2],d++);if(d===0){e(!1);return}let _=.299*(a/d)+.587*(l/d)+.114*(c/d);e(_>128)},s.onerror=n,r.onerror=n,r.readAsDataURL(t)})}export{Un as a,Qe as b,et as c,tt as d,hn as e,Sn as f,Pn as g,fn as h,ge as i,Cn as j,nt as k,vn as l,Nn as m,Tn as n};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Bundled license information:
|
|
2
|
+
|
|
3
|
+
@firebase/storage/dist/index.esm.js:
|
|
4
|
+
@firebase/storage/dist/index.esm.js:
|
|
5
|
+
@firebase/storage/dist/index.esm.js:
|
|
6
|
+
@firebase/storage/dist/index.esm.js:
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@firebase/storage/dist/index.esm.js:
|
|
25
|
+
/**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright 2017 Google LLC
|
|
28
|
+
*
|
|
29
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
30
|
+
* you may not use this file except in compliance with the License.
|
|
31
|
+
* You may obtain a copy of the License at
|
|
32
|
+
*
|
|
33
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
+
*
|
|
35
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
36
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
37
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
+
* See the License for the specific language governing permissions and
|
|
39
|
+
* limitations under the License.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* @license
|
|
43
|
+
* Copyright 2022 Google LLC
|
|
44
|
+
*
|
|
45
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
46
|
+
* you may not use this file except in compliance with the License.
|
|
47
|
+
* You may obtain a copy of the License at
|
|
48
|
+
*
|
|
49
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
50
|
+
*
|
|
51
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
52
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
53
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
54
|
+
* See the License for the specific language governing permissions and
|
|
55
|
+
* limitations under the License.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* @license
|
|
59
|
+
* Copyright 2021 Google LLC
|
|
60
|
+
*
|
|
61
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
62
|
+
* you may not use this file except in compliance with the License.
|
|
63
|
+
* You may obtain a copy of the License at
|
|
64
|
+
*
|
|
65
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
66
|
+
*
|
|
67
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
68
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
69
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
70
|
+
* See the License for the specific language governing permissions and
|
|
71
|
+
* limitations under the License.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
@firebase/storage/dist/index.esm.js:
|
|
75
|
+
/**
|
|
76
|
+
* @license
|
|
77
|
+
* Copyright 2019 Google LLC
|
|
78
|
+
*
|
|
79
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
80
|
+
* you may not use this file except in compliance with the License.
|
|
81
|
+
* You may obtain a copy of the License at
|
|
82
|
+
*
|
|
83
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
84
|
+
*
|
|
85
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
86
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
87
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
88
|
+
* See the License for the specific language governing permissions and
|
|
89
|
+
* limitations under the License.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
@firebase/storage/dist/index.esm.js:
|
|
93
|
+
/**
|
|
94
|
+
* @license
|
|
95
|
+
* Copyright 2017 Google LLC
|
|
96
|
+
*
|
|
97
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
98
|
+
* you may not use this file except in compliance with the License.
|
|
99
|
+
* You may obtain a copy of the License at
|
|
100
|
+
*
|
|
101
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
102
|
+
*
|
|
103
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
105
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
106
|
+
* See the License for the specific language governing permissions and
|
|
107
|
+
* limitations under the License.
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* @license
|
|
111
|
+
* Copyright 2019 Google LLC
|
|
112
|
+
*
|
|
113
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
114
|
+
* you may not use this file except in compliance with the License.
|
|
115
|
+
* You may obtain a copy of the License at
|
|
116
|
+
*
|
|
117
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
118
|
+
*
|
|
119
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
120
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
121
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
122
|
+
* See the License for the specific language governing permissions and
|
|
123
|
+
* limitations under the License.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
@firebase/storage/dist/index.esm.js:
|
|
127
|
+
/**
|
|
128
|
+
* @license
|
|
129
|
+
* Copyright 2017 Google LLC
|
|
130
|
+
*
|
|
131
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
132
|
+
* you may not use this file except in compliance with the License.
|
|
133
|
+
* You may obtain a copy of the License at
|
|
134
|
+
*
|
|
135
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
136
|
+
*
|
|
137
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
138
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
139
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
140
|
+
* See the License for the specific language governing permissions and
|
|
141
|
+
* limitations under the License.
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* @license
|
|
145
|
+
* Copyright 2020 Google LLC
|
|
146
|
+
*
|
|
147
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
148
|
+
* you may not use this file except in compliance with the License.
|
|
149
|
+
* You may obtain a copy of the License at
|
|
150
|
+
*
|
|
151
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
152
|
+
*
|
|
153
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
154
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
155
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
156
|
+
* See the License for the specific language governing permissions and
|
|
157
|
+
* limitations under the License.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
@firebase/storage/dist/index.esm.js:
|
|
161
|
+
/**
|
|
162
|
+
* @license
|
|
163
|
+
* Copyright 2021 Google LLC
|
|
164
|
+
*
|
|
165
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
166
|
+
* you may not use this file except in compliance with the License.
|
|
167
|
+
* You may obtain a copy of the License at
|
|
168
|
+
*
|
|
169
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
170
|
+
*
|
|
171
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
172
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
173
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
174
|
+
* See the License for the specific language governing permissions and
|
|
175
|
+
* limitations under the License.
|
|
176
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as na,b as P,c as I,d as ia,e as la}from"./chunk-DUJYIOLE.js";import{a as v}from"./chunk-KFAZBEPV.js";import{a as oa}from"./chunk-X2WHBGTP.js";import{a as d}from"./chunk-PJA7YP4A.js";import{a as D}from"./chunk-62UWGWON.js";import{a as A}from"./chunk-I6ICVKEC.js";import{f as Q}from"./chunk-AL3TN2KI.js";import{$a as aa,Db as ta,Ea as J,Ha as a,Kc as ra,Qa as X,Rc as sa,V as G,Xa as Z,a as l,c as W,ea as _,g as V,j as fa,lb as ea,ra as z,va as Y,ya as R,za as q}from"./chunk-NZHF733K.js";fa();var O=[{value:"new",label:"New"},{value:"in-progress",label:"In progress"},{value:"in-review",label:"In review"},{value:"closed",label:"Closed"}],Ta=O.filter(t=>t.value!=="closed"),xa=O.filter(t=>t.value==="closed"),va=[{value:"table",label:a("span",{className:"TaskManager__layoutOption",children:[a(ra,{size:14,strokeWidth:"1.8"}),"Table"]})},{value:"board",label:a("span",{className:"TaskManager__layoutOption",children:[a(ea,{size:14,strokeWidth:"1.8"}),"Board"]})}],ba=[{value:"open",label:"Active"},{value:"assigned-to-me",label:"Assigned to me"}],ha=[{value:"open",label:"Active"},{value:"assigned-to-me",label:"Assigned to me"},{value:"created-by-me",label:"Created by me"},{value:"closed",label:"Closed"},{value:"all",label:"All"}];function qa(t){let e=window.firebase.user.email||"",r=(t.variant||"compact")==="page",{tasks:i,loading:n,error:c}=Sa(r?"all":"open"),[f,b]=l("open"),[p,da]=oa("root-cms-task-manager-layout-v2","table"),[h,j]=l(""),[g,y]=l(""),[M,T]=l(!1),[w,B]=l("normal"),[x,N]=l(""),[C,L]=l(!1),[H,F]=l(!1),pa=r?ha:ba,U=V(()=>za(i,f,e),[i,f,e]),K=U.length,ga=r?`${K} shown`:`${K} active`,ma=!!h.trim()&&!H;async function ka(o){o.preventDefault();let $=h.trim();if(!$)return;let S=Ca($);F(!0);try{await na({title:S.title,description:S.description,assignee:g.trim()||void 0,priority:w,targetLaunchDate:_a(x)}),j(""),y(""),B("normal"),N(""),A({title:"Task created",message:S.title,autoClose:4e3})}catch(ua){A({title:"Could not create task",message:D(ua),color:"red",autoClose:!1})}finally{F(!1)}}return a("div",{className:Q(t.className,"TaskManager",r&&"TaskManager--page"),children:[a(d,{className:"TaskManager__composer",children:a("form",{onSubmit:o=>ka(o),children:[a("div",{className:"TaskManager__composer__header",children:[a("div",{className:"TaskManager__composer__avatar",children:g&&a(v,{email:g,size:32})}),a("div",{children:[a("div",{className:"TaskManager__composer__title",children:"Create a task"}),a("div",{className:"TaskManager__composer__subtitle",children:"Assign it to an agent, a teammate, or yourself."})]})]}),a("textarea",{className:"TaskManager__composer__textarea",value:h,rows:3,placeholder:"Enter a task description. Specify scope, collection, and acceptance criteria.",onInput:o=>{j(o.currentTarget.value)}}),a("div",{className:"TaskManager__composer__footer",children:[a("div",{className:"TaskManager__composer__controls",children:[a(R,{opened:M,onClose:()=>T(!1),position:"bottom",shadow:"md",width:280,withArrow:!0,target:a("button",{className:"TaskManager__composer__control",type:"button","aria-expanded":M,onClick:()=>T(!M),children:[a(sa,{size:15,strokeWidth:"1.8"}),a("span",{children:"assign to..."}),g&&a("span",{className:"TaskManager__composer__control__value",children:m(g)})]}),children:a("div",{className:"TaskManager__composer__popover",children:[a(Y,{autoFocus:!0,label:"Email",placeholder:"teammate@example.com",size:"xs",type:"email",value:g,onChange:o=>y(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),T(!1))}}),a("div",{className:"TaskManager__composer__popover__actions",children:[a(_,{compact:!0,size:"xs",variant:"default",onClick:()=>y(""),children:"Clear"}),a(_,{compact:!0,size:"xs",color:"dark",onClick:()=>T(!1),children:"Done"})]})]})}),a(z,{position:"bottom",shadow:"md",control:a("button",{className:"TaskManager__composer__control",type:"button",children:[a(ta,{size:15,strokeWidth:"1.8"}),a("span",{children:w}),a(aa,{size:14,strokeWidth:"1.8"})]}),children:["high","medium","normal"].map(o=>a(z.Item,{className:w===o?"TaskManager__composer__menuItem--active":"",onClick:()=>B(o),children:o},o))}),a(R,{opened:C,onClose:()=>L(!1),position:"bottom",shadow:"md",width:260,withArrow:!0,target:a("button",{className:"TaskManager__composer__control",type:"button","aria-expanded":C,onClick:()=>L(!C),children:[a(Z,{size:15,strokeWidth:"1.8"}),a("span",{children:x?Da(x):"target launch date"})]}),children:a("div",{className:"TaskManager__composer__popover",children:[a("label",{className:"TaskManager__composer__dateLabel",children:["Target launch date",a("input",{type:"date",value:x,onInput:o=>{N(o.currentTarget.value)}})]}),a("div",{className:"TaskManager__composer__popover__actions",children:[a(_,{compact:!0,size:"xs",variant:"default",onClick:()=>N(""),children:"Clear"}),a(_,{compact:!0,size:"xs",color:"dark",onClick:()=>L(!1),children:"Done"})]})]})})]}),a(_,{type:"submit",size:"xs",color:"dark",loading:H,disabled:!ma,rightIcon:a(X,{size:15,strokeWidth:"1.8"}),children:"Create task"})]})]})}),a("div",{className:"TaskManager__listHeader",children:[a("div",{className:"TaskManager__listHeader__summary",children:[a("div",{className:"TaskManager__listHeader__titleLine",children:[a("div",{className:"TaskManager__sectionTitle",children:r?"Tasks":"Active tasks"}),a("span",{className:"TaskManager__listHeader__count",children:ga})]}),a("div",{className:"TaskManager__filters","aria-label":"Task filters",children:pa.map(o=>a("button",{className:f===o.value?"active":"",type:"button",onClick:()=>b(o.value),children:o.label},o.value))})]}),a("div",{className:"TaskManager__listHeader__actions",children:r?a(q,{className:"TaskManager__layoutToggle",size:"xs",value:p,onChange:o=>da(o),data:va}):a(_,{component:"a",href:"/cms/tasks",variant:"default",size:"xs",compact:!0,children:"Show all"})})]}),a(ya,{error:c,filter:f,layout:r?p:"compact",loading:n,tasks:U})]})}function ya(t){let{error:e,filter:s,layout:r,loading:i,tasks:n}=t;return i?a(d,{className:"TaskManager__list",children:a("div",{className:"TaskManager__list__state",children:a(G,{color:"gray",size:"sm"})})}):e?a(d,{className:"TaskManager__list",children:a("div",{className:"TaskManager__list__state error",children:e})}):n.length===0?a(d,{className:"TaskManager__list",children:a("div",{className:"TaskManager__list__state",children:Ra(s,r)})}):r==="board"?a(wa,{filter:s,tasks:n}):r==="table"?a(Ma,{tasks:n}):a(d,{className:"TaskManager__list",children:n.map(c=>a(La,{task:c},c.id))})}function Ma(t){return a(d,{className:"TaskManager__tableSurface",children:a(J,{className:"TaskManager__table",verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[a("thead",{children:a("tr",{children:[a("th",{children:"task"}),a("th",{children:"status"}),a("th",{children:"priority"}),a("th",{children:"assignee"}),a("th",{children:"target"}),a("th",{children:"opened"})]})}),a("tbody",{children:t.tasks.map(e=>{let s=e.createdBy||"unknown";return a("tr",{children:[a("td",{children:a("a",{className:"TaskManager__tableTask",href:`/cms/tasks/${e.id}`,children:[a("div",{className:"TaskManager__taskRow__avatar",children:e.assignee&&a(v,{email:e.assignee,size:24})}),a("span",{className:"TaskManager__tableTask__content",children:[a("span",{className:"TaskManager__tableTask__title",children:e.title}),a("span",{className:"TaskManager__tableTask__meta",children:["#",e.id," by ",m(s)]})]})]})}),a("td",{children:a("span",{className:"TaskManager__taskRow__status",children:[a("span",{}),E(e.status)]})}),a("td",{children:a("span",{className:`TaskManager__taskRow__priority TaskManager__taskRow__priority--${u(e.priority)}`,children:u(e.priority)})}),a("td",{children:e.assignee?m(e.assignee):"Unassigned"}),a("td",{children:e.targetLaunchDate?k(e.targetLaunchDate):"None"}),a("td",{children:k(e.createdAt)})]},e.id)})})]})})}function wa(t){let e=Aa(t.tasks,t.filter);return a("div",{className:"TaskManager__board",children:e.map(s=>{let r=t.tasks.filter(i=>ca(i)===s.value);return a("section",{className:"TaskManager__boardColumn",children:[a("div",{className:"TaskManager__boardColumn__header",children:[a("span",{children:s.label}),a("span",{children:r.length})]}),a("div",{className:"TaskManager__boardColumn__tasks",children:[r.length===0&&a("div",{className:"TaskManager__boardColumn__empty",children:"No tasks"}),r.map(i=>a(Na,{task:i},i.id))]})]},s.value)})})}function Na(t){let{task:e}=t,s=e.createdBy||"unknown";return a("a",{className:"TaskManager__boardCard",href:`/cms/tasks/${e.id}`,children:[a("div",{className:"TaskManager__boardCard__title",children:e.title}),e.description&&a("div",{className:"TaskManager__boardCard__description",children:e.description}),a("div",{className:"TaskManager__boardCard__meta",children:["#",e.id," opened ",k(e.createdAt)," by"," ",m(s)]}),a("div",{className:"TaskManager__boardCard__badges",children:[a("span",{className:`TaskManager__taskRow__priority TaskManager__taskRow__priority--${u(e.priority)}`,children:u(e.priority)}),a("span",{className:"TaskManager__boardCard__badge",children:e.assignee?m(e.assignee):"Unassigned"}),e.targetLaunchDate&&a("span",{className:"TaskManager__boardCard__badge",children:["target ",k(e.targetLaunchDate)]})]})]})}function Ca(t){let[e,...s]=t.split(`
|
|
2
|
+
`);for(;s.length>0&&s[0].trim().length===0;)s.shift();return{title:e.trim(),description:s.join(`
|
|
3
|
+
`).trim()}}function La(t){let{task:e}=t,s=e.createdBy||"unknown";return a("a",{className:"TaskManager__taskRow",href:`/cms/tasks/${e.id}`,children:[a("div",{className:"TaskManager__taskRow__avatar",children:e.assignee&&a(v,{email:e.assignee,size:28})}),a("div",{className:"TaskManager__taskRow__content",children:[a("div",{className:"TaskManager__taskRow__title",children:e.title}),a("div",{className:"TaskManager__taskRow__meta",children:["opened ",k(e.createdAt)," by ",m(s)]})]}),a("div",{className:"TaskManager__taskRow__badges",children:[a("div",{className:"TaskManager__taskRow__status",children:[a("span",{}),E(e.status)]}),a("div",{className:`TaskManager__taskRow__priority TaskManager__taskRow__priority--${u(e.priority)}`,children:u(e.priority)}),e.targetLaunchDate&&a("div",{className:"TaskManager__taskRow__date",children:["target ",k(e.targetLaunchDate)]})]})]})}function Sa(t){let[e,s]=l([]),[r,i]=l(!0),[n,c]=l("");return W(()=>{i(!0);let b=(t==="all"?ia:la)(p=>{s(p),c(""),i(!1)},p=>{c(D(p)),i(!1)});return()=>b()},[t]),{tasks:e,loading:r,error:n}}function za(t,e,s){switch(e){case"all":return t;case"closed":return t.filter(r=>!P(r.status));case"assigned-to-me":return t.filter(r=>r.assignee===s);case"created-by-me":return t.filter(r=>r.createdBy===s);default:return t.filter(r=>P(r.status))}}function Ra(t,e){switch(t){case"assigned-to-me":return e==="compact"?"No active tasks are assigned to you.":"No tasks are assigned to you.";case"created-by-me":return"No tasks created by you.";case"closed":return"No closed tasks yet.";case"all":return"No tasks yet.";default:return"No active tasks yet."}}function m(t){return t.split("@")[0]||t}function k(t){return t?.toMillis?new Date(t.toMillis()).toLocaleDateString("en",{month:"short",day:"numeric"}):"just now"}function E(t){return I(t).replace(/[-_]/g," ")}function ca(t){return I(t.status)}function Aa(t,e){let s=e==="open"?Ta:e==="closed"?xa:O,r=new Set(s.map(n=>n.value)),i=t.map(n=>ca(n)).filter(n=>!r.has(n));return[...s,...Array.from(new Set(i)).map(n=>({value:n,label:E(n)}))]}function u(t){return t||"normal"}function _a(t){if(!t)return null;let[e,s,r]=t.split("-").map(Number);return!e||!s||!r?null:new Date(e,s-1,r)}function Da(t){let e=_a(t);return e?e.toLocaleDateString("en",{month:"short",day:"numeric"}):"target launch date"}export{qa as a};
|